go/pkg/lab/handler/templates/services.html
Claude 5e9a9c2790
Some checks failed
Security Scan / Go Vulnerability Check (push) Has been cancelled
Security Scan / Secret Detection (push) Has been cancelled
Security Scan / Dependency & Config Scan (push) Has been cancelled
feat: integrate lab dashboard as core lab serve
Port the standalone lab dashboard (lab.lthn.io) into the core CLI as
pkg/lab/ with collectors, handlers, and HTML templates. The dashboard
monitors machines, Docker containers, Forgejo, HuggingFace models,
training runs, and InfluxDB metrics with SSE live updates.

New command: core lab serve --bind :8080

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 05:53:52 +00:00

65 lines
2.3 KiB
HTML

{{template "head" "Services"}}
{{template "nav" "services"}}
<h2 class="section-title">Internal Services</h2>
<style>
.svc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;margin-bottom:2rem}
.svc-card{padding:1rem 1.25rem;border:1px solid var(--border);border-radius:8px;background:var(--surface);display:flex;align-items:center;gap:1rem;transition:border-color .2s}
.svc-card:hover{border-color:var(--accent-dim)}
.svc-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.svc-dot.ok{background:var(--green)}
.svc-dot.degraded{background:var(--yellow)}
.svc-dot.unavailable{background:var(--red)}
.svc-dot.unchecked{background:var(--muted)}
.svc-info{flex:1;min-width:0}
.svc-name{font-weight:600;font-size:.875rem}
.svc-name a{color:var(--text)}
.svc-name a:hover{color:var(--accent)}
.svc-meta{font-size:.75rem;color:var(--muted)}
.svc-cat-title{font-size:.875rem;font-weight:600;color:var(--accent);text-transform:uppercase;letter-spacing:.05em;margin-bottom:.75rem;padding-bottom:.375rem;border-bottom:1px solid var(--border)}
.svc-section{margin-bottom:1.5rem}
.svc-summary{display:flex;gap:1.5rem;margin-bottom:1.5rem;flex-wrap:wrap}
.svc-stat{font-size:.8125rem;color:var(--muted)}
.svc-stat strong{font-size:1.25rem;color:var(--text);display:block}
</style>
{{$services := .Services}}
<div class="svc-summary">
<div class="svc-stat">
<strong>{{len $services}}</strong>
Total Services
</div>
<div class="svc-stat">
<strong style="color:var(--green)">{{countStatus $services "ok"}}</strong>
Online
</div>
<div class="svc-stat">
<strong style="color:var(--yellow)">{{countStatus $services "degraded"}}</strong>
Degraded
</div>
<div class="svc-stat">
<strong style="color:var(--red)">{{countStatus $services "unavailable"}}</strong>
Offline
</div>
</div>
{{range categories $services}}
<div class="svc-section">
<div class="svc-cat-title">{{.}}</div>
<div class="svc-grid">
{{range filterCat $services .}}
<div class="svc-card">
<div class="svc-dot {{.Status}}"></div>
<div class="svc-info">
<div class="svc-name"><a href="{{.URL}}" target="_blank">{{.Name}}</a></div>
<div class="svc-meta">{{.Machine}} &middot; {{.URL}}</div>
</div>
</div>
{{end}}
</div>
</div>
{{end}}
{{template "footer"}}