]> git.99rst.org Git - openwrt-luci.git/blob
2f80e24c5c3088087d31c8bc0427505c1006bfc0
[openwrt-luci.git] /
1 'use strict';
2 'require form';
3 'require view';
4 'require uci';
5
6 return view.extend({
7 load: function() {
8 return Promise.all([
9 uci.load('basicstation')
10 ]);
11 },
12
13 render: function(data) {
14 var m, s, o, options;
15
16 /* Advanced Settings */
17 m = new form.Map('basicstation', _('Advanced Settings'));
18
19 /* RF Configuration */
20 s = m.section(form.GridSection, 'rfconf', _('RF Configuration'));
21 s.addremove = true;
22 s.anonymous = false;
23 s.nodescriptions = true;
24
25 o = s.option(form.ListValue, 'type', _('Type'),
26 _('RF front end type'));
27 o.value('SX1250');
28 o.default = 'SX1250';
29
30 o = s.option(form.Flag, 'txEnable', _('Tx enable'),
31 _('Enable transmission capabilities'));
32 o.default = 'false';
33
34 o = s.option(form.Value, 'freq', _('Frequency'),
35 _('Frequency in Hz'));
36 o.datatype = 'uinteger';
37
38 o = s.option(form.Value, 'antennaGain', _('Antenna Gain'),
39 _('Antenna gain in dBi'));
40 o.datatype = 'uinteger';
41
42 o = s.option(form.Value, 'rssiOffset', _('RSSI Offset'),
43 _('RSSI offset in dBm'));
44 o.datatype = 'float';
45
46 o = s.option(form.ListValue, 'useRssiTcomp', _('RSSI Tcomp'),
47 _('RSSI Tcomp object to be used for this RF configuration'));
48 options = uci.sections('basicstation', 'rssitcomp')
49 for (var i = 0; i < options.length; i++) {
50 var value = options[i]['.name'];
51 o.value(value);
52 }
53 o.default = 'std';
54
55 /* RSSI Tcomp */
56 s = m.section(form.GridSection, 'rssitcomp', _('RSSI Tcomp'));
57 s.addremove = true;
58 s.anonymous = false;
59 s.nodescripitons = true;
60
61 o = s.option(form.Value, 'coeff_a', _('Coeff A'));
62 o.datatype = 'float';
63
64 o = s.option(form.Value, 'coeff_b', _('Coeff B'));
65 o.datatype = 'float';
66
67 o = s.option(form.Value, 'coeff_c', _('Coeff C'));
68 o.datatype = 'float';
69
70 o = s.option(form.Value, 'coeff_d', _('Coeff D'));
71 o.datatype = 'float';
72
73 o = s.option(form.Value, 'coeff_e', _('Coeff E'));
74 o.datatype = 'float';
75
76 /* TX Gain Lookup Table */
77 s = m.section(form.GridSection, 'txlut', _('TX Gain Lookup Table'));
78 s.addremove = true;
79 s.anonymous = true;
80 s.nodescriptions = true;
81
82 o = s.option(form.Value, 'rfPower', _('RF Power'),
83 _('RF output power target in dBm'));
84 o.datatype = 'uinteger';
85
86 o = s.option(form.Flag, 'paGain', _('PA Enable'),
87 _('Power amplifier enabled'));
88 o.default = false;
89
90 o = s.option(form.Value, 'pwrIdx', _('Power Index'),
91 _('Possible gain settings from 0 (min. gain) to 22 (max. gain)'));
92 o.datatype = 'range(0,22)';
93
94 o = s.option(form.DynamicList, 'usedBy', _('Used By'),
95 _('RF configurations that use this tx gain object'));
96 options = uci.sections('basicstation', 'rfconf');
97 for (var i = 0; i < options.length; i++) {
98 var value = options[i]['.name'];
99 o.value(value);
100 }
101
102 return m.render();
103 },
104 });
git clone https://git.99rst.org/PROJECT