Skip to content

Commit

Permalink
0.5.105
Browse files Browse the repository at this point in the history
* merged MI, thx @rejoe2 #788
* fixed reboot message #793
  • Loading branch information
lumapu committed Mar 23, 2023
1 parent 53d02df commit 5a1a600
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 104
#define VERSION_PATCH 105

//-------------------------------------
typedef struct {
Expand Down
8 changes: 8 additions & 0 deletions src/web/RestApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
5 changes: 4 additions & 1 deletion src/web/html/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@


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):
f = open(path, "r")
Expand Down
6 changes: 3 additions & 3 deletions src/web/web.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 5a1a600

Please sign in to comment.