foris 6.11.0 → 6.11.1-beta.6db5402e
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.
|
@@ -9,7 +9,8 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import PropTypes from "prop-types";
|
|
11
11
|
|
|
12
|
-
import { HELP_TEXTS, HTMODES, BANDS
|
|
12
|
+
import { HELP_TEXTS, HTMODES, BANDS } from "./constants";
|
|
13
|
+
import getEncryptionChoices from "./encryptionHelpers";
|
|
13
14
|
import WifiGuestForm from "./WiFiGuestForm";
|
|
14
15
|
import WiFiQRCode from "./WiFiQRCode";
|
|
15
16
|
import PasswordInput from "../../bootstrap/PasswordInput";
|
|
@@ -170,13 +171,22 @@ function DeviceForm({
|
|
|
170
171
|
// Get the last item in the available HT modes for the selected band
|
|
171
172
|
const bestHtmode =
|
|
172
173
|
selectedBand.available_htmodes.slice(-1)[0];
|
|
174
|
+
const deviceUpdate = {
|
|
175
|
+
band: { $set: value },
|
|
176
|
+
channel: { $set: "0" },
|
|
177
|
+
htmode: { $set: bestHtmode },
|
|
178
|
+
};
|
|
179
|
+
// The 6 GHz band supports only WPA3, both for the
|
|
180
|
+
// main and for the guest network
|
|
181
|
+
if (value === "6g") {
|
|
182
|
+
deviceUpdate.encryption = { $set: "WPA3" };
|
|
183
|
+
deviceUpdate.guest_wifi = {
|
|
184
|
+
encryption: { $set: "WPA3" },
|
|
185
|
+
};
|
|
186
|
+
}
|
|
173
187
|
return {
|
|
174
188
|
devices: {
|
|
175
|
-
[deviceIndex]:
|
|
176
|
-
band: { $set: value },
|
|
177
|
-
channel: { $set: "0" },
|
|
178
|
-
htmode: { $set: bestHtmode },
|
|
179
|
-
},
|
|
189
|
+
[deviceIndex]: deviceUpdate,
|
|
180
190
|
},
|
|
181
191
|
};
|
|
182
192
|
})}
|
|
@@ -210,7 +220,10 @@ function DeviceForm({
|
|
|
210
220
|
|
|
211
221
|
<Select
|
|
212
222
|
label={_("Encryption")}
|
|
213
|
-
choices={getEncryptionChoices(
|
|
223
|
+
choices={getEncryptionChoices(
|
|
224
|
+
formData.band,
|
|
225
|
+
formData.encryption
|
|
226
|
+
)}
|
|
214
227
|
helpText={HELP_TEXTS.wpa3}
|
|
215
228
|
value={formData.encryption}
|
|
216
229
|
onChange={setFormValue((value) => ({
|
|
@@ -250,6 +263,7 @@ function DeviceForm({
|
|
|
250
263
|
...formData.guest_wifi,
|
|
251
264
|
}}
|
|
252
265
|
formErrors={formErrors.guest_wifi || {}}
|
|
266
|
+
band={formData.band}
|
|
253
267
|
setFormValue={setFormValue}
|
|
254
268
|
{...props}
|
|
255
269
|
/>
|
|
@@ -301,15 +315,3 @@ function getBandChoices(device) {
|
|
|
301
315
|
value: availableBand.band,
|
|
302
316
|
}));
|
|
303
317
|
}
|
|
304
|
-
|
|
305
|
-
function getEncryptionChoices(device) {
|
|
306
|
-
if (device.encryption === "custom") {
|
|
307
|
-
ENCRYPTIONMODES.custom = _("Custom");
|
|
308
|
-
}
|
|
309
|
-
if (device.band === "6g") {
|
|
310
|
-
return {
|
|
311
|
-
WPA3: ENCRYPTIONMODES.WPA3,
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
return ENCRYPTIONMODES;
|
|
315
|
-
}
|
|
@@ -9,7 +9,8 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import PropTypes from "prop-types";
|
|
11
11
|
|
|
12
|
-
import { HELP_TEXTS
|
|
12
|
+
import { HELP_TEXTS } from "./constants";
|
|
13
|
+
import getEncryptionChoices from "./encryptionHelpers";
|
|
13
14
|
import WiFiQRCode from "./WiFiQRCode";
|
|
14
15
|
import PasswordInput from "../../bootstrap/PasswordInput";
|
|
15
16
|
import Select from "../../bootstrap/Select";
|
|
@@ -30,6 +31,8 @@ WifiGuestForm.propTypes = {
|
|
|
30
31
|
}),
|
|
31
32
|
setFormValue: PropTypes.func.isRequired,
|
|
32
33
|
deviceIndex: PropTypes.string,
|
|
34
|
+
/** Band of the device the guest network shares the radio with. */
|
|
35
|
+
band: PropTypes.string,
|
|
33
36
|
};
|
|
34
37
|
|
|
35
38
|
export default function WifiGuestForm({
|
|
@@ -37,6 +40,7 @@ export default function WifiGuestForm({
|
|
|
37
40
|
formErrors,
|
|
38
41
|
setFormValue,
|
|
39
42
|
deviceIndex,
|
|
43
|
+
band,
|
|
40
44
|
...props
|
|
41
45
|
}) {
|
|
42
46
|
return (
|
|
@@ -93,7 +97,10 @@ export default function WifiGuestForm({
|
|
|
93
97
|
/>
|
|
94
98
|
<Select
|
|
95
99
|
label={_("Encryption")}
|
|
96
|
-
choices={
|
|
100
|
+
choices={getEncryptionChoices(
|
|
101
|
+
band,
|
|
102
|
+
formData.encryption
|
|
103
|
+
)}
|
|
97
104
|
helpText={HELP_TEXTS.wpa3}
|
|
98
105
|
value={formData.encryption}
|
|
99
106
|
onChange={setFormValue((value) => ({
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2019-2026 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
|
3
|
+
*
|
|
4
|
+
* This is free software, licensed under the GNU General Public License v3.
|
|
5
|
+
* See /LICENSE for more information.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ENCRYPTIONMODES } from "./constants";
|
|
9
|
+
|
|
10
|
+
// Both the main and the guest network run on the same radio, so the band
|
|
11
|
+
// limits the encryption choices of both of them.
|
|
12
|
+
export default function getEncryptionChoices(band, encryption) {
|
|
13
|
+
if (band === "6g") {
|
|
14
|
+
return { WPA3: ENCRYPTIONMODES.WPA3 };
|
|
15
|
+
}
|
|
16
|
+
if (encryption === "custom") {
|
|
17
|
+
return { ...ENCRYPTIONMODES, custom: _("Custom") };
|
|
18
|
+
}
|
|
19
|
+
return ENCRYPTIONMODES;
|
|
20
|
+
}
|
package/foris-6.11.1.tgz
ADDED
|
Binary file
|
package/package.json
CHANGED
package/foris-6.11.0.tgz
DELETED
|
Binary file
|