882fc4c3455b94d03ec5b98e5f985b7e90449171
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'));
15 o
= s
.option(form
.Flag
, 'CollectIndividualUsers', _('Generate a separate graph for each logged user'));
18 o
.depends('enable', '1');
20 o
= s
.option(form
.Flag
, 'CollectUserCount', _('Aggregate number of connected users'));
23 o
.depends('enable', '1');
25 o
= s
.option(form
.Flag
, 'CollectCompression', _('Gather compression statistics'));
28 o
.depends('enable', '1');
30 o
= s
.option(form
.Flag
, 'ImprovedNamingSchema', _('Use improved naming schema'));
33 o
.depends('enable', '1');
35 o
= s
.option(form
.DynamicList
, 'StatusFile', _('OpenVPN status files'));
37 o
.depends('enable', '1');
38 o
.load = function(section_id
) {
39 return L
.resolveDefault(fs
.list('/var/run'), []).then(L
.bind(function(entries
) {
40 for (var i
= 0; i
< entries
.length
; i
++)
41 if (entries
[i
].type
== 'file' && entries
[i
].name
.match(/^openvpn\..+\.status$/))
42 o
.value('/var/run/' + entries
[i
].name
);
47 configSummary: function(section
) {
48 var stats
= L
.toArray(section
.StatusFile
);
51 return N_(stats
.length
, 'Monitoring one OpenVPN instance', 'Monitoring %d OpenVPN instancees').format(stats
.length
);