fix(http-ui): avoid blocking controls on slow rig initialization
This commit is contained in:
@@ -746,19 +746,29 @@ function render(update) {
|
|||||||
updateFooterBuildInfo();
|
updateFooterBuildInfo();
|
||||||
|
|
||||||
initialized = !!update.initialized;
|
initialized = !!update.initialized;
|
||||||
|
const hasUsableSnapshot =
|
||||||
|
!!update.info &&
|
||||||
|
!!update.status &&
|
||||||
|
!!update.status.freq &&
|
||||||
|
typeof update.status.freq.hz === "number";
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
const manu = (update.info && update.info.manufacturer) || rigName || "Rig";
|
const manu = (update.info && update.info.manufacturer) || rigName || "Rig";
|
||||||
const model = (update.info && update.info.model) || rigName || "Rig";
|
const model = (update.info && update.info.model) || rigName || "Rig";
|
||||||
const rev = (update.info && update.info.revision) || "";
|
const rev = (update.info && update.info.revision) || "";
|
||||||
const parts = [manu, model, rev].filter(Boolean).join(" ");
|
const parts = [manu, model, rev].filter(Boolean).join(" ");
|
||||||
loadingTitle.textContent = `Initializing ${parts}…`;
|
if (!hasUsableSnapshot) {
|
||||||
loadingSub.textContent = "";
|
loadingTitle.textContent = `Initializing ${parts}…`;
|
||||||
console.info("Rig initializing:", { manufacturer: manu, model, revision: rev });
|
loadingSub.textContent = "";
|
||||||
loadingEl.style.display = "";
|
console.info("Rig initializing:", { manufacturer: manu, model, revision: rev });
|
||||||
if (contentEl) contentEl.style.display = "none";
|
loadingEl.style.display = "";
|
||||||
powerHint.textContent = "Initializing rig…";
|
if (contentEl) contentEl.style.display = "none";
|
||||||
setDisabled(true);
|
powerHint.textContent = "Initializing rig…";
|
||||||
return;
|
setDisabled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingEl.style.display = "none";
|
||||||
|
if (contentEl) contentEl.style.display = "";
|
||||||
|
powerHint.textContent = "Rig not fully initialized yet";
|
||||||
} else {
|
} else {
|
||||||
loadingEl.style.display = "none";
|
loadingEl.style.display = "none";
|
||||||
if (contentEl) contentEl.style.display = "";
|
if (contentEl) contentEl.style.display = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user