ui: split /hosts/{id} into host page + /runs/{runID} run page
Host page owns host metadata, full runs table with per-row stage strip, in-flight banner, and empty-state CTA. Run page owns pipeline, active step, logs, sub-steps, spec diffs, and hold banner with a breadcrumb back to the host. Dashboard tile reverts to host-only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -7,16 +7,13 @@ import (
|
||||
"time"
|
||||
|
||||
"vetting/internal/model"
|
||||
"vetting/internal/store"
|
||||
)
|
||||
|
||||
// HostTile renders a single dashboard card as a mini run-view. The whole
|
||||
// tile is a link to /hosts/{id} (via a CSS-overlay <a>) — every control
|
||||
// beyond the one primary action lives on the detail page. It's the SSE-
|
||||
// swap target for per-host tile refreshes (`tile-N`). The step list is
|
||||
// a compact vertical strip of the 9 canonical stages with just a
|
||||
// coloured dot per stage; operators can read run health at a glance
|
||||
// across the whole dashboard without drilling in.
|
||||
// HostTile renders a single dashboard card: hostname, heartbeat badge,
|
||||
// latest run status, and the primary action (Start / Cancel / View
|
||||
// report). The whole tile is a link to /hosts/{id} via a CSS-overlay
|
||||
// <a>; every deeper control lives on the host page or the run page.
|
||||
// It's the SSE-swap target for per-host tile refreshes (`tile-N`).
|
||||
templ HostTile(t TileData) {
|
||||
<article
|
||||
id={ fmt.Sprintf("host-%d", t.Host.ID) }
|
||||
@@ -32,17 +29,6 @@ templ HostTile(t TileData) {
|
||||
<div class="tile-status">{ tileStatus(t.Latest) }</div>
|
||||
</div>
|
||||
</header>
|
||||
if t.Latest != nil {
|
||||
<div class="tile-meta-row">
|
||||
<span class="tile-run-id">{ fmt.Sprintf("#%d", t.Latest.ID) }</span>
|
||||
<span class="tile-run-duration">{ runDuration(t.Latest) }</span>
|
||||
</div>
|
||||
}
|
||||
<ol class="tile-steplist">
|
||||
for _, name := range store.DefaultStageOrder {
|
||||
@tileStep(stageForName(t.Stages, name))
|
||||
}
|
||||
</ol>
|
||||
<div class="tile-primary-action">
|
||||
if canStart(t) {
|
||||
<form method="post" action={ templ.SafeURL(fmt.Sprintf("/hosts/%d/start", t.Host.ID)) } class="inline tile-start-form">
|
||||
@@ -65,17 +51,6 @@ templ HostTile(t TileData) {
|
||||
</article>
|
||||
}
|
||||
|
||||
// tileStep renders one entry of the tile's mini step-list: a small
|
||||
// coloured dot plus the short stage name. Kept as its own templ so the
|
||||
// markup stays consistent with the detail page's larger stage-dot
|
||||
// elements (same class prefix, different size via the `-sm` modifier).
|
||||
templ tileStep(s model.Stage) {
|
||||
<li class={ "tile-step", "tile-step-" + string(s.State) }>
|
||||
<span class={ "stage-dot", "stage-dot-sm", "stage-dot-" + string(s.State) }>{ stageMarker(string(s.State)) }</span>
|
||||
<span class="tile-step-name">{ s.Name }</span>
|
||||
</li>
|
||||
}
|
||||
|
||||
func canOverrideWipe(r *model.Run) bool {
|
||||
if r == nil {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user