feat: GPU-Name und CUDA-Version, Auswertung als Seite, Engines-Seite überarbeitet (#1087, #1088, #1091)

- #1087: nvidia-smi liefert den Produktnamen; CUDA-Kompatibilitätsversion aus dem Kopf von nvidia-smi.
- #1088: Seite /ui/auswertung mit Zeitraum und Gruppierung; Ladevorgänge in lade_log (Migration 0006, Schema-Änderung, ältere Versionen öffnen die Datenbank danach nicht mehr).
- #1091: Engines-Seite mit Hinweis zur Anmeldung der Engine-Oberfläche; Startkommando nur für Admins. Statuszeile fehlt (wartet auf #1086), Link zur Engine-Oberfläche fehlt noch.

Geprüft: cargo fmt --check, clippy -D warnings, cargo test --workspace (258 bestanden).

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 12:04:01 +01:00
parent 90400d9e35
commit b0b659efa0
11 changed files with 589 additions and 61 deletions

View File

@ -142,7 +142,8 @@ pub(super) async fn engines_page(
None => None,
};
let rows = super::verwaltung::model_engine_names(&state);
let view = state.runtime.scheduler_view();
let mut summary = String::new();
let mut searches = String::new();
let cards: String = state
.runtime
.engine_overview()
@ -153,11 +154,12 @@ pub(super) async fn engines_page(
.filter(|(_, engine)| engine.as_deref() == Some(name.as_str()))
.map(|(model, _)| model)
.collect();
let loaded = view
.instances
.iter()
.filter(|i| models.iter().any(|m| **m == i.model))
.count();
let links: String = models.iter().map(|model| format!(
"<a href=\"/ui/modelle#modell-{}\">{}</a> ",
super::verwaltung::dialog_id(model), esc(model)
)).collect();
summary.push_str(&format!("<tr><th>{}</th><td>{}</td></tr>", esc(&name),
if links.is_empty() { "Keine Modelle registriert.".into() } else { links }));
let installed = match &start.executable {
Some(path) if path.exists() => {
"<span class=\"chip ok\">gefunden</span>".to_string()
@ -190,53 +192,42 @@ pub(super) async fn engines_page(
.iter()
.map(|(k, v)| format!("<div><dt>{}</dt><dd class=\"pfad\">{}</dd></div>", esc(k), esc(v)))
.collect();
let start_details = if viewer.admin() {
format!("<details><summary>Startkommando und Umgebung</summary><dl class=\"daten\">{exe}\
<div class=\"breit-zeile\"><dt>Start</dt><dd><pre class=\"befehl\">{}</pre></dd></div>{env}{details}</dl></details>",
if start.command.is_empty() { "Der Adapter nennt kein Startkommando.".into() } else { esc(&start.command) })
} else { String::new() };
if viewer.admin() {
searches.push_str(&format!(
"<section><h3>{}</h3><form method=\"get\" action=\"/ui/engines\">\
<input type=\"hidden\" name=\"suche\" value=\"{}\">\
<button class=\"sm\" type=\"submit\">Modelle suchen</button></form>{}</section>",
esc(&name), esc(&name),
match &searched {
Some((engine, result, registered)) if *engine == name => found_block(&viewer, &name, result.clone(), registered),
_ => String::new(),
}));
}
format!(
"<section class=\"card engine\"><div class=\"zeile\"><h2>{name}</h2>\
<span class=\"chip accent\">{mode}</span>{installed}\
<span class=\"rechts muted\">{n} Modelle registriert · {loaded} geladen</span></div>\
<div class=\"chips\">{caps}</div>{search_button}\
<dl class=\"daten\">{exe}\
<div class=\"breit-zeile\"><dt>Start</dt><dd><pre class=\"befehl\">{command}</pre></dd></div>\
{env}{details}</dl>{found}</section>",
name = esc(&name),
search_button = if viewer.admin() {
format!(
"<form class=\"zeile\" method=\"get\" action=\"/ui/engines\">\
<input type=\"hidden\" name=\"suche\" value=\"{}\">\
<button class=\"sm\" type=\"submit\">Modelle suchen</button></form>",
esc(&name)
)
} else {
String::new()
},
found = match &searched {
Some((engine, result, registered)) if *engine == name => format!(
"<h3>Gefundene Modelle</h3>{}",
found_block(&viewer, &name, result.clone(), registered)
),
_ => String::new(),
},
mode = mode_text(info.mode),
n = models.len(),
caps = capability_chips(&info.capabilities),
command = if start.command.is_empty() {
"(Der Adapter nennt kein Startkommando.)".to_string()
} else {
esc(&start.command)
},
<span class=\"rechts muted\">{n} Modelle registriert</span></div>\
<div class=\"chips\">{caps}</div>{start_details}</section>",
name = esc(&name), mode = mode_text(info.mode), n = models.len(), caps = capability_chips(&info.capabilities),
)
})
.collect();
let search_section = if viewer.admin() {
format!(
"<section class=\"card\"><h2>Modelle suchen und registrieren</h2>{searches}</section>"
)
} else {
String::new()
};
let body = format!(
"{notice}<p class=\"klein\">So startet das Gateway die Engines. Angezeigt wird die Kommandozeile mit Platzhaltern in spitzen Klammern; \
Port, Modelldatei und GPUs setzt das Gateway beim Start ein. Geändert wird in der Konfiguration (<code>config.toml</code>), \
Startprofile in der Oberfläche folgen später.{search_hint}</p>{cards}",
"{notice}<section class=\"card\"><h2>Engines und Modelle</h2><table><thead><tr><th>Engine</th><th>Modelle</th></tr></thead><tbody>{summary}</tbody></table></section>\
{cards}{search_section}<p class=\"klein\">Die Oberfläche der Engine hat keine eigene Anmeldung, das Gateway kontrolliert sie nicht.</p>",
notice = notice(query.as_deref()),
search_hint = if viewer.admin() {
" Mit „Modelle suchen“ findet das Gateway, was die Engine in den Ordnern ihrer Konfiguration hat, und trägt es auf Wunsch ein."
} else {
""
},
);
html(
StatusCode::OK,