mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Update resetConfig endpoint to /config/reset #246
This commit is contained in:
parent
301a227d91
commit
cfdc343349
@ -1082,7 +1082,7 @@ static void webHandleConfig()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
httpMessage += F("<a href='/config/debug'>" D_HTTP_DEBUG_SETTINGS "</a>");
|
httpMessage += F("<a href='/config/debug'>" D_HTTP_DEBUG_SETTINGS "</a>");
|
||||||
httpMessage += F("<a href='/resetConfig' class='red'>" D_HTTP_FACTORY_RESET "</a>");
|
httpMessage += F("<a href='/config/reset' class='red'>" D_HTTP_FACTORY_RESET "</a>");
|
||||||
httpMessage += FPSTR(MAIN_MENU_BUTTON);
|
httpMessage += FPSTR(MAIN_MENU_BUTTON);
|
||||||
|
|
||||||
webSendHeader(haspDevice.get_hostname(), httpMessage.length(), false);
|
webSendHeader(haspDevice.get_hostname(), httpMessage.length(), false);
|
||||||
@ -2092,18 +2092,18 @@ static void httpHandleEspFirmware()
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
#if HASP_USE_CONFIG > 0
|
// #if HASP_USE_CONFIG > 0
|
||||||
static void webHandleSaveConfig()
|
// static void webHandleSaveConfig()
|
||||||
{
|
// {
|
||||||
if(!httpIsAuthenticated(F("saveConfig"))) return;
|
// if(!httpIsAuthenticated(F("saveConfig"))) return;
|
||||||
|
|
||||||
configWrite();
|
// configWrite();
|
||||||
}
|
// }
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
static void httpHandleResetConfig()
|
static void httpHandleResetConfig()
|
||||||
{ // http://plate01/resetConfig
|
{ // http://plate01/config/reset
|
||||||
if(!httpIsAuthenticated(F("resetConfig"))) return;
|
if(!httpIsAuthenticated(F("reset"))) return;
|
||||||
|
|
||||||
bool resetConfirmed = webServer.arg(F("confirm")) == F("yes");
|
bool resetConfirmed = webServer.arg(F("confirm")) == F("yes");
|
||||||
|
|
||||||
@ -2126,7 +2126,7 @@ static void httpHandleResetConfig()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Form
|
// Form
|
||||||
httpMessage += F("<form method='POST' action='/resetConfig'>");
|
httpMessage += F("<form method='POST' action='/config/reset'>");
|
||||||
httpMessage +=
|
httpMessage +=
|
||||||
F("<div class=\"warning\"><b>Warning</b><p>This process will reset all settings to the "
|
F("<div class=\"warning\"><b>Warning</b><p>This process will reset all settings to the "
|
||||||
"default values. The internal flash will be erased and the device is restarted. You may need to "
|
"default values. The internal flash will be erased and the device is restarted. You may need to "
|
||||||
@ -2336,8 +2336,8 @@ void httpSetup()
|
|||||||
webServer.on(F("/config/gpio/options"), webHandleGpioOutput);
|
webServer.on(F("/config/gpio/options"), webHandleGpioOutput);
|
||||||
webServer.on(F("/config/gpio/input"), webHandleGpioInput);
|
webServer.on(F("/config/gpio/input"), webHandleGpioInput);
|
||||||
#endif
|
#endif
|
||||||
webServer.on(F("/saveConfig"), webHandleSaveConfig);
|
// webServer.on(F("/saveConfig"), webHandleSaveConfig);
|
||||||
webServer.on(F("/resetConfig"), httpHandleResetConfig);
|
webServer.on(F("/config/reset"), httpHandleResetConfig);
|
||||||
#endif // HASP_USE_CONFIG
|
#endif // HASP_USE_CONFIG
|
||||||
webServer.onNotFound(httpHandleFileFromFlash);
|
webServer.onNotFound(httpHandleFileFromFlash);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user