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