register scuttlebutt status routes and pass standalone var to home template
This commit is contained in:
@ -2,6 +2,7 @@ use rocket::{get, request::FlashMessage};
|
|||||||
use rocket_dyn_templates::{tera::Context, Template};
|
use rocket_dyn_templates::{tera::Context, Template};
|
||||||
|
|
||||||
use crate::routes::authentication::Authenticated;
|
use crate::routes::authentication::Authenticated;
|
||||||
|
use crate::STANDALONE_MODE;
|
||||||
|
|
||||||
// HELPERS AND ROUTES FOR / (HOME PAGE)
|
// HELPERS AND ROUTES FOR / (HOME PAGE)
|
||||||
|
|
||||||
@ -11,6 +12,8 @@ pub fn home(_auth: Authenticated) -> Template {
|
|||||||
context.insert("flash_name", &None::<()>);
|
context.insert("flash_name", &None::<()>);
|
||||||
context.insert("flash_msg", &None::<()>);
|
context.insert("flash_msg", &None::<()>);
|
||||||
context.insert("title", &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())
|
Template::render("home", &context.into_json())
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
pub mod device;
|
pub mod device;
|
||||||
pub mod network;
|
pub mod network;
|
||||||
|
pub mod scuttlebutt;
|
||||||
|
Reference in New Issue
Block a user