* merged MI, thx @rejoe2 #788
* fixed reboot message #793
This commit is contained in:
lumapu 2023-03-23 22:41:56 +01:00
parent 53d02df854
commit 5a1a600327
5 changed files with 20 additions and 5 deletions

View file

@ -2,6 +2,10 @@
(starting from release version `0.5.66`)
## 0.5.105
* merged MI, thx @rejoe2 #788
* fixed reboot message #793
## 0.5.104
* further improved save settings
* removed `#` character from ePaper

View file

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 104
#define VERSION_PATCH 105
//-------------------------------------
typedef struct {

View file

@ -79,6 +79,7 @@ class RestApi {
String path = request->url().substring(5);
if(path == "html/system") getHtmlSystem(root);
else if(path == "html/logout") getHtmlLogout(root);
else if(path == "html/reboot") getHtmlReboot(root);
else if(path == "html/save") getHtmlSave(root);
else if(path == "system") getSysInfo(root);
else if(path == "generic") getGeneric(root);
@ -264,6 +265,13 @@ class RestApi {
obj[F("html")] = F("succesfully logged out");
}
void getHtmlReboot(JsonObject obj) {
getGeneric(obj.createNestedObject(F("generic")));
obj[F("refresh")] = 20;
obj[F("refresh_url")] = "/";
obj[F("html")] = F("rebooting ...");
}
void getHtmlSave(JsonObject obj) {
getGeneric(obj.createNestedObject(F("generic")));
obj["pending"] = (bool)mApp->getSavePending();

View file

@ -9,7 +9,10 @@ import subprocess
def get_git_sha():
try:
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
except:
return "0000000"
def readVersion(path):
f = open(path, "r")

View file

@ -327,7 +327,7 @@ class Web {
mProtected = true;
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), save_html, save_html_len);
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), system_html, system_html_len);
response->addHeader(F("Content-Encoding"), "gzip");
request->send(response);
}
@ -375,7 +375,7 @@ class Web {
void onReboot(AsyncWebServerRequest *request) {
mApp->setRebootFlag();
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), save_html, save_html_len);
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), system_html, system_html_len);
response->addHeader(F("Content-Encoding"), "gzip");
request->send(response);
}
@ -593,7 +593,7 @@ class Web {
mApp->saveSettings((request->arg("reboot") == "on"));
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), save_html, save_html_len);
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), system_html, save_html_len);
response->addHeader(F("Content-Encoding"), "gzip");
request->send(response);
}