Compare commits

..

2 commits

Author SHA1 Message Date
154141a6ed fix(repo): avoid blocking threads when pausing
All checks were successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
2024-08-31 07:27:01 +01:00
9f277199e0 feat(tui): use moving heart emoji as liveness indicator
Some checks failed
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
Rust / build (push) Failing after 7m28s
The heart moves between two positions every second as long as the ui is
being updated.
2024-08-31 07:27:01 +01:00

View file

@ -40,6 +40,15 @@ impl State {
*tick += 1;
}
}
fn beating_heart(&self) -> String {
if self.last_update.duration_since(self.started).as_secs() % 2 == 0 {
"💚 "
} else {
" 💚"
}
.to_string()
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
@ -326,11 +335,8 @@ impl StatefulWidget for &State {
.title(
Title::from(Line::from(vec![
" [q]uit ".into(),
format!(
"{}s ",
self.last_update.duration_since(self.started).as_secs()
)
.into(),
self.beating_heart().into(),
" ".into(),
]))
.alignment(Alignment::Center)
.position(ratatui::widgets::block::Position::Bottom),