TUI: VRAM-tila värikoodattu (vihreä=100% GPU, keltainen=osittainen, punainen=CPU)
This commit is contained in:
Binary file not shown.
@@ -198,12 +198,38 @@ fn ui(f: &mut ratatui::Frame, st: &DashboardState) {
|
|||||||
].as_ref())
|
].as_ref())
|
||||||
.split(body_chunks[0]);
|
.split(body_chunks[0]);
|
||||||
|
|
||||||
// Vasen paneeli: Laitteisto, Malli & Verkosto
|
// Vasen paneeli: Laitteisto, Malli & Verkosto — VRAM-rivi värikoodattu
|
||||||
let info_text = format!(
|
let vram_color = if st.vram_status.starts_with('✓') {
|
||||||
"🚀 Malli: {}\n🎮 VRAM: {}\n💻 Järjestelmä: {}\n📊 Tehdyt: {} | Nopeus: {} t/s\n🌐 Verkosto: {} solmua | {} tehtävää",
|
Color::Green
|
||||||
st.model_name, st.vram_status, st.sys_info, st.tasks_completed, st.last_tokens_sec, st.network_active_nodes, st.network_total_tasks
|
} else if st.vram_status.starts_with('◐') {
|
||||||
);
|
Color::Yellow
|
||||||
let left_panel = Paragraph::new(info_text)
|
} else if st.vram_status.starts_with('✗') {
|
||||||
|
Color::Red
|
||||||
|
} else {
|
||||||
|
Color::DarkGray
|
||||||
|
};
|
||||||
|
|
||||||
|
let info_lines = vec![
|
||||||
|
ratatui::text::Line::from(vec![
|
||||||
|
ratatui::text::Span::raw("🚀 Malli: "),
|
||||||
|
ratatui::text::Span::styled(&st.model_name, Style::default().fg(Color::Cyan).add_modifier(Modifier::BOLD)),
|
||||||
|
]),
|
||||||
|
ratatui::text::Line::from(vec![
|
||||||
|
ratatui::text::Span::raw("🎮 VRAM: "),
|
||||||
|
ratatui::text::Span::styled(&st.vram_status, Style::default().fg(vram_color)),
|
||||||
|
]),
|
||||||
|
ratatui::text::Line::from(vec![
|
||||||
|
ratatui::text::Span::raw("💻 Järjestelmä: "),
|
||||||
|
ratatui::text::Span::styled(&st.sys_info, Style::default().fg(Color::White)),
|
||||||
|
]),
|
||||||
|
ratatui::text::Line::from(format!(
|
||||||
|
"📊 Tehdyt: {} | Nopeus: {:.1} t/s", st.tasks_completed, st.last_tokens_sec
|
||||||
|
)),
|
||||||
|
ratatui::text::Line::from(format!(
|
||||||
|
"🌐 Verkosto: {} solmua | {} tehtävää", st.network_active_nodes, st.network_total_tasks
|
||||||
|
)),
|
||||||
|
];
|
||||||
|
let left_panel = Paragraph::new(info_lines)
|
||||||
.block(Block::default().title(" Laitteisto ja AI ").borders(Borders::ALL))
|
.block(Block::default().title(" Laitteisto ja AI ").borders(Borders::ALL))
|
||||||
.style(Style::default().fg(Color::White))
|
.style(Style::default().fg(Color::White))
|
||||||
.wrap(Wrap { trim: true });
|
.wrap(Wrap { trim: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user