mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 19:36:20 -05:00
controller: address hotspot protocol review findings
- Reset a saved protocol the newly probed device does not support instead of offering it (both UIs); a successful probe is authoritative, the saved value is only kept when probing fails. - Ignore out-of-order protocol probe responses when switching devices quickly (both UIs). - Verify the WPA2 rollback after a failed WPA3 activation; report that the hotspot may be down instead of claiming the revert succeeded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
8687816b84
commit
2baa9cbd2e
5 changed files with 67 additions and 12 deletions
|
|
@ -1464,14 +1464,19 @@
|
|||
savedProtocol = savedProtocol || select.value;
|
||||
try {
|
||||
const response = await apiCall(`api/hotspot/protocols?device=${encodeURIComponent(device)}`);
|
||||
// Ignore out-of-order responses when the user switches devices quickly.
|
||||
if (document.getElementById('hotspot-device').value !== device) return;
|
||||
select.innerHTML = '';
|
||||
// Keep the saved protocol selectable even if the device does not report it.
|
||||
const protocols = [...new Set([...(response.protocols || []), savedProtocol])].filter(Boolean);
|
||||
// Keep the saved protocol only when probing found nothing (e.g. the saved
|
||||
// device is unplugged); a successful probe is authoritative.
|
||||
const supported = (response.protocols || []).filter(Boolean);
|
||||
const protocols = supported.length ? supported : [savedProtocol].filter(Boolean);
|
||||
const selected = protocols.includes(savedProtocol) ? savedProtocol : protocols[0];
|
||||
for (const protocol of protocols) {
|
||||
const option = document.createElement('option');
|
||||
option.value = protocol;
|
||||
option.textContent = hotspotProtocolLabels[protocol] || protocol;
|
||||
option.selected = protocol === savedProtocol;
|
||||
option.selected = protocol === selected;
|
||||
select.appendChild(option);
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue