|
1 | 1 | <template lang="pug"> |
2 | 2 | div |
3 | 3 | div |
4 | | - b-alert(v-if="mode == 'range' && invalidDaterange" variant="warning" show) |
| 4 | + b-alert(v-if="mode == 'range' && invalidDaterange", variant="warning", show) |
5 | 5 | | The selected date range is invalid. The second date must be greater than the first date. |
6 | | - b-alert(v-if="mode == 'range' && daterangeTooLong" variant="warning" show) |
| 6 | + b-alert(v-if="mode == 'range' && daterangeTooLong", variant="warning", show) |
7 | 7 | | The selected date range is too long. The maximum is {{ maxDuration/(24*60*60) }} days. |
8 | 8 |
|
9 | 9 | table |
10 | 10 | tr |
11 | 11 | th.pr-2 |
12 | 12 | label(for="mode") Interval mode: |
13 | 13 | td |
14 | | - select(id="mode" v-model="mode") |
| 14 | + select(id="mode", v-model="mode") |
15 | 15 | option(value='last_duration') Last duration |
16 | 16 | option(value='range') Date range |
17 | 17 | tr(v-if="mode == 'last_duration'") |
18 | 18 | th.pr-2 |
19 | 19 | label(for="duration") Show last: |
20 | 20 | td |
21 | | - select(id="duration" v-model="duration" @change="valueChanged") |
| 21 | + select(id="duration", v-model="duration", @change="valueChanged") |
22 | 22 | option(:value="15*60") 15min |
23 | 23 | option(:value="30*60") 30min |
24 | 24 | option(:value="60*60") 1h |
|
30 | 30 | tr(v-if="mode == 'range'") |
31 | 31 | th.pr-2 Range: |
32 | 32 | td |
33 | | - input(type="date" v-model="start") |
34 | | - input(type="date" v-model="end") |
| 33 | + input(type="date", v-model="start") |
| 34 | + input(type="date", v-model="end") |
35 | 35 | button( |
36 | 36 | class="btn btn-outline-dark btn-sm", |
37 | 37 | type="button", |
@@ -85,6 +85,9 @@ export default { |
85 | 85 | return moment(this.start).add(this.maxDuration, 'seconds').isBefore(moment(this.end)); |
86 | 86 | }, |
87 | 87 | }, |
| 88 | + mounted() { |
| 89 | + this.valueChanged(); |
| 90 | + }, |
88 | 91 | methods: { |
89 | 92 | valueChanged() { |
90 | 93 | if ( |
|
0 commit comments