Radish alpha
r
rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE
Radicle CI adapter for native CI
Radicle
Git
feat: add a "last update" time stamp to the report page
Lars Wirzenius committed 2 years ago
commit 30e297a725594983ca3632f284f783f704915b3c
parent ed2678e
1 file changed +9 -0
modified src/report.rs
@@ -5,6 +5,7 @@ use std::{

use html_page::{Document, Element, Tag};
use radicle_ci_broker::msg::RunResult;
+
use time::{macros::format_description, OffsetDateTime};
use walkdir::WalkDir;

use crate::{logfile::LogFile, runinfo::RunInfo};
@@ -115,6 +116,14 @@ fn list_runs(repos: &[&str], run_infos: &[RunInfo]) -> Document {
        doc.push_to_body(&list);
    }

+
    let fmt = format_description!(
+
        "[year]-[month]-[day] [hour]:[minute]:[second] [offset_hour]:[offset_minute]"
+
    );
+
    let now = OffsetDateTime::now_utc().format(fmt).expect("time format");
+

+
    let timestamp = Element::new(Tag::Div).with_text(&format!("Last updated {}.", now));
+
    doc.push_to_body(&timestamp);
+

    doc
}