summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-11-11 10:14:03 +0100
committerJo-Philipp Wich <jo@mein.io>2019-11-11 10:14:03 +0100
commit0731f7e5e43f490c39e364e43988a59ee2be9576 (patch)
tree966cde21d54c8efde018a1b9563edffac476be1f /modules/luci-mod-system
parente8abe15483e6e740ed8efae32c2382f999a94a8f (diff)
luci-mod-system: leds.js: display default state as On/Off
Fixes: #3289 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js
index b571032ef..edd4a24e0 100644
--- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js
+++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/leds.js
@@ -53,6 +53,14 @@ return L.view.extend({
o = s.option(form.Flag, 'default', _('Default state'));
o.rmempty = false;
+ o.textvalue = function(section_id) {
+ var cval = this.cfgvalue(section_id);
+
+ if (cval == null)
+ cval = this.default;
+
+ return (cval == this.enabled) ? _('On') : _('Off');
+ };
o = s.option(form.ListValue, 'trigger', _('Trigger'));
if (usb.devices && usb.devices.length)