Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
fc1b687ef3
1 changed files with 12 additions and 2 deletions
  1. 12 2
      web/components/rproot.html

+ 12 - 2
web/components/rproot.html

@@ -66,8 +66,18 @@
     $("#advanceRootSettings").accordion();
 
     function handleUseStaticWebServerAsRoot(){
-        alert("WIP");
-        //TODO: Add automatic fill in static web server info
+        let useStaticWebServer = $("#useStaticWebServer")[0].checked;
+        if (useStaticWebServer){
+            let staticWebServerURL = "127.0.0.1:" + $("#webserv_listenPort").val();
+            $("#proxyRoot").val(staticWebServerURL);
+            $("#proxyRoot").parent().addClass("disabled");
+            $("#rootReqTLS").parent().checkbox("set unchecked");
+            $("#rootReqTLS").parent().addClass("disabled");
+        }else{
+            $("#rootReqTLS").parent().removeClass("disabled");
+            $("#proxyRoot").parent().removeClass("disabled");
+            initRootInfo();
+        }
     }
     
     function initRootInfo(){