add subnav to every subpage of system

This commit is contained in:
Marcus 2024-10-24 14:49:31 +02:00
parent dc8ba42909
commit 00a4acfd13
3 changed files with 28 additions and 11 deletions

View file

@ -111,7 +111,9 @@ a:active {
.subnavTitle { .subnavTitle {
font-size: 1em; font-size: 1em;
margin-top: -15px; /*font-weight: bold;*/
margin-top: -20px;
margin-bottom: 10px;
/*text-align: center;*/ /*text-align: center;*/
} }
.nav li { .nav li {

View file

@ -47,9 +47,7 @@ String Proc_WebPage_system(const String& var) {
} }
String Proc_WebPage_system_POST(const String& var) { String Proc_WebPage_system_POST(const String& var) {
if(var == "SUBNAV") { if(var == "SAVE_MSG") {
return String(Page_system_HTML_SUBNAV);
} else if(var == "SAVE_MSG") {
return String(Common_HTML_SAVE_MSG); return String(Common_HTML_SAVE_MSG);
} else { } else {
return Proc_WebPage_system(var); return Proc_WebPage_system(var);
@ -57,9 +55,7 @@ String Proc_WebPage_system_POST(const String& var) {
} }
String Proc_WebPage_system_POST_ERR(const String& var) { String Proc_WebPage_system_POST_ERR(const String& var) {
if(var == "SUBNAV") { if(var == "SAVE_MSG") {
return String(Page_system_HTML_SUBNAV);
} else if(var == "SAVE_MSG") {
return String(Common_HTML_SAVE_MSG_ERR); return String(Common_HTML_SAVE_MSG_ERR);
} else { } else {
return Proc_WebPage_system(var); return Proc_WebPage_system(var);
@ -104,6 +100,8 @@ void WebPage_system(AsyncWebServerRequest *request) {
String Proc_WebPage_system_restart(const String& var) { String Proc_WebPage_system_restart(const String& var) {
if(TestHeaderFooter(var)) { if(TestHeaderFooter(var)) {
return AddHeaderFooter(var); return AddHeaderFooter(var);
} else if(var == "SUBNAV") {
return String(Page_system_HTML_SUBNAV);
} else if(var == "RESTART_MSG") { } else if(var == "RESTART_MSG") {
return String(Page_system_restart_HTML_RESTART_MSG); return String(Page_system_restart_HTML_RESTART_MSG);
} else { } else {
@ -173,6 +171,17 @@ void WebPage_system_update_ApplyUpdate(AsyncWebServerRequest *request, String fi
} }
} }
String Proc_WebPage_system_update(const String& var) {
if(TestHeaderFooter(var)) {
return AddHeaderFooter(var);
} else if(var == "SUBNAV") {
return String(Page_system_HTML_SUBNAV);
} else {
return String();
}
}
/* After an update.bin file was uploaded*/
String Proc_WebPage_system_update_POST(const String& var) { String Proc_WebPage_system_update_POST(const String& var) {
if(var == "CONFIGWIFI_IP") { if(var == "CONFIGWIFI_IP") {
if(config.wifi.dhcp == true) { if(config.wifi.dhcp == true) {
@ -194,7 +203,7 @@ void WebPage_system_update(AsyncWebServerRequest *request) {
response->addHeader("Connection", "close"); response->addHeader("Connection", "close");
request->send(response); request->send(response);
} else { } else {
request->send_P(200, "text/html", Page_system_update_HTML, AddHeaderFooter); request->send_P(200, "text/html", Page_system_update_HTML, Proc_WebPage_system_update);
} }
} }
@ -205,6 +214,8 @@ void WebPage_system_update(AsyncWebServerRequest *request) {
String Proc_WebPage_system_wipe(const String& var) { String Proc_WebPage_system_wipe(const String& var) {
if(TestHeaderFooter(var)) { if(TestHeaderFooter(var)) {
return AddHeaderFooter(var); return AddHeaderFooter(var);
} else if(var == "SUBNAV") {
return String(Page_system_HTML_SUBNAV);
} else if(var == "WIPE_MSG") { } else if(var == "WIPE_MSG") {
return String(Page_system_wipe_HTML_WIPE_MSG); return String(Page_system_wipe_HTML_WIPE_MSG);
} else { } else {

View file

@ -66,7 +66,8 @@ const char* Page_system_HTML_SUBNAV PROGMEM = R"(<ul class='subnav'>
*/ */
const char* Page_system_update_HTML PROGMEM = R"(%HEADER% const char* Page_system_update_HTML PROGMEM = R"(%HEADER%
<h2>&#9881; System settings</h2> <h2>&#9881; System settings</h2>
<h3>&#x1F504; Firmware update</h3> <div class='subnavTitle'>&#x1F504; Firmware update</div>
%SUBNAV%
Version: %CGVER% <br> Version: %CGVER% <br>
Build : %CGBUILD% <br> Build : %CGBUILD% <br>
@ -97,7 +98,8 @@ Please see messages on serial monitor for more information and go back to <a hre
*/ */
const char* Page_system_restart_HTML PROGMEM = R"(%HEADER% const char* Page_system_restart_HTML PROGMEM = R"(%HEADER%
<h2>&#9881; System settings</h2> <h2>&#9881; System settings</h2>
<h3>&#10071; Restart CanGrow</h3> <div class='subnavTitle'>&#10071; Restart CanGrow</div>
%SUBNAV%
<div class='warnmsg'> <div class='warnmsg'>
%RESTART_MSG% %RESTART_MSG%
</div> </div>
@ -118,7 +120,8 @@ const char* Page_system_restart_HTML_RESTART_MSG_POST PROGMEM = R"(Restarting...
*/ */
const char* Page_system_wipe_HTML PROGMEM = R"(%HEADER% const char* Page_system_wipe_HTML PROGMEM = R"(%HEADER%
<h2>&#9881; System settings</h2> <h2>&#9881; System settings</h2>
<h3>&#x1F4A3; Factory reset</h3> <div class='subnavTitle'>&#x1F4A3; Factory reset</div>
%SUBNAV%
<div class='warnmsg'> <div class='warnmsg'>
%WIPE_MSG% %WIPE_MSG%
</div> </div>
@ -141,5 +144,6 @@ const char* Page_system_wipe_HTML_WIPE_MSG_POST PROGMEM = R"(Restarting...)";
const char* Page_system_output_HTML PROGMEM = R"(%HEADER% const char* Page_system_output_HTML PROGMEM = R"(%HEADER%
<h2>&#9881; System settings</h2> <h2>&#9881; System settings</h2>
<div class='subnavTitle'>&#9889; Output configuration</div> <div class='subnavTitle'>&#9889; Output configuration</div>
%SUBNAV%
%FOOTER%)"; %FOOTER%)";