Mercurial > gemma
annotate client/src/components/importoverview/ImportOverview.vue @ 2968:8b32574bed09 unified_import
wip
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 01 Apr 2019 15:12:49 +0200 |
parents | 55a9c7965e25 |
children | c40540889b53 |
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" |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
5 :title="importReviewLabel" |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 :closeCallback="$parent.close" |
2789
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
7 :actions="[{ callback: loadUpdatedLogs, 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"> |
2840
503a73e9a755
client: ui: implemented global SpinnerOverlay component
Markus Kottlaender <markus@intevation.de>
parents:
2834
diff
changeset
|
10 <SpinnerOverlay v-if="loading" /> |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
11 <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
|
12 <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
|
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 <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
|
15 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
|
16 :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
|
17 @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
|
18 > |
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 <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
|
20 </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
|
21 </div> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
22 </div> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
23 <div |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
24 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
|
25 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
26 <div class="mr-3 my-auto pointer"> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
27 <button |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
28 :disabled="!this.prev" |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
29 @click="earlier" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
30 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
|
31 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
32 <translate>Earlier</translate> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
33 <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
|
34 </button> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
35 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
36 <div class="selected-interval my-auto"> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
37 <span class="date">{{ interval[0] | dateTime }}</span> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
38 <span class="ml-3 mr-3">-</span> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
39 <span class="date">{{ interval[1] | dateTime }}</span> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
40 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
41 <div class="ml-3 my-auto pointer"> |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
42 <button |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
43 :disabled="!this.next" |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
44 @click="later" |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
45 class="btn btn-sm btn-outline-light text-dark" |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
46 > |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
47 <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
|
48 >Later</translate |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
49 > |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
50 </button> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
51 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
52 <div class="d-flex flex-row"> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
53 <select |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
54 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
|
55 v-model="selectedInterval" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
56 > |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
57 <option :value="$options.LAST_HOUR" |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
58 ><translate>Hour</translate></option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
59 > |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
60 <option :value="$options.TODAY"><translate>Day</translate></option> |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
61 <option :value="$options.LAST_7_DAYS" |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
62 ><translate>7 days</translate></option |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
63 > |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
64 <option :value="$options.LAST_30_DAYS"> |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
65 <translate>30 Days</translate> |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
66 </option> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
67 </select> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
68 </div> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
69 </div> |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
70 <UITableHeader |
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
71 :columns="[ |
2779
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
72 { id: 'id', title: `${idLabel}`, width: '79px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
73 { id: 'kind', title: `${kindLabel}`, width: '53px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
74 { id: 'enqueued', title: `${enqueuedLabel}`, width: '138px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
75 { id: 'user', title: `${userLabel}`, width: '105px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
76 { id: 'signer', title: `${signerLabel}`, width: '105px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
77 { id: 'state', title: `${statusLabel}`, width: '72px' }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
78 { 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
|
79 ]" |
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
80 /> |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
81 <!-- |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
82 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
|
83 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
|
84 :data="loadImports(sortColumn, sortDirection)" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
85 --> |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
86 <UITableBody |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
87 :data="filteredImports() | sortTable(sortColumn, sortDirection)" |
2834
f91ee5d2c58a
client: import overview: fixed height
Markus Kottlaender <markus@intevation.de>
parents:
2827
diff
changeset
|
88 maxHeight="73vh" |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
89 > |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2847
diff
changeset
|
90 <template v-slot:row="{ item: entry }"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2847
diff
changeset
|
91 <LogEntry :entry="entry"></LogEntry> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2847
diff
changeset
|
92 </template> |
2725
9465749410ba
client: import overview: use table body component
Markus Kottlaender <markus@intevation.de>
parents:
2720
diff
changeset
|
93 </UITableBody> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
94 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
95 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 </template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
98 <script> |
2578 | 99 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
100 * without warranty, see README.md and license for details. | |
101 * | |
102 * SPDX-License-Identifier: AGPL-3.0-or-later | |
103 * License-Filename: LICENSES/AGPL-3.0.txt | |
104 * | |
105 * Copyright (C) 2018 by via donau | |
106 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
107 * Software engineering by Intevation GmbH | |
108 * | |
109 * Author(s): | |
110 * Thomas Junk <thomas.junk@intevation.de> | |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
111 * Markus Kottländer <markus.kottlaender@intevation.de> |
2578 | 112 */ |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
113 |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
114 import { mapState, mapGetters } from "vuex"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
115 import { displayError, displayInfo } from "@/lib/errors"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
116 import { STATES } from "@/store/imports"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
117 import { sortTable } from "@/lib/mixins"; |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
118 import { HTTP } from "@/lib/http.js"; |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
119 import { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
120 startOfDay, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
121 startOfHour, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
122 endOfHour, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
123 endOfDay, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
124 addDays, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
125 subDays, |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
126 format |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
127 } from "date-fns"; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
128 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
129 export default { |
2578 | 130 components: { |
131 Filters: () => import("./Filters.vue"), | |
132 LogEntry: () => import("./LogEntry.vue") | |
133 }, | |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
134 mixins: [sortTable], |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
135 LAST_HOUR: "lasthour", |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
136 TODAY: "today", |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
137 LAST_7_DAYS: "lastsevendays", |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
138 LAST_30_DAYS: "lastthirtydays", |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
139 data() { |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
140 return { |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
141 loading: false, |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
142 selectedInterval: this.$options.LAST_HOUR |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
143 }; |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
144 }, |
2578 | 145 computed: { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
146 ...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
|
147 ...mapState("imports", [ |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
148 "show", |
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 "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
|
150 "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
|
151 "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
|
152 "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
|
153 "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
|
154 "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
|
155 ]), |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
156 ...mapGetters("imports", ["filters"]), |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
157 importReviewLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
158 return this.$gettext("Import review"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
159 }, |
2779
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
160 idLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
161 return this.$gettext("Id"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
162 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
163 kindLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
164 return this.$gettext("Kind"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
165 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
166 enqueuedLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
167 return this.$gettext("Enqueued"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
168 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
169 userLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
170 return this.$gettext("User"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
171 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
172 signerLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
173 return this.$gettext("Signer"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
174 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
175 statusLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
176 return this.$gettext("Status"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
177 }, |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
178 interval() { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
179 return [this.startDate, this.endDate]; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
180 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
181 }, |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
182 watch: { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
183 $route() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
184 const { id } = this.$route.params; |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
185 if (id) this.showSingleRessource(id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
186 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
187 selectedInterval() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
188 const now = new Date(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
189 switch (this.selectedInterval) { |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
190 case this.$options.LAST_HOUR: |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
191 this.$store.commit("imports/setStartDate", startOfHour(now)); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
192 this.$store.commit("imports/setEndDate", now); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
193 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
194 case this.$options.TODAY: |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
195 this.$store.commit("imports/setStartDate", startOfDay(now)); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
196 this.$store.commit("imports/setEndDate", now); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
197 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
198 case this.$options.LAST_7_DAYS: |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
199 this.$store.commit( |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
200 "imports/setStartDate", |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
201 subDays(startOfDay(now), 7) |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
202 ); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
203 this.$store.commit("imports/setEndDate", now); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
204 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
205 case this.$options.LAST_30_DAYS: |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
206 this.$store.commit( |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
207 "imports/setStartDate", |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
208 subDays(startOfDay(now), 30) |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
209 ); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
210 this.$store.commit("imports/setEndDate", now); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
211 break; |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
212 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
213 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
214 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
215 imports() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
216 if (this.imports.length == 0) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
217 if (this.next) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
218 const [start, end] = this.determineInterval(this.next); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
219 this.$store.commit("imports/setStartDate", start); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
220 this.$store.commit("imports/setEndDate", end); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
221 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
222 } else if (this.prev) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
223 const [start, end] = this.determineInterval(this.prev); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
224 this.$store.commit("imports/setStartDate", start); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
225 this.$store.commit("imports/setEndDate", end); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
226 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
227 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
228 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
229 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
230 filters() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
231 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
232 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
233 }, |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
234 methods: { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
235 showSingleRessource(id) { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
236 id = id * 1; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
237 this.loadDetails(id) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
238 .then(response => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
239 this.$store.commit("imports/setCurrentDetails", response.data); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
240 const { enqueued } = response.data; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
241 this.$store.commit("imports/setStartDate", startOfHour(enqueued)); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
242 this.$store.commit("imports/setEndDate", endOfHour(enqueued)); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
243 this.$store.commit("imports/showDetailsFor", id); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
244 this.loadLogs(); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
245 }) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
246 .catch(error => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
247 this.loading = false; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
248 this.$store.commit("imports/setCurrentDetails", {}); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
249 const { status, data } = error.response; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
250 displayError({ |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
251 title: this.$gettext("Backend Error"), |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
252 message: `${status}: ${data.message || data}` |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
253 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
254 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
255 }, |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
256 loadDetails(id) { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
257 return new Promise((resolve, reject) => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
258 HTTP.get("/imports/" + id, { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
259 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
260 }) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
261 .then(response => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
262 resolve(response); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
263 }) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
264 .catch(error => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
265 reject(error); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
266 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
267 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
268 }, |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
269 determineInterval(pointInTime) { |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
270 let start, end; |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
271 switch (this.selectedInterval) { |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
272 case this.$options.LAST_HOUR: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
273 start = startOfHour(pointInTime); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
274 end = endOfHour(pointInTime); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
275 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
276 case this.$options.TODAY: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
277 start = startOfDay(pointInTime); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
278 end = endOfDay(pointInTime); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
279 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
280 case this.$options.LAST_7_DAYS: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
281 start = startOfDay(pointInTime); |
2847
4da07a11e6e1
import_overview: fix date calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2840
diff
changeset
|
282 end = endOfDay(addDays(start, 7)); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
283 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
284 case this.$options.LAST_30_DAYS: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
285 start = startOfDay(pointInTime); |
2847
4da07a11e6e1
import_overview: fix date calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2840
diff
changeset
|
286 end = endOfDay(addDays(start, 30)); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
287 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
288 } |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
289 return [start, end]; |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
290 }, |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
291 earlier() { |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
292 if (!this.prev) return; |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
293 const [start, end] = this.determineInterval(this.prev); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
294 this.$store.commit("imports/setStartDate", start); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
295 this.$store.commit("imports/setEndDate", end); |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
296 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
297 }, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
298 later() { |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
299 if (!this.next) return; |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
300 const [start, end] = this.determineInterval(this.next); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
301 this.$store.commit("imports/setStartDate", start); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
302 this.$store.commit("imports/setEndDate", end); |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
303 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
304 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
305 filteredImports() { |
2749
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
306 return this.imports; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
307 }, |
2789
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
308 loadUpdatedLogs() { |
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
309 const [start, end] = this.determineInterval(new Date()); |
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
310 this.$store.commit("imports/setStartDate", start); |
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
311 this.$store.commit("imports/setEndDate", end); |
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
312 this.loadLogs(); |
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
313 }, |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
314 loadLogs() { |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
315 this.loading = true; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
316 this.$store |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
317 .dispatch("imports/getImports", { |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
318 filter: this.filters, |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
319 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
|
320 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
|
321 query: this.searchQuery |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
322 }) |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
323 .then(() => { |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
324 if (this.show != -1) { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
325 this.loadDetails(this.show) |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
326 .then(response => { |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
327 this.$store.commit("imports/setCurrentDetails", response.data); |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
328 this.loading = false; |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
329 }) |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
330 .catch(error => { |
2796
718ec88fbeed
import_overview: disable loading spinner in case of errors
Thomas Junk <thomas.junk@intevation.de>
parents:
2789
diff
changeset
|
331 this.loading = false; |
718ec88fbeed
import_overview: disable loading spinner in case of errors
Thomas Junk <thomas.junk@intevation.de>
parents:
2789
diff
changeset
|
332 this.$store.commit("imports/setCurrentDetails", {}); |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
333 const { status, data } = error.response; |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
334 displayError({ |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
335 title: this.$gettext("Backend Error"), |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
336 message: `${status}: ${data.message || data}` |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
337 }); |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
338 }); |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
339 } else { |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
340 this.loading = false; |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
341 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
342 }) |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
343 .catch(error => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
344 const { status, data } = error.response; |
2796
718ec88fbeed
import_overview: disable loading spinner in case of errors
Thomas Junk <thomas.junk@intevation.de>
parents:
2789
diff
changeset
|
345 this.loading = false; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
346 displayError({ |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
347 title: this.$gettext("Backend Error"), |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
348 message: `${status}: ${data.message || data}` |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
349 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
350 }); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
351 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
352 save() { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
353 if (!this.reviewed.length) return; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
354 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
355 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
|
356 this.reviewed.forEach(r => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
357 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
|
358 let approved = STATES.APPROVED === r.status; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
359 popupContent += `<tr> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
360 <td>${imp.id}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
361 <td>${imp.kind.toUpperCase()}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
362 <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
|
363 <td class="text-${approved ? "success" : "danger"}"> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
364 ${this.$gettext(approved ? "approved" : "declined")} |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
365 </td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
366 </tr>`; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
367 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
368 popupContent += "</table>"; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
369 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
370 this.$store.commit("application/popup", { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
371 icon: "clipboard-check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
372 title: this.$gettext("Finish Review"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
373 padding: false, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
374 big: true, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
375 content: popupContent, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
376 confirm: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
377 icon: "check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
378 callback: () => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
379 let data = this.reviewed.map(r => ({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
380 id: r.id, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
381 state: r.status |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
382 })); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
383 this.$store |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
384 .dispatch("imports/confirmReview", data) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
385 .then(response => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
386 this.loadLogs(); |
2638
6c1730fc3dc1
client: importsoverview2: clear reviewed array after finishing review
Markus Kottlaender <markus@intevation.de>
parents:
2632
diff
changeset
|
387 this.$store.commit("imports/setReviewed", []); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
388 const messages = response.data |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
389 .map(x => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
390 if (x.message) return x.message; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
391 if (x.error) return x.error; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
392 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
393 .join("\n\n"); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
394 displayInfo({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
395 title: "Staging Area", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
396 message: messages, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
397 options: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
398 timeout: 0, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
399 buttons: [{ text: "Ok", action: null, bold: true }] |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
400 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
401 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
402 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
403 .catch(error => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
404 const { status, data } = error.response; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
405 displayError({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
406 title: "Backend Error", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
407 message: `${status}: ${data.message || data}` |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
408 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
409 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
410 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
411 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
412 cancel: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
413 label: this.$gettext("Cancel"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
414 icon: "times" |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
415 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
416 }); |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
417 } |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
418 }, |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
419 mounted() { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
420 const { id } = this.$route.params; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
421 if (!id) { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
422 this.$store.commit("application/searchQuery", ""); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
423 this.loadLogs(); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
424 } else { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
425 this.showSingleRessource(id); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
426 } |
2578 | 427 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
428 }; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
429 </script> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
430 |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
431 <style lang="scss" scoped> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
432 .date { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
433 font-stretch: condensed; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
434 } |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
435 .interval-select { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
436 padding: 0px; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
437 margin: 0px; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
438 font-size: 80%; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
439 } |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
440 </style> |