added analytics page

This commit is contained in:
2026-04-04 13:04:26 +02:00
parent 5f58664b6d
commit a82b6da9ca
6 changed files with 454 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ use tera::Tera;
mod handlers;
use handlers::home_handler;
use crate::handlers::report_details_handler;
use crate::handlers::{analytics_handler, report_details_handler};
lazy_static! {
pub static ref TEMPLATES: Tera = {
@@ -17,6 +17,10 @@ lazy_static! {
("_base.css", include_str!("../templates/_base.css")),
("index.html", include_str!("../templates/homepage.html")),
("details.html", include_str!("../templates/details.html")),
(
"analytics.html",
include_str!("../templates/analytics.html"),
),
])
.unwrap();
tera
@@ -58,6 +62,7 @@ async fn main() -> anyhow::Result<()> {
let app = Router::new()
.route("/", get(home_handler))
.route("/report/{id}", get(report_details_handler))
.route("/analytics", get(analytics_handler))
.with_state(shared_state);
let addr = if cli.host {