2020-02-08 21:12:17 +00:00
|
|
|
'use strict';
|
2020-04-03 08:00:06 +00:00
|
|
|
'require baseclass';
|
2020-02-08 21:12:17 +00:00
|
|
|
'require form';
|
|
|
|
|
2020-04-03 08:00:06 +00:00
|
|
|
return baseclass.extend({
|
2020-02-08 21:12:17 +00:00
|
|
|
title: _('APCUPS Plugin Configuration'),
|
|
|
|
description: _('The APCUPS plugin collects statistics about the APC UPS.'),
|
|
|
|
|
|
|
|
addFormOptions: function(s) {
|
|
|
|
var o;
|
|
|
|
|
|
|
|
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
|
|
|
|
|
2021-04-27 08:09:05 +00:00
|
|
|
o = s.option(form.Value, 'Host', _('Monitor host'));
|
2020-02-08 21:12:17 +00:00
|
|
|
o.default = 'localhost';
|
|
|
|
o.datatype = 'host';
|
|
|
|
o.depends('enable', '1');
|
|
|
|
|
|
|
|
o = s.option(form.Value, 'Port', _('Port for apcupsd communication'));
|
|
|
|
o.default = '3551';
|
|
|
|
o.datatype = 'port';
|
|
|
|
o.depends('enable', '1');
|
|
|
|
},
|
|
|
|
|
|
|
|
configSummary: function(section) {
|
2021-04-27 08:09:05 +00:00
|
|
|
return _('Monitoring APC UPS at host %s, port %d').format(section.Host || 'localhost', section.Port || 3551);
|
2020-02-08 21:12:17 +00:00
|
|
|
}
|
|
|
|
});
|