aboutsummaryrefslogtreecommitdiff
path: root/src/webui_ws.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/webui_ws.rs')
-rw-r--r--src/webui_ws.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/webui_ws.rs b/src/webui_ws.rs
index a1fd348..bfa18b0 100644
--- a/src/webui_ws.rs
+++ b/src/webui_ws.rs
@@ -15,6 +15,11 @@ use tokio::sync::RwLock;
#[derive(Debug, Serialize)]
#[serde(tag = "t", rename_all = "snake_case")]
pub enum WebuiEvent {
+ Counters {
+ queue: usize,
+ loading: usize,
+ complete: usize,
+ },
UpdateWorker {
id: WorkerID,
html: String,
@@ -88,6 +93,11 @@ impl State {
key: key.to_owned(),
html: webui::Task { class, data, key }.to_string(),
}));
+ let _ = self.webui_broadcast.send(Arc::new(WebuiEvent::Counters {
+ queue: self.queue.len(),
+ loading: self.loading.len(),
+ complete: self.complete.len(),
+ }));
}
}
pub fn send_webui_worker_removal(&self, id: WorkerID) {