luci-mod-system: add config option to invert heartbeat trigger 5923/head
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 3 Aug 2022 11:21:14 +0000 (13:21 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Fri, 5 Aug 2022 10:58:10 +0000 (12:58 +0200)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/led-trigger/heartbeat.js

index 49744ed42ae339fe9a511311340c548df7cabfaa..4a093ffed55328e1a84b9f45ead0ad913d4ca2fa 100644 (file)
@@ -1,10 +1,19 @@
 'use strict';
 'require baseclass';
+'require form';
 
 return baseclass.extend({
        trigger: _('Heartbeat interval (kernel: heartbeat)'),
        description: _('The LED flashes to simulate actual heart beat.') +
                _('The frequency is in direct proportion to 1-minute average CPU load.'),
        kernel: true,
-       addFormOptions: function(s) {}
+       addFormOptions: function(s) {
+               var o;
+
+               o = s.option(form.Flag, 'inverted', _('Invert blinking'),
+                       _('When inverted, the LED is continuously lit and flickers instead of it being off by default and blinking on system activity.'));
+               o.rmempty = true;
+               o.modalonly = true;
+               o.depends('trigger', 'heartbeat');
+       }
 });