Luigit
repositories / bugabinga.net

bugabinga.net

personal infrastructure for bugabinga!

owned by admin

services/luci/internal/web/assets/dashboard.tmpl

Raw
{{define "body"}}{{range .Warnings}}<p class="warning"><b>State warning</b><br>{{.}}</p>{{end}}<section class="dashboard-intro"><h1>{{if .FailingRepos}}<span class="failed">{{.FailingRepos}} {{if eq .FailingRepos 1}}repository{{else}}repositories{{end}}</span><br>need attention.{{else}}<span class="success">Healthy.</span><br>Nothing needs attention.{{end}}</h1><p>{{.RunningRepos}} in progress · <span class="success">{{.HealthyRepos}} healthy</span></p></section><section class="metrics{{if not .FailingRepos}} clear{{end}}" aria-label="Repository health"><div class="metric attention{{if .FailingRepos}} bad{{end}}"><small>NEEDS ATTENTION</small><strong>{{.FailingRepos}}</strong></div><div class="metric run"><small>IN PROGRESS</small><strong>{{.RunningRepos}}</strong></div><div class="metric ok"><small>HEALTHY</small><strong>{{.HealthyRepos}}</strong></div></section><div class="filters"><input id="filter" type="search" placeholder="Filter repository or job" aria-label="Filter repository or job">{{if not .All}}<a class="control" href="?all=1">SHOW ALL</a>{{end}}</div><section><h2>Needs attention</h2>{{range .Attention}}{{template "run-row" .}}{{else}}<p class="muted">Nothing failing.</p>{{end}}</section><section><h2>In progress</h2>{{range .Progress}}{{template "run-row" .}}{{else}}<p class="muted">Nothing running.</p>{{end}}</section><section><h2>Recent successful runs</h2>{{range .Success}}{{template "run-row" .}}{{else}}<p class="muted">No successful runs.</p>{{end}}</section><script>const f=document.querySelector('#filter');f.addEventListener('input',()=>{const q=f.value.toLowerCase();document.querySelectorAll('.run-row').forEach(r=>r.hidden=!r.dataset.search.includes(q))});setInterval(()=>{if(!document.hidden&&f.value===''&&document.activeElement===document.body)location.reload()},5000)</script>{{end}}