From 3517f6abf4ea9cd969ec9b70f1994838f765a78b Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 24 Oct 2024 23:22:56 +0200 Subject: [PATCH] put cangrow.css and favicon to sepereate webserver path and not incldue them in the html body --- Arduino/CanGrow/include/CanGrow_Webserver.h | 10 ++++- .../include/Webserver/File_cangrow_CSS.h | 6 +-- Arduino/CanGrow/include/Webserver/Header.h | 5 +-- .../CanGrow/include/Webserver/Page_system.h | 40 +++++++++++++++++++ .../include/Webserver/Page_system_HTML.h | 15 ++++--- 5 files changed, 62 insertions(+), 14 deletions(-) diff --git a/Arduino/CanGrow/include/CanGrow_Webserver.h b/Arduino/CanGrow/include/CanGrow_Webserver.h index 3213e39..59cc5f8 100644 --- a/Arduino/CanGrow/include/CanGrow_Webserver.h +++ b/Arduino/CanGrow/include/CanGrow_Webserver.h @@ -31,6 +31,7 @@ * include static files files */ #include "Webserver/File_cangrow_CSS.h" +#include "Webserver/File_favicon_ico.h" /* * include webpages header files @@ -85,6 +86,8 @@ void Webserver_Init() { /* url handler definition */ webserver.on("/", HTTP_GET, WebPage_root); webserver.on("/cangrow.css", HTTP_GET, WebFile_cangrow_CSS); + webserver.on("/favicon.ico", HTTP_GET, WebFile_favicon_ico); + webserver.on("/wifi/", HTTP_GET, WebPage_wifi); webserver.on("/wifi/", HTTP_POST, WebPage_wifi); webserver.on("/system/", HTTP_GET, WebPage_system); @@ -99,8 +102,11 @@ void Webserver_Init() { webserver.on("/system/wipe", HTTP_GET, WebPage_system_wipe); webserver.on("/system/wipe", HTTP_POST, WebPage_system_wipe); - webserver.on("/system/output", HTTP_GET, WebPage_system_output); - webserver.on("/system/output", HTTP_POST, WebPage_system_output); + webserver.on("/system/output/", HTTP_GET, WebPage_system_output); + webserver.on("/system/output/", HTTP_POST, WebPage_system_output); + + webserver.on("/system/output/add", HTTP_GET, WebPage_system_output_add); + webserver.on("/system/output/add", HTTP_POST, WebPage_system_output_add); requestLogger.setOutput(Serial); // this activates the middleware diff --git a/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h b/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h index 7355efe..f61e4a6 100644 --- a/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h +++ b/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h @@ -41,7 +41,7 @@ const char* File_cangrow_CSS PROGMEM = R"(body { } .center { - width: 100%%; + /*width: 100; */ margin: auto; } @@ -104,7 +104,7 @@ a:active { } .nav { background: #333; - /*width: 100%%; */ + /*width: 100; */ margin: auto; margin-bottom: 10px; padding: 0; @@ -207,7 +207,7 @@ input[type=text], input[type=date], input[type=number], input[type=password], se @media only screen and (min-width: 1820px) { /*.center, .nav { - width: 60%%; min-width: 420px; + width: 60; min-width: 420px; }*/ .subnav li { display: ''; diff --git a/Arduino/CanGrow/include/Webserver/Header.h b/Arduino/CanGrow/include/Webserver/Header.h index 8b39888..8cbfdd9 100644 --- a/Arduino/CanGrow/include/Webserver/Header.h +++ b/Arduino/CanGrow/include/Webserver/Header.h @@ -33,10 +33,7 @@ const char* Header_HTML PROGMEM = R"( %GROWNAME% - CanGrow v%CGVER% - - +