foris 5.2.0-beta.01eeb06f → 5.2.0-beta.188ed87f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bootstrap/Select.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C) 2019-
|
|
2
|
+
* Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
|
3
3
|
*
|
|
4
4
|
* This is free software, licensed under the GNU General Public License v3.
|
|
5
5
|
* See /LICENSE for more information.
|
|
@@ -18,20 +18,14 @@ Select.propTypes = {
|
|
|
18
18
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
19
19
|
/** Help text message. */
|
|
20
20
|
helpText: PropTypes.string,
|
|
21
|
-
/** Turns on/off alphabetical ordering of the Select options. */
|
|
22
|
-
customOrder: PropTypes.bool,
|
|
23
21
|
};
|
|
24
22
|
|
|
25
|
-
export function Select({ label, choices, helpText,
|
|
23
|
+
export function Select({ label, choices, helpText, ...props }) {
|
|
26
24
|
const uid = useUID();
|
|
27
25
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
const options = keys.map((key) => (
|
|
33
|
-
<option key={key} value={key}>
|
|
34
|
-
{choices[key]}
|
|
26
|
+
const options = Object.keys(choices).map((choice) => (
|
|
27
|
+
<option key={choice} value={choice}>
|
|
28
|
+
{choices[choice]}
|
|
35
29
|
</option>
|
|
36
30
|
));
|
|
37
31
|
|
|
@@ -64,6 +64,7 @@ DeviceForm.propTypes = {
|
|
|
64
64
|
channel: PropTypes.string.isRequired,
|
|
65
65
|
guest_wifi: PropTypes.object.isRequired,
|
|
66
66
|
encryption: PropTypes.string.isRequired,
|
|
67
|
+
available_bands: PropTypes.array.isRequired,
|
|
67
68
|
}),
|
|
68
69
|
formErrors: PropTypes.object.isRequired,
|
|
69
70
|
setFormValue: PropTypes.func.isRequired,
|
|
@@ -87,6 +88,7 @@ function DeviceForm({
|
|
|
87
88
|
...props
|
|
88
89
|
}) {
|
|
89
90
|
const deviceID = formData.id;
|
|
91
|
+
const bnds = formData.available_bands;
|
|
90
92
|
return (
|
|
91
93
|
<>
|
|
92
94
|
<Switch
|
|
@@ -159,18 +161,24 @@ function DeviceForm({
|
|
|
159
161
|
value={formData.hwmode}
|
|
160
162
|
helpText={HELP_TEXTS.hwmode}
|
|
161
163
|
inline
|
|
162
|
-
onChange={setFormValue((value) =>
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
onChange={setFormValue((value) => {
|
|
165
|
+
// Get the last item in an array of available HT modes
|
|
166
|
+
const [best2] = bnds[0].available_htmodes.slice(-1);
|
|
167
|
+
const [best5] = bnds[1].available_htmodes.slice(-1);
|
|
168
|
+
return {
|
|
169
|
+
devices: {
|
|
170
|
+
[deviceIndex]: {
|
|
171
|
+
hwmode: { $set: value },
|
|
172
|
+
channel: { $set: "0" },
|
|
173
|
+
htmode: {
|
|
174
|
+
$set:
|
|
175
|
+
// Set HT mode depending on checked frequency
|
|
176
|
+
value === "11a" ? best5 : best2,
|
|
177
|
+
},
|
|
170
178
|
},
|
|
171
179
|
},
|
|
172
|
-
}
|
|
173
|
-
})
|
|
180
|
+
};
|
|
181
|
+
})}
|
|
174
182
|
{...props}
|
|
175
183
|
/>
|
|
176
184
|
|
|
@@ -209,7 +217,6 @@ function DeviceForm({
|
|
|
209
217
|
[deviceIndex]: { encryption: { $set: value } },
|
|
210
218
|
},
|
|
211
219
|
}))}
|
|
212
|
-
customOrder
|
|
213
220
|
{...props}
|
|
214
221
|
/>
|
|
215
222
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C) 2019-
|
|
2
|
+
* Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
|
3
3
|
*
|
|
4
4
|
* This is free software, licensed under the GNU General Public License v3.
|
|
5
5
|
* See /LICENSE for more information.
|
|
@@ -13,6 +13,10 @@ export const HTMODES = {
|
|
|
13
13
|
VHT40: _("802.11ac - 40 MHz wide channel"),
|
|
14
14
|
VHT80: _("802.11ac - 80 MHz wide channel"),
|
|
15
15
|
VHT160: _("802.11ac - 160 MHz wide channel"),
|
|
16
|
+
HE20: _("802.11ax - 20 MHz wide channel"),
|
|
17
|
+
HE40: _("802.11ax - 40 MHz wide channel"),
|
|
18
|
+
HE80: _("802.11ax - 80 MHz wide channel"),
|
|
19
|
+
HE160: _("802.11ax - 160 MHz wide channel"),
|
|
16
20
|
};
|
|
17
21
|
export const HWMODES = {
|
|
18
22
|
"11g": "2.4",
|
package/foris-5.2.0.tgz
CHANGED
|
Binary file
|