diff options
| author | Jo-Philipp Wich <jo@mein.io> | 2023-12-08 12:38:51 +0100 |
|---|---|---|
| committer | Jo-Philipp Wich <jo@mein.io> | 2023-12-08 12:41:33 +0100 |
| commit | d6d4dcf240df721e85f91f4e45593f407d565c85 (patch) | |
| tree | 427f4529a489e0e725a26b8ea7b59ea7886c312f | |
| parent | 9b695f9bea19e0a42936fee6e348d13d0910b3a0 (diff) | |
luci-mod-network: properly reflect config state in sysfs tristates
When a boolean sysfs option is forcibly set to `0` or `1` in uci, then make
sure to properly reflect that choice state when rendering the widget.
Right now the dropdown incorrectly reverted to "automatic" after saving but
not applying the changes.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4b6b00927b4a1076ed8bf23f3a0327a335ebece5)
| -rw-r--r-- | modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js | 2 |
1 files changed, 1 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 092bbbc14a..318373c7c7 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 @@ -198,7 +198,7 @@ var cbiFlagTristate = form.ListValue.extend({ this.vallist[0] = sysdef ? _('automatic (enabled)') : _('automatic (disabled)'); } - return this.super('renderWidget', [section_id, option_index, cfgvalue]); + return this.super('renderWidget', [section_id, option_index, cfgvalue ? cfgvalue + '!' : null]); } }); |
