5 return L
.Class
.extend({
6 title
: _('OpenVPN Plugin Configuration'),
7 description
: _('The OpenVPN plugin gathers information about the current vpn connection status.'),
9 addFormOptions: function(s
) {
12 o
= s
.option(form
.Flag
, 'enable', _('Enable this plugin'));
14 o
= s
.option(form
.Flag
, 'CollectIndividualUsers', _('Generate a separate graph for each logged user'));
15 o
.depends('enable', '1');
17 o
= s
.option(form
.Flag
, 'CollectUserCount', _('Aggregate number of connected users'));
18 o
.depends('enable', '1');
20 o
= s
.option(form
.Flag
, 'CollectCompression', _('Gather compression statistics'));
21 o
.depends('enable', '1');
23 o
= s
.option(form
.Flag
, 'ImprovedNamingSchema', _('Use improved naming schema'));
24 o
.depends('enable', '1');
26 o
= s
.option(form
.DynamicList
, 'StatusFile', _('OpenVPN status files'));
27 o
.depends('enable', '1');
28 o
.load = function(section_id
) {
29 return L
.resolveDefault(fs
.list('/var/run'), []).then(L
.bind(function(entries
) {
30 for (var i
= 0; i
< entries
.length
; i
++)
31 if (entries
[i
].type
== 'file' && entries
[i
].name
.match(/^openvpn\..+\.status$/))
32 o
.value('/var/run/' + entries
[i
].name
);
37 configSummary: function(section
) {
38 var stats
= L
.toArray(section
.StatusFile
);
41 return N_(stats
.length
, 'Monitoring one OpenVPN instance', 'Monitoring %d OpenVPN instancees').format(stats
.length
);