diff options
Diffstat (limited to 'server/src/routes')
| -rw-r--r-- | server/src/routes/ui/admin/log.rs | 10 | ||||
| -rw-r--r-- | server/src/routes/ui/style/layout.css | 4 | 
2 files changed, 12 insertions, 2 deletions
| diff --git a/server/src/routes/ui/admin/log.rs b/server/src/routes/ui/admin/log.rs index e264e8f..fb09091 100644 --- a/server/src/routes/ui/admin/log.rs +++ b/server/src/routes/ui/admin/log.rs @@ -6,6 +6,7 @@ use crate::{      },      uri,  }; +use chrono::{DateTime, Utc};  use log::Level;  use rocket::get;  use std::{ @@ -29,6 +30,7 @@ pub struct Log {  }  pub struct LogLine { +    time: DateTime<Utc>,      module: Option<&'static str>,      level: Level,      message: String, @@ -45,8 +47,9 @@ pub fn r_admin_log<'a>(_session: AdminSession, warnonly: bool) -> MyResult<DynLa                  @let g = LOGGER.log.read().unwrap();                  table { @for e in if warnonly { g.1.iter() } else { g.0.iter() } {                      tr[class=format!("level-{:?}", e.level).to_ascii_lowercase()] { -                        td { @format_level(e.level) } -                        td { @e.module } +                        td.time { @e.time.to_rfc3339() } +                        td.loglevel  { @format_level(e.level) } +                        td.module { @e.module }                          td { @markup::raw(vt100_to_html(&e.message)) }                      }                  }} @@ -77,7 +80,9 @@ impl Log {      }      fn do_log(&self, record: &log::Record) {          let mut w = self.log.write().unwrap(); +        let time = Utc::now();          w.0.push_back(LogLine { +            time,              module: record.module_path_static(),              level: record.level(),              message: record.args().to_string(), @@ -87,6 +92,7 @@ impl Log {          }          if record.level() <= Level::Warn {              w.1.push_back(LogLine { +                time,                  module: record.module_path_static(),                  level: record.level(),                  message: record.args().to_string(), diff --git a/server/src/routes/ui/style/layout.css b/server/src/routes/ui/style/layout.css index e62e59a..dca6491 100644 --- a/server/src/routes/ui/style/layout.css +++ b/server/src/routes/ui/style/layout.css @@ -72,6 +72,10 @@ nav {  code {      font-family: monospace !important;  } +.log .time, +.log .module { +    color: grey; +}  nav a {      border: 0px solid transparent; | 
