add checkbox for MQTT-TLS, fix #1474

This commit is contained in:
MichaelDvP
2023-12-03 18:07:30 +01:00
parent fd5f5d49b7
commit 42ba93bdc1
16 changed files with 55 additions and 38 deletions

View File

@@ -168,20 +168,24 @@ const MqttSettingsForm: FC = () => {
<MenuItem value={2}>2</MenuItem>
</TextField>
</Grid>
{data.rootCA !== undefined && (
<Grid item xs={12} sm={6}>
<ValidatedPasswordField
name="rootCA"
label={LL.CERT()}
fullWidth
variant="outlined"
value={data.rootCA}
onChange={updateFormValue}
margin="normal"
/>
</Grid>
)}
</Grid>
{data.enableTLS !== undefined && (
<BlockFormControlLabel
control={<Checkbox name="enableTLS" checked={data.enableTLS} onChange={updateFormValue} />}
label={LL.ENABLE_TLS()}
/>
)}
{data.enableTLS === true && (
<ValidatedPasswordField
name="rootCA"
label={LL.CERT()}
fullWidth
variant="outlined"
value={data.rootCA}
onChange={updateFormValue}
margin="normal"
/>
)}
<BlockFormControlLabel
control={<Checkbox name="clean_session" checked={data.clean_session} onChange={updateFormValue} />}