NC logic for button. 2 button behaviors. some suggestions implemented

This commit is contained in:
amarofarinha 2024-10-02 16:20:10 +01:00
parent 8344bf5179
commit 173acab23a
5 changed files with 51 additions and 25 deletions

View file

@ -167,7 +167,7 @@ void init_webserver() {
});
// Route for emergency stop/resume
server.on("/estop", HTTP_GET, [](AsyncWebServerRequest* request) {
server.on("/emergencyStop", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
if (request->hasParam("stop")) {
@ -908,7 +908,7 @@ String processor(const String& var) {
content +=
"var xhr=new "
"XMLHttpRequest();xhr.onload=function() { "
"window.location.reload();};xhr.open('GET','/estop?stop='+stop,true);xhr.send();";
"window.location.reload();};xhr.open('GET','/emergencyStop?stop='+stop,true);xhr.send();";
content += "}";
content += "</script>";