show version data on frontpage
This commit is contained in:
parent
2ddca1dd6d
commit
56409d9922
|
@ -54,6 +54,12 @@ mod templates {
|
||||||
pub commit: String,
|
pub commit: String,
|
||||||
pub version: String,
|
pub version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
pub struct Index {
|
||||||
|
pub commit: String,
|
||||||
|
pub version: String,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct StaticDir(String);
|
struct StaticDir(String);
|
||||||
|
@ -447,9 +453,12 @@ fn lookup(
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
fn root() -> Template {
|
fn root() -> Template {
|
||||||
use std::collections::HashMap;
|
let context = templates::Index {
|
||||||
|
version: env!("VERGEN_SEMVER").to_string(),
|
||||||
|
commit: env!("VERGEN_SHA_SHORT").to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
Template::render("index", HashMap::<String, String>::default())
|
Template::render("index", context)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn serve(opt: &Opt, db: Polymorphic) -> Result<()> {
|
pub fn serve(opt: &Opt, db: Polymorphic) -> Result<()> {
|
||||||
|
|
Loading…
Reference in New Issue