Support configurable TLS probes in the API and dashboard
This commit is contained in:
1 parent
0bde5627f0
commit
c7fdd2c430
38 files changed
+495
-203
No files matched your search
@@ -0,0 +1,30 @@
|
||||
(() => {
|
||||
function addRow(form) {
|
||||
const template = form.querySelector("[data-tls-row-template]");
|
||||
const row = template.content.cloneNode(true);
|
||||
const input = row.querySelector("input");
|
||||
form.querySelector("[data-tls-rows]").append(row);
|
||||
input.focus();
|
||||
}
|
||||
|
||||
document.addEventListener("change", event => {
|
||||
if (!event.target.matches("[data-inbound-checks] select[name=tls_mode]")) return;
|
||||
const form = event.target.form;
|
||||
const fields = form.querySelector("[data-tls-fields]");
|
||||
const custom = event.target.value === "custom";
|
||||
fields.hidden = fields.disabled = !custom;
|
||||
if (custom && !fields.querySelector("[data-tls-row]")) addRow(form);
|
||||
});
|
||||
|
||||
document.addEventListener("click", event => {
|
||||
const button = event.target.closest("[data-tls-add], [data-tls-remove]");
|
||||
const form = button?.closest("[data-inbound-checks]");
|
||||
if (!form) return;
|
||||
if (button.matches("[data-tls-add]")) {
|
||||
addRow(form);
|
||||
} else {
|
||||
button.closest("[data-tls-row]").remove();
|
||||
form.querySelector("[data-tls-add]").focus();
|
||||
}
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user