mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 15:03:46 +00:00
- Format all Rust code with cargo fmt - Generate Cargo.lock for security audit - Add build:wasm script to graph-wasm package.json - Update npm/package-lock.json The CI was failing due to: 1. Rust code formatting check failures 2. Missing Cargo.lock file for cargo audit 3. Missing build:wasm script expected by graph-ci.yml workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
56 lines
1.6 KiB
Rust
56 lines
1.6 KiB
Rust
// ! Progress tracking for CLI operations
|
|
|
|
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
|
|
use std::time::Duration;
|
|
|
|
/// Progress tracker for long-running operations
|
|
pub struct ProgressTracker {
|
|
multi: MultiProgress,
|
|
}
|
|
|
|
impl ProgressTracker {
|
|
/// Create a new progress tracker
|
|
pub fn new() -> Self {
|
|
Self {
|
|
multi: MultiProgress::new(),
|
|
}
|
|
}
|
|
|
|
/// Create a progress bar for an operation
|
|
pub fn create_bar(&self, total: u64, message: &str) -> ProgressBar {
|
|
let pb = self.multi.add(ProgressBar::new(total));
|
|
pb.set_style(
|
|
ProgressStyle::default_bar()
|
|
.template("{msg}\n{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {pos}/{len} ({eta})")
|
|
.unwrap()
|
|
.progress_chars("#>-")
|
|
);
|
|
pb.set_message(message.to_string());
|
|
pb.enable_steady_tick(Duration::from_millis(100));
|
|
pb
|
|
}
|
|
|
|
/// Create a spinner for indeterminate operations
|
|
pub fn create_spinner(&self, message: &str) -> ProgressBar {
|
|
let pb = self.multi.add(ProgressBar::new_spinner());
|
|
pb.set_style(
|
|
ProgressStyle::default_spinner()
|
|
.template("{spinner:.green} {msg}")
|
|
.unwrap(),
|
|
);
|
|
pb.set_message(message.to_string());
|
|
pb.enable_steady_tick(Duration::from_millis(100));
|
|
pb
|
|
}
|
|
|
|
/// Finish all progress bars
|
|
pub fn finish_all(&self) {
|
|
// Progress bars auto-finish when dropped
|
|
}
|
|
}
|
|
|
|
impl Default for ProgressTracker {
|
|
fn default() -> Self {
|
|
Self::new()
|
|
}
|
|
}
|