fix(ui): gesperrte Modelle zeigen Engine, Pfad und GPUs und zählen im Reiter Engines mit (#1068)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg3osejhFSpUz472iQ1
This commit is contained in:
2026-11-16 13:12:32 +01:00
parent 46046d154e
commit 3f5b7f46eb
4 changed files with 63 additions and 14 deletions

View File

@ -90,27 +90,24 @@ fn model_rows(state: &AppState) -> Vec<ModelRow> {
.unwrap_or_default()
.into_iter()
.map(|m| {
// Gesperrte Modelle haben keinen Startplan; die Planung kennt sie trotzdem.
let plan = store.start_plan(&m.name).ok().flatten();
// Auch gesperrte Modelle haben Engine, Pfad und GPUs (nur keinen Startplan).
let details = store.model_details(&m.name).ok().flatten();
let p = planning.iter().find(|p| p.0 == m.name);
ModelRow {
enabled: m.enabled,
engine: plan.as_ref().map(|p| p.engine_name.clone()),
gpus: plan
engine: details.as_ref().map(|d| d.engine.clone()),
gpus: details
.as_ref()
.map(|p| {
p.gpus
.map(|d| {
d.gpus
.iter()
.map(u32::to_string)
.collect::<Vec<_>>()
.join(", ")
})
.unwrap_or_default(),
context: plan.as_ref().and_then(|p| p.context),
path: plan
.as_ref()
.map(|p| p.model_path.display().to_string())
.unwrap_or_default(),
context: details.as_ref().and_then(|d| d.context),
path: details.as_ref().map(|d| d.path.clone()).unwrap_or_default(),
declared_mb: p.and_then(|p| p.1),
measured_mb: p.and_then(|p| p.2),
idle_secs: p.and_then(|p| p.3),
@ -316,7 +313,7 @@ fn edit_dialog(viewer: &Viewer, m: &ModelRow) -> String {
.map(|c| c.to_string())
.unwrap_or_else(|| "Standard der Engine".to_string()),
path = if m.path.is_empty() {
"– (gesperrt)".to_string()
"–".to_string()
} else {
esc(&m.path)
},