Skip to content

Commit b177eef

Browse files
committed
Added runs page
1 parent f32c280 commit b177eef

File tree

4 files changed

+198
-214
lines changed

4 files changed

+198
-214
lines changed

web/server/vue-cli/src/components/DateTimePicker.vue

Lines changed: 50 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
:content-class="dialogClass"
55
width="400"
66
>
7-
<template v-slot:activator="{ on }">
7+
<template #activator="{ props }">
88
<v-text-field
9+
v-bind="props"
910
:label="label"
10-
:value="formattedDatetime"
11-
:class="[ inputClass, 'pa-0', 'ma-0' ]"
11+
:class="[inputClass, 'pa-0', 'ma-0']"
1212
:prepend-inner-icon="prependInnerIcon"
1313
:outlined="outlined"
14-
:dense="dense"
14+
:density="dense ? 'compact' : undefined"
1515
hide-details
1616
readonly
17-
v-on="on"
1817
>
1918
<template #append>
2019
<slot name="append" />
@@ -24,58 +23,51 @@
2423

2524
<v-card>
2625
<v-card-text class="pa-0">
27-
<v-tabs
28-
v-model="activeTab"
29-
fixed-tabs
30-
>
26+
<v-tabs v-model="activeTab" grow>
3127
<v-tab>
3228
<v-icon>mdi-calendar</v-icon>
3329
</v-tab>
34-
35-
<v-tab
36-
:disabled="!date"
37-
>
30+
<v-tab :disabled="!date">
3831
<v-icon>mdi-clock-outline</v-icon>
3932
</v-tab>
33+
</v-tabs>
4034

41-
<v-tab-item>
35+
<v-window v-model="activeTab">
36+
<v-window-item>
4237
<v-date-picker
4338
v-model="date"
44-
full-width
45-
@input="activeTab = 1"
39+
show-adjacent-months
40+
color="primary"
41+
@update:model-value="activeTab = 1"
4642
/>
47-
</v-tab-item>
48-
49-
<v-tab-item>
43+
</v-window-item>
44+
<v-window-item>
5045
<v-time-picker
5146
v-model="time"
52-
full-width
53-
use-seconds
5447
format="24hr"
48+
full-width
49+
with-seconds
50+
color="primary"
5551
/>
56-
</v-tab-item>
57-
</v-tabs>
52+
</v-window-item>
53+
</v-window>
5854
</v-card-text>
5955

