Forráskód Böngészése

auto update script executed

Toby Chui 1 éve
szülő
commit
01f0bbf2ba
1 módosított fájl, 27 hozzáadás és 5 törlés
  1. 27 5
      web/snippet/acme.html

+ 27 - 5
web/snippet/acme.html

@@ -57,7 +57,7 @@
               <p>Renew all certificates with ACME supported CAs</p>
               <p>Renew all certificates with ACME supported CAs</p>
               <div class="ui toggle checkbox">
               <div class="ui toggle checkbox">
                 <input type="checkbox" id="renewAllSupported" onchange="setAutoRenewIfCASupportMode(this.checked);" checked>
                 <input type="checkbox" id="renewAllSupported" onchange="setAutoRenewIfCASupportMode(this.checked);" checked>
-                <label>Auto renew if CA is supported</label>
+                <label>Renew All Certs</label>
               </div><br>
               </div><br>
               <button id="renewNowBtn" onclick="renewNow();" class="ui basic right floated button" style="margin-top: -2em;"><i class="yellow refresh icon"></i> Renew Now</button>
               <button id="renewNowBtn" onclick="renewNow();" class="ui basic right floated button" style="margin-top: -2em;"><i class="yellow refresh icon"></i> Renew Now</button>
               <div class="ui horizontal divider"> OR </div>
               <div class="ui horizontal divider"> OR </div>
@@ -76,7 +76,7 @@
               <div class="ui yellow message">
               <div class="ui yellow message">
                 Certificate Renew only works on the certification authority (CA) supported by Zoraxy. Check Zoraxy wiki for more information on supported list of CAs.
                 Certificate Renew only works on the certification authority (CA) supported by Zoraxy. Check Zoraxy wiki for more information on supported list of CAs.
               </div>
               </div>
-              <button class="ui basic right floated button"><i class="blue save icon"></i> Save Changes</button>
+              <button class="ui basic right floated button" onclick="saveAutoRenewPolicy();"><i class="blue save icon"></i> Save Changes</button>
               <button id="renewSelectedButton" onclick="renewNow();" class="ui basic right floated disabled button"><i class="yellow refresh icon"></i> Renew Selected</button>
               <button id="renewSelectedButton" onclick="renewNow();" class="ui basic right floated disabled button"><i class="yellow refresh icon"></i> Renew Selected</button>
               <br><br>
               <br><br>
           </div>
           </div>
@@ -389,7 +389,12 @@
             $("#renewAllSupported").parent().checkbox("set checked");
             $("#renewAllSupported").parent().checkbox("set checked");
           }else{
           }else{
             //This is a list of domain files
             //This is a list of domain files
-
+            data.forEach(function(name) {
+              $('#domainTableBody input[type="checkbox"][name="' + name + '"]').prop('checked', true);
+            });
+            $("#domainCertFileTable").removeClass("disabled");
+            $("#renewNowBtn").addClass("disabled");
+            $("#renewSelectedButton").removeClass("disabled");
           }
           }
         }
         }
       })
       })
@@ -398,9 +403,26 @@
     function saveAutoRenewPolicy(){
     function saveAutoRenewPolicy(){
       let autoRenewAll = $("#renewAllSupported").parent().checkbox("is checked");
       let autoRenewAll = $("#renewAllSupported").parent().checkbox("is checked");
       if (autoRenewAll == true){
       if (autoRenewAll == true){
-
+        $.ajax({
+          url: "/api/acme/autoRenew/setDomains",
+          data: {opr: "setAuto"},
+          success: function(data){
+            parent.msgbox("Renew policy rule updated")
+          }
+        });
       }else{
       }else{
-
+        let checkedNames = [];
+        $('#domainTableBody input[type="checkbox"]:checked').each(function() {
+          checkedNames.push($(this).attr('name'));
+        });
+
+        $.ajax({
+          url: "/api/acme/autoRenew/setDomains",
+          data: {opr: "setSelected", domains: JSON.stringify(checkedNames)},
+          success: function(data){
+            parent.msgbox("Renew policy rule updated")
+          }
+        });
       }
       }
     }
     }