From: Jo-Philipp Wich Date: Mon, 11 Nov 2019 09:14:03 +0000 (+0100) Subject: luci-mod-system: leds.js: display default state as On/Off X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ae61ecb6bec477628280ada77a031ca46db4263f;p=oweals%2Fluci.git luci-mod-system: leds.js: display default state as On/Off Fixes: #3289 Signed-off-by: Jo-Philipp Wich (cherry picked from commit 0731f7e5e43f490c39e364e43988a59ee2be9576) --- 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)