Parcourir la source

auto update script executed

Toby Chui il y a 1 an
Parent
commit
14895cac16
1 fichiers modifiés avec 29 ajouts et 1 suppressions
  1. 29 1
      web/components/rproot.html

+ 29 - 1
web/components/rproot.html

@@ -20,7 +20,6 @@
 </div>
 
 <script>
-     initRootInfo();
     function initRootInfo(){
         $.get("/api/proxy/list?type=root", function(data){
             if (data == null){
@@ -30,4 +29,33 @@
             }
         });
     }
+    initRootInfo();
+
+    function setProxyRoot(){
+        var newpr = $("#proxyRoot").val();
+        if (newpr.trim() == ""){
+            $("#proxyRoot").parent().addClass('error');
+            return
+        }else{
+            $("#proxyRoot").parent().removeClass('error');
+        }
+
+        var rootReqTls = $("#rootReqTLS")[0].checked;
+
+        //Create the endpoint by calling add
+        $.ajax({
+            url: "/api/proxy/add",
+            data: {"type": "root", tls: rootReqTls, ep: newpr},
+            success: function(data){
+                if (data.error != undefined){
+                    alert(data.error);
+                }else{
+                    //OK
+                    initRootInfo();
+                    $("#ProxyRootUpdate").stop().slideDown('fast').delay(3000).slideUp('fast');
+                }
+            }
+        });
+
+    }
 </script>