Added a check in `BootstrapManager` to detect if PostgreSQL is running and attempt to start the "tables" component automatically if not. Also prefixed unused variables and struct fields with underscores in compiler, session, and model modules to suppress warnings and improve code clarity.
26 lines
627 B
Rust
26 lines
627 B
Rust
use ratatui::{
|
|
style::{Color, Style},
|
|
widgets::{Block, Borders, Gauge},
|
|
};
|
|
|
|
pub struct StreamProgress {
|
|
pub progress: f64,
|
|
pub status: String,
|
|
}
|
|
|
|
pub fn render_progress_bar(progress: &StreamProgress) -> Gauge {
|
|
let color = if progress.progress >= 1.0 {
|
|
Color::Green
|
|
} else {
|
|
Color::Blue
|
|
};
|
|
|
|
Gauge::default()
|
|
.block(
|
|
Block::default()
|
|
.title(format!("Stream Progress: {}", progress.status))
|
|
.borders(Borders::ALL),
|
|
)
|
|
.gauge_style(Style::default().fg(color))
|
|
.percent((progress.progress * 100.0) as u16)
|
|
}
|