internal/web/templates/admin.html

dd06e80a071d451ebb7b083363e0580550481114
gitbay/internal/web/templates/admin.html history · blame · raw

86 lines · 5387 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="#push">Push</a></li>
17    <li><a href="#mirrors">Mirrors</a></li>
18    <li><a href="#builds">Builds</a></li>
19    <li><a href="#deps">Dependency checks</a></li>
20  </ul></div>
21</details>
22</nav>
23<div class="colmain">
24
25{{with .Queues.Webhooks}}
26<section id="webhooks">
27<h2>Webhook deliveries <span class="count">{{.Pending}}</span></h2>
28<p class="meta">{{.Pending}} pending · {{.Retrying}} retrying · {{.Failed}} dead-lettered{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
29{{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>
30{{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>
31{{end}}</tbody></table></div>{{else}}<p class="none">Nothing retrying or dead-lettered</p>{{end}}
32</section>
33{{end}}
34
35{{with .Queues.Mail}}
36<section id="mail">
37<h2>Mail <span class="count">{{.Pending}}</span></h2>
38<p class="meta">{{.Pending}} pending · {{.Retrying}} retrying · {{.Failed}} failed{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
39{{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>
40{{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>
41{{end}}</tbody></table></div>{{else}}<p class="none">Nothing retrying or failed</p>{{end}}
42</section>
43{{end}}
44
45{{/* A push row names the device id, never the token, as dashboard does. */}}
46{{with .Queues.Push}}
47<section id="push">
48<h2>Push <span class="count">{{.Pending}}</span></h2>
49<p class="meta">{{.Pending}} pending · {{.Retrying}} retrying · {{.Failed}} failed{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
50{{if .Items}}<div class="tablewrap"><table class="keys"><thead><tr class="cols"><th>Push</th><th>Device</th><th>Title</th><th>Attempts</th><th>State</th><th>Last error</th></tr></thead><tbody>
51{{range .Items}}<tr><td class="mono">{{.ID}}</td><td class="mono">device {{.DeviceID}}</td><td>{{.Title}}</td><td>{{.Attempts}}</td><td>{{if .FailedAt}}failed {{when .FailedAt}}{{else}}retrying{{end}}</td><td>{{.LastError}}</td></tr>
52{{end}}</tbody></table></div>{{else}}<p class="none">Nothing retrying or failed</p>{{end}}
53</section>
54{{end}}
55
56{{with .Queues.Mirrors}}
57<section id="mirrors">
58<h2>Mirrors <span class="count">{{.Errors}}</span></h2>
59<p class="meta">{{.Dirty}} waiting for a sync · {{.Errors}} with a failed last sync</p>
60{{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>
61{{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>
62{{end}}</tbody></table></div>{{else}}<p class="none">Every mirror's last sync succeeded</p>{{end}}
63</section>
64{{end}}
65
66{{with .Queues.Builds}}
67<section id="builds">
68<h2>Builds <span class="count">{{.Pending}}</span></h2>
69<p class="meta">{{.Pending}} pending · {{.Running}} running{{if .OldestPending}} · oldest pending {{when .OldestPending}}{{end}}</p>
70{{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>
71{{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>
72{{end}}</tbody></table></div>{{else}}<p class="none">No build running or pending</p>{{end}}
73</section>
74{{end}}
75
76{{with .Queues.Deps}}
77<section id="deps">
78<h2>Dependency checks <span class="count">{{.Errors}}</span></h2>
79{{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>
80{{range .Items}}<tr><td><a href="/{{.Repo}}">{{.Repo}}</a></td><td>{{if .LastCheck}}{{when .LastCheck}}{{else}}never{{end}}</td><td>{{.LastError}}</td></tr>
81{{end}}</tbody></table></div>{{else}}<p class="none">No check has failed</p>{{end}}
82</section>
83{{end}}
84</div>
85</div>
86{{end}}