mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-16 21:43:33 +08:00
34 lines
934 B
HTML
34 lines
934 B
HTML
<%
|
|
local map = self.map
|
|
local api = map.api
|
|
local config = map.config
|
|
local section = self.section
|
|
-%>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
let node_id = "<%=section%>";
|
|
let node_config_url = '<%=api.url("server_config")%>/' + node_id;
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
waitForElement('select[name*="<%=config%>"][name*="type"]', function(el) {
|
|
let o_val = el.value;
|
|
el.addEventListener("change", () => {
|
|
el.blur();
|
|
if (o_val != el.value) {
|
|
let save = true;
|
|
if (save) {
|
|
//document.getElementsByClassName('cbi-button-save')[0].click();
|
|
server_update_config(node_id, {
|
|
enable: getOption("<%=config%>", node_id, "enable").value,
|
|
remarks: getOption("<%=config%>", node_id, "remarks").value,
|
|
type: getOption("<%=config%>", node_id, "type").value,
|
|
protocol: ''
|
|
}, node_config_url);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
//]]>
|
|
</script>
|