From 8e5c29ca6d33d395942ce87516bc7c28a4644fda Mon Sep 17 00:00:00 2001 From: glyph Date: Thu, 27 Jan 2022 10:55:44 +0200 Subject: [PATCH] add sbot stats to home template and set inner circle colour accordingly --- peach-web/src/routes/index.rs | 5 +++++ peach-web/templates/home.html.tera | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/peach-web/src/routes/index.rs b/peach-web/src/routes/index.rs index a703ed1..8b40d53 100644 --- a/peach-web/src/routes/index.rs +++ b/peach-web/src/routes/index.rs @@ -1,3 +1,4 @@ +use peach_stats::sbot; use rocket::{get, request::FlashMessage, State}; use rocket_dyn_templates::{tera::Context, Template}; @@ -8,7 +9,11 @@ use crate::RocketConfig; #[get("/")] pub fn home(_auth: Authenticated, config: &State) -> Template { + // retrieve go-sbot systemd process stats + let sbot_stats = sbot::sbot_stats().ok(); + let mut context = Context::new(); + context.insert("sbot_stats", &sbot_stats); context.insert("flash_name", &None::<()>); context.insert("flash_msg", &None::<()>); context.insert("title", &None::<()>); diff --git a/peach-web/templates/home.html.tera b/peach-web/templates/home.html.tera index 5d16781..fe0e298 100644 --- a/peach-web/templates/home.html.tera +++ b/peach-web/templates/home.html.tera @@ -25,7 +25,7 @@ -
+