timestamp html and css improvements

Each time stamp has an ID that can be linked to. Currently, there's no
mechanism for getting the fragment. A solution could be to wrap the
timestamp in an anchor.
This commit is contained in:
Reynir Björnsson 2020-12-09 11:39:39 +01:00
parent eb039308ec
commit 774074be63

View file

@ -23,7 +23,11 @@ let layout ~title:title_ body_ =
(head (title (txt title_)) (head (title (txt title_))
[style ~a:[a_mime_type "text/css"] [style ~a:[a_mime_type "text/css"]
[ [
txt ".output-ts { white-space: nowrap; }"; txt ".output-ts {\
white-space: nowrap;\
cursor: pointer;\
user-select: none;\
}";
txt ".output-code { overflow: visible; }" txt ".output-code { overflow: visible; }"
]]) ]])
(body body_) (body body_)
@ -75,12 +79,16 @@ let job_run
[ h1 [txtf "Job build %s %a" name ptime_pp start]; [ h1 [txtf "Job build %s %a" name ptime_pp start];
p [txtf "Build took %a." Ptime.Span.pp delta ]; p [txtf "Build took %a." Ptime.Span.pp delta ];
p [txtf "Execution result: %a." Builder.pp_execution_result result]; p [txtf "Execution result: %a." Builder.pp_execution_result result];
table (List.concat_map (fun (ts, line) -> table
[tr [ (List.mapi (fun idx (ts, line) ->
td ~a:[a_class ["output-ts"]] tr [
[txtf "%d ms" (Duration.to_ms (Int64.of_int ts))]; td ~a:[
a_class ["output-ts"];
a_id ("L" ^ string_of_int idx);
]
[txtf "%#d ms" (Duration.to_ms (Int64.of_int ts))];
td ~a:[a_class ["output-code"]] td ~a:[a_class ["output-code"]]
[code [txt line]]; [code [txt line]];
]]) ])
(List.rev out)); (List.rev out));
] ]