diff --git a/src/CHANGES.md b/src/CHANGES.md index 88415c51..dff8eb2a 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -4,7 +4,7 @@ ## 0.5.110 * MQTT fix reconnection by new lib version #780 -* display 'failed' if no Update was selected #813 +* add `about` page ## 0.5.109 * reduced heap fragmentation by optimizing MqTT #768 diff --git a/src/web/html/about.html b/src/web/html/about.html new file mode 100644 index 00000000..c0eb8c5e --- /dev/null +++ b/src/web/html/about.html @@ -0,0 +1,57 @@ + + + + About + {#HTML_HEADER} + + + {#HTML_NAV} +
+
+

About AhoyDTU

+
+
+
Used Libraries
+
+ + + + + + + + +
+
Contact Information
+
+
+
Github Repository
+ +
+
+
Discord Chat
+ +
+
+
E-Mail
+ +
+
+
+
+ {#HTML_FOOTER} + + + diff --git a/src/web/html/api.js b/src/web/html/api.js index 6e63740d..5ccb0e15 100644 --- a/src/web/html/api.js +++ b/src/web/html/api.js @@ -74,7 +74,7 @@ function topnav() { } function parseNav(obj) { - for(i = 0; i < 10; i++) { + for(i = 0; i < 11; i++) { if(i == 2) continue; var l = document.getElementById("nav"+i); diff --git a/src/web/html/includes/nav.html b/src/web/html/includes/nav.html index f1e1a2bd..3dac1590 100644 --- a/src/web/html/includes/nav.html +++ b/src/web/html/includes/nav.html @@ -15,11 +15,10 @@ REST API Documentation + About Login Logout
- - diff --git a/src/web/web.h b/src/web/web.h index 36193986..47bdeb1d 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -30,6 +30,7 @@ #include "html/h/save_html.h" #include "html/h/update_html.h" #include "html/h/visualization_html.h" +#include "html/h/about_html.h" #define WEB_SERIAL_BUF_SIZE 2048 @@ -83,6 +84,7 @@ class Web { mWeb.on("/upload", HTTP_POST, std::bind(&Web::onUpload, this, std::placeholders::_1), std::bind(&Web::onUpload2, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6)); mWeb.on("/serial", HTTP_GET, std::bind(&Web::onSerial, this, std::placeholders::_1)); + mWeb.on("/about", HTTP_GET, std::bind(&Web::onAbout, this, std::placeholders::_1)); mWeb.on("/debug", HTTP_GET, std::bind(&Web::onDebug, this, std::placeholders::_1)); @@ -243,7 +245,7 @@ class Web { } void showUpdate(AsyncWebServerRequest *request) { - bool reboot = (!Update.hasError() && Update.size() > 0); + bool reboot = (!Update.hasError()); String html = F("UpdateUpdate: "); if (reboot) @@ -616,6 +618,21 @@ class Web { request->send(response); } + void onAbout(AsyncWebServerRequest *request) { + if (CHECK_MASK(mConfig->sys.protectionMask, PROT_MASK_LIVE)) { + if (mProtected) { + checkRedirect(request); + return; + } + } + + AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), about_html, about_html_len); + response->addHeader(F("Content-Encoding"), "gzip"); + response->addHeader(F("content-type"), "text/html; charset=UTF-8"); + + request->send(response); + } + void onDebug(AsyncWebServerRequest *request) { mApp->getSchedulerNames(); AsyncWebServerResponse *response = request->beginResponse(200, F("text/html; charset=UTF-8"), "ok");