mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-25 00:11:36 +01:00
Add encryption selection to WiFiGuestForm
This commit is contained in:
parent
a63b5bfa4e
commit
6352060da3
|
@ -9,9 +9,10 @@ import React from "react";
|
||||||
|
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { HELP_TEXTS } from "./constants";
|
import { HELP_TEXTS, ENCRYPTIONMODES } from "./constants";
|
||||||
import WiFiQRCode from "./WiFiQRCode";
|
import WiFiQRCode from "./WiFiQRCode";
|
||||||
import PasswordInput from "../../bootstrap/PasswordInput";
|
import PasswordInput from "../../bootstrap/PasswordInput";
|
||||||
|
import Select from "../../bootstrap/Select";
|
||||||
import Switch from "../../bootstrap/Switch";
|
import Switch from "../../bootstrap/Switch";
|
||||||
import TextInput from "../../bootstrap/TextInput";
|
import TextInput from "../../bootstrap/TextInput";
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ WifiGuestForm.propTypes = {
|
||||||
SSID: PropTypes.string.isRequired,
|
SSID: PropTypes.string.isRequired,
|
||||||
password: PropTypes.string.isRequired,
|
password: PropTypes.string.isRequired,
|
||||||
enabled: PropTypes.bool.isRequired,
|
enabled: PropTypes.bool.isRequired,
|
||||||
|
encryption: PropTypes.string.isRequired,
|
||||||
}),
|
}),
|
||||||
formErrors: PropTypes.shape({
|
formErrors: PropTypes.shape({
|
||||||
SSID: PropTypes.string,
|
SSID: PropTypes.string,
|
||||||
|
@ -89,6 +91,20 @@ export default function WifiGuestForm({
|
||||||
}))}
|
}))}
|
||||||
{...props}
|
{...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}
|
) : null}
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user