Add base status bar
This commit is contained in:
@ -31,7 +31,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.build(),
|
||||
)
|
||||
// Web configuration routes
|
||||
.route("/static/{tail:.*}", web::get().to(web_ui::static_file))
|
||||
.route("/assets/{tail:.*}", web::get().to(web_ui::static_file))
|
||||
.route("/", web::get().to(web_ui::home))
|
||||
.route("/oidc_cb", web::get().to(web_ui::oidc_cb))
|
||||
.route("/sign_out", web::get().to(web_ui::sign_out))
|
||||
|
@ -29,7 +29,9 @@ pub async fn static_file(path: web::Path<String>) -> HttpResult {
|
||||
|
||||
#[derive(askama::Template)]
|
||||
#[template(path = "index.html")]
|
||||
struct HomeTemplate {}
|
||||
struct HomeTemplate {
|
||||
name: String,
|
||||
}
|
||||
|
||||
/// Main route
|
||||
pub async fn home(session: Session) -> HttpResult {
|
||||
@ -53,7 +55,7 @@ pub async fn home(session: Session) -> HttpResult {
|
||||
|
||||
Ok(HttpResponse::Ok()
|
||||
.insert_header(("content-type", "text/html"))
|
||||
.body(HomeTemplate {}.render().unwrap()))
|
||||
.body(HomeTemplate { name: user.name }.render().unwrap()))
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
|
Reference in New Issue
Block a user