luci-mod-network: don't trigger uci save on removing bridge vlans
authorJo-Philipp Wich <jo@mein.io>
Fri, 15 Mar 2024 12:23:04 +0000 (13:23 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 15 Mar 2024 12:28:13 +0000 (13:28 +0100)
Do not trigger a uci save operation on removing bridge VLANs as that might
invalidate the ephemeral section ID of a just added network device.

Fixes: #6990
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 61cef9baad6cf753d37bfa7fb7a661d26180f6b9)

modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index f823d696042309c0392b6158b317f0ab09474813..40ab9637b4e68f1a328be5b03734b0d96f8d3c69 100644 (file)
@@ -919,6 +919,15 @@ return baseclass.extend({
                        }, this));
                };
 
+               ss.handleRemove = function(section_id) {
+                       this.map.data.remove('network', section_id);
+                       s.map.addedVLANs = s.map.addedVLANs.filter(function(sid) {
+                               return sid != section_id;
+                       });
+
+                       return this.redraw();
+               };
+
                o = ss.option(form.Value, 'vlan', _('VLAN ID'));
                o.datatype = 'range(1, 4094)';