mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-25 12:17:12 +02:00
* Added history charts to web and to Display_Mono_128x64
This commit is contained in:
parent
6fb0535939
commit
2b4de00a89
17 changed files with 694 additions and 100 deletions
|
@ -36,6 +36,7 @@
|
|||
#include "html/h/update_html.h"
|
||||
#include "html/h/visualization_html.h"
|
||||
#include "html/h/about_html.h"
|
||||
#include "html/h/history_html.h"
|
||||
|
||||
#define WEB_SERIAL_BUF_SIZE 2048
|
||||
|
||||
|
@ -80,6 +81,7 @@ class Web {
|
|||
mWeb.on("/save", HTTP_POST, std::bind(&Web::showSave, this, std::placeholders::_1));
|
||||
|
||||
mWeb.on("/live", HTTP_ANY, std::bind(&Web::onLive, this, std::placeholders::_1));
|
||||
mWeb.on("/history", HTTP_ANY, std::bind(&Web::onHistory, this, std::placeholders::_1));
|
||||
|
||||
#ifdef ENABLE_PROMETHEUS_EP
|
||||
mWeb.on("/metrics", HTTP_ANY, std::bind(&Web::showMetrics, this, std::placeholders::_1));
|
||||
|
@ -249,6 +251,8 @@ class Web {
|
|||
request->redirect(F("/index"));
|
||||
else if ((mConfig->sys.protectionMask & PROT_MASK_LIVE) != PROT_MASK_LIVE)
|
||||
request->redirect(F("/live"));
|
||||
else if ((mConfig->sys.protectionMask & PROT_MASK_HISTORY) != PROT_MASK_HISTORY)
|
||||
request->redirect(F("/history"));
|
||||
else if ((mConfig->sys.protectionMask & PROT_MASK_SERIAL) != PROT_MASK_SERIAL)
|
||||
request->redirect(F("/serial"));
|
||||
else if ((mConfig->sys.protectionMask & PROT_MASK_SYSTEM) != PROT_MASK_SYSTEM)
|
||||
|
@ -264,7 +268,7 @@ class Web {
|
|||
}
|
||||
}
|
||||
|
||||
void getPage(AsyncWebServerRequest *request, uint8_t mask, const uint8_t *zippedHtml, uint32_t len) {
|
||||
void getPage(AsyncWebServerRequest *request, uint16_t mask, const uint8_t *zippedHtml, uint32_t len) {
|
||||
if (CHECK_MASK(mConfig->sys.protectionMask, mask))
|
||||
checkProtection(request);
|
||||
|
||||
|
@ -594,6 +598,10 @@ class Web {
|
|||
getPage(request, PROT_MASK_LIVE, visualization_html, visualization_html_len);
|
||||
}
|
||||
|
||||
void onHistory(AsyncWebServerRequest *request) {
|
||||
getPage(request, PROT_MASK_HISTORY, history_html, history_html_len);
|
||||
}
|
||||
|
||||
void onAbout(AsyncWebServerRequest *request) {
|
||||
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), about_html, about_html_len);
|
||||
response->addHeader(F("Content-Encoding"), "gzip");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue