1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-25 00:11:36 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Aleksandr Gumroian
ffa1121d39 Merge branch 'add-encryption-selection-to-guest-form' into 'dev'
Add encryption selection to WiFiGuestForm

Closes #27

See merge request turris/reforis/foris-js!258
2024-12-09 16:59:57 +01:00
Aleksandr Gumroian
ee6865e3bb
Update Snapshots 2024-12-09 16:52:51 +01:00
Aleksandr Gumroian
6352060da3
Add encryption selection to WiFiGuestForm 2024-12-09 16:52:50 +01:00
2 changed files with 56 additions and 3 deletions

View File

@ -9,9 +9,10 @@ import React from "react";
import PropTypes from "prop-types";
import { HELP_TEXTS } from "./constants";
import { HELP_TEXTS, ENCRYPTIONMODES } from "./constants";
import WiFiQRCode from "./WiFiQRCode";
import PasswordInput from "../../bootstrap/PasswordInput";
import Select from "../../bootstrap/Select";
import Switch from "../../bootstrap/Switch";
import TextInput from "../../bootstrap/TextInput";
@ -21,6 +22,7 @@ WifiGuestForm.propTypes = {
SSID: PropTypes.string.isRequired,
password: PropTypes.string.isRequired,
enabled: PropTypes.bool.isRequired,
encryption: PropTypes.string.isRequired,
}),
formErrors: PropTypes.shape({
SSID: PropTypes.string,
@ -89,6 +91,20 @@ export default function WifiGuestForm({
}))}
{...props}
/>
<Select
label={_("Encryption")}
choices={ENCRYPTIONMODES}
helpText={HELP_TEXTS.wpa3}
value={formData.encryption}
onChange={setFormValue((value) => ({
devices: {
[formData.id]: {
guest_wifi: { encryption: { $set: value } },
},
},
}))}
{...props}
/>
</>
) : null}
</>

View File

@ -339,7 +339,7 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
- First value
+ Second value
@@ -524,10 +524,87 @@
@@ -524,10 +524,124 @@
<small>
Enables Wi-Fi for guests, which is separated from LAN network. Devices connected to this network are allowed to access the internet, but aren't allowed to access other devices and the configuration interface of the router. Parameters of the guest network can be set in the Guest network tab.
</small>
@ -421,13 +421,50 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
+ WPA2/3 pre-shared key, that is required to connect to the network.
+ </small>
+ </div>
+ </div>
+ <div
+ class="mb-3"
+ >
+ <label
+ class="form-label"
+ for="14"
+ >
+ Encryption
+ </label>
+ <select
+ class="form-select"
+ id="14"
+ >
+ <option
+ value="WPA3"
+ >
+ WPA3 only
+ </option>
+ <option
+ value="WPA2/3"
+ >
+ WPA3 with WPA2 as fallback (default)
+ </option>
+ <option
+ value="WPA2"
+ >
+ WPA2 only
+ </option>
+ </select>
+ <div
+ class="form-text"
+ >
+ <small>
+ The WPA3 standard is the new most secure encryption method that is suggested to be used with any device that supports it. The older devices without WPA3 support require older WPA2. If you experience issues with connecting older devices, try to enable WPA2.
+ </small>
+ </div>
+ </div>
<hr />
<div
class="form-check form-switch mb-3 d-flex align-items-center"
>
<input
@@ -550,10 +627,11 @@
@@ -550,10 +664,11 @@
<div
class="text-end"
>