mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-25 03:34:14 +00:00
91 lines
4.1 KiB
HTML
91 lines
4.1 KiB
HTML
{{define "partials/gc_backfill_preview.html"}}
|
|
<div class="space-y-6">
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
<div class="stats shadow bg-base-100">
|
|
<div class="stat">
|
|
<div class="stat-title">Missing</div>
|
|
<div class="stat-value {{if .Preview.MissingCount}}text-warning{{end}}">{{.Preview.MissingCount}}</div>
|
|
<div class="stat-desc">Would be created</div>
|
|
</div>
|
|
</div>
|
|
<div class="stats shadow bg-base-100">
|
|
<div class="stat">
|
|
<div class="stat-title">Already Present</div>
|
|
<div class="stat-value text-success">{{.Preview.PresentCount}}</div>
|
|
<div class="stat-desc">Would be skipped</div>
|
|
</div>
|
|
</div>
|
|
<div class="stats shadow bg-base-100">
|
|
<div class="stat">
|
|
<div class="stat-title">Manifests Checked</div>
|
|
<div class="stat-value">{{.Preview.ManifestsChecked}}</div>
|
|
<div class="stat-desc">Distinct from layer records</div>
|
|
</div>
|
|
</div>
|
|
<div class="stats shadow bg-base-100">
|
|
<div class="stat">
|
|
<div class="stat-title">Users Affected</div>
|
|
<div class="stat-value">{{.Preview.UsersAffected}}</div>
|
|
<div class="stat-desc">{{formatDuration .Preview.Duration}}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{if .Preview.Missing}}
|
|
<div class="collapse collapse-arrow bg-base-100 shadow-sm">
|
|
<input type="checkbox" aria-label="Show manifests missing image configs" />
|
|
<div class="collapse-title font-medium">
|
|
{{ icon "file-plus" "size-4" }} Missing Image Configs ({{.Preview.MissingCount}}{{if gt .Preview.MissingCount (len .Preview.Missing)}}, showing first {{len .Preview.Missing}}{{end}})
|
|
</div>
|
|
<div class="collapse-content">
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-sm table-fixed">
|
|
<caption class="sr-only">Manifests missing image config records</caption>
|
|
<colgroup>
|
|
<col style="width: 30%">
|
|
<col style="width: 30%">
|
|
<col style="width: 40%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Digest</th>
|
|
<th scope="col">User</th>
|
|
<th scope="col">Manifest</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Preview.Missing}}
|
|
<tr>
|
|
<td><code class="text-xs font-mono truncate block max-w-full" title="{{.Digest}}">{{truncate .Digest 24}}</code></td>
|
|
<td><code class="text-xs font-mono truncate block max-w-full" title="{{.UserDID}}">{{truncate .UserDID 24}}</code></td>
|
|
<td><code class="text-xs font-mono truncate block max-w-full" title="{{.ManifestURI}}">{{truncate .ManifestURI 50}}</code></td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .Preview.MissingCount}}
|
|
<div class="flex flex-wrap items-center gap-3 mt-6">
|
|
<button class="btn btn-warning gap-2"
|
|
hx-post="/admin/api/gc/backfill-configs"
|
|
hx-target="#gc-results"
|
|
hx-swap="innerHTML"
|
|
hx-confirm="Create {{.Preview.MissingCount}} image config records by reading config blobs from S3?">
|
|
{{ icon "refresh-cw" "size-4" }}
|
|
Backfill {{.Preview.MissingCount}} Image Configs
|
|
</button>
|
|
</div>
|
|
<p class="text-sm text-base-content/50 mt-2">Backfill is idempotent: present records are left alone.</p>
|
|
{{else}}
|
|
<div class="alert alert-success">
|
|
{{ icon "check-circle" "size-5" }}
|
|
<span>Every manifest already has an image config record. Nothing to backfill.</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|