Files
small-packages/luci-app-passwall/luasrc/view/passwall/node_config/header.htm
T
2026-08-08 16:33:49 +08:00

31 lines
975 B
HTML

<script type="text/javascript">
//<![CDATA[
function fetchCertSha256(el) {
if (el.getAttribute("data-loading") === "1") return;
el.setAttribute("data-loading", "1");
el.style.pointerEvents = "none";
el.style.color = "red";
XHR.get('<%=self.api.url("fetch_certsha256")%>', { id: "<%=self.section%>" }, function(x, res) {
el.setAttribute("data-loading", "0");
el.style.pointerEvents = "";
el.style.color = "";
if (!x || x.status !== 200) {
alert("<%:Error%>");
return;
}
if (!res || res.code !== 1 || !res.data) {
alert(res && res.msg ? res.msg : "<%:Fetch Failed!%>\n" +
"<%:Requires OpenSSL to retrieve the TLS certificate chain fingerprint.%>\n" +
"<%:QUIC protocols such as HY2 also require curl with http3 support.%>"
);
return;
}
const inputs = document.querySelectorAll('input[id$=".xray_tls_pinSHA256"]');
inputs.forEach(function(input) {
input.value = res.data;
});
});
}
//]]>
</script>