summaryrefslogtreecommitdiff
path: root/src/render/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/mod.rs')
-rw-r--r--src/render/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/render/mod.rs b/src/render/mod.rs
index f7ad1d1..75fd9b5 100644
--- a/src/render/mod.rs
+++ b/src/render/mod.rs
@@ -9,7 +9,7 @@ fn render_in_page<'a>(content: Box<RenderBox + 'a>) -> String {
html {
head {
title: "Systemhttpd";
- link(rel="stylesheet", type="text/css", href="static/main.css");
+ link(rel="stylesheet", type="text/css", href="/static/main.css");
}
body {
: content
@@ -65,3 +65,13 @@ pub fn system_status(sections: &[(String, Vec<&unit::Unit>)]) -> String {
};
render_in_page(b)
}
+
+pub fn unit_status(unit: &unit::Unit, log: &str) -> String {
+ render_in_page(box_html! {
+ h1 { :&unit.name }
+ p { : format_args!("{} ({})", &unit.active_state, &unit.sub_state) }
+ pre {
+ : log
+ }
+ })
+}