/** * WEB client interface Temperature-Control for DS18B20 (Dallas) * Version 1.00 * 11.02.2023 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2023 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private using can exchange some parts of code or modify some code-lines. This code is allowed change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). **/ #ifndef WEB_CLIENT_H_ #define WEB_CLIENT_H_ #include "global.h" #include "configFS.h" extern configFS Config; extern String getFilesFromServer(IPAddress ip,String actVersion, String updateServer); extern String getTime2String(int hour,int minute,int second); extern String getDate2String(int year,int month,int day); extern bool syncron_NTP_Time(bool correctOn); extern void getTime2Value(); //*** declarations *** String prepareRefreshJSON(); String showSetup(); //*** declaration end ***// String webSave(String PostValues){ Config.savePostValues(PostValues); String ret = HTTP_ANSWER; ret += HTTP_HEAD_IoT; ret += "
Ihre Eingaben wurden gespeichert.
"; ret += ""; ret+=Config.getName(); ret+="
"; ret += "Zeit: 🔄
";
ret += "
";
ret += "Datum:
";
ret += "IoT-IP:
Server Sendestatus:
";
if(_transmitResult != "") ret += _transmitResult;
else { ret += Config.getName(); if(Config.sendPUSH)ret+=" Push-Mode"; else ret+=" Pull-Mode";}
ret += "
Softwareversion: "; ret += Version; ret += "
"; ret += HTTP_SETUP_BUTTON; ret += HTTP_JS_SCRIPT; return ret; } //*** end *** //*** refresh clock and date ***/ String webSetTime(){ String ret = HTTP_ANSWER; ret += HTTP_BODYSTYLE; ret += ""; ret += HTTP_DIV_FIELD; ret += "Zeit:
";
ret += "Unix-Time: "; ret += _timestamp; ret +="
";
if (syncron_NTP_Time(true) == true){
getTime2Value();
ret += "Neue Zeit:
";
ret += "Unix-Time: "; ret += _timestamp; ret +="
";
} else {
ret += "NTP Serverfehler! Aktuallisierung nicht erfolgt.
Bitte eine Wartezeit von 2 Minuten,
bis zur wiederholten, manuellen Aktuallisierung einhalten.
";
}
ret += "
";
ret += "URL: -"; ret += Config.getTargetURL(); ret +="-
";
ret += "Update-Server: -"; ret += Config.getTargetServer(); ret+="-
";
ret += "Timestamp: -"; ret +=_timestamp; ret +="-
";
ret += "AdjustSec: -"; ret +=_secAdjust; ret +="-
";
ret += "Connect-Sensors: -"; ret +=_numberOfSensors; ret +="-
";
ret += "Filesystem: ";
if(Config.getMounted()) {ret+="Filesystem mounted.
Free-Space: "; ret+=Config.getFreeSpace(); ret+="kByte";}
else ret += "Filesystem not mounted!";
ret +="
";
ret +="