system: pick the management VLAN from System Settings

`vlan <id> mgmt` existed on the CLI, but nothing reported which VLAN
currently carries management, so the setting was invisible from the web UI -
the only way to find out was to read the startup config.

Report it in information.json and offer it where the other switch-wide
addressing settings live, between Gateway and Language, as a picker filled
from the configured VLANs. When management is untagged there is no VLAN to
select, so that state shows as a disabled entry rather than inventing an id
the switch would reject.

Confirm before applying, and say what will happen rather than echoing the
action back: the switch starts tagging its own frames, and if the port you
came in on does not carry that VLAN the page becomes unreachable and the way
back is the console. Cancelling puts the picker back where it was.
This commit is contained in:
d00f
2026-08-08 18:26:49 +02:00
parent 23f0ba995c
commit 1a55a134c7
4 changed files with 64 additions and 2 deletions
+5 -1
View File
@@ -26,6 +26,7 @@
extern __code const struct machine machine;
extern __xdata uint8_t outbuf[TCP_OUTBUF_SIZE];
extern __xdata uint16_t slen;
extern __xdata uint16_t management_vlan;
extern __xdata uint16_t cont_len;
extern __xdata uint32_t cont_addr;
extern __code uint8_t * __code hex;
@@ -264,7 +265,10 @@ void send_basic_info(void)
slen += strtox(outbuf + slen, BUILD_DATE);
slen += strtox(outbuf + slen, "\",\"hw_ver\":\"");
slen += strtox(outbuf + slen, machine.machine_name);
slen += strtox(outbuf + slen, "\",\"flash_size\":\"");
/* VLAN carrying switch management, 0 = untagged. */
slen += strtox(outbuf + slen, "\",\"mgmt_vlan\":");
itoa16_html(management_vlan);
slen += strtox(outbuf + slen, ",\"flash_size\":\"");
string_to_html(get_flash_size_str());
if (machine.n_sfp) {