summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2017-05-24 08:32:53 -0400
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2017-05-24 08:32:53 -0400
commitcd986ee64cf627ab0d39138e2cb24b115c4032b4 (patch)
treeb0aa9fb743daf906bcb1cb49a78bad2eb032309e /src/main.rs
parent92ab79b327e4b3e7fb8e7b8688b1c63a284ada1c (diff)
unit: Renamed from job.
Improved unit parsing and some refactoring.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 3fe1b7f..ce50828 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -21,8 +21,7 @@ use iron::{Iron, Request, IronResult, Response, Chain};
use router::Router;
use horrorshow::prelude::*;
use horrorshow::Raw;
-use std::process::Command;
-use systemhttp::systemd::job;
+use systemhttp::systemd::unit;
struct Aaa(String);
@@ -38,7 +37,7 @@ impl iron_sessionstorage::Value for Aaa {
}
}
-fn render_message(message: &str, units: &[job::Unit]) -> String {
+fn render_message(message: &str, units: &[unit::Unit]) -> String {
(html!{
: Raw("<!DOCTYPE html>");
html {
@@ -76,14 +75,14 @@ fn hello(r: &mut Request) -> IronResult<Response> {
.find("name")
.unwrap_or("World").to_owned();
- let jobs = job::get_jobs().unwrap();
+ let units = unit::get_units().unwrap();
let res = Ok(Response::with((status::Ok,
Header(ContentType::html()),
render_message(&format!("Hello, {} ({})",
name,
session_value.0),
- &jobs))));
+ &units))));
info!("Updating session value. Current value: {}", session_value.0);
session_value.0.push('a');