123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- void httpServerHandlePage_admin()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_admin_body1);
- #ifdef FIRMWARE_VARIANT_THERMOSTAT
- httpServer.sendContent_P(html_admin_body_therm);
- #elif FIRMWARE_VARIANT_HEATCONTROL
- httpServer.sendContent_P(html_admin_body_heatc);
- #endif
- httpServer.sendContent_P(html_admin_body2);
- #ifdef ENABLE_FEATURE_HTTP_UPDATER
- httpServer.sendContent_P(html_admin_body_ota);
- #endif
- #ifdef ENABLE_FEATURE_FILESYSTEM_BROWSER
- if (confWeb.FSbrowser)
- httpServer.sendContent_P(html_admin_body_fsbrowser);
- #endif
- #ifdef ENABLE_FEATURE_WEB_CONSOLE
- if (confWeb.wConsole)
- httpServer.sendContent_P(html_admin_body_console);
- #endif
- #ifdef ENABLE_FEATURE_WSCONSOLE
- if (confWeb.wsConsole)
- httpServer.sendContent_P(html_admin_body_wsconsole);
- #endif
- httpServer.sendContent_P(html_admin_body_end);
- httpServerSendHtmlFooterChunked();
- }
- void httpServerHandlePage_confWeb()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_js_confpages_start);
- httpServer.sendContent_P(html_confweb_script);
- httpServer.sendContent_P(html_js_confpages_end);
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag_jsinit);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_confweb_body);
-
- #ifdef ENABLE_FEATURE_WSCONSOLE
- httpServer.sendContent_P(html_confweb_body_wsconsole);
- #endif
- httpServer.sendContent_P(html_confweb_body2);
-
- #ifdef ENABLE_FEATURE_FILESYSTEM_BROWSER
- httpServer.sendContent_P(html_confweb_body_fsbrowser);
- #endif
- httpServer.sendContent_P(html_confweb_body3);
- httpServerSendHtmlFooterChunked();
- }
- void httpServerHandlePage_confMqtt()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_js_confpages_start);
- httpServer.sendContent_P(html_confmqtt_script);
- httpServer.sendContent_P(html_js_confpages_end);
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag_jsinit);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_confmqtt_body);
- httpServerSendHtmlFooterChunked();
- }
- void httpServerHandlePage_confDevWiFi()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_js_confpages_start);
- httpServer.sendContent_P(html_confDevWiFi_script);
- httpServer.sendContent_P(html_js_confpages_end);
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag_jsinit);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_confDevWiFi_body);
- httpServerSendHtmlFooterChunked();
- }
- void httpServerHandlePage_confAdd()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_js_confpages_start);
- httpServer.sendContent_P(html_confadd_script);
- httpServer.sendContent_P(html_js_confpages_end);
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag_jsinit);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_confadd_body);
- httpServerSendHtmlFooterChunked();
- }
- void httpServerHandlePage_confTime()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_js_confpages_start);
- httpServer.sendContent_P(html_conftime_script);
- httpServer.sendContent_P(html_js_confpages_end);
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag_jsinit);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_conftime_body);
- httpServerSendHtmlFooterChunked();
- }
- void httpServerHandlePage_confLog()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_js_confpages_start);
- httpServer.sendContent_P(html_conflog_script);
- httpServer.sendContent_P(html_js_confpages_end);
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag_jsinit);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_conflog_body);
- httpServerSendHtmlFooterChunked();
- }
- #ifdef ENABLE_FEATURE_WSCONSOLE
- void httpServerHandlePage_WSConsole()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_wsconsole_body);
- httpServer.sendContent_P(html_wsconsole_script);
- httpServer.sendContent_P(js_wsapp);
- httpServer.sendContent_P(html_wsconsole_endScript);
- httpServerSendHtmlFooterChunked();
- }
- #endif
- #ifdef ENABLE_FEATURE_WEB_CONSOLE
- void httpServerHandlePage_console()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_console_body);
- httpServerSendHtmlFooterChunked();
- }
- #endif
- void httpServerHandlePage_confSaved()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_confsaved_body);
- httpServerSendHtmlFooterChunked();
- }
- //void httpServerHandlePage_confSavedRestart() {
- // httpServerSendHtmlHeadChunked();
- // httpServer.sendContent_P(html_head_end);
- // httpServer.sendContent_P(html_bodytag);
- // httpServerSendHtmlBodyPageheadChunked();
- // httpServer.sendContent_P(html_confsavedrestart_body);
- // httpServerSendHtmlFooterChunked();
- //}
- void httpServerHandlePage_clearConf()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_head_end);
- httpServer.sendContent_P(html_bodytag);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_clearconf_body);
- httpServerSendHtmlFooterChunked();
- }
- #ifdef ENABLE_FEATURE_FILESYSTEM_BROWSER
- void httpServerHandlePage_fsbrowser()
- {
- httpServerSendHtmlHeadChunked();
- httpServer.sendContent_P(html_head_end);
- httpServerSendHtmlBodyPageheadChunked();
- httpServer.sendContent_P(html_fsbrowser_body_1);
-
- // output FS file list
- Dir dir = LittleFS.openDir("/");
- char _tmpStr[301];
- uint8_t _numFiles=0;
- while (dir.next())
- {
- _numFiles++;
- if(_numFiles > 1) {
- httpServer.sendContent("\n");
- }
- File f = dir.openFile("r");
- // filter out some files in file list - i.E: "formatted" should never be deleted by accident as this will clear all config on the next reboot!!
- if(strcmp(dir.fileName().c_str(), "formatted") != 0) {
- sprintf_P(_tmpStr, html_fsbrowser_listentry, dir.fileName().c_str(), dir.fileName().c_str(), f.size(), dir.fileName().c_str());
- httpServer.sendContent(_tmpStr);
- }
- f.close();
- }
- FS_getInfo();
- sprintf_P(_tmpStr, html_fsbrowser_listEnd);
- httpServer.sendContent(_tmpStr);
- sprintf_P(_tmpStr, html_fsbrowser_stats_total, fs_info.totalBytes);
- httpServer.sendContent(_tmpStr);
- sprintf_P(_tmpStr, html_fsbrowser_stats_used, fs_info.usedBytes);
- httpServer.sendContent(_tmpStr);
-
- httpServer.sendContent_P(html_fsbrowser_body_2);
- httpServerSendHtmlFooterChunked();
- }
- #endif
|