Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Fri May 03 10:36:38 2019 +0000
Parent:
114:900e33dfa460
Child:
116:e2f4bf715af7
Commit message:
Changed firmware reset to call the new restart routine rather than directly calling the semihost reset.

Changed in this revision

base/firmware/web-firmware-html.c Show annotated file Show diff for this revision Revisions of this file
base/firmware/web-firmware-query.c Show annotated file Show diff for this revision Revisions of this file
base/firmware/web-firmware-script.inc Show annotated file Show diff for this revision Revisions of this file
base/firmware/web-firmware-script.js Show annotated file Show diff for this revision Revisions of this file
--- a/base/firmware/web-firmware-html.c	Thu May 02 17:40:20 2019 +0000
+++ b/base/firmware/web-firmware-html.c	Fri May 03 10:36:38 2019 +0000
@@ -28,9 +28,4 @@
     WebAddH2("Restart the device");
     HttpAddText("<div><button onclick='restart();'>Restart</button></div>\r\n");
     HttpAddText("<code id='restartresult'></code>\r\n");
-    
-    WebAddH2("Reset password");
-    HttpAddText("<div><button onclick='resetPassword();'>Reset</button></div>\r\n");
-
-    WebAddEnd();
 }
--- a/base/firmware/web-firmware-query.c	Thu May 02 17:40:20 2019 +0000
+++ b/base/firmware/web-firmware-query.c	Fri May 03 10:36:38 2019 +0000
@@ -1,5 +1,5 @@
 #include "http.h"
-#include "semihost.h"
+#include "restart.h"
 #include "web-pages-base.h"
 
 void WebFirmwareQuery(char* pQuery)
@@ -11,8 +11,6 @@
         pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
         int value = HttpQueryValueAsInt(pValue);    
         
-        if (HttpSameStr(pName, "restart" )) SemihostReset();
-        
-        if (HttpSameStr(pName, "resetpassword")) WebLoginForceNewPassword();
+        if (HttpSameStr(pName, "restart")) Restart();
     }
 }
--- a/base/firmware/web-firmware-script.inc	Thu May 02 17:40:20 2019 +0000
+++ b/base/firmware/web-firmware-script.inc	Fri May 03 10:36:38 2019 +0000
@@ -85,15 +85,4 @@
 "{\n"
 "    xhrRestartStart();\n"
 "}\n"
-"function resetPassword()\n"
-"{\n"
-"    xhr = new XMLHttpRequest();\n"
-"\n"
-"    xhr.onload  = xhrRestartOnLoad;\n"
-"\n"
-"    xhr.open('GET', '/firmware-ajax?resetpassword='); //Defaults to async=true\n"
-"    xhr.send();\n"
-"    \n"
-"    location.href = '/firmware';\n"
-"}\n"
 ""
\ No newline at end of file
--- a/base/firmware/web-firmware-script.js	Thu May 02 17:40:20 2019 +0000
+++ b/base/firmware/web-firmware-script.js	Fri May 03 10:36:38 2019 +0000
@@ -85,14 +85,4 @@
 {
     xhrRestartStart();
 }
-function resetPassword()
-{
-    xhr = new XMLHttpRequest();
 
-    xhr.onload  = xhrRestartOnLoad;
-
-    xhr.open('GET', '/firmware-ajax?resetpassword='); //Defaults to async=true
-    xhr.send();
-    
-    location.href = '/firmware';
-}