feat: Status der Modelle als Symbol, Tabelle schmaler; Version 0.1.15-rc4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -236,6 +236,27 @@ pub(super) fn zustand(art: &str, text: &str) -> String {
|
||||
)
|
||||
}
|
||||
|
||||
/// Freigabe eines Modells als Symbol (Lucide `circle-check` und `lock`): freigegeben (grün) oder gesperrt (rot).
|
||||
/// Der Text steht im Hinweis und für Screenreader; der Tabellenfilter liest ihn aus `data-sort`.
|
||||
pub(super) fn freigabe(enabled: bool) -> String {
|
||||
let (text, farbe, pfade) = if enabled {
|
||||
(
|
||||
"freigegeben",
|
||||
"z-ok",
|
||||
"<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m9 12 2 2 4-4\"/>",
|
||||
)
|
||||
} else {
|
||||
(
|
||||
"gesperrt",
|
||||
"z-fehler",
|
||||
"<rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\"/><path d=\"M7 11V7a5 5 0 0 1 10 0v4\"/>",
|
||||
)
|
||||
};
|
||||
format!(
|
||||
"<svg class=\"fsym gemeldet {farbe}\" viewBox=\"0 0 24 24\" role=\"img\" aria-label=\"{text}\"><title>{text}</title>{pfade}</svg>"
|
||||
)
|
||||
}
|
||||
|
||||
/// GPU-Nummern („0, 1“) als Chip-Symbole mit Nummer.
|
||||
pub(super) fn gpu_symbole(gpus: &str) -> String {
|
||||
gpus.split(',')
|
||||
|
||||
@ -270,20 +270,17 @@ fn models_table(state: &AppState, viewer: &Viewer) -> String {
|
||||
),
|
||||
(None, None) => "<span class=\"muted\">–</span>".to_string(),
|
||||
};
|
||||
let status_text = if m.enabled { "freigegeben" } else { "gesperrt" };
|
||||
let row_id = format!("modell-{}", dialog_id(&m.name));
|
||||
format!(
|
||||
"<tr id=\"{row_id}\"><td class=\"name\">{}</td><td>{}</td><td>{}</td>{faehig}<td>{}</td><td class=\"num\"{context_attr}>{context}</td>\
|
||||
"<tr id=\"{row_id}\"><td class=\"name\">{}</td><td>{}</td><td data-sort=\"{status_text}\">{}</td>{faehig}<td>{}</td><td class=\"num\"{context_attr}>{context}</td>\
|
||||
<td class=\"num\"{memory_attr}>{memory}</td><td>{}</td><td>{}</td><td data-sort=\"{state_sort}\">{state_chip}</td>{actions}</tr>",
|
||||
esc(&m.name),
|
||||
m.engine
|
||||
.as_ref()
|
||||
.map(|e| format!("<span class=\"chip\">{}</span>", esc(e)))
|
||||
.unwrap_or_else(|| "–".to_string()),
|
||||
if m.enabled {
|
||||
"<span class=\"chip ok\">freigegeben</span>"
|
||||
} else {
|
||||
"<span class=\"chip error\">gesperrt</span>"
|
||||
},
|
||||
super::faehigkeiten::freigabe(m.enabled),
|
||||
if m.gpus.is_empty() {
|
||||
"–".to_string()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user