瀏覽代碼

Make setup abort configuration requests asynchronous

SybexXx 1 天之前
父節點
當前提交
9de450c39b
共有 1 個文件被更改,包括 6 次插入 和 3 次删除
  1. 6 3
      sd-card/html/edit_explain_7_abort.html

+ 6 - 3
sd-card/html/edit_explain_7_abort.html

@@ -44,10 +44,10 @@ p {font-size: 1em;}
 
 
     <script type="text/javascript">
     <script type="text/javascript">
    
    
-    function reboot() {
+    async function reboot() {
         if (confirm("Do you want to abort the setup mode and switch to regular web interface?")) {
         if (confirm("Do you want to abort the setup mode and switch to regular web interface?")) {
             domainname = getDomainname(); 
             domainname = getDomainname(); 
-            if (!loadConfig(domainname)) {
+            if (!await loadConfig(domainname)) {
                 firework.launch('Setup mode could not be deactivated! Please try again!', 'danger', 30000);
                 firework.launch('Setup mode could not be deactivated! Please try again!', 'danger', 30000);
                 return;
                 return;
             } 
             } 
@@ -57,7 +57,10 @@ p {font-size: 1em;}
             param["System"]["SetupMode"]["value1"] = "false";
             param["System"]["SetupMode"]["value1"] = "false";
 
 
             WriteConfigININew();
             WriteConfigININew();
-            SaveConfigToServer(domainname);    
+            if (!await SaveConfigToServer(domainname)) {
+                firework.launch('Setup mode could not be saved!', 'danger', 10000);
+                return;
+            }    
 
 
             var stringota = getDomainname() + "/reboot";
             var stringota = getDomainname() + "/reboot";
             parent.location = stringota;
             parent.location = stringota;