Port worker page to Page

This commit is contained in:
Joscha 2024-05-13 15:00:34 +02:00
parent a931f00df3
commit eb1e82dae6

View file

@ -12,11 +12,7 @@ use crate::{
config::ServerConfig,
server::{
util,
web::{
base::{Base, Tab},
components,
paths::PathWorkerByName,
},
web::{components, page::Page, paths::PathWorkerByName},
workers::Workers,
},
shared::WorkerStatus,
@ -61,15 +57,11 @@ pub async fn get_worker_by_name(
return Ok(StatusCode::NOT_FOUND.into_response());
};
let base = Base::new(config, Tab::None);
let status = status(config, &info.status, &db).await?;
Ok(base
.html(
&path.name,
html! {},
html! {
let html = Page::new(config)
.title(&path.name)
.body(html! {
h2 { "Worker" }
div .commit-like .worker {
span .title { "worker " (path.name) }
@ -96,7 +88,8 @@ pub async fn get_worker_by_name(
}
}
}
},
)
.into_response())
})
.build();
Ok(html.into_response())
}