mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-06 07:37:21 +02:00
Minor fix to renew now function
This commit is contained in:
parent
23eca5afae
commit
741d3f8de1
@ -185,7 +185,21 @@ func (a *AutoRenewer) HandleLoadAutoRenewDomains(w http.ResponseWriter, r *http.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *AutoRenewer) HandleRenewNow(w http.ResponseWriter, r *http.Request) {
|
func (a *AutoRenewer) HandleRenewNow(w http.ResponseWriter, r *http.Request) {
|
||||||
|
renewedDomains, err := a.CheckAndRenewCertificates()
|
||||||
|
if err != nil {
|
||||||
|
utils.SendErrorResponse(w, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
message := "Domains renewed"
|
||||||
|
if len(renewedDomains) == 0 {
|
||||||
|
message = ("All certificates are up-to-date!")
|
||||||
|
} else {
|
||||||
|
message = ("The following domains have been renewed: " + strings.Join(renewedDomains, ","))
|
||||||
|
}
|
||||||
|
|
||||||
|
js, _ := json.Marshal(message)
|
||||||
|
utils.SendJSONResponse(w, string(js))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AutoRenewer) HandleAutoRenewEnable(w http.ResponseWriter, r *http.Request) {
|
func (a *AutoRenewer) HandleAutoRenewEnable(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -393,10 +393,12 @@
|
|||||||
|
|
||||||
//Handle the renew now btn click
|
//Handle the renew now btn click
|
||||||
function renewNow(){
|
function renewNow(){
|
||||||
alert("wip");
|
|
||||||
return
|
|
||||||
$.get("/api/acme/autoRenew/renewNow", function(data){
|
$.get("/api/acme/autoRenew/renewNow", function(data){
|
||||||
alert(data);
|
if (data.error != undefined){
|
||||||
|
parent.msgbox(data.error, false, 6000);
|
||||||
|
}else{
|
||||||
|
parent.msgbox(data)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user