diff --git a/src/CHANGES.md b/src/CHANGES.md index 863b6fba..b661b8d2 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -7,6 +7,8 @@ * removed add to total (MqTT) inverter setting * fixed sending commands to inverters which are soft turned off * save settings before they are exported #1395 +* fix autologin bug if no password is set +* translated `/serial` ## 0.8.70 - 2024-02-01 * prevent sending commands to inverter which isn't active #1387 diff --git a/src/web/Protection.h b/src/web/Protection.h index 710ba8b3..0c7b8379 100644 --- a/src/web/Protection.h +++ b/src/web/Protection.h @@ -39,7 +39,7 @@ class Protection { // auto logout if(0 != mLogoutTimeout) { if (0 == --mLogoutTimeout) { - if(mPwd[0] == '\0') + if(mPwd[0] != '\0') mProtected = true; } } diff --git a/src/web/RestApi.h b/src/web/RestApi.h index b2041ee7..e6760390 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -259,6 +259,8 @@ class RestApi { } void getGeneric(AsyncWebServerRequest *request, JsonObject obj) { + mApp->resetLockTimeout(); + obj[F("wifi_rssi")] = (WiFi.status() != WL_CONNECTED) ? 0 : WiFi.RSSI(); obj[F("ts_uptime")] = mApp->getUptime(); obj[F("ts_now")] = mApp->getTimestamp(); @@ -268,7 +270,7 @@ class RestApi { obj[F("env")] = String(ENV_NAME); obj[F("menu_prot")] = mApp->isProtected(request->client()->remoteIP().toString().c_str()); obj[F("menu_mask")] = (uint16_t)(mConfig->sys.protectionMask ); - obj[F("menu_protEn")] = (bool) (strlen(mConfig->sys.adminPwd) > 0); + obj[F("menu_protEn")] = (bool) (mConfig->sys.adminPwd[0] != '\0'); obj[F("cst_lnk")] = String(mConfig->plugin.customLink); obj[F("cst_lnk_txt")] = String(mConfig->plugin.customLinkText); obj[F("region")] = mConfig->sys.region; diff --git a/src/web/html/serial.html b/src/web/html/serial.html index 25940eb0..83e614c8 100644 --- a/src/web/html/serial.html +++ b/src/web/html/serial.html @@ -12,12 +12,12 @@
-
console active:
-
Uptime:
+
{#CONSOLE_ACTIVE}:
+
{#UPTIME}:
- - - + + +
diff --git a/src/web/lang.json b/src/web/lang.json index 92f046a5..78c7d653 100644 --- a/src/web/lang.json +++ b/src/web/lang.json @@ -865,6 +865,36 @@ } ] }, + { + "name": "serial.html", + "list": [ + { + "token": "BTN_CLEAR", + "en": "clear", + "de": "l&ouuml;schen" + }, + { + "token": "BTN_AUTOSCROLL", + "en": "autoscroll", + "de": "automatisch scrollen" + }, + { + "token": "BTN_COPY", + "en": "copy", + "de": "kopieren" + }, + { + "token": "CONSOLE_ACTIVE", + "en": "console active", + "de": "Konsole aktiv" + }, + { + "token": "UPTIME", + "en": "uptime", + "de": "Laufzeit" + } + ] + }, { "name": "index.html", "list": [ diff --git a/src/web/web.h b/src/web/web.h index 77a059cb..0ffd0594 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -387,7 +387,6 @@ class Web { AsyncWebServerResponse *response = request->beginResponse_P(200, favicon_type, favicon_ico, favicon_ico_len); response->addHeader(F("Content-Encoding"), "gzip"); request->send(response); - mApp->resetLockTimeout(); } void showNotFound(AsyncWebServerRequest *request) {