diff options
author | metamuffin <metamuffin@disroot.org> | 2025-05-18 14:32:55 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-05-18 14:32:55 +0200 |
commit | 439f184ac655eb649f056cdf0b9326dcc0af4648 (patch) | |
tree | 76746359bbfc760fd4a8d52b3c69c6759b699ad9 /src/api.rs | |
parent | 0669d3871297abae36f0456e0d0042bf861afce8 (diff) | |
download | isda-439f184ac655eb649f056cdf0b9326dcc0af4648.tar isda-439f184ac655eb649f056cdf0b9326dcc0af4648.tar.bz2 isda-439f184ac655eb649f056cdf0b9326dcc0af4648.tar.zst |
webui ws
Diffstat (limited to 'src/api.rs')
-rw-r--r-- | src/api.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api.rs b/src/api.rs new file mode 100644 index 0000000..4fd3888 --- /dev/null +++ b/src/api.rs @@ -0,0 +1,14 @@ +use crate::State; +use axum::{Json, extract::State as S}; +use std::{collections::HashSet, sync::Arc}; +use tokio::sync::RwLock; + +pub async fn api_queue_json(S(state): S<Arc<RwLock<State>>>) -> Json<HashSet<String>> { + Json(state.read().await.queue.clone()) +} +pub async fn api_loading_json(S(state): S<Arc<RwLock<State>>>) -> Json<HashSet<String>> { + Json(state.read().await.loading.clone()) +} +pub async fn api_complete_json(S(state): S<Arc<RwLock<State>>>) -> Json<HashSet<String>> { + Json(state.read().await.complete.clone()) +} |