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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
'use strict';
'require view';
'require ui';
'require form';
'require uci';
return view.extend({
load() {
return Promise.all([
uci.load('keepalived'),
]);
},
render(data) {
let m, s, o;
let instances = uci.sections('keepalived', 'vrrp_instance');
if (instances == '' || instances.length < 1) {
ui.addNotification(null, E('p', _('Instances must be configured for VRRP Groups')));
}
m = new form.Map('keepalived');
s = m.section(form.GridSection, 'vrrp_sync_group', _('VRRP synchronization group'),
_('VRRP Sync Group is an extension to VRRP protocol.') + ' ' +
_('The main goal is to define a bundle of VRRP instance to get synchronized together so that transition of one instance will be reflected to others group members'));
s.anonymous = true;
s.addremove = true;
s.nodescriptions = true;
o = s.option(form.Value, 'name', _('Name'));
o.rmempty = false;
o.optional = false;
o.placeholder = 'name';
o = s.option(form.DynamicList, 'group', _('Instance Group'));
o.rmempty = false;
o.optional = false;
for (let i = 0; i < instances.length; i++) {
o.value(instances[i]['name']);
}
o = s.option(form.Flag, 'smtp_alert', _('Email Notification'),
_('Send email notification during state transition'));
o.optional = true;
o.default = false;
o = s.option(form.Flag, 'global_tracking', _('Global Tracking'),
_('Track interfaces, scripts and files'));
o.optional = true;
o.default = false;
return m.render();
}
});
|