Add result tooltip, spacing

A tooltip will be displayed when hovering the cursor over the build
status check mark.
This commit is contained in:
Reynir Björnsson 2020-12-07 16:45:19 +01:00
parent 355835df5e
commit e8aa906c00

View file

@ -1,14 +1,21 @@
open Tyxml.Html open Tyxml.Html
let txtf fmt = Fmt.kstrf txt fmt let txtf fmt = Fmt.kstrf txt fmt
let a_titlef fmt = Fmt.kstrf a_title fmt
let check_icon check = let check_icon result =
if check match result with
then | Builder.Exited 0 ->
span ~a:[a_style "color: green;"] span ~a:[
a_style "color: green;";
a_titlef "%a" Builder.pp_execution_result result;
]
[txt ""] [txt ""]
else | _ ->
span ~a:[a_style "color: red;"] span ~a:[
a_style "color: red;";
a_titlef "%a" Builder.pp_execution_result result;
]
[txt ""] [txt ""]
let layout ~title:title_ body_ = let layout ~title:title_ body_ =
@ -44,8 +51,9 @@ let job name runs =
a ~a:[a_href Fpath.(to_string (v "run" / Uuidm.to_string run.Model.uuid) ^ "/")] a ~a:[a_href Fpath.(to_string (v "run" / Uuidm.to_string run.Model.uuid) ^ "/")]
[ [
txtf "%a" (Ptime.pp_human ()) run.Model.start; txtf "%a" (Ptime.pp_human ()) run.Model.start;
check_icon (match run.result with Builder.Exited 0 -> true | _ -> false);
]; ];
txt " ";
check_icon run.result;
]) ])
runs); runs);