This commit is contained in:
2021-01-12 12:26:58 +01:00
parent 2d67aceba0
commit 0031f92c54
190 changed files with 25835 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
#include <RestartService.h>
RestartService::RestartService(AsyncWebServer* server, SecurityManager* securityManager) {
server->on(RESTART_SERVICE_PATH,
HTTP_POST,
securityManager->wrapRequest(std::bind(&RestartService::restart, this, std::placeholders::_1),
AuthenticationPredicates::IS_ADMIN));
}
void RestartService::restart(AsyncWebServerRequest* request) {
request->onDisconnect(RestartService::restartNow);
request->send(200);
}