From fceabd74465f2aafc40edc084429f30837deff2c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 31 Oct 2021 22:26:42 +0100 Subject: [PATCH] luci-mod-system: add missing require to `none` led trigger class Also convert ES6 to ES5 syntax while we're at it. Fixes: #5476 Fixes: 5b42cd5b46 ("luci-mod-system: move default option from defaul-on trigger to none trigger") Signed-off-by: Jo-Philipp Wich --- .../resources/view/system/led-trigger/default-on.js | 5 +---- .../resources/view/system/led-trigger/heartbeat.js | 4 +--- .../luci-static/resources/view/system/led-trigger/netdev.js | 2 +- .../luci-static/resources/view/system/led-trigger/none.js | 3 ++- .../luci-static/resources/view/system/led-trigger/timer.js | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js index 2de2743e4c..73263b8b0e 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/default-on.js @@ -1,12 +1,9 @@ 'use strict'; 'require baseclass'; -'require form'; return baseclass.extend({ trigger: _('Always on (kernel: default-on)'), description: _('The LED is always in default state on.'), kernel: true, - addFormOptions(s){ - var o; - } + addFormOptions: function(s) {} }); diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js index 1a6eeebd2c..49744ed42a 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js @@ -6,7 +6,5 @@ return baseclass.extend({ description: _('The LED flashes to simulate actual heart beat.') + _('The frequency is in direct proportion to 1-minute average CPU load.'), kernel: true, - addFormOptions(s){ - var o; - } + addFormOptions: function(s) {} }); diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js index af70f449d2..382705203b 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/netdev.js @@ -7,7 +7,7 @@ return baseclass.extend({ trigger: _("Network device activity (kernel: netdev)"), description: _('The LED flashes with link status and activity on the configured interface.'), kernel: true, - addFormOptions(s){ + addFormOptions: function(s) { var o; o = s.option(widgets.DeviceSelect, '_net_dev', _('Device')); diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js index 4b96cf087a..a68ab5a004 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/none.js @@ -1,11 +1,12 @@ 'use strict'; +'require form'; 'require baseclass'; return baseclass.extend({ trigger: _('Always off (kernel: none)'), description: _('The LED is always in default state off.'), kernel: true, - addFormOptions(s){ + addFormOptions: function(s) { var o; o = s.option(form.Flag, 'default', _('Default state')); diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js index 6213604a1a..c2f20f2c97 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/timer.js @@ -6,7 +6,7 @@ return baseclass.extend({ trigger: _('Custom flash interval (kernel: timer)'), description: _('The LED blinks with the configured on/off frequency'), kernel: true, - addFormOptions(s){ + addFormOptions: function(s) { var o; o = s.option(form.Value, 'delayon', _('On-State Delay'), -- 2.30.2