summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-10-22 19:17:42 +0200
committerJo-Philipp Wich <jo@mein.io>2021-10-22 19:18:27 +0200
commit216767f420a92468b865a5ef301a1e94283dcb0e (patch)
tree8d0acc3470afa8e9d2cde357576b6b2db21d51f6 /modules
parentf4f64b91ca4d443af9e7bc0dfc2565ae0a796ea3 (diff)
luci-mod-network: remove related bridge-vlan sections on deleting device
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
index 5cc7186124..371d82770e 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
@@ -1314,6 +1314,20 @@ return view.extend({
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
};
+ s.handleRemove = function(section_id /*, ... */) {
+ var name = uci.get('network', section_id, 'name'),
+ type = uci.get('network', section_id, 'type');
+
+ if (name != null && type == 'bridge') {
+ uci.sections('network', 'bridge-vlan', function(bvs) {
+ if (bvs.device == name)
+ uci.remove('network', bvs['.name']);
+ });
+ }
+
+ return form.GridSection.prototype.handleRemove.apply(this, arguments);
+ };
+
function getDevice(section_id) {
var m = section_id.match(/^dev:(.+)$/),
name = m ? m[1] : uci.get('network', section_id, 'name');