Line up how each mirrored model runs

The run mode sat after a tag repeating the model's name, so each selector started where the name ended and long names wrapped the row. The column is now Runs: one fixed-width selector per model, with the catalog's name above it only when it differs from the mirror's. Sizes no longer wrap.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-09-28 20:44:36 +02:00
1 parent bf94cd1667
commit c609805e4b
3 files changed
+24 -8

No files matched your search

+2 -2
View File
@@ -557,7 +557,7 @@ func TestAHeldVersionIsOneLineAndSaysWhoUsesIt(t *testing.T) {
if !strings.Contains(body, `data-url="http://mirror:8081/big/v1/"`) {
t.Error("a set's address is its directory, trailing slash included")
}
if !strings.Contains(body, ">small-chat<") {
if !strings.Contains(body, ">as small-chat<") {
t.Error("the model serving a file should be named on its row")
}
// Already served: offering to serve it again invites a second catalog
@@ -585,7 +585,7 @@ func TestHowAModelRunsIsChangedWhereItsFileIsShown(t *testing.T) {
t.Error("the running model's mode is not shown as chosen")
}
// Declared in server.yaml: shown, not offered, since it would revert.
if !strings.Contains(body, "on demand · set in server.yaml") {
if !strings.Contains(body, "on demand<br>set in server.yaml") {
t.Error("a declared model should say where its mode is set")
}
if strings.Count(body, `name="mode" class="mode"`) != 1 {
+8 -2
View File
@@ -445,5 +445,11 @@ h3.limits-for { font-size: .92rem; margin: 1rem 0 .4rem; }
table.narrow-table { max-width: 30rem; }
.q-act a + a { margin-left: .8rem; }
.chip-role { font-size: .68rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
table.held .use { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .1rem 0; }
table.held select.mode { padding: .1rem .3rem; font-size: .8rem; }
/* Runs: one fixed-width selector per model, so they line up down the column
whatever the names; a catalog name differing from the mirror's sits above. */
table.held .use { width: 9.5rem; margin: .1rem 0; }
table.held .use .as { display: block; font-size: .72rem; color: var(--muted);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.held .use .opt { font-size: .75rem; line-height: 1.3; }
table.held td.num { white-space: nowrap; }
table.held select.mode { width: 100%; padding: .15rem .3rem; font-size: .8rem; }
+14 -4
View File
@@ -31,7 +31,7 @@ reachable from this machine.</p>
<h2>What the mirror holds</h2>
{{if .Rows}}
<table class="compact held">
<tr><th>Model</th><th>Files</th><th class="num">Size</th><th>In use</th><th></th></tr>
<tr><th>Model</th><th>Files</th><th class="num">Size</th><th>Runs</th><th></th></tr>
{{range .Rows}}<tr>
<td><strong>{{.Model}}</strong> <span class="opt">{{.Version}}</span></td>
<td class="file" title="{{.File}}{{if .SHA256}} · sha256 {{.SHA256}}{{end}}">
@@ -49,9 +49,11 @@ reachable from this machine.</p>
<td>
{{if eq (printf "%s" .State) "fetching"}}<span class="state state-starting">downloading</span>
{{else if eq (printf "%s" .State) "failed"}}<span class="state state-failed">failed</span>
{{else if .UsedBy}}{{range .UsedBy}}<div class="use">
<span class="tag">{{.Name}}</span>
{{if .Declared}}<span class="opt">{{if eq .Mode "always"}}always on{{else if eq .Mode "ondemand"}}on demand{{else}}stopped{{end}} · set in server.yaml</span>
{{else if .UsedBy}}{{$row := .}}{{range .UsedBy}}<div class="use">
{{/* Named only when the catalog calls it something other than the
mirror does; otherwise it is the model column again. */}}
{{if ne .Name $row.Model}}<span class="as" title="{{.Name}}">as {{.Name}}</span>{{end}}
{{if .Declared}}<span class="opt">{{if eq .Mode "always"}}always on{{else if eq .Mode "ondemand"}}on demand{{else}}stopped{{end}}<br>set in server.yaml</span>
{{else}}
{{/* Submitted on change: the choice is the action, and a second click
to confirm it would only be a way to forget to. */}}
@@ -223,6 +225,11 @@ directory, or give the mirror a token.</p>
<td class="num">{{bytes .Bytes}}</td>
<td>{{with .SHA256}}<code title="{{.}}">{{slice . 0 12}}</code>{{else}}—{{end}}</td>
<td>
{{if not .Verdict.Servable}}
<span class="state state-failed" title="{{.Verdict.Reason}}">cannot be served</span>
<div class="note">{{.Verdict.Reason}}</div>
{{else}}
{{if .Verdict.Architecture}}<span class="opt" title="{{.Verdict.Reason}}">{{.Verdict.Architecture}}{{if .Verdict.Checked}} ✓{{end}}</span>{{end}}
<form method="post" action="/admin/mirror/fetch" class="inline">
<input type="hidden" name="csrf" value="{{$.CSRF}}">
{{range .Sources}}<input type="hidden" name="source" value="{{.URL}}">
@@ -232,6 +239,7 @@ directory, or give the mirror a token.</p>
<input type="text" name="version" value="{{.Version}}" size="10">
<button type="submit">Fetch</button>
</form>
{{end}}
</td>
</tr>{{end}}
</table>
@@ -263,6 +271,8 @@ computes once it has it.</p>
<label>File <span class="opt">optional</span>
<input type="text" name="file" placeholder="taken from the URL"></label>
</div>
<label class="inline-check"><input type="checkbox" name="force" value="1">
Fetch anyway <span class="opt">even if the nodes' llama.cpp cannot load it</span></label>
<button type="submit">Start download</button>
</form>
<p class="note">The mirror answers as soon as the download is under way, not when