mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Working through git filesystem recovery
This commit is contained in:
parent
a3cb1d63fe
commit
67cd9a3200
5 changed files with 15 additions and 2 deletions
10
Web.cpp
10
Web.cpp
|
|
@ -2449,8 +2449,14 @@ void Web::begin() {
|
|||
server.on("/recoverFilesystem", [] () {
|
||||
if(server.method() == HTTP_OPTIONS) { server.send(200, "OK"); return; }
|
||||
webServer.sendCORSHeaders(server);
|
||||
git.recoverFilesystem();
|
||||
server.send(200, "application/json", "{\"status\":\"OK\",\"desc\":\"Recovering filesystem from github please wait!!!\"}");
|
||||
if(git.status == GIT_UPDATING)
|
||||
server.send(200, "application/json", "{\"status\":\"OK\",\"desc\":\"Filesystem is updating. Please wait!!!\"}");
|
||||
else if(git.status != GIT_STATUS_READY)
|
||||
server.send(200, "application/json", "{\"status\":\"ERROR\",\"desc\":\"Cannot recover file system at this time.\"}");
|
||||
else {
|
||||
git.recoverFilesystem();
|
||||
server.send(200, "application/json", "{\"status\":\"OK\",\"desc\":\"Recovering filesystem from github please wait!!!\"}");
|
||||
}
|
||||
});
|
||||
server.begin();
|
||||
apiServer.begin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue