mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-25 06:46:10 +02:00
0.5.102
Warning: old exports are not compatible any more! further save settings improvements (only store inverters which are existing) improved display of settings save return value made save settings asynchronous (more heap memory is free)
This commit is contained in:
parent
e1326698b9
commit
57bda044e5
9 changed files with 99 additions and 41 deletions
|
@ -80,6 +80,7 @@ class RestApi {
|
|||
if(path == "html/system") getHtmlSystem(root);
|
||||
else if(path == "html/logout") getHtmlLogout(root);
|
||||
else if(path == "html/save") getHtmlSave(root);
|
||||
else if(path == "html/chk_save") getHtmlChkSave(root);
|
||||
else if(path == "system") getSysInfo(root);
|
||||
else if(path == "generic") getGeneric(root);
|
||||
else if(path == "reboot") getReboot(root);
|
||||
|
@ -266,9 +267,19 @@ class RestApi {
|
|||
|
||||
void getHtmlSave(JsonObject obj) {
|
||||
getGeneric(obj.createNestedObject(F("generic")));
|
||||
obj[F("refresh")] = 2;
|
||||
obj[F("refresh_url")] = "/setup";
|
||||
obj[F("html")] = F("settings succesfully save");
|
||||
obj[F("refresh")] = 1;
|
||||
obj[F("refresh_url")] = F("/chk_save");
|
||||
obj[F("html")] = F("saving settings ...");
|
||||
}
|
||||
|
||||
void getHtmlChkSave(JsonObject obj) {
|
||||
getGeneric(obj.createNestedObject(F("generic")));
|
||||
obj[F("refresh")] = (mApp->getLastSaveSucceed()) ? 10 : 1;
|
||||
obj[F("refresh_url")] = mApp->getSavePending() ? F("/chk_save") : F("/setup");
|
||||
if(mApp->getSavePending())
|
||||
obj[F("html")] = F("saving settings ...");
|
||||
else
|
||||
obj[F("html")] = mApp->getLastSaveSucceed() ? F("settings succesfully saved") : F("failed saving settings");
|
||||
}
|
||||
|
||||
void getReboot(JsonObject obj) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue