treewide: import utility classes explicitly
[project/luci.git] / applications / luci-app-statistics / htdocs / luci-static / resources / view / statistics / plugins / unixsock.js
1 'use strict';
2 'require baseclass';
3 'require form';
4 'require tools.widgets as widgets';
5
6 return baseclass.extend({
7 title: _('Unixsock Plugin Configuration'),
8 description: _('The unixsock plugin creates a unix socket which can be used to read collected data from a running collectd instance.'),
9
10 addFormOptions: function(s) {
11 var o;
12
13 o = s.option(form.Flag, 'enable', _('Enable this plugin'));
14
15 o = s.option(form.Value, 'SocketFile', _('Socket path'));
16 o.default = '/var/run/collect-query.socket';
17 o.depends('enable', '1');
18
19 o = s.option(widgets.GroupSelect, 'SocketGroup', _('Socket group'), _('Change the ownership of the socket file to the specified group.'));
20 o.placeholder = 'nogroup';
21 o.optional = true;
22 o.rmempty = true;
23 o.depends('enable', '1');
24
25 o = s.option(form.Value, 'SocketPerms', _('Socket permissions'));
26 o.placeholder = '0770';
27 o.optional = true;
28 o.rmempty = true;
29 o.depends('enable', '1');
30 },
31
32 configSummary: function(section) {
33 if (section.SocketFile)
34 return _('Socket %s active').format(section.SocketFile);
35 }
36 });