summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-keepalived/htdocs/luci-static/resources/view/keepalived/track_interface.js
blob: f00797980ab415cf908222c8c48ed7b6c2250631 (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
31
32
33
34
35
36
37
38
'use strict';
'require view';
'require form';
'require tools.widgets as widgets';
'require uci';

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

		m = new form.Map('keepalived');

		s = m.section(form.GridSection, 'track_interface', _('Track Interface'));
		s.anonymous = true;
		s.addremove = true;
		s.nodescriptions = true;

		o = s.option(form.Value, 'name', _('Name'));
		o.rmempty = false;
		o.optional = false;

		o = s.option(widgets.DeviceSelect, 'value', _('Device'),
			_('Device to track'));
		o.noaliases = true;
		o.rmempty = false;
		o.optional = false;

		o = s.option(form.Value, 'weight', _('Weight'),
			_('When a weight is specified, instead of setting the' +
			  'vrrp_instance to the FAULT state in case of failure, ' +
			  'its priority will be increased or decreased by the ' +
			  'weight when the interface is up or down'));
		o.optional = false;
		o.datatype = 'uinteger';

		return m.render();
	}
});