mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-04 01:06:57 +00:00
more admin ui changes
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -25,6 +25,7 @@ type RelayStatusView struct {
|
||||
HasListReposByCollection bool
|
||||
RepoStatus *atproto.RepoStatus
|
||||
HostStatus *atproto.HostStatus
|
||||
CurrentRev string
|
||||
}
|
||||
|
||||
// getRelayViews returns the list of known relays for display
|
||||
@@ -68,6 +69,8 @@ func (ui *AdminUI) handleRelayStatus(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
status := atproto.CheckRelayStatus(relayURL, hostname, holdDID)
|
||||
|
||||
currentRev, _ := ui.pds.RepomgrRef().GetRepoRev(r.Context(), ui.pds.UID())
|
||||
|
||||
view := RelayStatusView{
|
||||
Name: relayName,
|
||||
URL: relayURL,
|
||||
@@ -76,6 +79,7 @@ func (ui *AdminUI) handleRelayStatus(w http.ResponseWriter, r *http.Request) {
|
||||
HasListReposByCollection: status.HasListReposByCollection,
|
||||
RepoStatus: status.RepoStatus,
|
||||
HostStatus: status.HostStatus,
|
||||
CurrentRev: currentRev,
|
||||
}
|
||||
|
||||
ui.renderTemplate(w, "partials/relay_status.html", view)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -8,25 +8,25 @@
|
||||
<body class="min-h-screen flex flex-col bg-base-200">
|
||||
{{template "nav" .}}
|
||||
|
||||
<main class="flex-1 w-full mx-auto max-w-screen-2xl px-6 pt-6 pb-6">
|
||||
{{if .Flash}}
|
||||
<div role="alert" class="alert alert-{{.Flash.Category}} mb-4">
|
||||
<span>{{.Flash.Message}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="flex-1 flex">
|
||||
{{template "admin-sidebar" .}}
|
||||
|
||||
{{block "page-header" .}}{{end}}
|
||||
<main class="flex-1 min-w-0">
|
||||
<div class="max-w-480 mx-auto px-6 pt-6 pb-6">
|
||||
{{if .Flash}}
|
||||
<div role="alert" class="alert alert-{{.Flash.Category}} mb-4">
|
||||
<span>{{.Flash.Message}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{template "admin-sidebar-mobile" .}}
|
||||
{{block "page-header" .}}{{end}}
|
||||
|
||||
<div class="flex gap-8">
|
||||
{{template "admin-sidebar" .}}
|
||||
{{template "admin-sidebar-mobile" .}}
|
||||
|
||||
<div class="flex-1 min-w-0">
|
||||
{{block "page-content" .}}{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="text-center p-6 text-base-content/50 text-sm">
|
||||
<p>Hold: <code class="font-mono">{{.HoldDID}}</code></p>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
{{end}}
|
||||
|
||||
{{define "admin-sidebar"}}
|
||||
<!-- Sidebar (lg and above) -->
|
||||
<aside class="hidden lg:block w-56 shrink-0">
|
||||
<ul class="menu bg-base-200 rounded-box w-full">
|
||||
<li data-tab="dashboard"><a href="/admin#dashboard">{{ icon "compass" "size-4" }} Dashboard</a></li>
|
||||
<li data-tab="crew"><a href="/admin#crew">{{ icon "anchor" "size-4" }} Crew</a></li>
|
||||
<li data-tab="settings"><a href="/admin#settings">{{ icon "settings" "size-4" }} Settings</a></li>
|
||||
<li data-tab="relays"><a href="/admin#relays">{{ icon "radio-tower" "size-4" }} Relays</a></li>
|
||||
<!-- Sidebar (lg and above) — pinned to left edge -->
|
||||
<aside class="hidden lg:block w-64 shrink-0 sticky top-0 h-screen overflow-y-auto bg-base-200 pt-6 px-4">
|
||||
<ul class="menu menu-lg rounded-box w-full">
|
||||
<li data-tab="dashboard"><a href="/admin#dashboard">{{ icon "compass" "size-5" }} Dashboard</a></li>
|
||||
<li data-tab="crew"><a href="/admin#crew">{{ icon "anchor" "size-5" }} Crew</a></li>
|
||||
<li data-tab="settings"><a href="/admin#settings">{{ icon "settings" "size-5" }} Settings</a></li>
|
||||
<li data-tab="relays"><a href="/admin#relays">{{ icon "radio-tower" "size-5" }} Relays</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
{{end}}
|
||||
|
||||
@@ -32,7 +32,11 @@
|
||||
<td>
|
||||
{{if .RepoStatus}}
|
||||
{{if .RepoStatus.Active}}
|
||||
<span class="text-sm text-success">Known (rev: {{truncate .RepoStatus.Rev 12}})</span>
|
||||
{{if eq .RepoStatus.Rev $.CurrentRev}}
|
||||
<span class="text-sm text-success">Known (rev: {{truncate .RepoStatus.Rev 12}})</span>
|
||||
{{else}}
|
||||
<span class="text-sm text-warning">Behind (rev: {{truncate .RepoStatus.Rev 12}})</span>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<span class="text-sm text-warning">Inactive</span>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user