From 06ee1ce38ea566ad12706b00c649a07d7fed0432 Mon Sep 17 00:00:00 2001 From: Erdnusschokolade <96622762+Erdnusschokolade@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:44:19 +0200 Subject: [PATCH] Persist port speed settings in config parser parseConf() only recognized "port N name" in conf_cmds, so "port N " lines were treated as unknown commands and dropped on save - configured port speeds never persisted. Add the speed command (incl. optional half/full duplex suffix) to conf_cmds, add a "port N" entry to conf_overwrite so re-saving a speed replaces the previous value, and guard the per-port name entry so changing a port's speed no longer wipes its configured name. --- html/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/config.js b/html/config.js index b9e2e9c..fd426e9 100644 --- a/html/config.js +++ b/html/config.js @@ -14,6 +14,7 @@ const conf_cmds = [ /^pvid\s+\d{1,2}\s+\d{1,4}$/, /^ingress(\s+\d{1,2}[tua])+$/, /^ingress\s+[tua]$/, + /^port\s+\d{1,2}\s+(10m|100m|1g|2g5|5g|10g|auto|on|off)(\s+(half|full))?$/, /^port\s+\d{1,2}\s+name\s+\S+$/, /^eee(\s+\d{1,2})?\s+(on|off)$/, /^mirror(\s+\d{1,2})(\s+\d{1,2}[tr]?)+$/, @@ -36,6 +37,7 @@ const conf_overwrite = [ /^vlan\s+\d{1,4}(?!\s+mgmt\b)/, /^pvid\s+\d{1,2}\b/, /^ingress\b/, + /^port\s+\d{1,2}(?!\s+name\b)/, /^port\s+\d{1,2}\s+name\b/, /^eee\s+\d{1,2}\b/, /^eee\b/, @@ -71,7 +73,7 @@ function parseConf(s){ let m = line.match(x); let matchStr = m[0]; configuration = configuration.filter(item => - !(item === matchStr || (item.startsWith(matchStr + " ") && !item.endsWith(" mgmt")))); + !(item === matchStr || (item.startsWith(matchStr + " ") && !item.endsWith(" mgmt") && !item.startsWith(matchStr + " name ")))); break; } }