Skip to content

Commit

Permalink
Merge pull request #106 from crazy-max/website-format-result
Browse files Browse the repository at this point in the history
website: format result items
  • Loading branch information
crazy-max authored Sep 17, 2024
2 parents 688c89b + 5ba7918 commit 8a85908
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion website/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BuildKit Benchmarks</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap">
<link rel="icon" type="image/x-icon" href="./images/favicon.ico">
<link rel="icon" type="image/x-icon" href="./img/favicon.ico">
<style>
body {
font-family: 'Roboto', Arial, sans-serif;
Expand Down
1 change: 1 addition & 0 deletions website/src/assets/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 23 additions & 3 deletions website/src/components/ResultsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div class="results">
<h2>Results</h2>
<ul>
<li v-for="result in results" :key="result" @click="loadResult(result)"
:class="['result-item', { 'selected': result === selectedResult }]">
{{ result }}
<li v-for="result in results" :key="result" @click="loadResult(result)" :class="['result-item', { 'selected': result === selectedResult }]">
<i class="calendar-icon"></i>
{{ formatResult(result) }}
</li>
</ul>
</div>
Expand Down Expand Up @@ -56,6 +56,15 @@ export default {
this.selectedResult = this.results[0];
}
},
formatResult(result) {
const year = result.substring(0, 4);
const month = result.substring(4, 6);
const day = result.substring(6, 8);
const hour = result.substring(9, 11);
const minute = result.substring(11, 13);
const second = result.substring(13, 15);
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}
}
};
</script>
Expand All @@ -73,6 +82,8 @@ export default {
}
.results .result-item {
display: flex;
align-items: center;
padding: 10px;
margin-bottom: 10px;
background-color: #ffffff;
Expand All @@ -94,4 +105,13 @@ export default {
background-color: #d4edda;
border-left: 5px solid #28a745;
}
.results .calendar-icon {
margin-right: 10px;
width: 16px;
height: 16px;
background-image: url('../assets/calendar.svg');
background-size: contain;
background-repeat: no-repeat;
}
</style>
4 changes: 1 addition & 3 deletions website/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ import { createApp } from 'vue';
import App from './App.vue';
import router from './router';

const app = createApp(App);
app.use(router);
app.mount('#app');
createApp(App).use(router).mount('#app');

0 comments on commit 8a85908

Please sign in to comment.