summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-06-12 22:54:51 +0200
committerJo-Philipp Wich <jo@mein.io>2021-06-12 22:54:51 +0200
commitbb3269945c7f189e1d1de1e7979d79d30a860b03 (patch)
tree036ea91eadceac357c149c9528d92c9d2c765a0e
parent7a781d9cd8ab783dd7a5c72f154b972a9ea9aa98 (diff)
luci-mod-network: reset bridge VLANs on cancelling modal dialog
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js3
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js6
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
index 67aecf262c..8ba259e2c9 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
@@ -922,6 +922,9 @@ return baseclass.extend({
s.getOption('vlan_filtering').updateDefaultValue(s.section);
+ s.map.addedVLANs = s.map.addedVLANs || [];
+ s.map.addedVLANs.push(section_id);
+
return this.redraw();
}, this));
};
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 7e9eadf788..694d43141f 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
@@ -1302,7 +1302,7 @@ return view.extend({
nettools.addDeviceOptions(s, dev, isNew);
};
- s.handleModalCancel = function(/* ... */) {
+ s.handleModalCancel = function(map /*, ... */) {
var name = uci.get('network', this.addedSection, 'name')
uci.sections('network', 'bridge-vlan', function(bvs) {
@@ -1310,6 +1310,10 @@ return view.extend({
uci.remove('network', bvs['.name']);
});
+ if (map.addedVLANs)
+ for (var i = 0; i < map.addedVLANs.length; i++)
+ uci.remove('network', map.addedVLANs[i]);
+
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
};