Skip to content

Commit 351c988

Browse files
committed
Better compare toolboxes
1 parent cf1daa1 commit 351c988

File tree

1 file changed

+54
-35
lines changed

1 file changed

+54
-35
lines changed

site/static/compare.html

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#filters {
7070
border: 1px black;
7171
border-style: dotted;
72-
margin: 16px 0px;
72+
margin: 12px 0px;
7373
border-radius: 10px;
7474
}
7575

@@ -141,6 +141,29 @@
141141
visibility: visible;
142142
opacity: 1;
143143
}
144+
145+
.description-box {
146+
border: 1px solid;
147+
display: flex;
148+
}
149+
150+
.description-arrow {
151+
display: flex;
152+
flex-direction: column;
153+
justify-content: center;
154+
background: #8dcc8d;
155+
padding: 5px;
156+
}
157+
158+
#not-continuous {
159+
display: flex;
160+
flex-direction: column;
161+
justify-content: center;
162+
text-align: center;
163+
background: #cc3300;
164+
border: 1px solid;
165+
cursor: help;
166+
}
144167
</style>
145168
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
146169
</head>
@@ -180,6 +203,31 @@ <h1>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
180203
</div>
181204
<input id="submit" type="submit" value="Submit" onclick="submitSettings(); return false;">
182205
</fieldset>
206+
<div v-if="data" style="margin: 12px 0;">
207+
<div style="display: flex;justify-content: center;">
208+
<div class="description-box">
209+
<div class="description-arrow"><a v-if="data.prev" v-bind:href="prevLink">&larr;</a></div>
210+
<div style="padding: 10px;">
211+
<a v-if="data.a.pr" v-bind:href="prLink(data.a.pr)">#{{data.a.pr}}</a>
212+
<span>{{formatDate(data.a.date)}}</span>
213+
(<a v-bind:href="commitLink(data.a.commit)">{{short(data.a)}}</a>)
214+
</div>
215+
</div>
216+
<div v-if="notContinuous" id="not-continuous" title="WARNING! The commits are not continuous.">...
217+
</div>
218+
<div class="description-box">
219+
<div style="padding: 10px;">
220+
<a v-if="data.b.pr" v-bind:href="prLink(data.b.pr)">#{{data.b.pr}}</a>
221+
<span>{{formatDate(data.b.date)}}</span>
222+
(<a v-bind:href="commitLink(data.b.commit)">{{short(data.b)}}</a>)
223+
</div>
224+
<div class="description-arrow"><a v-if="data.next" v-bind:href="nextLink">&rarr;</a></div>
225+
</div>
226+
</div>
227+
<div style="display: flex; justify-content: center;">
228+
<a v-bind:href="compareLink">🔎 compare commits</a>
229+
</div>
230+
</div>
183231
<fieldset id="filters">
184232
<legend id="filters-toggle" class="section-heading">Filters<span id="filters-toggle-indicator"></span>
185233
</legend>
@@ -234,40 +282,8 @@ <h1>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
234282
</div>
235283
</div>
236284
</fieldset>
237-
<div id="content" style="margin-top: 15px">
238-
<table v-if="data" class="compare" style="font-size: medium !important;">
239-
<thead>
240-
<tr>
241-
<td v-if="notContinuous" colspan="4" style="text-align:center;"><b>Warning</b>: The start and
242-
end
243-
are not adjacent!</td>
244-
</tr>
245-
<tr>
246-
<th>
247-
<a v-bind:href="compareLink">compare</a>
248-
</th>
249-
<th>
250-
<a v-if="data.prev" v-bind:href="prevLink">&larr;</a>
251-
{{formatDate(data.a.date)}}
252-
(<a>{{short(data.a)}}</a>)
253-
</th>
254-
<th>
255-
{{formatDate(data.b.date)}}
256-
(<a>{{short(data.b)}}</a>)
257-
<a v-if="data.next" v-bind:href="nextLink">&rarr;</a>
258-
</th>
259-
<th>% change</th>
260-
</tr>
261-
<tr>
262-
<th></th>
263-
<th style="text-align: left;"><a v-if="data.a.pr"
264-
v-bind:href="prLink(data.a.pr)">#{{data.a.pr}}</a>
265-
</th>
266-
<th style="text-align: left;"><a v-if="data.b.pr"
267-
v-bind:href="prLink(data.b.pr)">#{{data.b.pr}}</a>
268-
</th>
269-
</tr>
270-
</thead>
285+
<div v-if="data" id="content" style="margin-top: 15px">
286+
<table class="compare" style="width: 80%; margin: 0 auto; font-size: medium !important;">
271287
<tbody>
272288
<template v-for="bench in benches">
273289
<tr data-field-start="true">
@@ -504,6 +520,9 @@ <h1>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
504520
percentLink(commit, baseCommit, bench, run) {
505521
return `/detailed-query.html?commit=${commit}&base_commit=${baseCommit}&benchmark=${bench}&run_name=${run}`;
506522
},
523+
commitLink(commit) {
524+
return `https://github.com/rust-lang/rust/commit/${commit}`;
525+
},
507526
benchGroupToggle(e) {
508527
const element = e.target;
509528
toggleBenchGroup(element);

0 commit comments

Comments
 (0)