summaryrefslogtreecommitdiff
path: root/client/src/download.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-18 00:57:22 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-18 00:57:22 +0100
commit6703f1c56605ca7dca8f7fe87b79badb764bd461 (patch)
treee2cb0863c3a844b20cfcb6ae1ab987a7f7ab0a6a /client/src/download.rs
parentf5ffcaf01b91daf0019dd6534b035398fa51f2f0 (diff)
downloadweareserver-6703f1c56605ca7dca8f7fe87b79badb764bd461.tar
weareserver-6703f1c56605ca7dca8f7fe87b79badb764bd461.tar.bz2
weareserver-6703f1c56605ca7dca8f7fe87b79badb764bd461.tar.zst
profiler interface
Diffstat (limited to 'client/src/download.rs')
-rw-r--r--client/src/download.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/client/src/download.rs b/client/src/download.rs
index bcdd80e..4e2f0aa 100644
--- a/client/src/download.rs
+++ b/client/src/download.rs
@@ -16,6 +16,7 @@
*/
use crate::network::Network;
use anyhow::Result;
+use egui::{Grid, Widget};
use log::debug;
use std::{collections::HashSet, marker::PhantomData, sync::RwLock};
use weareshared::{
@@ -100,3 +101,23 @@ impl Downloader {
Ok(())
}
}
+
+impl Widget for &Downloader {
+ fn ui(self, ui: &mut egui::Ui) -> egui::Response {
+ let state = self.inner.read().unwrap();
+ Grid::new("dl")
+ .num_columns(2)
+ .show(ui, |ui| {
+ ui.label("Need");
+ ui.label(state.need.len().to_string());
+ ui.end_row();
+ ui.label("Pending");
+ ui.label(state.pending.len().to_string());
+ ui.end_row();
+ ui.label("Have");
+ ui.label(state.have.len().to_string());
+ ui.end_row();
+ })
+ .response
+ }
+}