From 6923f0d200d790dc25324b164a357965b18a5c18 Mon Sep 17 00:00:00 2001
From: Toby Chui
- For online documentation, please refer to zoraxy.arozos.com or the project wiki.
+ For online documentation, please refer to zoraxy.aroz.org or the project wiki.
Thank you for using Zoraxy!
Current list of loaded certificates
Domain | Last Update | @@ -161,7 +161,9 @@ msgbox("Requesting certificate via " + defaultCA +"..."); //Request ACME for certificate + let buttonOriginalHTML = ""; if (btn != undefined){ + buttonOriginalHTML = $(btn).html(); $(btn).addClass('disabled'); $(btn).html(``); } @@ -169,11 +171,26 @@ obtainCertificate(domain, dns, defaultCA.trim(), function(succ){ if (btn != undefined){ $(btn).removeClass('disabled'); - if (succ){ - $(btn).html(``); + if ($(btn).hasClass("icon")){ + //Only change the button icon + if (succ){ + $(btn).html(``); + }else{ + $(btn).html(``); + } }else{ - $(btn).html(``); + //Show error or success icon with text + if (succ){ + $(btn).html(` Requested`); + }else{ + $(btn).html(` Error`); + } } + + //Restore the button after 3 seconds + setTimeout(function(){ + $(btn).html(buttonOriginalHTML); + }, 3000); setTimeout(function(){ initManagedDomainCertificateList(); diff --git a/src/web/components/httprp.html b/src/web/components/httprp.html index 28007bb..237e305 100644 --- a/src/web/components/httprp.html +++ b/src/web/components/httprp.html @@ -350,15 +350,27 @@ let originalContent = $(column).html(); //Check if this host is covered within one of the certificates. If not, show the icon - let domainIsCovered = true; + let enableQuickRequestButton = true; let domains = [payload.RootOrMatchingDomain]; //Domain for getting certificate if needed for (var i = 0; i < payload.MatchingDomainAlias.length; i++){ let thisAliasName = payload.MatchingDomainAlias[i]; domains.push(thisAliasName); } - if (true){ - domainIsCovered = false; + + //Check if the domain or alias contains wildcard, if yes, disabled the get certificate button + if (payload.RootOrMatchingDomain.indexOf("*") > -1){ + enableQuickRequestButton = false; } + + if (payload.MatchingDomainAlias != undefined){ + for (var i = 0; i < payload.MatchingDomainAlias.length; i++){ + if (payload.MatchingDomainAlias[i].indexOf("*") > -1){ + enableQuickRequestButton = false; + break; + } + } + } + //encode the domain to DOM let certificateDomains = encodeURIComponent(JSON.stringify(domains)); @@ -371,9 +383,8 @@
---|