This commit is contained in:
@@ -25,7 +25,6 @@ import { committedRebalanceStartup } from './concurrency.js';
|
||||
import { nativeDeployment } from '../backends/native.js';
|
||||
import { safetyOverride, safetyOverrideAvailability } from './safety-override.js';
|
||||
import { serverTitle } from '../../ui/server-labels.js';
|
||||
import { provisioningQueueStatus } from '../../ui/provisioning-queue.js';
|
||||
import {
|
||||
provisioningPageSize,
|
||||
provisioningPageOffset,
|
||||
@@ -617,6 +616,7 @@ const deploymentListColumns = `d.id, d.server, d.server_deleted_at, d.action, d.
|
||||
d.started_at, d.finished_at, d.triggered_by, d.requested_by, d.error, d.warnings,
|
||||
d.phase_key AS phase, d.phase_started_at AS phaseStartedAt,
|
||||
CASE WHEN json_valid(d.observation_json) THEN json_extract(d.observation_json,'$.blocker.code') END AS waitCode,
|
||||
CASE WHEN json_valid(d.observation_json) THEN json_extract(d.observation_json,'$.blocker.message') END AS waitMessage,
|
||||
(d.server_deleted_at IS NULL AND EXISTS(SELECT 1 FROM servers s WHERE s.name = d.server AND s.destroyed_at IS NULL)) AS server_exists,
|
||||
(d.server_deleted_at IS NULL AND d.action = 'destroy' AND d.state = 'waiting' AND d.stage != ?) AS canCancelRemoval,
|
||||
(d.server_deleted_at IS NULL AND d.state IN ('queued','waiting','running','awaiting-health','interrupted')
|
||||
@@ -674,28 +674,9 @@ function deploymentListQuery(options: ProvisioningListOptions) {
|
||||
}
|
||||
|
||||
function activeDeploymentRank(row: ProvisioningListRow): number {
|
||||
const { group } = provisioningQueueStatus(row);
|
||||
if (group === 'verifying') return 0;
|
||||
if (group === 'running') return 1;
|
||||
// Launch preparation keeps its queued/waiting state until command submission.
|
||||
if (row.phase === 'prepare' && !row.waitCode) return 1;
|
||||
// Remote file staging currently records its progress only in the stage message.
|
||||
if (
|
||||
row.waitCode === 'native-host' &&
|
||||
[
|
||||
'Staging and verifying files on the host.',
|
||||
'Waiting for verified remote file staging.'
|
||||
].includes(row.stage)
|
||||
)
|
||||
return 1;
|
||||
if (group === 'queued') return 3;
|
||||
// A submitted command remains in progress while its agent result is pending.
|
||||
if (
|
||||
row.state === 'running' &&
|
||||
row.phase === 'container-action' &&
|
||||
row.waitCode === 'native-host'
|
||||
)
|
||||
return 1;
|
||||
if (row.state === 'awaiting-health') return 0;
|
||||
if (row.state === 'running') return 1;
|
||||
if (row.state === 'queued') return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -714,7 +695,7 @@ function deploymentListRows(
|
||||
...(active ? [] : [query.limit, query.offset])
|
||||
) as ProvisioningListRow[];
|
||||
if (!rows.length) return rows;
|
||||
// Stable sorting keeps request/insertion order within each progress group.
|
||||
// Stable sorting keeps request/insertion order within each lifecycle state.
|
||||
if (active)
|
||||
rows.sort((left, right) => activeDeploymentRank(left) - activeDeploymentRank(right));
|
||||
const links = db()
|
||||
|
||||
Reference in New Issue
Block a user