6056
<v-card-actions>
6157
<v-spacer />
62-
6358
<v-btn
6459
color="grey lighten-1"
65-
class="clear-btn"
66-
text
67-
@click.native="clear"
60+
variant="text"
61+
@click="clear"
6862
>
6963
Clear
7064
</v-btn>
71-
7265
<v-btn
73-
class="ok-btn"
7466
color="green darken-1"
75-
text
67+
variant="text"
7668
@click="ok"
7769
>
78-
Ok
70+
OK
7971
</v-btn>
8072
</v-card-actions>
8173
</v-card>
@@ -88,7 +80,7 @@ import { format, parse } from "date-fns";
8880
export default {
8981
name: "DateTimePicker",
9082
props: {
91-
value: { type: [ Date, String ], default: null },
83+
value: { type: [Date, String], default: null },
9284
label: { type: String, default: "" },
9385
dateFormat: { type: String, default: "yyyy-MM-dd" },
9486
timeFormat: { type: String, default: "HH:mm:ss" },
@@ -97,7 +89,7 @@ export default {
9789
dialogClass: { type: String, default: null },
9890
outlined: { type: Boolean, default: false },
9991
dense: { type: Boolean, default: false },
100-
prependInnerIcon: { type: String, default: null },
92+
prependInnerIcon: { type: String, default: null }
10193
},
10294
data() {
10395
return {
@@ -107,36 +99,31 @@ export default {
10799
time: this.defaultTime
108100
};
109101
},
110-
111102
computed: {
112103
dateTimeFormat() {
113104
return `${this.dateFormat} ${this.timeFormat}`;
114105
},
115-
116106
dateTime() {
117-
if (this.date && this.time) {
118-
const dt = this.date + " " + this.time;
119-
return parse(dt, this.dateTimeFormat, new Date());
120-
}
121107
122-
return null;
108+
let hours, minutes;
109+
[hours,minutes] = this.time.split(":");
110+
const formatted = new Date(this.date);
111+
formatted.setHours(parseInt(hours));
112+
formatted.setMinutes(parseInt(minutes));
113+
return formatted;
123114
},
124-
125115
formattedDatetime() {
126116
return this.dateTime ? format(this.dateTime, this.dateTimeFormat) : null;
127117
}
128118
},
129-
130119
watch: {
131-
value() {
132-
this.init();
120+
value: {
121+
handler() {
122+
this.init();
123+
},
124+
immediate: true
133125
}
134126
},
135-
136-
mounted() {
137-
this.init();
138-
},
139-
140127
methods: {
141128
init() {
142129
if (!this.value) {
@@ -147,34 +134,34 @@ export default {
147134
let initValue = null;
148135
if (this.value instanceof Date) {
149136
initValue = this.value;
150-
} else if (typeof this.value === "string" ||
151-
this.value instanceof String
152-
) {
153-
initValue = parse(this.value, this.dateTimeFormat, new Date());
137+
} else if (typeof this.value === "string") {
138+
try {
139+
initValue = parse(this.value, this.dateTimeFormat, new Date());
140+
} catch (e) {
141+
initValue = null;
142+
}
154143
}
155144
156-
this.date = format(initValue, this.dateFormat);
157-
this.time = format(initValue, this.timeFormat);
145+
if (initValue) {
146+
this.date = format(initValue, this.dateFormat);
147+
this.time = format(initValue, this.timeFormat);
148+
} else {
149+
this.resetDateTimes();
150+
}
158151
},
159-
160152
clear() {
161153
this.reset();
162154
this.resetDateTimes();
163-
164155
this.$emit("input", null);
165156
},
166-
167157
ok() {
168158
this.reset();
169-
170159
this.$emit("input", this.dateTime);
171160
},
172-
173161
reset() {
174162
this.dialog = false;
175163
this.activeTab = 0;
176164
},
177-
178165
resetDateTimes() {
179166
this.date = null;
180167
this.time = this.defaultTime;
@@ -183,13 +170,8 @@ export default {
183170
};
184171
</script>
185172

186-
<style lang="scss" scoped>
187-
::v-deep .v-picker.v-card {
173+
<style scoped>
174+
.v-picker {
188175
box-shadow: none;
189-
190-
& > .v-picker__title {
191-
border-radius: 0;
192-
}
193176
}
194-
195177
</style>

web/server/vue-cli/src/components/Run/RunFilterToolbar.vue

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
11
<template>
22
<v-toolbar flat class="run-filter-toolbar mb-4">
33
<v-row>
4-
<v-col align-self="center">
4+
<v-col cols="12" md="2" align-self="center">
55
<v-text-field
6-
:value="runName"
6+
:model-value="runName"
77
class="run-name"
88
prepend-inner-icon="mdi-magnify"
99
label="Search for runs..."
1010
single-line
1111
hide-details
12-
outlined
13-
solo
14-
flat
15-
dense
16-
@input="setRunName"
12+
variant="outlined"
13+
density="compact"
14+
@update:model-value="setRunName"
1715
/>
1816
</v-col>
1917

20-
<v-col align-self="center">
18+
<v-col cols="12" md="3" align-self="center">
2119
<v-text-field
22-
:value="runTag"
20+
:model-value="runTag"
2321
class="run-tag"
2422
prepend-inner-icon="mdi-tag"
2523
label="Filter events by tag name..."
2624
clearable
2725
single-line
2826
hide-details
29-
outlined
30-
solo
31-
flat
32-
dense
33-
@input="setRunTag"
27+
variant="outlined"
28+
density="compact"
29+
@update:model-value="setRunTag"
3430
>
3531
<template #append>
3632
<tooltip-help-icon>
@@ -41,15 +37,15 @@
4137
</v-text-field>
4238
</v-col>
4339

44-
<v-col align-self="center" width="50px">
40+
<v-col cols="12" md="2" align-self="center">
4541
<date-time-picker
4642
:value="storedAfter"
4743
input-class="stored-after"
4844
dialog-class="stored-after"
4945
label="History stored after..."
5046
prepend-inner-icon="mdi-calendar-arrow-right"
51-
outlined
52-
dense
47+
variant="outlined"
48+
density="compact"
5349
@input="setStoredAfter"
5450
>
5551
<template #append>
@@ -62,15 +58,15 @@
6258
</date-time-picker>
6359
</v-col>
6460

65-
<v-col align-self="center" cols="2">
61+
<v-col cols="12" md="2" align-self="center">
6662
<date-time-picker
6763
:value="storedBefore"
6864
input-class="stored-before"
6965
dialog-class="stored-before"
7066
label="History stored before..."
7167
prepend-inner-icon="mdi-calendar-arrow-left"
72-
outlined
73-
dense
68+
variant="outlined"
69+
density="compact"
7470
@input="setStoredBefore"
7571
>
7672
<template #append>
@@ -92,13 +88,13 @@
9288
/>
9389

9490
<v-btn
95-
outlined
91+
variant="outlined"
9692
color="primary"
9793
class="diff-runs-btn mr-2"
9894
:to="diffTargetRoute"
9995
:disabled="isDiffBtnDisabled"
10096
>
101-
<v-icon left>
97+
<v-icon start>
10298
mdi-select-compare
10399
</v-icon>
104100
Diff
@@ -135,6 +131,7 @@
135131
<script>
136132
import _ from "lodash";
137133
import { mapGetters, mapMutations } from "vuex";
134+
import { useRoute } from "vue-router";
138135
import {
139136
SET_RUN_HISTORY_RUN_TAG,
140137
SET_RUN_HISTORY_STORED_AFTER,
@@ -162,7 +159,7 @@ export default {
162159
selectedComparedToRuns: { type: Array, required: true },
163160
selectedComparedToTags: { type: Array, required: true }
164161
},
165-
162+
166163
computed: {
167164
...mapGetters("run", [
168165
"runName",
@@ -182,7 +179,7 @@ export default {
182179
return {
183180
name: "reports",
184181
query: {
185-
...this.$router.currentRoute.query,
182+
...this.$route.query,
186183
"run": this.selectedBaselineRuns.length
187184
? this.selectedBaselineRuns : undefined,
188185
"run-tag": this.selectedBaselineTags.length
@@ -243,19 +240,19 @@ export default {
243240
]),
244241
245242
initByUrl() {
246-
const runName = this.$router.currentRoute.query["run"];
243+
const runName = this.$route.query["run"];
247244
if (runName)
248245
this.setRunName(runName);
249246
250-
const runTag = this.$router.currentRoute.query["run-tag"];
247+
const runTag = this.$route.query["run-tag"];
251248
if (runTag)
252249
this.setRunTag(runTag);
253250
254-
const storedAfter = this.$router.currentRoute.query["stored-after"];
251+
const storedAfter = this.$route.query["stored-after"];
255252
if (storedAfter)
256253
this.setStoredAfter(new Date(storedAfter));
257254
258-
const storedBefore = this.$router.currentRoute.query["stored-before"];
255+
const storedBefore = this.$route.query["stored-before"];
259256
if (storedBefore)
260257
this.setStoredBefore(new Date(storedBefore));
261258
},

web/server/vue-cli/src/services/api/cc.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function extractTagWithRunName(runWithTagName) {
2727

2828
class CodeCheckerService extends BaseService {
2929
constructor() {
30-
super("CodeCheckerService", ServiceClient,"v6.61", true);
30+
super("CodeCheckerService", ServiceClient,"6.61", true);
3131
}
3232

3333
getSameReports(bugHash) {

0 commit comments

Comments
 (0)