[fix](trx-frontend-http): show scheduler interleave timing
Replace the misleading scheduler task countdown with the actual time-span interleave switch timing in the main controls row. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -13,18 +13,6 @@ let vchanChannels = [];
|
||||
let vchanActiveId = null;
|
||||
let schedulerReleaseState = null;
|
||||
let schedulerReleasePollTimer = null;
|
||||
let schedulerCycleCountdownTimer = null;
|
||||
|
||||
function schedulerNextCycleSeconds() {
|
||||
const periodMs = 30000;
|
||||
const remMs = periodMs - (Date.now() % periodMs);
|
||||
const secs = Math.ceil(remMs / 1000);
|
||||
return Math.max(1, Math.min(30, secs));
|
||||
}
|
||||
|
||||
function schedulerCycleSummaryText() {
|
||||
return `Next scheduler cycle in ${schedulerNextCycleSeconds()}s.`;
|
||||
}
|
||||
|
||||
function vchanFmtFreq(hz) {
|
||||
if (!Number.isFinite(hz) || hz <= 0) return "--";
|
||||
@@ -59,14 +47,12 @@ function schedulerReleaseSummaryText(state) {
|
||||
function vchanRenderSchedulerRelease() {
|
||||
const btn = document.getElementById("scheduler-release-btn");
|
||||
const status = document.getElementById("scheduler-release-status");
|
||||
const cycleStatus = document.getElementById("scheduler-cycle-status");
|
||||
if (!btn || !status) return;
|
||||
const currentReleased = !!(schedulerReleaseState && schedulerReleaseState.current_session_released);
|
||||
btn.disabled = !vchanSessionId || currentReleased;
|
||||
btn.classList.toggle("active", !currentReleased);
|
||||
btn.textContent = "Release to Scheduler";
|
||||
status.textContent = schedulerReleaseSummaryText(schedulerReleaseState);
|
||||
if (cycleStatus) cycleStatus.textContent = schedulerCycleSummaryText();
|
||||
}
|
||||
|
||||
async function vchanPollSchedulerRelease() {
|
||||
@@ -90,10 +76,6 @@ function vchanStartSchedulerReleasePolling() {
|
||||
clearInterval(schedulerReleasePollTimer);
|
||||
}
|
||||
schedulerReleasePollTimer = setInterval(vchanPollSchedulerRelease, 10000);
|
||||
if (schedulerCycleCountdownTimer) {
|
||||
clearInterval(schedulerCycleCountdownTimer);
|
||||
}
|
||||
schedulerCycleCountdownTimer = setInterval(vchanRenderSchedulerRelease, 1000);
|
||||
}
|
||||
|
||||
async function vchanToggleSchedulerRelease() {
|
||||
|
||||
Reference in New Issue
Block a user