luci/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/unixsock.js
Jo-Philipp Wich e7d22dce50 luci-app-statistics: convert collectd configuration to client side views
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-12 11:59:41 +01:00

36 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.default = '0';
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);
}
});