mirror of
https://github.com/git-pkgs/proxy.git
synced 2026-11-12 09:09:15 -05:00
With cache_delete set, DELETE /api/git/{upstream}/{repo} removes one
repository from the git cache and /ui/git gets a Delete button per
repository. The repository is moved aside under the cache's lock, as
eviction does, so the next clone fetches it again. One that a clone, a
fetch or a client is using answers 409. The response names the
repository and the bytes freed.
46 lines
2.9 KiB
HTML
46 lines
2.9 KiB
HTML
{{define "title"}}Git repositories - git-pkgs proxy{{end}}
|
|
|
|
{{define "content"}}
|
|
<div class="mb-8">
|
|
<h1 class="text-3xl font-bold mb-2">Git repositories</h1>
|
|
<p class="text-gray-600 dark:text-gray-400">{{.Summary}}</p>
|
|
{{if .Pending}}<p class="text-sm text-gray-500 dark:text-gray-400">Branches and commits not read yet for {{.Pending}}. Reload to see more.</p>{{end}}
|
|
</div>
|
|
|
|
{{if .Rows}}
|
|
<div class="bg-white dark:bg-gray-900 rounded-xl shadow-sm border border-gray-200 dark:border-gray-800">
|
|
{{if .CacheDelete}}<p id="cache-delete-error" class="hidden px-6 py-3 text-sm text-red-700 dark:text-red-400 border-b border-gray-200 dark:border-gray-800"></p>{{end}}
|
|
<div class="divide-y divide-gray-200 dark:divide-gray-800">
|
|
{{range .Rows}}
|
|
<div class="px-6 py-4 flex flex-col sm:flex-row sm:items-center justify-between gap-2"{{if $.CacheDelete}} data-cache-url="{{.DeleteURL}}"{{end}}>
|
|
<div class="min-w-0">
|
|
<div class="font-medium break-all"><span class="text-gray-500 dark:text-gray-400">{{.Upstream}}</span> / {{.Repo}}</div>
|
|
<div class="text-sm text-gray-500 dark:text-gray-400 font-mono break-all">{{.CloneURL}}</div>
|
|
{{if .Commit}}
|
|
<div class="text-sm text-gray-600 dark:text-gray-300 break-all"><span class="font-mono">{{.Branch}}{{if .Branch}} @ {{end}}{{.Commit}}</span> {{.Subject}}{{if .CommitAge}} <span class="text-gray-500 dark:text-gray-400">· {{.CommitAge}}</span>{{end}}</div>
|
|
{{end}}
|
|
{{if .LastError}}
|
|
<div class="text-sm text-red-600 dark:text-red-400">Last refresh failed: {{.LastError}}{{if .LastErrorAt}}, {{.LastErrorAt}}{{end}}</div>
|
|
{{end}}
|
|
</div>
|
|
<div class="flex flex-wrap items-center gap-4 text-sm text-gray-500 dark:text-gray-400 shrink-0">
|
|
{{if .Refs}}<span class="tabular-nums">{{.Refs}}</span>{{end}}
|
|
<span class="tabular-nums">{{.Size}}</span>
|
|
<span class="tabular-nums">{{.Requests}}</span>
|
|
{{if .LastChecked}}<span title="Upstream last checked">checked {{.LastChecked}}</span>{{end}}
|
|
{{if .LastUsed}}<span title="Last read by a client">used {{.LastUsed}}</span>{{end}}
|
|
{{if $.CacheDelete}}<button type="button" class="cache-delete text-xs px-2 py-1 rounded border border-red-300 text-red-700 hover:bg-red-50 dark:border-red-800 dark:text-red-400 dark:hover:bg-red-950" data-label="Delete">Delete</button>{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div class="bg-white dark:bg-gray-900 rounded-xl shadow-sm border border-gray-200 dark:border-gray-800 p-12 text-center">
|
|
<p class="text-gray-500 dark:text-gray-400">No repository is cached yet</p>
|
|
</div>
|
|
{{end}}
|
|
{{if and .CacheDelete .Rows}}
|
|
<script src="/ui/static/cache-delete.js" defer></script>
|
|
{{end}}
|
|
{{end}}
|