diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js index 6bceed6..c824683 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js @@ -745,6 +745,7 @@ function applyRigList(activeRigId, rigIds, displayNames) { const disableSwitch = lastRigIds.length === 0 || !authRole || authRole === "rx"; populateRigPicker(headerRigSwitchSelect, lastRigIds, activeRigId, disableSwitch); updateRigSubtitle(activeRigId); + if (typeof reloadSchedulerRigSelect === "function") reloadSchedulerRigSelect(); } async function refreshRigList() { diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js index 2a8df39..e0a660d 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js @@ -42,13 +42,8 @@ if (!sel) return; // Populate from global rig list exposed by app.js const rigs = (typeof getAvailableRigIds === "function") ? getAvailableRigIds() : []; + if (!rigs.length) return; // wait until rig list arrives sel.innerHTML = ""; - if (!rigs.length) { - const opt = document.createElement("option"); - opt.textContent = "No rigs available"; - sel.appendChild(opt); - return; - } rigs.forEach(function (id) { const opt = document.createElement("option"); opt.value = id; @@ -56,6 +51,13 @@ if (id === currentRigId) opt.selected = true; sel.appendChild(opt); }); + // If currentRigId was unset, pick the first available rig and load its config. + if (!currentRigId || !rigs.includes(currentRigId)) { + currentRigId = rigs[0]; + sel.value = currentRigId; + loadScheduler(); + pollStatus(); + } } // -------------------------------------------------------------------------