File tree Expand file tree Collapse file tree 4 files changed +32
-23
lines changed Expand file tree Collapse file tree 4 files changed +32
-23
lines changed Original file line number Diff line number Diff line change 11<script setup lang="tsx">
22import {h , ref , Ref } from " vue" ;
33import {parseISO , differenceInHours } from " date-fns" ;
4- import {formatISODate , shortenTag } from " ../../utils/formatting" ;
5- import {CollectorConfig , BenchmarkJobStatus , isJobComplete } from " ./data" ;
4+ import {formatISODate } from " ../../utils/formatting" ;
5+ import {
6+ CollectorConfig ,
7+ BenchmarkJobStatus ,
8+ isJobComplete ,
9+ BenchmarkJob ,
10+ } from " ./data" ;
11+ import CommitSha from " ./commit-sha.vue" ;
612
713const props = defineProps <{
814 collector: CollectorConfig ;
@@ -163,6 +169,7 @@ function toggleShowJobs() {
163169 <tr v-if =" ACTIVE_FILTERS[job.status]" >
164170 <td class =" table-cell-padding" >
165171 {{ shortenTag(job.requestTag) }}
172+ <CommitSha :tag =" job.requestTag" ></CommitSha >
166173 </td >
167174 <td class =" table-cell-padding" >
168175 {{ formatJobStatus(job.status) }}
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import {computed } from " vue" ;
3+
4+ const props = defineProps <{
5+ tag: string ;
6+ }>();
7+
8+ const looksLikeSha = computed (() => props .tag .length === 40 );
9+ </script >
10+
11+ <template >
12+ <a
13+ v-if =" looksLikeSha"
14+ :href =" 'https://github.com/rust-lang/rust/commit/' + tag"
15+ >
16+ {{ tag.substring(0, 13) }}
17+ </a >
18+ <template v-else >
19+ {{ tag }}
20+ </template >
21+ </template >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 StatusResponse ,
1515} from " ./data" ;
1616import Collector from " ./collector.vue" ;
17+ import CommitSha from " ./commit-sha.vue" ;
1718
1819const loading = ref (true );
1920
@@ -116,18 +117,6 @@ function PullRequestLink({request}: {request: BenchmarkRequest}) {
116117 );
117118}
118119
119- function CommitSha({request }: {request: BenchmarkRequest }): string {
120- if (request .requestType === " Release" ) {
121- return request .tag ;
122- }
123- const sha = request .tag ;
124- return (
125- <a href = { ` https://github.com/rust-lang/rust/commit/${sha } ` } >
126- { sha .substring (0 , 13 )}
127- </a >
128- );
129- }
130-
131120function RequestProgress({
132121 request ,
133122 collectors ,
@@ -197,7 +186,7 @@ loadStatusData(loading);
197186 <tr :class =" getRequestRowClassName(req)" >
198187 <td ><PullRequestLink :request =" req" /></td >
199188 <td >{{ req.requestType }}</td >
200- <td ><CommitSha :request =" req" / ></td >
189+ <td ><CommitSha :tag =" req.tag " ></ CommitSha ></td >
201190 <td >
202191 {{ formatStatus(req.status)
203192 }}{{
Original file line number Diff line number Diff line change @@ -27,11 +27,3 @@ export function formatISODate(dateString?: string): string {
2727 }
2828 return "" ;
2929}
30-
31- // Shorten a tag, only commit shas will be truncated
32- export function shortenTag ( tag : string ) : string {
33- if ( tag . length < 40 ) {
34- return tag ;
35- }
36- return tag . slice ( 0 , 12 ) ;
37- }
You can’t perform that action at this time.
0 commit comments