mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-10 03:25:35 +00:00
MAIN page item added to HTML footer. (#1115)
This commit is contained in:
@ -996,7 +996,7 @@ int http_fn_about(http_request_t* request) {
|
||||
http_setup(request, httpMimeTypeHTML);
|
||||
http_html_start(request, "About");
|
||||
poststr_h2(request, "Open source firmware for BK7231N, BK7231T, XR809 and BL602 by OpenSHWProjects");
|
||||
poststr(request, htmlFooterReturnToMenu);
|
||||
poststr(request, htmlFooterReturnToMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1019,7 +1019,7 @@ int http_fn_cfg_mqtt(http_request_t* request) {
|
||||
add_label_password_field(request, "Password", "password", CFG_GetMQTTPass(), "<br>");
|
||||
|
||||
poststr(request, "<br><input type=\"submit\" value=\"Submit\" onclick=\"return confirm('Are you sure? Please check MQTT data twice?')\"></form> ");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1065,7 +1065,7 @@ int http_fn_cfg_ip(http_request_t* request) {
|
||||
add_label_text_field(request, "Gate", "gate", tmp, "<br>");
|
||||
|
||||
poststr(request, "<br><input type=\"submit\" value=\"Submit\" onclick=\"return confirm('Are you sure? Remember that you need to reboot manually to apply changes')\"></form> ");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1103,7 +1103,7 @@ int http_fn_cfg_mqtt_set(http_request_t* request) {
|
||||
g_mqtt_bBaseTopicDirty = 1;
|
||||
|
||||
poststr(request, "<br><a href=\"cfg_mqtt\">Return to MQTT settings</a><br>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1114,7 +1114,7 @@ int http_fn_cfg_webapp(http_request_t* request) {
|
||||
http_html_start(request, "Set Webapp");
|
||||
add_label_text_field(request, "URL of the Webapp", "url", CFG_GetWebappRoot(), "<form action=\"/cfg_webapp_set\">");
|
||||
poststr(request, SUBMIT_AND_END_FORM);
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1135,7 +1135,7 @@ int http_fn_cfg_webapp_set(http_request_t* request) {
|
||||
}
|
||||
|
||||
poststr(request, "<br>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1196,7 +1196,7 @@ int http_fn_cfg_ping(http_request_t* request) {
|
||||
poststr(request, "<br><br>\
|
||||
<input type=\"submit\" value=\"Submit\" onclick=\"return confirm('Are you sure?')\">\
|
||||
</form>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1293,7 +1293,7 @@ int http_fn_cfg_wifi(http_request_t* request) {
|
||||
poststr(request, "<br><br>\
|
||||
<input type=\"submit\" value=\"Submit\" onclick=\"return confirm('Are you sure? Please check SSID and pass twice?')\">\
|
||||
</form>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1330,7 +1330,7 @@ int http_fn_cfg_name(http_request_t* request) {
|
||||
//poststr(request,htmlReturnToCfg);
|
||||
//HTTP_AddBuildFooter(request);
|
||||
//poststr(request,htmlEnd);
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1389,7 +1389,7 @@ int http_fn_cfg_wifi_set(http_request_t* request) {
|
||||
RESET_ScheduleModuleReset(3);
|
||||
}
|
||||
poststr(request, "<br><a href=\"cfg_wifi\">Return to WiFi settings</a><br>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1420,7 +1420,7 @@ int http_fn_cfg_loglevel_set(http_request_t* request) {
|
||||
</form>");
|
||||
|
||||
poststr(request, "<br><a href=\"cfg\">Return to config settings</a><br>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1461,7 +1461,7 @@ int http_fn_cfg_mac(http_request_t* request) {
|
||||
poststr(request, "<br><br>\
|
||||
<input type=\"submit\" value=\"Submit\" onclick=\"return confirm('Are you sure? Please check MAC hex string twice?')\">\
|
||||
</form>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1552,7 +1552,7 @@ int http_fn_cfg_mac(http_request_t* request) {
|
||||
// add_label_numeric_field(request, "Length", "len", len, "<br>");
|
||||
// poststr(request, SUBMIT_AND_END_FORM);
|
||||
//
|
||||
// poststr(request, htmlFooterReturnToCfgLink);
|
||||
// poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
// http_html_end(request);
|
||||
// poststr(request, NULL);
|
||||
// return 0;
|
||||
@ -1617,7 +1617,7 @@ int http_fn_cmd_tool(http_request_t* request) {
|
||||
add_label_text_field(request, "Command", "cmd", tmpA, "<form action=\"/cmd_tool\">");
|
||||
poststr(request, SUBMIT_AND_END_FORM);
|
||||
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -1646,7 +1646,7 @@ int http_fn_startup_command(http_request_t* request) {
|
||||
poststr(request, "<input type='hidden' name='startup_cmd' value='1'>");
|
||||
poststr(request, SUBMIT_AND_END_FORM);
|
||||
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2373,7 +2373,7 @@ int http_fn_ha_cfg(http_request_t* request) {
|
||||
|
||||
poststr(request, "</textarea>");
|
||||
poststr(request, "<br/><div><label for=\"ha_disc_topic\">Discovery topic:</label><input id=\"ha_disc_topic\" value=\"homeassistant\"><button onclick=\"send_ha_disc();\">Start Home Assistant Discovery</button> <form action=\"cfg_mqtt\" class='disp-inline'><button type=\"submit\">Configure MQTT</button></form></div><br/>");
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, ha_discovery_script);
|
||||
poststr(request, NULL);
|
||||
@ -2454,7 +2454,7 @@ int http_fn_cfg(http_request_t* request) {
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
poststr(request, htmlFooterReturnToMenu);
|
||||
poststr(request, htmlFooterReturnToMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2605,7 +2605,7 @@ int http_fn_cfg_pins(http_request_t* request) {
|
||||
}
|
||||
poststr(request, "<input type=\"submit\" value=\"Save\"/></form>");
|
||||
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2729,7 +2729,7 @@ int http_fn_cfg_generic(http_request_t* request) {
|
||||
CFG_GetBootOkSeconds(), "<form action=\"/cfg_generic\">");
|
||||
poststr(request, "<br><input type=\"submit\" value=\"Save\"/></form>");
|
||||
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2783,7 +2783,7 @@ int http_fn_cfg_startup(http_request_t* request) {
|
||||
}
|
||||
}
|
||||
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2881,7 +2881,7 @@ int http_fn_cfg_dgr(http_request_t* request) {
|
||||
poststr(request, SUBMIT_AND_END_FORM);
|
||||
}
|
||||
|
||||
poststr(request, htmlFooterReturnToCfgLink);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2916,7 +2916,7 @@ int http_fn_ota_exec(http_request_t* request) {
|
||||
addLogAdv(LOG_INFO, LOG_FEATURE_HTTP, "http_fn_ota_exec: will try to do OTA for %s \r\n", tmpA);
|
||||
OTA_RequestDownloadFromHTTP(tmpA);
|
||||
}
|
||||
poststr(request, htmlFooterReturnToMenu);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2930,7 +2930,7 @@ int http_fn_ota(http_request_t* request) {
|
||||
poststr(request, "<br>\
|
||||
<input type=\"submit\" value=\"Submit\" onclick=\"return confirm('Are you sure?')\">\
|
||||
</form>");
|
||||
poststr(request, htmlFooterReturnToMenu);
|
||||
poststr(request, htmlFooterReturnToCfgOrMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
@ -2940,7 +2940,7 @@ int http_fn_other(http_request_t* request) {
|
||||
http_setup(request, httpMimeTypeHTML);
|
||||
http_html_start(request, "Not found");
|
||||
poststr(request, "Not found.<br/>");
|
||||
poststr(request, htmlFooterReturnToMenu);
|
||||
poststr(request, htmlFooterReturnToMainPage);
|
||||
http_html_end(request);
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
|
||||
@ -41,9 +41,11 @@ const char htmlBodyStart2[] =
|
||||
"</a></h1>";
|
||||
const char htmlBodyEnd[] = "</div></body></html>";
|
||||
|
||||
const char htmlFooterReturnToMenu[] = "<a href=\"index\">Return to menu</a>";
|
||||
const char htmlFooterReturnToMainPage[] = "<a href=\"index\">MAIN page</a>";
|
||||
const char htmlFooterRefreshLink[] = "<a href=\"index\">Refresh</a>";
|
||||
const char htmlFooterReturnToCfgLink[] = "<a href=\"cfg\">Return to cfg</a>";
|
||||
const char htmlFooterReturnToCfgOrMainPage[] =
|
||||
"<a href=\"cfg\">Return to cfg</a> | "
|
||||
"<a href=\"index\">MAIN page</a>";
|
||||
|
||||
const char htmlFooterInfo[] =
|
||||
"<a target=\"_blank\" "
|
||||
|
||||
@ -13,9 +13,9 @@ extern const char htmlShortcutIcon[];
|
||||
extern const char htmlDoctype[];
|
||||
extern const char htmlHeadMeta[];
|
||||
|
||||
extern const char htmlFooterReturnToMenu[];
|
||||
extern const char htmlFooterReturnToMainPage[];
|
||||
extern const char htmlFooterRefreshLink[];
|
||||
extern const char htmlFooterReturnToCfgLink[];
|
||||
extern const char htmlFooterReturnToCfgOrMainPage[];
|
||||
|
||||
extern const char* htmlPinRoleNames[];
|
||||
|
||||
|
||||
@ -324,7 +324,7 @@ static int http_rest_app(http_request_t* request) {
|
||||
}
|
||||
else {
|
||||
http_html_start(request, "Not available");
|
||||
poststr(request, htmlFooterReturnToMenu);
|
||||
poststr(request, htmlFooterReturnToMainPage);
|
||||
poststr(request, "no APP available<br/>");
|
||||
http_html_end(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user