summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-bmx7/htdocs/luci-static/resources/view/bmx7/config.js
blob: 74fff5817a681fe98217d804d47d84d67ff13309 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
'require view';
'require form';
'require tools.widgets as widgets';

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

		m = new form.Map('bmx7', _('BMX7'));
		s = m.section(form.NamedSection, 'general');
		s.anonymous = true;

		o = s.option(form.Value, 'runtimeDir', _('runtimeDir'));
		o = s.option(form.Value, 'trustedNodesDir', _('trustedNodesDir'));

		s = m.section(form.TypedSection, 'plugin', _('Plugins'));
		s.addremove = true;
		s.anonymous = true;

		o = s.option(form.Value, 'plugin', _('Plugin')); 

		s = m.section(form.TypedSection, 'dev', _('Devices'));
		s.addremove = true;
		s.anonymous = false;

		o = s.option(widgets.DeviceSelect, 'dev', _('Dev')); 

		s = m.section(form.TypedSection, 'tunDev', _('Tunnel Devices'));
		s.addremove = true;
		s.anonymous = false;

		o = s.option(form.Value, 'tunDev', _('Dev'));
		o = s.option(form.Value, 'tun6Address', _('tun6Address'));
		o = s.option(form.Value, 'tun4Address', _('tun4Address'));

		s = m.section(form.TypedSection, 'tunOut', _('Gateway Devices'));
		s.addremove = true;
		s.anonymous = true;

		o = s.option(form.Value, 'tunOut', _('tunOut'));
		o.value('ip4');
		o.value('ip6');

		o = s.option(form.Value, 'network', _('Network')); 
		o.datatype = 'ipaddr';

		o = s.option(form.Value, 'exportDistance', _('exportDistance'));
		o.datatype = 'uinteger';
		o = s.option(form.Value, 'minPrefixLen', _('minPrefixLen'));
		o.datatype = 'uinteger';

		s = m.section(form.NamedSection, 'luci', _('luci'));
		s.uciconfig = 'bmx7-luci';
		s.anonymous = true;

		o = s.option(form.Flag, 'ignore', _('Ignore'));
		o.default = '0';
		o.rmempty = false;

		o = s.option(form.Value, 'json', _('JSON source')); 
		o.rmempty = false;

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