diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-05-28 13:50:57 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2017-05-28 13:50:57 -0400 |
commit | a2395baef35d3daedb66268d6e7bbcdad7b4cbe9 (patch) | |
tree | 445794b23e21040b49cbb0a25341e5a9a28372a9 /src/render/mod.rs | |
parent | 5545fc8938f7e609c45d8dfef346ba50d7c681f9 (diff) |
unit_status: Render as html.
Diffstat (limited to 'src/render/mod.rs')
-rw-r--r-- | src/render/mod.rs | 12 |
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 + } + }) +} |