Skip to content

Commit 5d99066

Browse files
committed
UI: Show errors from the result
1 parent 0dc4bbe commit 5d99066

File tree

3 files changed

+60
-10
lines changed

3 files changed

+60
-10
lines changed

web/src/App.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@
66
<link href="https://fonts.googleapis.com/css2?family=Lato&family=Open+Sans&family=Roboto&display=swap" rel="stylesheet">
77

88
<Navbar :serverInfo="serverInfo" />
9+
910
<div class="section">
1011
<LaunchTest :serverInfo="serverInfo" :serverBaseUrl="serverBaseUrl" />
1112
</div>
13+
1214
<div class="section" :class="{'is-hidden': !isResultVisible}">
1315
<ResultSummary :summary="metricsSummary"/>
1416
</div>
17+
1518
<div class="section" :class="{'is-hidden': !isResultVisible}">
1619
<ResultDetail :workers="workers" :summary="metricsSummary" />
1720
</div>
1821

22+
<div class="section" :class="{'is-hidden': !isErrorsVisible}">
23+
<ResultErrors :workers="workers" />
24+
</div>
1925
</template>
2026

2127
<script>
@@ -24,6 +30,7 @@
2430
import LaunchTest from './components/launch_test.vue'
2531
import ResultSummary from './components/result_summary.vue'
2632
import ResultDetail from './components/result_detail.vue'
33+
import ResultErrors from './components/result_errors.vue'
2734
2835
let serverBaseUrl = process.env.VUE_APP_SERVER_BASE_URL;
2936
if (!serverBaseUrl) {
@@ -37,6 +44,7 @@
3744
LaunchTest,
3845
ResultSummary,
3946
ResultDetail,
47+
ResultErrors,
4048
},
4149
data: function() {
4250
return {
@@ -47,6 +55,7 @@
4755
workers: {},
4856
serverBaseUrl: serverBaseUrl,
4957
isResultVisible: false,
58+
isErrorsVisible: false,
5059
}
5160
},
5261
created: function() {
@@ -92,7 +101,10 @@
92101
const worker = obj[key];
93102
if ("name" in worker && "metrics" in worker) {
94103
_this.workers[worker.name] = worker;
95-
console.log("workers updated", _this.workers);
104+
105+
if (!_this.isErrorsVisible && 'errors' in worker.metrics && worker.metrics.errors.length) {
106+
_this.isErrorsVisible = true;
107+
}
96108
}
97109
}
98110
}
@@ -181,13 +193,14 @@
181193
182194
.section .card {
183195
box-shadow: none;
184-
border: 1px solid rgba(14, 18, 23, 0.08);
196+
border: 1px solid rgba(14, 18, 23, 0.09);
185197
background: rgba(255, 255, 255, 0.9);
186198
}
187199
188200
.section .card .card-header {
189201
background: rgba(100, 110, 128, 0.2) !important;
190202
}
203+
191204
.section .card .card-header .card-header-title {
192205
border-bottom: 1px solid rgba(100, 110, 128, 0.1) !important;
193206
}
@@ -215,5 +228,9 @@
215228
.button.is-danger[disabled], fieldset[disabled] .button.is-danger {
216229
background-color: #e18888 !important;
217230
}
231+
232+
.section > .content {
233+
padding: 0 1rem !important;
234+
}
218235
</style>
219236

web/src/components/result_detail.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,19 @@
5252
</template>
5353

5454
<script>
55-
export default {
56-
name: 'ResultDetail',
57-
props: {
58-
workers: Object,
59-
summary: Object,
60-
},
61-
methods: {
55+
export default {
56+
name: 'ResultDetail',
57+
props: {
58+
workers: Object,
59+
summary: Object,
60+
},
61+
methods: {
62+
}
6263
}
63-
}
6464
</script>
6565

6666
<style scoped>
67+
.table {
68+
color: #464646;
69+
}
6770
</style>

web/src/components/result_errors.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<div class="content">
3+
<div class="card">
4+
<div class="card-header">
5+
<strong class="card-header-title"><span class="icon"><i class="fas fa-exclamation-triangle" aria-hidden="true"></i></span> Errors</strong>
6+
</div>
7+
<div class="card-content">
8+
<div v-for="(worker, name) in workers" :key="name">
9+
<div v-for="(err, id) in worker.metrics.errors" :key="name + '-' + id">
10+
<strong>{{ name }}</strong>&nbsp; {{ err }}
11+
</div>
12+
</div>
13+
</div>
14+
</div>
15+
</div>
16+
</template>
17+
18+
<script>
19+
export default {
20+
name: 'ResultErrors',
21+
props: {
22+
workers: Object,
23+
},
24+
methods: {
25+
}
26+
}
27+
</script>
28+
29+
<style scoped>
30+
</style>

0 commit comments

Comments
 (0)