Browse Source

Finalized change on toggle

Toby Chui 1 năm trước cách đây
mục cha
commit
4a9f9e91f4
2 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 5 0
      reverseproxy.go
  2. 2 2
      web/components/httprp.html

+ 5 - 0
reverseproxy.go

@@ -732,6 +732,11 @@ func ReverseProxyToggleRuleSet(w http.ResponseWriter, r *http.Request) {
 	ruleDisabled := enableStr == "false"
 
 	targetProxyRule.Disabled = ruleDisabled
+	err = SaveReverseProxyConfig(targetProxyRule)
+	if err != nil {
+		utils.SendErrorResponse(w, "unable to save updated rule")
+		return
+	}
 	utils.SendOK(w)
 }
 

+ 2 - 2
web/components/httprp.html

@@ -5,7 +5,7 @@
     </div>
     <style>
         #httpProxyList .ui.toggle.checkbox input:checked ~ label::before{
-            background-color: #21ba45 !important;
+            background-color: #00ca52 !important;
         }
     </style>
     <div style="width: 100%; overflow-x: auto; margin-bottom: 1em;">
@@ -85,7 +85,7 @@
                         <td data-label="" editable="true" datatype="basicauth">${subd.RequireBasicAuth?`<i class="ui green check icon"></i>`:`<i class="ui grey remove icon"></i>`}</td>
                         <td class="center aligned" editable="true" datatype="action" data-label="">
                             <div class="ui toggle tiny fitted checkbox" style="margin-bottom: -0.5em; margin-right: 0.4em;" title="Enable / Disable Rule">
-                                <input type="checkbox" name="active" ${enableChecked} eptuuid="${subd.RootOrMatchingDomain}" onchange="handleProxyRuleToggle(this);">
+                                <input type="checkbox" class="enableToggle" name="active" ${enableChecked} eptuuid="${subd.RootOrMatchingDomain}" onchange="handleProxyRuleToggle(this);">
                                 <label></label>
                             </div>
                             <button title="Edit Proxy Rule" class="ui circular mini basic icon button editBtn inlineEditActionBtn" onclick='editEndpoint("${(subd.RootOrMatchingDomain).hexEncode()}")'><i class="edit icon"></i></button>