Upgrade Iced and render Markdown tables

This commit is contained in:
Georg Bauer
2026-07-26 18:45:33 +02:00
parent 4420b81117
commit fd3f8e45dc
12 changed files with 932 additions and 1063 deletions

View File

@@ -47,7 +47,7 @@ impl App {
.color(muted_text()),
]
.spacing(5),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
container(text(stats.phase.label()).size(12).color(phase_color))
.padding([7, 11])
.style(move |_| status_badge_style(phase_color)),
@@ -109,7 +109,7 @@ impl App {
text("Decode")
.size(12)
.color(Color::from_rgb8(84, 170, 255)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!("{:.1} tok/s", stats.decode_tokens_per_second))
.size(12)
.color(muted_text()),
@@ -123,7 +123,7 @@ impl App {
text("Prefill")
.size(12)
.color(Color::from_rgb8(157, 119, 255)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!("{:.1} tok/s", stats.prefill_tokens_per_second))
.size(12)
.color(muted_text()),
@@ -142,7 +142,7 @@ impl App {
),
row![
text(format!("{} requests", format_count(stats.http_requests))).size(12),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!(
"{} errors · {} streaming",
stats.http_errors, stats.http_streaming_requests
@@ -171,7 +171,7 @@ impl App {
})
.size(12)
.color(Color::from_rgb8(67, 194, 203)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format_rate(latest.kv_read_bytes_per_second))
.size(12)
.color(muted_text()),
@@ -189,7 +189,7 @@ impl App {
})
.size(12)
.color(Color::from_rgb8(240, 180, 70)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format_rate(latest.kv_write_bytes_per_second))
.size(12)
.color(muted_text()),
@@ -210,7 +210,7 @@ impl App {
text("Selected loads")
.size(12)
.color(Color::from_rgb8(240, 180, 70)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!("{:.1}/s", latest.ssd_requests_per_second))
.size(12)
.color(muted_text()),
@@ -224,7 +224,7 @@ impl App {
text("Requested expert data")
.size(12)
.color(Color::from_rgb8(67, 194, 203)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format_rate(latest.ssd_bytes_per_second))
.size(12)
.color(muted_text()),
@@ -238,7 +238,7 @@ impl App {
text("Inference wait")
.size(12)
.color(Color::from_rgb8(220, 80, 86)),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!("{:.0} ms/s", latest.ssd_wait_ms_per_second))
.size(12)
.color(muted_text()),
@@ -443,7 +443,7 @@ impl App {
format_milliseconds(stats.last_kv_write_ms),
),
),
progress_bar(0.0..=1.0, cache_fraction.min(1.0)).height(4),
progress_bar(0.0..=1.0, cache_fraction.min(1.0)).girth(4),
]
.spacing(9)
.into(),
@@ -522,15 +522,16 @@ impl App {
continue;
}
bar = bar.push(
container(Space::new(Length::Fill, Length::Fill))
container(Space::new().width(Length::Fill).height(Length::Fill))
.width(Length::FillPortion(portion(bytes, capacity)))
.style(move |_| chart_bar_style(color)),
);
legend = legend.push(
row![
container(Space::new(9, 9)).style(move |_| chart_bar_style(color)),
container(Space::new().width(9).height(9))
.style(move |_| chart_bar_style(color)),
text(label).size(12).color(muted_text()),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!(
"{} · {:.0}%",
format_bytes(bytes),
@@ -544,7 +545,7 @@ impl App {
}
if total == 0 {
bar = bar.push(
container(Space::new(Length::Fill, Length::Fill))
container(Space::new().width(Length::Fill).height(Length::Fill))
.style(|_| chart_bar_style(muted_text().scale_alpha(0.25))),
);
}
@@ -562,7 +563,7 @@ impl App {
rows = rows.push(
row![
text(label).size(12),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
text(format!(
"{} · {} old",
format_bytes(entry.bytes),
@@ -607,7 +608,7 @@ impl App {
usage.transient_bytes as f32 / usage.budget_bytes.max(1) as f32 * 100.0,
),
),
Space::with_height(2),
Space::new().height(2),
text(if usage.entries.is_empty() {
"No checkpoints stored yet."
} else {
@@ -620,7 +621,7 @@ impl App {
text("Discarding a checkpoint costs one prefill to rebuild it.")
.size(11)
.color(muted_text()),
Space::with_width(Length::Fill),
Space::new().width(Length::Fill),
action_button(text("Clear transient cache").size(12))
.on_press(Message::ClearTransientCache),
]