made EEPROM-Format on WebUI more "secure"

This commit is contained in:
2022-08-22 14:49:14 +02:00
parent 984affb5a7
commit c7f26bee32
4 changed files with 33 additions and 17 deletions

View File

@@ -308,15 +308,21 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
PersistenceData.tankRemain_µl = LubeConfig.tankCapacity_ml * 1000;
globals.requestEEAction = EE_PDS_SAVE;
}
if (p->name() == "reset_ee_cfg")
if (p->name() == "reset_ee_btn")
{
globals.requestEEAction = EE_CFG_FORMAT;
if (request->hasParam("reset_ee_pds"))
{
AsyncWebParameter *param = request->getParam("reset_ee_pds");
if (param->value() == "checked")
globals.requestEEAction = globals.requestEEAction == EE_CFG_FORMAT ? EE_FORMAT_ALL : EE_PDS_FORMAT;
}
if (request->hasParam("reset_ee_cfg"))
{
AsyncWebParameter *param = request->getParam("reset_ee_cfg");
if (param->value() == "checked")
globals.requestEEAction = globals.requestEEAction == EE_PDS_FORMAT ? EE_FORMAT_ALL : EE_CFG_FORMAT;
}
}
if (p->name() == "reset_ee_pds")
{
globals.requestEEAction = EE_PDS_FORMAT;
}
// end: POST Form Maintenance
}
}