From 44b68a8b71f2c6293ee2581489fb4afb744f1608 Mon Sep 17 00:00:00 2001 From: glyph Date: Tue, 18 Jan 2022 12:49:47 +0200 Subject: [PATCH] register scuttlebutt status routes and pass standalone var to home template --- peach-web/src/routes/index.rs | 3 +++ peach-web/src/routes/status/mod.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/peach-web/src/routes/index.rs b/peach-web/src/routes/index.rs index 87d3d4f..54867b7 100644 --- a/peach-web/src/routes/index.rs +++ b/peach-web/src/routes/index.rs @@ -2,6 +2,7 @@ use rocket::{get, request::FlashMessage}; use rocket_dyn_templates::{tera::Context, Template}; use crate::routes::authentication::Authenticated; +use crate::STANDALONE_MODE; // HELPERS AND ROUTES FOR / (HOME PAGE) @@ -11,6 +12,8 @@ pub fn home(_auth: Authenticated) -> Template { context.insert("flash_name", &None::<()>); context.insert("flash_msg", &None::<()>); context.insert("title", &None::<()>); + // pass in mode so we can define appropriate urls in template + context.insert("standalone_mode", &*STANDALONE_MODE); Template::render("home", &context.into_json()) } diff --git a/peach-web/src/routes/status/mod.rs b/peach-web/src/routes/status/mod.rs index 803899a..a2e0f54 100644 --- a/peach-web/src/routes/status/mod.rs +++ b/peach-web/src/routes/status/mod.rs @@ -1,2 +1,3 @@ pub mod device; pub mod network; +pub mod scuttlebutt;