{collection?.name ?? 'Collection launch'} | Electric Cherry
{#snippet crumbs()}{/snippet} {#if error}{/if} {#if collection && detail}
Collection progress

{heading}

{collection.done + collection.failed + collection.cancelled} / {collection.total} finished
0}>
{exact ? 'Completed' : 'Ready'}
{collection.done}
{exact ? 'In progress' : 'Launching'}
{collection.provisioning + collection.verifying}
Queued
{collection.queued}
0}>
Need attention
{collection.failed}
{#if cancellationRequested || collection.cancelled > 0}
Cancelled
{collection.cancelled}
{/if}

{collection.done} completed, {collection.provisioning + collection.verifying} in progress, {collection.queued} queued, {collection.failed} {plural(collection.failed, 'needs', 'need')} attention, {collection.cancelled} cancelled, {collection.cleanupActive} cleaning up, {collection.cleanupFailed} {plural(collection.cleanupFailed, 'cleanup')} {plural(collection.cleanupFailed, 'needs', 'need')} attention.

{#if cancellationRequested}

Completed launches and retained servers are kept. Removals that already started or are shared with another collection may still finish. Follow each cancelled server's cleanup below until removal is confirmed.

{/if} {#if collection.cleanupActive || collection.cleanupFailed}
{#if collection.cleanupActive}

{collection.cleanupActive} server cleanup{collection.cleanupActive === 1 ? '' : 's'} in progress. Keys and ports remain reserved until removal is confirmed.

{/if} {#if collection.cleanupFailed}

{collection.cleanupFailed} cleanup{collection.cleanupFailed === 1 ? ' needs' : 's need'} attention. Open the cleanup operation below to review and recover.

{/if}
{/if} {#if canOperate && detail.canCancel && !cancellationRequested}

Stops unfinished launches and removes their containers and instance files. Completed launches and retained servers are kept.

{/if} {#if cancelError}{/if}
{#if currentServers.length}
In progress {#each currentServers as server (server.id)}
{server.action === 'destroy' ? 'Removing: ' : ''}

{server.state === 'awaiting-health' ? 'Checking the container, connection, and expected map.' : server.stage}

Follow progress
{/each}
{:else if firstQueued} {/if} {#if exact && detail.retainedServers.length}
{detail.retainedServers.length} retained server{detail.retainedServers.length === 1 ? '' : 's'} (unchanged)
{/if}

{exact ? 'Fleet changes' : 'Launch order'}

{collection.total} operation{collection.total === 1 ? '' : 's'}
    {#each detail.servers as server, index (server.id)}
  1. {stateLabel(server)}

    {server.error ?? (server.state === 'queued' ? queueHint(server) : server.state === 'done' ? server.action === 'destroy' ? server.stage : 'Startup checks passed.' : server.stage)}

    {server.action === 'destroy' ? 'Destroy server' : server.port === null ? 'Create server · Port not assigned yet' : `Create server · Port ${server.port}`}{needsAttention(server) ? 'Review & recover' : 'View operation'}
    {#if server.cancellation} {server.cancellation.state === 'done' ? 'Cleanup completed' : cleanupNeedsAttention(server.cancellation) ? 'Cleanup needs attention' : 'Cleanup in progress'} {server.cancellation.error ?? server.cancellation.stage} {cleanupNeedsAttention(server.cancellation) ? 'Review cleanup' : 'View cleanup progress'} {/if}
  2. {/each}
{:else if !error}

Loading collection…

{/if}