From 388dae96c7e96b60e8ba35058091d7cfb163b3f3 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 (cherry picked from commit fceabd74465f2aafc40edc084429f30837deff2c) --- .../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 b9713cef1c..10bf7d3238 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,11 +1,8 @@ 'use strict'; 'require baseclass'; -'require form'; return baseclass.extend({ trigger: _('Always on (kernel: default-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 9050063bf2..5a12575084 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 @@ -4,7 +4,5 @@ return baseclass.extend({ trigger: _('Heartbeat interval (kernel: heartbeat)'), 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 692c887ea4..c7cefbb0cb 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 @@ -6,7 +6,7 @@ return baseclass.extend({ trigger: _("Network device activity (kernel: netdev)"), 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 8542a6cda7..361084f4cf 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,10 +1,11 @@ 'use strict'; +'require form'; 'require baseclass'; return baseclass.extend({ trigger: _('Always off (kernel: none)'), 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 1ec362b601..43d26613b1 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 @@ -5,7 +5,7 @@ return baseclass.extend({ trigger: _('Custom flash interval (kernel: timer)'), kernel: true, - addFormOptions(s){ + addFormOptions: function(s) { var o; o = s.option(form.Value, 'delayon', _('On-State Delay'));