internal/web/templates/admin.html
74 lines · 4478 bytes
1{{define "width"}}wide{{end}}
2{{define "title"}}admin · {{.Site}}{{end}}
3{{define "content"}}
4<h1>Admin</h1>
5<p class="meta">Server build {{.Commit}}. Every background worker's backlog. This is the same read as <code>gitbay dashboard --json</code> for an admin.</p>
6<p class="meta"><a href="/admin/users">Accounts</a>: view every instance user account.</p>
7
8<div class="withcol narrow">
9<nav class="sidecol" aria-label="Sections">
10<details class="sidedrop">
11<summary><span class="sideword">Sections</span></summary>
12 <div class="grp"><h2 class="colhead">Sections</h2>
13 <ul>
14 <li><a href="#webhooks">Webhook deliveries</a></li>
15 <li><a href="#mail">Mail</a></li>
16 <li><a href="#mirrors">Mirrors</a></li>
17 <li><a href="#builds">Builds</a></li>
18 <li><a href="#deps">Dependency checks</a></li>
19 </ul></div>
20</details>
21</nav>
22<div class="colmain">
23
24{{with .Queues.Webhooks}}
25<section id="webhooks">
26<h2>Webhook deliveries <span class="count">{{.Pending}}</span></h2>
27<p class="meta">{{.Pending}} pending · {{.Retrying}} retrying · {{.Failed}} dead-lettered{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
28{{if .Items}}<div class="tablewrap"><table class="keys"><thead><tr class="cols"><th>Repository</th><th>URL</th><th>Attempts</th><th>State</th><th>Last error</th></tr></thead><tbody>
29{{range .Items}}<tr><td><a href="/{{.Repo}}">{{.Repo}}</a></td><td>{{.URL}}</td><td>{{.Attempts}}</td><td>{{if .FailedAt}}dead-lettered {{when .FailedAt}}{{else}}retrying{{end}}</td><td>{{if .Status}}{{.Status}} {{end}}{{.LastError}}</td></tr>
30{{end}}</tbody></table></div>{{else}}<p class="none">Nothing retrying or dead-lettered</p>{{end}}
31</section>
32{{end}}
33
34{{with .Queues.Mail}}
35<section id="mail">
36<h2>Mail <span class="count">{{.Pending}}</span></h2>
37<p class="meta">{{.Pending}} pending · {{.Retrying}} retrying · {{.Failed}} failed{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
38{{if .Items}}<div class="tablewrap"><table class="keys"><thead><tr class="cols"><th>Mail</th><th>Recipient</th><th>Subject</th><th>Attempts</th><th>State</th><th>Last error</th></tr></thead><tbody>
39{{range .Items}}<tr><td class="mono">{{.ID}}</td><td>{{.Recipient}}</td><td>{{.Subject}}</td><td>{{.Attempts}}</td><td>{{if .FailedAt}}failed {{when .FailedAt}}{{else}}retrying{{end}}</td><td>{{.LastError}}</td></tr>
40{{end}}</tbody></table></div>{{else}}<p class="none">Nothing retrying or failed</p>{{end}}
41</section>
42{{end}}
43
44{{with .Queues.Mirrors}}
45<section id="mirrors">
46<h2>Mirrors <span class="count">{{.Errors}}</span></h2>
47<p class="meta">{{.Dirty}} waiting for a sync · {{.Errors}} with a failed last sync</p>
48{{if .Items}}<div class="tablewrap"><table class="keys"><thead><tr class="cols"><th>Repository</th><th>Direction</th><th>URL</th><th>Last sync</th><th>Error</th></tr></thead><tbody>
49{{range .Items}}<tr><td><a href="/{{.Repo}}">{{.Repo}}</a></td><td>{{.Direction}}</td><td>{{.URL}}</td><td>{{if .LastSync}}{{when .LastSync}}{{else}}never{{end}}</td><td>{{.LastError}}</td></tr>
50{{end}}</tbody></table></div>{{else}}<p class="none">Every mirror's last sync succeeded</p>{{end}}
51</section>
52{{end}}
53
54{{with .Queues.Builds}}
55<section id="builds">
56<h2>Builds <span class="count">{{.Pending}}</span></h2>
57<p class="meta">{{.Pending}} pending · {{.Running}} running{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
58{{if .Items}}<div class="tablewrap"><table class="keys"><thead><tr class="cols"><th>Repository</th><th>Build</th><th>Job</th><th>Status</th><th>Since</th></tr></thead><tbody>
59{{range .Items}}<tr><td><a href="/{{.Repo}}">{{.Repo}}</a></td><td><a href="/{{.Repo}}/builds/{{.Number}}">#{{.Number}}</a></td><td>{{.Job}}</td><td>{{.Status}}</td><td>{{if .StartedAt}}{{when .StartedAt}}{{else}}{{when .CreatedAt}}{{end}}</td></tr>
60{{end}}</tbody></table></div>{{else}}<p class="none">No build running or pending</p>{{end}}
61</section>
62{{end}}
63
64{{with .Queues.Deps}}
65<section id="deps">
66<h2>Dependency checks <span class="count">{{.Errors}}</span></h2>
67{{if .Items}}<div class="tablewrap"><table class="keys"><thead><tr class="cols"><th>Repository</th><th>Last check</th><th>Error</th></tr></thead><tbody>
68{{range .Items}}<tr><td><a href="/{{.Repo}}">{{.Repo}}</a></td><td>{{if .LastCheck}}{{when .LastCheck}}{{else}}never{{end}}</td><td>{{.LastError}}</td></tr>
69{{end}}</tbody></table></div>{{else}}<p class="none">No check has failed</p>{{end}}
70</section>
71{{end}}
72</div>
73</div>
74{{end}}