fix(ui): sync role select to live role; mark RF chip unavailable on poll failure
This commit is contained in:
@@ -527,11 +527,21 @@ const Live = (() => {
|
||||
}
|
||||
}
|
||||
function pollRfplan() {
|
||||
fetch(App.apiBase + '/api/rfplan', { credentials: 'include' }).then((r) => r.json())
|
||||
.then((d) => {
|
||||
rfState = d && typeof d.role === 'string' ? d : null;
|
||||
renderRfChip();
|
||||
}).catch(() => {});
|
||||
fetch(App.apiBase + '/api/rfplan', { credentials: 'include' }).then((r) => {
|
||||
if (!r.ok) throw new Error('http ' + r.status);
|
||||
return r.json();
|
||||
}).then((d) => {
|
||||
rfState = d && typeof d.role === 'string' ? d : null;
|
||||
renderRfChip();
|
||||
}).catch(() => {
|
||||
rfState = null;
|
||||
const el = document.getElementById('rf-chip');
|
||||
if (el) {
|
||||
el.textContent = 'PHY1: ?';
|
||||
el.title = 'RF plan unavailable';
|
||||
el.className = 'health-chip warn';
|
||||
}
|
||||
});
|
||||
}
|
||||
function renderRfChip() {
|
||||
const el = document.getElementById('rf-chip');
|
||||
|
||||
Reference in New Issue
Block a user