summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-apinger/htdocs/luci-static/resources/view/apinger/alarm_loss.js
blob: 94c6cd91494af49ae6571a547d7939f331be368f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
'require view';
'require form';

return view.extend({
	render: function() {
		let m, s, o;

		m = new form.Map('apinger', _('Apinger - Loss Alarms'),
			_('This alarm will be fired when packet loss goes over "Loss High"') + '<br />' +
			_('This alarm will be canceled, when the loss drops below "Loss Low"'));

		s = m.section(form.GridSection, 'alarm_loss');
		s.anonymous = false;
		s.addremove = true;
		s.addbtntitle = _('Add Loss Alarm');

		o = s.option(form.Value, 'percent_low', _('Loss Low (%)'));
		o.datatype = 'range(1-100)';
		o.default = '10';
		o.placeholder = '10';

		o = s.option(form.Value, 'percent_high', _('Loss High (%)'));
		o.datatype = 'range(1-100)';
		o.default = '20';
		o.placeholder = '20';

		return m.render();
	},
});