From 62869da98970d50bd9ada870476c0762a8f19744 Mon Sep 17 00:00:00 2001 From: blek Date: Sun, 29 Oct 2023 19:44:31 +1000 Subject: [PATCH] print version at the footer --- filed/src/env.rs | 2 ++ filed/templates/base.html | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/filed/src/env.rs b/filed/src/env.rs index 4f43568..46aac2e 100644 --- a/filed/src/env.rs +++ b/filed/src/env.rs @@ -18,6 +18,7 @@ pub struct Redis { #[derive(Debug, Clone)] pub struct VersionData { pub commit: String, + pub short_commit: String, pub branch: String } @@ -25,6 +26,7 @@ impl Default for VersionData { fn default() -> Self { VersionData { commit: env!("COMMIT_HASH").to_string(), + short_commit: env!("COMMIT_HASH").to_string().chars().take(6).collect(), branch: env!("COMMIT_BRANCH").to_string() } } diff --git a/filed/templates/base.html b/filed/templates/base.html index 761bbb5..4e23bf8 100644 --- a/filed/templates/base.html +++ b/filed/templates/base.html @@ -66,6 +66,13 @@ Made with Rust and <3 + + + Version + + {{ env!("CARGO_PKG_VERSION") }} ({{ env.version.branch -}}/{{- env.version.short_commit }}) + +