* Sat May 10 2025 Brian Read <brianr@koozali.org> 11.0.0-3.sme
- Get javascript working and password visible icon [SME: 13001] - Fix missing cmd in panel - Delete out of date list of protocols/device/services etc from controller source
This commit is contained in:
62
root/usr/share/smanager/themes/default/public/js/ddclient.js
Normal file
62
root/usr/share/smanager/themes/default/public/js/ddclient.js
Normal file
@@ -0,0 +1,62 @@
|
||||
function showPass() {
|
||||
var x = document.getElementById("ddcPass");
|
||||
if (x.type === "password") {
|
||||
x.type = "text";
|
||||
} else {
|
||||
x.type = "password";
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Run on page load
|
||||
SelectInput_custom();
|
||||
|
||||
// Attach onchange event to the select element
|
||||
var dnsSelect = document.getElementById('dns');
|
||||
if (dnsSelect) {
|
||||
dnsSelect.addEventListener('change', SelectInput_custom);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function SelectInput_custom() {
|
||||
var method = document.querySelector("#dns");
|
||||
const types=['custom'];
|
||||
types.forEach((type)=>{
|
||||
var service = document.querySelector(`.${type}`);
|
||||
if (service != null) {
|
||||
if (method.value == type) {
|
||||
service.style.display = 'block';
|
||||
} else {
|
||||
service.style.display = 'none';
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Run on page load (replaces onload)
|
||||
SelectInput_params();
|
||||
|
||||
// Attach onchange event (replaces inline onchange)
|
||||
var dnsSelect = document.getElementById('retrievemethod');
|
||||
if (dnsSelect) {
|
||||
dnsSelect.addEventListener('change', SelectInput_params);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function SelectInput_params() {
|
||||
var method = document.querySelector("#retrievemethod");
|
||||
const types=['smeIF','smeCMD','web','router','if','ip','cmd','custom'];
|
||||
types.forEach((type)=>{
|
||||
var service = document.querySelector(`.${type}`);
|
||||
if (service != null) {
|
||||
if (method.value == type) {
|
||||
service.style.display = 'block';
|
||||
} else {
|
||||
service.style.display = 'none';
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user