@@ -4,6 +4,7 @@ import {ref, Ref} from "vue";
44import {getJson } from " ../../utils/requests" ;
55import {STATUS_DATA_NEW_URL } from " ../../urls" ;
66import {withLoading } from " ../../utils/loading" ;
7+ import {formatDuration } from " ../../utils/formatting" ;
78import {
89 StatusResponse ,
910 CollectorJobMap ,
@@ -28,33 +29,11 @@ const dataNew: Ref<
2829 (StatusResponse & {collectorJobMap: CollectorJobMap }) | null
2930> = ref (null );
3031
31- function PullRequestLink({ request } : {request : BenchmarkRequestType }) {
32- if (request .type === ReleaseCommit ) {
32+ function pullRequestUrlAsHtml( reqType : BenchmarkRequestType ) : string {
33+ if (reqType .type === ReleaseCommit ) {
3334 return " " ;
3435 }
35- return (
36- <a href = { ` https://github.com/rust-lang/rust/pull/${request .pr } ` } >
37- #{ request .pr }
38- </a >
39- );
40- }
41-
42- function formatDuration(milliseconds : number ): string {
43- let seconds = milliseconds / 1000 ;
44- let secs = seconds % 60 ;
45- let mins = Math .trunc (seconds / 60 );
46- let hours = Math .trunc (mins / 60 );
47- mins -= hours * 60 ;
48-
49- let s = " " ;
50- if (hours > 0 ) {
51- s = ` ${hours }h ${mins < 10 ? " 0" + mins : mins }m ${
52- secs < 10 ? " 0" + secs : secs
53- }s ` ;
54- } else {
55- s = ` ${mins < 10 ? " " + mins : mins }m ${secs < 10 ? " 0" + secs : secs }s ` ;
56- }
57- return s ;
36+ return ` <a href="https://github.com/rust-lang/rust/pull/${reqType .pr }">#${reqType .pr }</a> ` ;
5837}
5938
6039loadStatusNew (loading );
@@ -81,13 +60,15 @@ loadStatusNew(loading);
8160 <tbody >
8261 <template v-for =" req in dataNew .completed " >
8362 <tr >
84- <td >< PullRequestLink :request = " req.requestType" / ></td >
63+ <td v-html = " pullRequestUrlAsHtml( req.requestType) " ></td >
8564 <td >{{ req.requestType.type }}</td >
8665 <td >{{ req.requestType.tag }}</td >
8766 <td >{{ req.status.state }}</td >
8867 <td >{{ req.status.completedAt }}</td >
8968 <td v-html =" formatDuration(req.status.duration)" ></td >
90- <td >{{ req.errors.join("\n") }}</td >
69+ <td >
70+ <pre >{{ req.errors.join("\n") }}</pre >
71+ </td >
9172 </tr >
9273 </template >
9374 </tbody >
@@ -107,7 +88,7 @@ loadStatusNew(loading);
10788 <tbody >
10889 <template v-for =" req in dataNew .queue " >
10990 <tr >
110- <td >< PullRequestLink :request = " req.requestType" / ></td >
91+ <td v-html = " pullRequestUrlAsHtml( req.requestType) " ></td >
11192 <td >{{ req.requestType.type }}</td >
11293 <td >{{ req.requestType.tag }}</td >
11394 <td >{{ req.status.state }}</td >
0 commit comments