Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
feat: show result of latest run on front page
Lars Wirzenius committed 2 years ago
commit ed9df5a86efd3bf8b71eb2fd32c509550dd1fb1e
parent f9196a2c9a48af60740b93d43d6e64499418abe5
1 file changed +18 -1
modified src/pages.rs
@@ -23,7 +23,7 @@ use radicle::prelude::RepoId;

use crate::{
    event::BrokerEvent,
-
    msg::RunId,
+
    msg::{RunId, RunResult},
    run::{Run, RunState, Whence},
};

@@ -193,6 +193,23 @@ impl PageData {
                        .with_attribute("class", &state)
                        .with_text(&state),
                );
+

+
                let result = match run.result() {
+
                    None => Element::new(Tag::Span)
+
                        .with_text(" ")
+
                        .with_class("unknown")
+
                        .with_text("unknown result"),
+
                    Some(RunResult::Success) => Element::new(Tag::Span)
+
                        .with_text(" ")
+
                        .with_class("success")
+
                        .with_text("success"),
+
                    Some(_) => Element::new(Tag::Span)
+
                        .with_text(" ")
+
                        .with_class("failure")
+
                        .with_text("failure"),
+
                };
+

+
                item.push_child(&result);
            }

            list.push_child(&item);