diff options
author | Michael Pratt <mcpratt@pm.me> | 2021-04-21 18:03:58 -0400 |
---|---|---|
committer | Michael Pratt <mcpratt@pm.me> | 2021-04-21 18:12:43 -0400 |
commit | 51ab737a4ba2b0f2a9d479cf114837c570f8d05c (patch) | |
tree | 68da46a658c06adde8374839665affafb09eb40a | |
parent | c4f3ac05288ba148fcd5c0222f34f393dbec57a2 (diff) |
luci-mod-network: do not remove enable_vlan from config
There are many switch drivers where VLAN functionality is enabled by default.
In this situation, LuCI cannot be used to disable VLAN functionality,
because removing the line from configuration results in VLAN remaining enabled
by the driver.
When enable_vlan is set to 0 by default
by using functions in board.d,
and an unrelated change is made on the Switch webpage,
then the enable_vlan option gets deleted when changes are saved.
Therefore, the option needs to be preserved, whether set to 0 or 1.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
-rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js index 3133d27250..8c24775cab 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/switch.js @@ -180,8 +180,10 @@ return view.extend({ s = m.section(form.NamedSection, sid, 'switch', switch_title); s.addremove = false; - if (feat.vlan_option) - s.option(form.Flag, feat.vlan_option, _('Enable VLAN functionality')); + if (feat.vlan_option) { + o = s.option(form.Flag, feat.vlan_option, _('Enable VLAN functionality')); + o.rmempty = false; + } if (feat.learning_option) { o = s.option(form.Flag, feat.learning_option, _('Enable learning and aging')); |