diff --git a/src/pages/panel/mod.rs b/src/pages/panel/mod.rs index a1679de8..61b0900c 100644 --- a/src/pages/panel/mod.rs +++ b/src/pages/panel/mod.rs @@ -66,6 +66,7 @@ pub mod routes { pub sitekey: Sitekey, pub notifications: &'static str, pub settings: Settings, + pub stats: &'static str, } impl Panel { @@ -75,10 +76,11 @@ pub mod routes { sitekey: Sitekey::new(), notifications: "/notifications", settings: Settings::new(), + stats: "/stats", } } - pub const fn get_sitemap() -> [&'static str; 5] { + pub const fn get_sitemap() -> [&'static str; 6] { const PANEL: Panel = Panel::new(); const S: [&str; 2] = Sitekey::get_sitemap(); @@ -88,6 +90,7 @@ pub mod routes { S[0], S[1], Settings::get_sitemap()[0], + PANEL.stats, ] } } diff --git a/src/pages/sitemap.rs b/src/pages/sitemap.rs index 298ba413..4105ba28 100644 --- a/src/pages/sitemap.rs +++ b/src/pages/sitemap.rs @@ -26,12 +26,19 @@ use crate::PAGES; #[template(path = "sitemap.html")] struct IndexPage { urls: [&'static str; 7], + domain: &'static str, } impl Default for IndexPage { fn default() -> Self { let urls = Routes::get_sitemap(); - Self { urls } + let domain = if crate::SETTINGS.server.domain.ends_with('/') { + &crate::SETTINGS.server.domain[0..crate::SETTINGS.server.domain.len() - 1] + } else { + &crate::SETTINGS.server.domain + }; + + Self { urls, domain } } } diff --git a/src/static_assets/static_files.rs b/src/static_assets/static_files.rs index 0e5fdc49..4ece6973 100644 --- a/src/static_assets/static_files.rs +++ b/src/static_assets/static_files.rs @@ -68,6 +68,10 @@ pub mod assets { FILES.get("./static/cache/img/icon-trans.png").unwrap(), "Logo" ); + pub static ref BAR_CHART: Img = ( + FILES.get("./static/cache/img/svg/bar-chart.svg").unwrap(), + "Statistics" + ); } } diff --git a/static/cache/img/svg/bar-chart.svg b/static/cache/img/svg/bar-chart.svg new file mode 100644 index 00000000..074d7c1a --- /dev/null +++ b/static/cache/img/svg/bar-chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/components/svg.html b/templates/components/svg.html deleted file mode 100644 index 54cd62f1..00000000 --- a/templates/components/svg.html +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/templates/panel/navbar/index.html b/templates/panel/navbar/index.html index 8b6ce4b5..507fd34b 100644 --- a/templates/panel/navbar/index.html +++ b/templates/panel/navbar/index.html @@ -30,7 +30,14 @@ - +