mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
more queue stuff
This commit is contained in:
parent
14ad4e1011
commit
4643483d70
15 changed files with 126 additions and 42 deletions
|
|
@ -51,6 +51,7 @@ async fn get_style_css() -> Response {
|
|||
#[derive(Serialize)]
|
||||
struct Data {
|
||||
connections: Vec<Connection>,
|
||||
queues: Vec<Queue>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
|
@ -66,6 +67,13 @@ struct Channel {
|
|||
number: u16,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct Queue {
|
||||
id: String,
|
||||
name: String,
|
||||
durable: bool,
|
||||
}
|
||||
|
||||
async fn get_data(global_data: GlobalData) -> impl IntoResponse {
|
||||
let global_data = global_data.lock();
|
||||
|
||||
|
|
@ -92,7 +100,20 @@ async fn get_data(global_data: GlobalData) -> impl IntoResponse {
|
|||
})
|
||||
.collect();
|
||||
|
||||
let data = Data { connections };
|
||||
let queues = global_data
|
||||
.queues
|
||||
.values()
|
||||
.map(|queue| Queue {
|
||||
id: queue.id.to_string(),
|
||||
name: queue.name.to_string(),
|
||||
durable: queue.durable,
|
||||
})
|
||||
.collect();
|
||||
|
||||
let data = Data {
|
||||
connections,
|
||||
queues,
|
||||
};
|
||||
|
||||
Json(data)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue