mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-06 23:57:21 +02:00
add frontend support
This commit is contained in:
parent
ce0b1a7585
commit
415838ad39
@ -109,10 +109,15 @@
|
|||||||
<div class="item" data-value="Let's Encrypt">Let's Encrypt</div>
|
<div class="item" data-value="Let's Encrypt">Let's Encrypt</div>
|
||||||
<div class="item" data-value="Buypass">Buypass</div>
|
<div class="item" data-value="Buypass">Buypass</div>
|
||||||
<div class="item" data-value="ZeroSSL">ZeroSSL</div>
|
<div class="item" data-value="ZeroSSL">ZeroSSL</div>
|
||||||
|
<div class="item" data-value="Custom ACME Server">Custom ACME Server</div>
|
||||||
<!-- <div class="item" data-value="Google">Google</div> -->
|
<!-- <div class="item" data-value="Google">Google</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="field" id="customca" style="display:none;">
|
||||||
|
<label>ACME Server URL</label>
|
||||||
|
<input id="caurl" type="text" placeholder="https://example.com/acme/dictionary">
|
||||||
|
</div>
|
||||||
<button id="obtainButton" class="ui basic button" type="submit"><i class="yellow refresh icon"></i> Renew Certificate</button>
|
<button id="obtainButton" class="ui basic button" type="submit"><i class="yellow refresh icon"></i> Renew Certificate</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
@ -295,6 +300,14 @@
|
|||||||
obtainCertificate();
|
obtainCertificate();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("input[name=ca]").on('change', function() {
|
||||||
|
if(this.value == "Custom ACME Server") {
|
||||||
|
$("#customca").show();
|
||||||
|
} else {
|
||||||
|
$("#customca").hide();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// Obtain certificate from API
|
// Obtain certificate from API
|
||||||
function obtainCertificate() {
|
function obtainCertificate() {
|
||||||
var domains = $("#domainsInput").val();
|
var domains = $("#domainsInput").val();
|
||||||
@ -316,7 +329,14 @@
|
|||||||
parent.msgbox("Filename cannot be empty for certs containing multiple domains.")
|
parent.msgbox("Filename cannot be empty for certs containing multiple domains.")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ca = $("#ca").dropdown("get value");
|
var ca = $("#ca").dropdown("get value");
|
||||||
|
var ca_url = "";
|
||||||
|
if (ca == "Custom ACME Server") {
|
||||||
|
ca = "custom";
|
||||||
|
ca_url = $("#caurl").val();
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/api/acme/obtainCert",
|
url: "/api/acme/obtainCert",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@ -325,6 +345,7 @@
|
|||||||
filename: filename,
|
filename: filename,
|
||||||
email: email,
|
email: email,
|
||||||
ca: ca,
|
ca: ca,
|
||||||
|
ca_url: ca_url,
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
$("#obtainButton").removeClass("loading").removeClass("disabled");
|
$("#obtainButton").removeClass("loading").removeClass("disabled");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user