From a369e46fe607266e98806cb0d8a72441cfbc9031 Mon Sep 17 00:00:00 2001
From: Erdnusschokolade <96622762+Erdnusschokolade@users.noreply.github.com>
Date: Thu, 21 May 2026 17:38:33 +0200
Subject: [PATCH] Add VLAN overview table to VLAN configuration page
Below the configuration form, a new table lists all configured VLANs
with their port memberships: Member, Tagged, Untagged, and PVID
columns. Port ranges are formatted compactly (e.g. "1-2,5").
Port-to-bit mapping uses the existing physToLogPort[] array populated
by /status.json, so the table is consistent with the icon view in
fetchVLAN() and works on any supported machine.
Each row has a delete button that sends "vlan N d" via /cmd, with
a confirmation dialog. VLAN 1 cannot be deleted (no button shown).
Table and dropdown both refresh automatically after Update/Create
and after delete via a new refreshVlanViews() helper.
The N+1 request pattern (1x /vlanlist + Nx /vlan.json) keeps the
backend simple and avoids buffer overflow risks for systems with
many VLANs. For typical configurations (<50 VLANs), page load
remains under one second.
---
html/style.css | 1 +
html/vlan.html | 16 +++++++++
html/vlan.js | 91 +++++++++++++++++++++++++++++++++++++++++++++++-
html/vlan_sub.js | 2 +-
4 files changed, 108 insertions(+), 2 deletions(-)
diff --git a/html/style.css b/html/style.css
index 581737a..84d3a2e 100644
--- a/html/style.css
+++ b/html/style.css
@@ -163,3 +163,4 @@ margin: 30px 0;
}
select { text-align-last: right; font-family: monospace}
option { direction: rtl; font-family: sans-serif}
+#vlanTable td { text-align: left; }
diff --git a/html/vlan.html b/html/vlan.html
index 353e20e..b2ffa55 100644
--- a/html/vlan.html
+++ b/html/vlan.html
@@ -36,6 +36,22 @@
+
| VLAN | +Name | +Member Ports | +Tagged Ports | +Untagged Ports | +PVID Ports | +Delete | +
|---|