mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 04:16:24 -05:00
Hotspot: address review comments.
* POST /api/hotspot/settings checks is_docker_mode() directly instead of string-matching the error message (still 500, matching the sibling hotspot/bluetooth/throttle endpoints). * Escape \ ; , " in the WiFi QR code per the WPA QR format. * Skip the controller.yaml write when a settings update changes nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
0d2c13e4e7
commit
2887309aae
4 changed files with 27 additions and 8 deletions
|
|
@ -1395,7 +1395,9 @@ function HotspotSettingsForm() {
|
|||
.map(device => ({key: device, value: device, text: device}));
|
||||
|
||||
// Special string which allows a mobile device to connect to a specific Wi-Fi.
|
||||
const qrCodeValue = `WIFI:S:${form.ssid};T:WPA;P:${form.password};;`;
|
||||
// The WPA QR format requires backslash-escaping of \ ; , " in the SSID and password.
|
||||
const escapeWifi = (s) => s.replace(/([\\;,"])/g, '\\$1');
|
||||
const qrCodeValue = `WIFI:S:${escapeWifi(form.ssid)};T:WPA;P:${escapeWifi(form.password)};;`;
|
||||
|
||||
return <Form style={{marginLeft: '1em', marginBottom: '1em'}}>
|
||||
<Form.Group widths='equal'>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue