From 0f5b0981304c51c0034c07898401d1bfbd88a6aa Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 12 Apr 2025 21:37:50 +0200 Subject: [PATCH] Files changed: modified: data/www/dashboard.html modified: src/web_server.cpp dashboard.html working, but ram and psram are duplicated --- data/www/dashboard.html | 36 ++++++++++++++++++++++++++++++------ src/web_server.cpp | 7 +++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/data/www/dashboard.html b/data/www/dashboard.html index f1a534d..af9e28a 100644 --- a/data/www/dashboard.html +++ b/data/www/dashboard.html @@ -9,6 +9,14 @@ margin: 10px; border-radius: 10px; } + .error-message { + color: red; + padding: 20px; + margin: 10px; + border: 1px solid red; + border-radius: 10px; + background: #fff0f0; + } @@ -16,26 +24,42 @@ diff --git a/src/web_server.cpp b/src/web_server.cpp index 7ce3f8e..aa3c3d4 100644 --- a/src/web_server.cpp +++ b/src/web_server.cpp @@ -27,6 +27,13 @@ void setupWebServer() { DefaultHeaders::Instance().addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); DefaultHeaders::Instance().addHeader("Access-Control-Allow-Headers", "Content-Type, Authorization"); + // ESP Info endpoint + server.on("/api/espinfo", HTTP_GET, [](AsyncWebServerRequest *request) { + String htmlContent = getESPInfoHTML() + getRAMInfoHTML(); + AsyncWebServerResponse *response = request->beginResponse(200, "text/html", htmlContent); + request->send(response); + }); + // Root route with debug logging server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { Serial.print("Handling root request from IP: ");