Bladeren bron

auto update script executed

Toby Chui 1 jaar geleden
bovenliggende
commit
56728da1d0
3 gewijzigde bestanden met toevoegingen van 16 en 2 verwijderingen
  1. 4 0
      reverseproxy.go
  2. 10 1
      web/components/status.html
  3. 2 1
      web/components/subd.html

+ 4 - 0
reverseproxy.go

@@ -604,6 +604,10 @@ func HandleUpdateHttpsRedirect(w http.ResponseWriter, r *http.Request) {
 		js, _ := json.Marshal(currentRedirectToHttps)
 		utils.SendJSONResponse(w, string(js))
 	} else {
+		if dynamicProxyRouter.Option.Port == 80 {
+			utils.SendErrorResponse(w, "This option is not available when listening on port 80")
+			return
+		}
 		if useRedirect == "true" {
 			sysdb.Write("settings", "redirect", true)
 			log.Println("Updating force HTTPS redirection to true")

+ 10 - 1
web/components/status.html

@@ -316,7 +316,16 @@
                         data: {set: thisValue},
                         success: function(data){
                             if (data.error != undefined){
-                                alert(data.error);
+                                msgbox(data.error, false, 8000);
+
+                                //Restore backend value to make sure the UI is always in sync
+                                $.get("/api/proxy/useHttpsRedirect", function(data){
+                                    if (data == true){
+                                        $("#redirect").checkbox("set checked");
+                                    }else{
+                                        $("#redirect").checkbox("set unchecked");
+                                    }
+                                });
                             }else{
                                 //Updated
                                 msgbox("Setting Updated");

+ 2 - 1
web/components/subd.html

@@ -42,8 +42,9 @@
                     if (subd.RequireTLS){
                         tlsIcon = `<i class="green lock icon" title="TLS Mode"></i>`;
                     }
+
                     $("#subdList").append(`<tr eptuuid="${subd.RootOrMatchingDomain}" payload="${subdData}" class="subdEntry">
-                        <td data-label="" editable="false">${subd.RootOrMatchingDomain}</td>
+                        <td data-label="" editable="false"><a href="//${subd.RootOrMatchingDomain}" target="_blank">${subd.RootOrMatchingDomain}</a></td>
                         <td data-label="" editable="true" datatype="domain">${subd.Domain} ${tlsIcon}</td>
                         <td data-label="" editable="true" datatype="skipver">${!subd.SkipCertValidations?`<i class="ui green check icon"></i>`:`<i class="ui yellow exclamation circle icon" title="TLS/SSL Verification will be skipped on this host"></i>`}</td>
                         <td data-label="" editable="true" datatype="basicauth">${subd.RequireBasicAuth?`<i class="ui green check icon"></i>`:`<i class="ui grey remove icon"></i>`}</td>