mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-23 09:22:59 +02:00
zoneconf.cgi: Add Javascript for new GUI elements
Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
8de94a23e0
commit
b4434345dc
@@ -54,3 +54,30 @@ function highlightAccess(selectObj) {
|
||||
//if interface is assigned, highlight table cell in zone color
|
||||
colorParentCell(selectObj, zoneColor, (selectObj.value !== 'NONE'));
|
||||
}
|
||||
|
||||
//update zone mode
|
||||
function changeZoneMode(selectObj) {
|
||||
if(!(selectObj && ('zone' in selectObj.dataset))) {
|
||||
return; //required parameters are missing
|
||||
}
|
||||
|
||||
// STP enable checkbox
|
||||
let stpEnable = document.getElementById('STP-' + selectObj.dataset.zone);
|
||||
if(stpEnable) {
|
||||
stpEnable.disabled = (selectObj.value !== 'BRIDGE'); //STP is available if zone is in bridge mode
|
||||
stpEnable.checked = stpEnable.checked && (! stpEnable.disabled); //un-check if disabled
|
||||
stpEnable.dispatchEvent(new Event('change'));
|
||||
}
|
||||
}
|
||||
|
||||
//STP enable checkbox change toggles priority input
|
||||
function changeEnableSTP(inputObj) {
|
||||
if(!(inputObj && ('zone' in inputObj.dataset))) {
|
||||
return; //required parameters are missing
|
||||
}
|
||||
|
||||
let priority = document.getElementById('STP-PRIORITY-' + inputObj.dataset.zone);
|
||||
if(priority) {
|
||||
priority.disabled = inputObj.disabled || (! inputObj.checked);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user