Display current branch and version on the footer #10

Merged
blek merged 6 commits from display-version into 0.2-dev 2023-10-29 10:48:35 +01:00
2 changed files with 9 additions and 0 deletions
Showing only changes of commit 12614078ad - Show all commits

View File

@ -18,6 +18,7 @@ pub struct Redis {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct VersionData { pub struct VersionData {
pub commit: String, pub commit: String,
pub short_commit: String,
pub branch: String pub branch: String
} }
@ -25,6 +26,7 @@ impl Default for VersionData {
fn default() -> Self { fn default() -> Self {
VersionData { VersionData {
commit: env!("COMMIT_HASH").to_string(), commit: env!("COMMIT_HASH").to_string(),
short_commit: env!("COMMIT_HASH").to_string().chars().take(6).collect(),
branch: env!("COMMIT_BRANCH").to_string() branch: env!("COMMIT_BRANCH").to_string()
} }
} }

View File

@ -67,6 +67,13 @@
<td> <td>
<small>Made with Rust and &lt;3</small> <small>Made with Rust and &lt;3</small>
<small style="display:block">
Version
<a href="https://git.blek.codes/blek/bfile/commit/{{ env.version.commit }}" target="_blank">
{{ env!("CARGO_PKG_VERSION") }} ({{ env.version.branch -}}/{{- env.version.short_commit }})
</a>
</small>
<ul style='margin:10px 0'> <ul style='margin:10px 0'>
<li> <li>
<a href="https://git.blek.codes/blek/bfile"> <a href="https://git.blek.codes/blek/bfile">