luci/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/unixsock.js
Jo-Philipp Wich d4a475163e luci-app-statistics: clean and fix plugin configurations
- Remove redundant form flags
 - Fix various default values
 - Add some new collect options and remove options that do not exist anymore

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-22 23:26:49 +01:00

35 lines
1 KiB
JavaScript

'use strict';
'require form';
'require tools.widgets as widgets';
return L.Class.extend({
title: _('Unixsock Plugin Configuration'),
description: _('The unixsock plugin creates a unix socket which can be used to read collected data from a running collectd instance.'),
addFormOptions: function(s) {
var o;
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
o = s.option(form.Value, 'SocketFile', _('Socket path'));
o.default = '/var/run/collect-query.socket';
o.depends('enable', '1');
o = s.option(widgets.GroupSelect, 'SocketGroup', _('Socket group'), _('Change the ownership of the socket file to the specified group.'));
o.placeholder = 'nogroup';
o.optional = true;
o.rmempty = true;
o.depends('enable', '1');
o = s.option(form.Value, 'SocketPerms', _('Socket permissions'));
o.placeholder = '0770';
o.optional = true;
o.rmempty = true;
o.depends('enable', '1');
},
configSummary: function(section) {
if (section.SocketFile)
return _('Socket %s active').format(section.SocketFile);
}
});