Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
497983a122
4 changed files with 28 additions and 6 deletions
  1. 2 1
      web/components/httprp.html
  2. 1 1
      web/components/uptime.html
  3. 3 1
      web/components/vdir.html
  4. 22 3
      wrappers.go

+ 2 - 1
web/components/httprp.html

@@ -251,7 +251,8 @@
     }
 
     function quickEditVdir(uuid){
-        alert(uuid);
+        openTabById("vdir");
+        $("#vdirBaseRoutingRule").parent().dropdown("set selected", uuid);
     }
 
     function editCustomHeaders(uuid){

+ 1 - 1
web/components/uptime.html

@@ -177,7 +177,7 @@
         $("#utmrender").append(`<div class="ui basic segment statusbar">
             <div class="domain">
                 <div style="position: absolute; top: 0; right: 0.4em;">
-                    <p class="onlineStatus" style="display: inline-block; font-size: 1.3em; padding-right: 0.5em; padding-left: 0.3em; ${onlineStatusCss}">${currentOnlineStatus}</p>
+                    <p class="onlineStatus" style="display: inline-block; font-size: 1.2em; padding-right: 0.5em; padding-left: 0.3em; ${onlineStatusCss}">${currentOnlineStatus}</p>
                 </div>
                 <div>
                     <h3 class="ui header" style="margin-bottom: 0.2em;">${name}</h3>

+ 3 - 1
web/components/vdir.html

@@ -207,6 +207,7 @@
     }
 
     function reloadVdirList(){
+        $("#vdirList").find(".editBtn").removeClass("disabled");
         if ($("#useRootProxyRouterForVdir")[0].checked){
             loadVdirList("root");
             return;
@@ -314,7 +315,8 @@
     }
 
     function editVdir(matchingPath, ept){
-        let targetDOM = $(".vdirEntry[vdirid='" + matchingPath.hexEncode() + "']") 
+        let targetDOM = $(".vdirEntry[vdirid='" + matchingPath.hexEncode() + "']");
+        $("#vdirList").find(".editBtn").addClass("disabled");
         let payload = $(targetDOM).attr("payload").hexDecode();
         payload = JSON.parse(payload);
         console.log(payload);

+ 22 - 3
wrappers.go

@@ -123,7 +123,7 @@ func GetUptimeTargetsFromReverseProxyRules(dp *dynamicproxy.Router) []*uptime.Ta
 	hosts := dp.GetProxyEndpointsAsMap()
 
 	UptimeTargets := []*uptime.Target{}
-	for subd, target := range hosts {
+	for hostid, target := range hosts {
 		url := "http://" + target.Domain
 		protocol := "http"
 		if target.RequireTLS {
@@ -131,12 +131,31 @@ func GetUptimeTargetsFromReverseProxyRules(dp *dynamicproxy.Router) []*uptime.Ta
 			protocol = "https"
 		}
 
+		//Add the root url
 		UptimeTargets = append(UptimeTargets, &uptime.Target{
-			ID:       subd,
-			Name:     subd,
+			ID:       hostid,
+			Name:     hostid,
 			URL:      url,
 			Protocol: protocol,
 		})
+
+		//Add each virtual directory into the list
+		for _, vdir := range target.VirtualDirectories {
+			url := "http://" + vdir.Domain
+			protocol := "http"
+			if target.RequireTLS {
+				url = "https://" + vdir.Domain
+				protocol = "https"
+			}
+			//Add the root url
+			UptimeTargets = append(UptimeTargets, &uptime.Target{
+				ID:       hostid + vdir.MatchingPath,
+				Name:     hostid + vdir.MatchingPath,
+				URL:      url,
+				Protocol: protocol,
+			})
+
+		}
 	}
 
 	return UptimeTargets