mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
NC logic for button. 2 button behaviors. some suggestions implemented
This commit is contained in:
parent
8344bf5179
commit
173acab23a
5 changed files with 51 additions and 25 deletions
|
@ -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>";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue