luci-mod-network: remove related bridge-vlan sections on deleting device
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
f4f64b91ca
commit
216767f420
1 changed files with 14 additions and 0 deletions
|
@ -1314,6 +1314,20 @@ return view.extend({
|
||||||
return form.GridSection.prototype.handleModalCancel.apply(this, arguments);
|
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) {
|
function getDevice(section_id) {
|
||||||
var m = section_id.match(/^dev:(.+)$/),
|
var m = section_id.match(/^dev:(.+)$/),
|
||||||
name = m ? m[1] : uci.get('network', section_id, 'name');
|
name = m ? m[1] : uci.get('network', section_id, 'name');
|
||||||
|
|
Loading…
Reference in a new issue