add confirmation messages to form saving
This commit is contained in:
+1
-1
Submodule front-end updated: d831d47f53...c846cffedb
+1
-1
@@ -194,7 +194,7 @@ httpd_cgi_state ICACHE_FLASH_ATTR cgiNetworkSetParams(HttpdConnData *connData)
|
||||
os_timer_setfn(&timer, applyNetSettingsLaterCb, NULL);
|
||||
os_timer_arm(&timer, 1000, false);
|
||||
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=Settings%20saved%20and%20applied.");
|
||||
} else {
|
||||
cgi_warn("Some WiFi settings did not validate, asking for correction");
|
||||
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@ Cgi/template routines for configuring non-wifi settings
|
||||
#include "helpers.h"
|
||||
#include "cgi_logging.h"
|
||||
|
||||
#define SET_REDIR_SUC "/cfg/admin"
|
||||
#define SET_REDIR_SUC "/cfg/system"
|
||||
|
||||
static bool ICACHE_FLASH_ATTR
|
||||
verify_admin_pw(const char *pw)
|
||||
@@ -34,7 +34,7 @@ cgiPersistWriteDefaults(HttpdConnData *connData)
|
||||
|
||||
persist_set_as_default();
|
||||
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=Default%20settings%20updated.");
|
||||
return HTTPD_CGI_DONE;
|
||||
}
|
||||
// if pw failed, show the same error as if it's wrong
|
||||
@@ -55,7 +55,7 @@ cgiPersistRestoreDefaults(HttpdConnData *connData)
|
||||
|
||||
persist_restore_default();
|
||||
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=All%20settings%20restored%20to%20saved%20defaults.");
|
||||
return HTTPD_CGI_DONE;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,6 @@ cgiPersistRestoreHard(HttpdConnData *connData)
|
||||
// Defaults are not changed.
|
||||
persist_load_hard_default();
|
||||
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=All%20settings%20restored%20to%20factory%20defaults.");
|
||||
return HTTPD_CGI_DONE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ cgiSystemCfgSetParams(HttpdConnData *connData)
|
||||
sysconf_apply_settings();
|
||||
persist_store();
|
||||
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=Settings%20saved%20and%20applied.");
|
||||
} else {
|
||||
cgi_warn("Some settings did not validate, asking for correction");
|
||||
|
||||
|
||||
+1
-1
@@ -367,7 +367,7 @@ cgiTermCfgSetParams(HttpdConnData *connData)
|
||||
screen_notifyChange(CHANGE_LABELS);
|
||||
}
|
||||
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=Settings%20saved%20and%20applied.");
|
||||
} else {
|
||||
cgi_warn("Some settings did not validate, asking for correction");
|
||||
|
||||
|
||||
+1
-1
@@ -535,7 +535,7 @@ httpd_cgi_state ICACHE_FLASH_ATTR cgiWiFiSetParams(HttpdConnData *connData)
|
||||
httpdRedirect(connData, "/cfg/wifi/connecting");
|
||||
}
|
||||
else {
|
||||
httpdRedirect(connData, SET_REDIR_SUC);
|
||||
httpdRedirect(connData, SET_REDIR_SUC "?msg=Settings%20saved%20and%20applied.");
|
||||
}
|
||||
} else {
|
||||
cgi_warn("Some WiFi settings did not validate, asking for correction");
|
||||
|
||||
Reference in New Issue
Block a user