From 57fa57fc946e900875c1e142d553dafe6a0abdc8 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 20 Oct 2024 05:09:06 +0200 Subject: [PATCH] first try of v0.1 webui --- Arduino/CanGrow/include/CanGrow_Webserver.h | 2 ++ .../include/Webserver/Page_root_HTML.h | 6 +----- Arduino/CanGrow/include/Webserver/footer.h | 4 +--- Arduino/CanGrow/include/Webserver/header.h | 21 +++++++++++++++---- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Arduino/CanGrow/include/CanGrow_Webserver.h b/Arduino/CanGrow/include/CanGrow_Webserver.h index 36ae44f..ad5125b 100644 --- a/Arduino/CanGrow/include/CanGrow_Webserver.h +++ b/Arduino/CanGrow/include/CanGrow_Webserver.h @@ -61,6 +61,8 @@ void WebserverNotFound(AsyncWebServerRequest* request) { */ void SetupWebserver() { Serial.println(":: [Webserver] initializing"); + + /* url handler definition */ webserver.on("/", HTTP_GET, WebPage_root); webserver.on("/cangrow.css", HTTP_GET, WebFile_cangrow_CSS); diff --git a/Arduino/CanGrow/include/Webserver/Page_root_HTML.h b/Arduino/CanGrow/include/Webserver/Page_root_HTML.h index 5df5f4e..344fcd9 100644 --- a/Arduino/CanGrow/include/Webserver/Page_root_HTML.h +++ b/Arduino/CanGrow/include/Webserver/Page_root_HTML.h @@ -29,9 +29,5 @@ const char* Page_root_HTML PROGMEM = R"(%HEADER% -

CanGrow

-Hi
-%LOL%
-%ROFL%
-Bye
+

📡 Hello world!

%FOOTER%)"; diff --git a/Arduino/CanGrow/include/Webserver/footer.h b/Arduino/CanGrow/include/Webserver/footer.h index a8d4fa2..a91fe43 100644 --- a/Arduino/CanGrow/include/Webserver/footer.h +++ b/Arduino/CanGrow/include/Webserver/footer.h @@ -27,6 +27,4 @@ * */ -const char* Footer_HTML PROGMEM = R"(

Bottom %CGVER% - -)"; +const char* Footer_HTML PROGMEM = R"()"; diff --git a/Arduino/CanGrow/include/Webserver/header.h b/Arduino/CanGrow/include/Webserver/header.h index 4e7b037..c595223 100644 --- a/Arduino/CanGrow/include/Webserver/header.h +++ b/Arduino/CanGrow/include/Webserver/header.h @@ -27,8 +27,21 @@ * */ -const char* Header_HTML PROGMEM = R"( - +const char* Header_HTML PROGMEM = R"( + + + + + CanGrow %CGVER% - %CGBUILD% + + -%CGBUILD% -
)"; + +
)";