allow to publish free heap

This commit is contained in:
technyon
2023-02-05 13:43:23 +01:00
parent 1e20ed1d38
commit d72970e46b
4 changed files with 35 additions and 6 deletions

View File

@@ -167,13 +167,35 @@ void WebCfgServer::initialize()
buildInfoHtml(response);
_server.send(200, "text/html", response);
});
_server.on("/heapon", [&]() {
_preferences->putBool(preference_publish_heap, true);
String response = "";
buildConfirmHtml(response, "OK");
_server.send(200, "text/html", response);
Log->println(F("Restarting"));
waitAndProcess(true, 1000);
ESP.restart();
});
_server.on("/heapoff", [&]() {
_preferences->putBool(preference_publish_heap, false);
String response = "";
buildConfirmHtml(response, "OK");
_server.send(200, "text/html", response);
Log->println(F("Restarting"));
waitAndProcess(true, 1000);
ESP.restart();
});
_server.begin();
_network->setKeepAliveCallback([&]()
{
update();
});
{
update();
});
}
bool WebCfgServer::processArgs(String& message)