From 37b34aac37e35f31ec7c76beb464c9e60a4e1120 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 13 May 2024 00:35:10 +0200 Subject: [PATCH] Port graph page to Page --- src/server/web/pages/graph.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/server/web/pages/graph.rs b/src/server/web/pages/graph.rs index 7c07886..d94e6bf 100644 --- a/src/server/web/pages/graph.rs +++ b/src/server/web/pages/graph.rs @@ -12,7 +12,7 @@ use crate::{ server::{ util, web::{ - base::{Base, Tab}, + page::{Page, Tab}, paths::{PathGraph, PathGraphCommits, PathGraphMeasurements, PathGraphMetrics}, r#static::{GRAPH_JS, UPLOT_CSS}, server_config_ext::ServerConfigExt, @@ -25,22 +25,23 @@ pub async fn get_graph( _path: PathGraph, State(config): State<&'static ServerConfig>, ) -> somehow::Result { - let base = Base::new(config, Tab::Graph); - - Ok(base.html( - "graph", - html! { + let html = Page::new(config) + .title("graph") + .nav(Tab::Graph) + .head(html! { link rel="stylesheet" href=(config.path(UPLOT_CSS)); script type="module" src=(config.path(GRAPH_JS)) {} - }, - html! { + }) + .body(html! { h2 { "Graph" } div .graph-container { div #plot {} div #metrics .metrics-list { "Loading metrics..." } } - }, - )) + }) + .build(); + + Ok(html) } #[derive(Serialize)]