Skip to content

Commit 20a69bf

Browse files
committed
Correct queue and host state summaries
1 parent 769f948 commit 20a69bf

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

frontend/src/lib/components/dashboard/DashboardHostGrid.svelte

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
function hostTone(host: HostRuntime): HostTone {
2424
if (!host.available) return 'warn';
2525
if (host.queue_active) return 'ok';
26-
if (host.schedule_open === false) return 'hold';
2726
if (host.active_reason === 'encode queue capability disabled') return 'warn';
27+
if (host.schedule_open === false) return 'hold';
2828
return 'neutral';
2929
}
3030
3131
function hostStatusLabel(host: HostRuntime): string {
3232
if (!host.available) return 'Needs attention';
3333
if (host.queue_active) return 'Ready';
3434
if (host.schedule_profile_label === 'Never') return 'Disabled';
35-
if (host.schedule_open === false) return 'Scheduled';
3635
if (host.active_reason === 'parallel encode slots are full') return 'At capacity';
3736
if (host.active_reason === 'encode queue capability disabled') return 'Needs setup';
37+
if (host.schedule_open === false) return 'Scheduled';
3838
return 'Mounted';
3939
}
4040
@@ -46,12 +46,15 @@
4646
if (host.queue_active) return `${host.max_parallel_encodes} ${laneLabel} available`;
4747
if (host.schedule_profile_label === 'Never')
4848
return `${host.max_parallel_encodes} ${laneLabel} disabled`;
49-
if (host.schedule_open === false) {
50-
return `${host.max_parallel_encodes} ${laneLabel} scheduled for the next window`;
51-
}
5249
if (host.active_reason === 'parallel encode slots are full') {
5350
return `${host.max_parallel_encodes} ${laneLabel} busy`;
5451
}
52+
if (host.active_reason === 'encode queue capability disabled') {
53+
return `${host.max_parallel_encodes} ${laneLabel} need queue setup`;
54+
}
55+
if (host.schedule_open === false) {
56+
return `${host.max_parallel_encodes} ${laneLabel} scheduled for the next window`;
57+
}
5558
return `${host.max_parallel_encodes} ${laneLabel} mounted`;
5659
}
5760

frontend/src/lib/components/home/HomeSystemStrip.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
stopRequested,
99
queuePaused,
1010
queueWorkersScheduledOffWindow,
11+
runningCount,
1112
queuedCount,
1213
nextWorkerWindow,
1314
etaCopy,
@@ -28,6 +29,7 @@
2829
stopRequested: boolean;
2930
queuePaused: boolean;
3031
queueWorkersScheduledOffWindow: boolean;
32+
runningCount: number;
3133
queuedCount: number;
3234
nextWorkerWindow: string | null;
3335
etaCopy: string | null | undefined;
@@ -59,7 +61,7 @@
5961
: 'Queued work is waiting for a scheduled worker window.'}
6062
{:else if queuedCount > 0 && readyHosts === 0}
6163
Queued work is waiting for a worker to become ready.
62-
{:else if queueWorkersScheduledOffWindow}
64+
{:else if queueWorkersScheduledOffWindow && runningCount === 0}
6365
{nextWorkerWindow
6466
? `Queue is idle. Next worker window opens at ${nextWorkerWindow}.`
6567
: 'Queue is idle. All queue workers are currently scheduled off-window.'}

frontend/src/routes/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@
591591
stopRequested={dashboard.encode_queue.state.stop_requested}
592592
queuePaused={dashboard.encode_queue.state.is_paused}
593593
{queueWorkersScheduledOffWindow}
594+
runningCount={dashboard.encode_queue.running_count}
594595
queuedCount={dashboard.encode_queue.queued_count}
595596
nextWorkerWindow={nextWorkerWindow ?? null}
596597
etaCopy={dashboard.encode_queue.telemetry?.eta_copy}

frontend/src/routes/ops/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
? `Queued now. Next worker window opens at ${nextWorkerWindow}.`
187187
: 'Queued now. All queue workers are currently scheduled off-window.';
188188
}
189-
if (queueWorkersScheduledOffWindow) {
189+
if (queueWorkersScheduledOffWindow && dashboard.encode_queue.running_count === 0) {
190190
return nextWorkerWindow
191191
? `Queue is idle. Next worker window opens at ${nextWorkerWindow}.`
192192
: 'Queue is idle. All queue workers are currently scheduled off-window.';

0 commit comments

Comments
 (0)