Add support for configuring PVID on VLAN page.

This commit is contained in:
chriz
2026-01-25 22:04:05 +01:00
parent 17b428a603
commit c36136047c
3 changed files with 29 additions and 7 deletions
+13 -5
View File
@@ -1,4 +1,5 @@
async function vlanSub() {
var commands = [];
var cmd = "vlan ";
var v=document.getElementById('vid').value
if (!v) {
@@ -14,12 +15,19 @@ async function vlanSub() {
else if (document.getElementById('uport' + i).checked)
cmd = cmd + ` ${i}`;
}
commands.push(cmd);
for (let i = 1; i <= numPorts; i++) {
if (document.getElementById('pport' + i).checked)
commands.push(`pvid ${i} ${v}`);
}
try {
const response = await fetch('/cmd', {
method: 'POST',
body: cmd
});
console.log('Completed!', response);
for (let c of commands) {
const response = await fetch('/cmd', {
method: 'POST',
body: c
});
console.log('Completed!', response);
}
} catch(err) {
console.error(`Error: ${err}`);
}