add confirmation messages to form saving

http-comm
Ondřej Hruška 7 years ago
parent 0fae510207
commit 74d52a0c61
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      front-end
  2. 2
      user/cgi_network.c
  3. 8
      user/cgi_persist.c
  4. 2
      user/cgi_system.c
  5. 2
      user/cgi_term_cfg.c
  6. 2
      user/cgi_wifi.c

@ -1 +1 @@
Subproject commit d831d47f5329e3bab11786942d941eb8ff4d1682
Subproject commit c846cffedbd927433354f4fc2004154cd596916f

@ -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");

@ -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;
}

@ -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");

@ -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");

@ -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");

Loading…
Cancel
Save