Add graph tab
This commit is contained in:
parent
9caf664b10
commit
b0eb94a02a
7 changed files with 56 additions and 1 deletions
30
src/server/web/pages/graph.rs
Normal file
30
src/server/web/pages/graph.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use askama::Template;
|
||||
use axum::{extract::State, response::IntoResponse};
|
||||
|
||||
use crate::{
|
||||
config::Config,
|
||||
server::web::{
|
||||
base::{Base, Link, Tab},
|
||||
paths::PathGraph,
|
||||
r#static::GRAPH_JS,
|
||||
},
|
||||
somehow,
|
||||
};
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "pages/graph.html")]
|
||||
struct Page {
|
||||
link_graph_js: Link,
|
||||
base: Base,
|
||||
}
|
||||
|
||||
pub async fn get_graph(
|
||||
_path: PathGraph,
|
||||
State(config): State<&'static Config>,
|
||||
) -> somehow::Result<impl IntoResponse> {
|
||||
let base = Base::new(config, Tab::Graph);
|
||||
Ok(Page {
|
||||
link_graph_js: base.link(GRAPH_JS),
|
||||
base,
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue