diff --git a/src/web/assets/style.css b/src/web/assets/style.css index 2fd072c..946f19a 100644 --- a/src/web/assets/style.css +++ b/src/web/assets/style.css @@ -72,6 +72,10 @@ nav a { margin-right: 16px; } +.account .version { + font-size: 0.875em; +} + main { max-width: 960px; margin: 0 auto; diff --git a/src/web/page.rs b/src/web/page.rs index f33d9de..5ea240a 100644 --- a/src/web/page.rs +++ b/src/web/page.rs @@ -13,6 +13,9 @@ use crate::detail::{Column, Detail, Section}; use crate::ops::printable; use crate::queue::{Decision, PendingInfo}; +/// The broker's version, which signed-in pages show. +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); + /// HTML escaping, after replacing what [`printable`] replaces. #[derive(Debug, Clone, Copy)] pub struct Printable; @@ -300,5 +303,6 @@ mod tests { assert!(html.contains("
Command
uptime
"), "{html}"); assert!(html.contains("+a"), "{html}"); assert!(html.contains("Details (Text)") && html.contains("
Old: text
"), "{html}"); + assert!(html.contains(&format!("slop-broker {VERSION}")), "{html}"); } } diff --git a/templates/base.html b/templates/base.html index d6bc518..10376a7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -14,6 +14,7 @@
+slop-broker {{ crate::web::page::VERSION }} {{ name }}