Mercurial > gemma
annotate client/src/components/importoverview/ImportOverview.vue @ 2759:7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 21 Mar 2019 16:40:02 +0100 |
parents | 2aa1620ffd9e |
children | c6fba10926cc |
rev | line source |
---|---|
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 <div class="overview"> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
3 <UIBoxHeader |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 icon="clipboard-check" |
2717
5b990f612420
import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2709
diff
changeset
|
5 title="Import review" |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 :closeCallback="$parent.close" |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
7 :actions="[{ callback: loadLogs, icon: 'redo' }]" |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 /> |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
9 <div class="position-relative"> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
10 <transition name="fade"> |
2740
85de42146bdb
client: css: moved class for loading overlay to application.scss
Markus Kottlaender <markus@intevation.de>
parents:
2738
diff
changeset
|
11 <div class="loading" v-if="loading"> |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
12 <font-awesome-icon icon="spinner" spin /> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
13 </div> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
14 </transition> |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
15 <div class="p-2 mb-1 d-flex flex-row flex-fill justify-content-between"> |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
16 <Filters></Filters> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
17 <div> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
18 <button |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
19 class="btn btn-sm btn-info" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
20 :disabled="!reviewed.length" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
21 @click="save" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
22 > |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
23 <translate>Commit</translate> {{ reviewed.length }} |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
24 </button> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
25 </div> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 </div> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
27 <div |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
28 class="ml-2 mr-2 mb-2 datefilter d-flex flex-row justify-content-between" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
29 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
30 <div class="mr-3 my-auto pointer"> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
31 <button |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
32 @click="earlier" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
33 class="btn btn-sm btn-outline-light text-dark" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
34 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
35 <translate>Earlier</translate> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
36 <font-awesome-icon class="ml-2" icon="angle-left" /> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
37 </button> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
38 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
39 <div class="selected-interval my-auto"> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
40 <span class="date">{{ interval[0] | dateTime }}</span> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
41 <span class="ml-3 mr-3">-</span> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
42 <span class="date">{{ interval[1] | dateTime }}</span> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
43 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
44 <div class="ml-3 my-auto pointer"> |
2759
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
45 <button @click="later" class="btn btn-sm btn-outline-light text-dark"> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
46 <font-awesome-icon class="mr-2" icon="angle-right" /><translate |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
47 >Later</translate |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
48 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
49 </button> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
50 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
51 <div class="d-flex flex-row"> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
52 <select |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
53 class="my-auto btn btn-outline-light text-dark form-control interval-select" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
54 v-model="selectedInterval" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
55 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
56 <option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
57 :selected="selectedInterval === $options.LAST_HOUR" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
58 :value="$options.LAST_HOUR" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
59 ><translate>Hour</translate></option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
60 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
61 <option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
62 :selected="selectedInterval === $options.TODAY" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
63 :value="$options.TODAY" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
64 ><translate>Day</translate></option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
65 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
66 <option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
67 :selected="selectedInterval === $options.LAST_7_DAYS" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
68 :value="$options.LAST_7_DAYS" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
69 ><translate>7 days</translate></option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
70 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
71 <option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
72 :selected="selectedInterval === $options.LAST_30_DAYS" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
73 :value="$options.LAST_30_DAYS" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
74 ><translate>30 Days</translate></option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
75 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
76 </select> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
77 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
78 </div> |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
79 <UITableHeader |
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
80 :columns="[ |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
81 { id: 'id', title: 'Id', width: '79px' }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
82 { id: 'kind', title: 'Kind', width: '53px' }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
83 { id: 'enqueued', title: 'Enqueued', width: '138px' }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
84 { id: 'user', title: 'User', width: '105px' }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
85 { id: 'signer', title: 'Signer', width: '105px' }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
86 { id: 'state', title: 'Status', width: '72px' }, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
87 { id: 'warnings', icon: 'exclamation-triangle', width: '44px' } |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
88 ]" |
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
89 /> |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
90 <!-- |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
91 For server-side sorting, etc simply don't use the sortTable filter. |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
92 Instead you could just pass a function that loads the imports, like: |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
93 :data="loadImports(sortColumn, sortDirection)" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
94 --> |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
95 <UITableBody |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
96 :data="filteredImports() | sortTable(sortColumn, sortDirection)" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
97 maxHeight="80vh" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
98 v-slot="{ item: entry }" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
99 > |
2725
9465749410ba
client: import overview: use table body component
Markus Kottlaender <markus@intevation.de>
parents:
2720
diff
changeset
|
100 <LogEntry :entry="entry"></LogEntry> |
9465749410ba
client: import overview: use table body component
Markus Kottlaender <markus@intevation.de>
parents:
2720
diff
changeset
|
101 </UITableBody> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
102 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
103 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
104 </template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
105 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
106 <script> |
2578 | 107 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
108 * without warranty, see README.md and license for details. | |
109 * | |
110 * SPDX-License-Identifier: AGPL-3.0-or-later | |
111 * License-Filename: LICENSES/AGPL-3.0.txt | |
112 * | |
113 * Copyright (C) 2018 by via donau | |
114 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
115 * Software engineering by Intevation GmbH | |
116 * | |
117 * Author(s): | |
118 * Thomas Junk <thomas.junk@intevation.de> | |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
119 * Markus Kottländer <markus.kottlaender@intevation.de> |
2578 | 120 */ |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
121 |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
122 import { mapState, mapGetters } from "vuex"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
123 import { displayError, displayInfo } from "@/lib/errors"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
124 import { STATES } from "@/store/imports"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
125 import { sortTable } from "@/lib/mixins"; |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
126 import { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
127 startOfDay, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
128 startOfHour, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
129 endOfHour, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
130 addHours, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
131 subHours, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
132 endOfDay, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
133 addDays, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
134 subDays, |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
135 isFuture, |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
136 format |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
137 } from "date-fns"; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
138 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
139 export default { |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
140 name: "importoverview", |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
141 mixins: [sortTable], |
2578 | 142 components: { |
143 Filters: () => import("./Filters.vue"), | |
144 LogEntry: () => import("./LogEntry.vue") | |
145 }, | |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
146 data() { |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
147 return { |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
148 loading: false, |
2759
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
149 selectedInterval: this.$options.LAST_HOUR |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
150 }; |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
151 }, |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
152 LAST_HOUR: "lasthour", |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
153 TODAY: "today", |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
154 LAST_7_DAYS: "lastsevendays", |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
155 LAST_30_DAYS: "lastthirtydays", |
2578 | 156 computed: { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
157 ...mapState("application", ["searchQuery"]), |
2759
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
158 ...mapState("imports", [ |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
159 "imports", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
160 "reviewed", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
161 "startDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
162 "endDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
163 "prev", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
164 "next" |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
165 ]), |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
166 ...mapGetters("imports", ["filters"]), |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
167 interval() { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
168 return [this.startDate, this.endDate]; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
169 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
170 }, |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
171 methods: { |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
172 earlier() { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
173 switch (this.selectedInterval) { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
174 case this.$options.LAST_HOUR: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
175 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
176 "imports/setStartDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
177 subHours(startOfHour(this.startDate), 1) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
178 ); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
179 this.$store.commit("imports/setEndDate", endOfHour(this.startDate)); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
180 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
181 case this.$options.TODAY: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
182 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
183 "imports/setStartDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
184 subDays(startOfDay(this.startDate), 1) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
185 ); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
186 this.$store.commit("imports/setEndDate", endOfDay(this.startDate)); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
187 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
188 case this.$options.LAST_7_DAYS: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
189 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
190 "imports/setStartDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
191 subDays(startOfDay(this.startDate), 7) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
192 ); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
193 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
194 "imports/setEndDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
195 endOfDay(addDays(this.startDate, 7)) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
196 ); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
197 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
198 case this.$options.LAST_30_DAYS: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
199 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
200 "imports/setStartDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
201 subDays(startOfDay(this.startDate), 30) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
202 ); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
203 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
204 "imports/setEndDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
205 endOfDay(addDays(this.startDate, 30)) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
206 ); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
207 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
208 } |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
209 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
210 }, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
211 later() { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
212 let start, end; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
213 const now = new Date(); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
214 switch (this.selectedInterval) { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
215 case this.$options.LAST_HOUR: |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
216 start = addHours(startOfHour(this.startDate), 1); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
217 end = endOfHour(start); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
218 if (isFuture(subHours(end, 1))) { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
219 return; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
220 } |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
221 this.$store.commit("imports/setStartDate", start); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
222 this.$store.commit("imports/setEndDate", isFuture(end) ? now : end); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
223 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
224 case this.$options.TODAY: |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
225 start = addDays(startOfDay(this.startDate), 1); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
226 end = endOfDay(start); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
227 if (isFuture(subDays(end, 1))) { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
228 return; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
229 } |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
230 this.$store.commit("imports/setStartDate", start); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
231 this.$store.commit("imports/setEndDate", isFuture(end) ? now : end); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
232 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
233 case this.$options.LAST_7_DAYS: |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
234 start = addDays(startOfDay(this.startDate), 7); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
235 end = endOfDay(addDays(start, 7)); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
236 if (isFuture(subDays(end, 7))) { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
237 return; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
238 } |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
239 this.$store.commit("imports/setStartDate", start); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
240 this.$store.commit("imports/setEndDate", isFuture(end) ? now : end); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
241 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
242 case this.$options.LAST_30_DAYS: |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
243 start = addDays(startOfDay(this.startDate), 30); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
244 end = endOfDay(addDays(start, 30)); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
245 if (isFuture(subDays(end, 7))) return; |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
246 this.$store.commit("imports/setStartDate", start); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
247 this.$store.commit("imports/setEndDate", isFuture(end) ? now : end); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
248 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
249 } |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
250 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
251 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
252 filteredImports() { |
2749
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
253 return this.imports; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
254 }, |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
255 loadLogs() { |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
256 this.loading = true; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
257 this.$store |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
258 .dispatch("imports/getImports", { |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
259 filter: this.filters, |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
260 from: format(this.startDate, "YYYY-MM-DDTHH:mm:ss.SSS"), |
2749
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
261 to: format(this.endDate, "YYYY-MM-DDTHH:mm:ss.SSS"), |
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
262 query: this.searchQuery |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
263 }) |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
264 .then(() => { |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
265 this.loading = false; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
266 }) |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
267 .catch(error => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
268 const { status, data } = error.response; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
269 displayError({ |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
270 title: this.$gettext("Backend Error"), |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
271 message: `${status}: ${data.message || data}` |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
272 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
273 }); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
274 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
275 save() { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
276 if (!this.reviewed.length) return; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
277 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
278 let popupContent = `<table class="table table-sm small mb-0 border-0" style="margin-top: -1px;">`; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
279 this.reviewed.forEach(r => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
280 let imp = this.imports.find(i => i.id === r.id); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
281 let approved = STATES.APPROVED === r.status; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
282 popupContent += `<tr> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
283 <td>${imp.id}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
284 <td>${imp.kind.toUpperCase()}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
285 <td>${this.$options.filters.dateTime(imp.enqueued)}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
286 <td class="text-${approved ? "success" : "danger"}"> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
287 ${this.$gettext(approved ? "approved" : "declined")} |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
288 </td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
289 </tr>`; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
290 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
291 popupContent += "</table>"; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
292 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
293 this.$store.commit("application/popup", { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
294 icon: "clipboard-check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
295 title: this.$gettext("Finish Review"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
296 padding: false, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
297 big: true, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
298 content: popupContent, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
299 confirm: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
300 icon: "check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
301 callback: () => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
302 let data = this.reviewed.map(r => ({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
303 id: r.id, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
304 state: r.status |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
305 })); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
306 this.$store |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
307 .dispatch("imports/confirmReview", data) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
308 .then(response => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
309 this.loadLogs(); |
2638
6c1730fc3dc1
client: importsoverview2: clear reviewed array after finishing review
Markus Kottlaender <markus@intevation.de>
parents:
2632
diff
changeset
|
310 this.$store.commit("imports/setReviewed", []); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
311 const messages = response.data |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
312 .map(x => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
313 if (x.message) return x.message; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
314 if (x.error) return x.error; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
315 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
316 .join("\n\n"); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
317 displayInfo({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
318 title: "Staging Area", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
319 message: messages, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
320 options: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
321 timeout: 0, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
322 buttons: [{ text: "Ok", action: null, bold: true }] |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
323 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
324 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
325 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
326 .catch(error => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
327 const { status, data } = error.response; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
328 displayError({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
329 title: "Backend Error", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
330 message: `${status}: ${data.message || data}` |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
331 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
332 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
333 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
334 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
335 cancel: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
336 label: this.$gettext("Cancel"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
337 icon: "times" |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
338 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
339 }); |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
340 } |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
341 }, |
2593 | 342 watch: { |
2759
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
343 prev() { |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
344 if (this.prev) { |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
345 switch (this.selectedInterval) { |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
346 case this.$options.LAST_HOUR: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
347 this.$store.commit("imports/setStartDate", startOfHour(this.prev)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
348 this.$store.commit("imports/setEndDate", endOfHour(this.prev)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
349 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
350 case this.$options.TODAY: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
351 this.$store.commit("imports/setStartDate", startOfDay(this.prev)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
352 this.$store.commit("imports/setEndDate", endOfDay(this.prev)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
353 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
354 case this.$options.LAST_7_DAYS: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
355 this.$store.commit("imports/setStartDate", startOfDay(this.prev)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
356 this.$store.commit( |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
357 "imports/setEndDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
358 addDays(startOfDay(this.prev)), |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
359 7 |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
360 ); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
361 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
362 case this.$options.LAST_30_DAYS: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
363 this.$store.commit("imports/setStartDate", startOfDay(this.prev)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
364 this.$store.commit( |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
365 "imports/setEndDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
366 addDays(startOfDay(this.prev), 30) |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
367 ); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
368 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
369 } |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
370 this.loadLogs(); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
371 } |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
372 }, |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
373 next() { |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
374 if (this.next) { |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
375 switch (this.selectedInterval) { |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
376 case this.$options.LAST_HOUR: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
377 this.$store.commit("imports/setStartDate", startOfHour(this.next)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
378 this.$store.commit("imports/setEndDate", endOfHour(this.next)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
379 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
380 case this.$options.TODAY: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
381 this.$store.commit("imports/setStartDate", startOfDay(this.next)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
382 this.$store.commit("imports/setEndDate", endOfDay(this.next)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
383 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
384 case this.$options.LAST_7_DAYS: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
385 this.$store.commit("imports/setStartDate", startOfDay(this.next)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
386 this.$store.commit( |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
387 "imports/setEndDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
388 addDays(startOfDay(this.next)), |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
389 7 |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
390 ); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
391 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
392 case this.$options.LAST_30_DAYS: |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
393 this.$store.commit("imports/setStartDate", startOfDay(this.next)); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
394 this.$store.commit( |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
395 "imports/setEndDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
396 addDays(startOfDay(this.next), 30) |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
397 ); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
398 break; |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
399 } |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
400 this.loadLogs(); |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
401 } |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
402 }, |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
403 selectedInterval() { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
404 const now = new Date(); |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
405 switch (this.selectedInterval) { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
406 case this.$options.LAST_HOUR: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
407 this.$store.commit("imports/setStartDate", startOfHour(now)); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
408 this.$store.commit("imports/setEndDate", now); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
409 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
410 case this.$options.TODAY: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
411 this.$store.commit("imports/setStartDate", startOfDay(now)); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
412 this.$store.commit("imports/setEndDate", now); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
413 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
414 case this.$options.LAST_7_DAYS: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
415 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
416 "imports/setStartDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
417 subDays(startOfDay(now), 7) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
418 ); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
419 this.$store.commit("imports/setEndDate", now); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
420 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
421 case this.$options.LAST_30_DAYS: |
2753
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
422 this.$store.commit( |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
423 "imports/setStartDate", |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
424 subDays(startOfDay(now), 30) |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
425 ); |
2aa1620ffd9e
search: in context of importoverview pressing enter triggers a request for and updated dataset
Thomas Junk <thomas.junk@intevation.de>
parents:
2749
diff
changeset
|
426 this.$store.commit("imports/setEndDate", now); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
427 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
428 } |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
429 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
430 }, |
2593 | 431 filters() { |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
432 this.loadLogs(); |
2593 | 433 } |
434 }, | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
435 mounted() { |
2578 | 436 this.loadLogs(); |
437 } | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
438 }; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
439 </script> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
440 |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
441 <style lang="scss" scoped> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
442 .date { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
443 font-stretch: condensed; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
444 } |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
445 .interval-select { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
446 padding: 0px; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
447 margin: 0px; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
448 font-size: 80%; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
449 } |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
450 </style> |