minor changes to web layout

This commit is contained in:
Paul
2019-07-06 17:13:46 +02:00
parent 3d66c5897a
commit e0f07e52e2
3 changed files with 24 additions and 10 deletions

View File

@@ -511,7 +511,7 @@ void MyESP::_ota_setup() {
_progOld = _prog; _progOld = _prog;
} }
}); });
ArduinoOTA.onError([this](ota_error_t error) { ArduinoOTA.onError([this](ota_error_t error) {
if (error == OTA_AUTH_ERROR) if (error == OTA_AUTH_ERROR)
myDebug_P(PSTR("[OTA] Auth Failed")); myDebug_P(PSTR("[OTA] Auth Failed"));
@@ -1982,8 +1982,22 @@ void MyESP::_webRootPage() {
strlcat(s, "</h1>", sizeof(s)); strlcat(s, "</h1>", sizeof(s));
strlcat(s, "<p><b>System stats:</b><br>", sizeof(s)); strlcat(s, "<p><b>System stats:</b><br>", sizeof(s));
strlcat(s, isMQTTConnected() ? " MQTT is connected\n" : " MQTT is disconnected\n", sizeof(s));
strlcat(s, "<br>", sizeof(s)); if (isAPmode()) {
strlcat(s, " Device is in Wifi Access Point mode with SSID <b>", sizeof(s));
strlcat(s, jw.getAPSSID().c_str(), sizeof(s));
strlcat(s, "</b>", sizeof(s));
} else {
char buf[4];
strlcat(s, " Connected to wireless network <b>", sizeof(s));
strlcat(s, _getESPhostname().c_str(), sizeof(s));
strlcat(s, "</b> with signal strength <b>", sizeof(s));
strlcat(s, itoa(getWifiQuality(), buf, 10), sizeof(s));
strlcat(s, "%</b>", sizeof(s));
}
strlcat(s, isMQTTConnected() ? "<br> MQTT is connected\n" : " MQTT is disconnected\n", sizeof(s));
strlcat(s, "</br>", sizeof(s));
// uptime // uptime
char buffer[200]; char buffer[200];
@@ -1993,14 +2007,14 @@ void MyESP::_webRootPage() {
uint32_t rem = t % 3600L; uint32_t rem = t % 3600L;
uint8_t m = rem / 60; uint8_t m = rem / 60;
uint8_t sec = rem % 60; uint8_t sec = rem % 60;
sprintf(buffer, " System uptime: %d days %d hours %d minutes %d seconds<br>", d, h, m, sec); sprintf(buffer, " System uptime: %d days %d hours %d minutes %d seconds", d, h, m, sec);
strlcat(s, buffer, sizeof(s)); strlcat(s, buffer, sizeof(s));
// memory // memory
uint32_t total_memory = _getInitialFreeHeap(); //uint32_t total_memory = _getInitialFreeHeap();
uint32_t free_memory = ESP.getFreeHeap(); //uint32_t free_memory = ESP.getFreeHeap();
sprintf(buffer, " Memory: %d bytes free (%2u%%)<br>", free_memory, 100 * free_memory / total_memory); //sprintf(buffer, " Memory: %d bytes free (%2u%%)<br>", free_memory, 100 * free_memory / total_memory);
strlcat(s, buffer, sizeof(s)); //strlcat(s, buffer, sizeof(s));
strlcat(s, "<p>", sizeof(s)); strlcat(s, "<p>", sizeof(s));
if (_web_callback) { if (_web_callback) {

View File

@@ -208,7 +208,7 @@ const char webCommonPage_start[] = "<html>"
"body {background-color: #FFA500;font: normal 18px Verdana, Arial, sans-serif;} </style>"; "body {background-color: #FFA500;font: normal 18px Verdana, Arial, sans-serif;} </style>";
const char webCommonPage_start_refresh[] = "<meta http-equiv='refresh' content='5'>"; const char webCommonPage_start_refresh[] = "<meta http-equiv='refresh' content='30'>";
const char webCommonPage_start_body[] = "</head><body>"; const char webCommonPage_start_body[] = "</head><body>";

View File

@@ -6,5 +6,5 @@
#pragma once #pragma once
#define APP_NAME "EMS-ESP" #define APP_NAME "EMS-ESP"
#define APP_VERSION "1.8.1b13" #define APP_VERSION "1.8.1b14"
#define APP_HOSTNAME "ems-esp" #define APP_HOSTNAME "ems-esp"