mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-25 23:06:11 +02:00
parent
53d02df854
commit
5a1a600327
5 changed files with 20 additions and 5 deletions
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
(starting from release version `0.5.66`)
|
(starting from release version `0.5.66`)
|
||||||
|
|
||||||
|
## 0.5.105
|
||||||
|
* merged MI, thx @rejoe2 #788
|
||||||
|
* fixed reboot message #793
|
||||||
|
|
||||||
## 0.5.104
|
## 0.5.104
|
||||||
* further improved save settings
|
* further improved save settings
|
||||||
* removed `#` character from ePaper
|
* removed `#` character from ePaper
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 5
|
#define VERSION_MINOR 5
|
||||||
#define VERSION_PATCH 104
|
#define VERSION_PATCH 105
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -79,6 +79,7 @@ class RestApi {
|
||||||
String path = request->url().substring(5);
|
String path = request->url().substring(5);
|
||||||
if(path == "html/system") getHtmlSystem(root);
|
if(path == "html/system") getHtmlSystem(root);
|
||||||
else if(path == "html/logout") getHtmlLogout(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 == "html/save") getHtmlSave(root);
|
||||||
else if(path == "system") getSysInfo(root);
|
else if(path == "system") getSysInfo(root);
|
||||||
else if(path == "generic") getGeneric(root);
|
else if(path == "generic") getGeneric(root);
|
||||||
|
@ -264,6 +265,13 @@ class RestApi {
|
||||||
obj[F("html")] = F("succesfully logged out");
|
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) {
|
void getHtmlSave(JsonObject obj) {
|
||||||
getGeneric(obj.createNestedObject(F("generic")));
|
getGeneric(obj.createNestedObject(F("generic")));
|
||||||
obj["pending"] = (bool)mApp->getSavePending();
|
obj["pending"] = (bool)mApp->getSavePending();
|
||||||
|
|
|
@ -9,7 +9,10 @@ import subprocess
|
||||||
|
|
||||||
|
|
||||||
def get_git_sha():
|
def get_git_sha():
|
||||||
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
|
try:
|
||||||
|
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
|
||||||
|
except:
|
||||||
|
return "0000000"
|
||||||
|
|
||||||
def readVersion(path):
|
def readVersion(path):
|
||||||
f = open(path, "r")
|
f = open(path, "r")
|
||||||
|
|
|
@ -327,7 +327,7 @@ class Web {
|
||||||
|
|
||||||
mProtected = true;
|
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");
|
response->addHeader(F("Content-Encoding"), "gzip");
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ class Web {
|
||||||
|
|
||||||
void onReboot(AsyncWebServerRequest *request) {
|
void onReboot(AsyncWebServerRequest *request) {
|
||||||
mApp->setRebootFlag();
|
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");
|
response->addHeader(F("Content-Encoding"), "gzip");
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
|
@ -593,7 +593,7 @@ class Web {
|
||||||
|
|
||||||
mApp->saveSettings((request->arg("reboot") == "on"));
|
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");
|
response->addHeader(F("Content-Encoding"), "gzip");
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue