Mercurial > gemma
annotate client/src/components/importoverview/importlogs/Logs.vue @ 2457:374ee552ca85
client: immediately load data for menu indicator
I always forget that setInterval runs for first time _after_ the interval past, not immediately.
So now the code is executed on mount and then in a 15s inteval.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 04 Mar 2019 07:46:53 +0100 |
parents | 0c9121abf120 |
children |
rev | line source |
---|---|
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 <div class="w-95"> |
2428 | 3 <div class="text-left"> |
4 <h6><translate>Logs</translate></h6> | |
5 </div> | |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 <div class="d-flex justify-content-between flex-row"> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 <button @click="setFilter('failed')" :class="failedStyle"> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 <translate>Failed</translate> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 </button> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
10 <button @click="setFilter('pending')" :class="pendingStyle"> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
11 <translate>Pending</translate> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 </button> |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
13 <button @click="setFilter('declined')" :class="rejectedStyle"> |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
14 <translate>Rejected</translate> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 </button> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
16 <button @click="setFilter('accepted')" :class="acceptedStyle"> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 <translate>Accepted</translate> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 </button> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
19 <button @click="setFilter('warning')" :class="warningStyle"> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
20 <translate>Warning</translate> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
21 </button> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
22 </div> |
2429 | 23 <div class="mt-3 logdetails"> |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
24 <div v-for="job in imports" :key="job.id" class="d-flex flex-row"> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
25 <LogDetail :job="job"></LogDetail> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 </div> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
27 </div> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 </div> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 </template> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
31 <script> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
32 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
33 * without warranty, see README.md and license for details. |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
34 * |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 * SPDX-License-Identifier: AGPL-3.0-or-later |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
36 * License-Filename: LICENSES/AGPL-3.0.txt |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
37 * |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
38 * Copyright (C) 2018 by via donau |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 * – Österreichische Wasserstraßen-Gesellschaft mbH |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
40 * Software engineering by Intevation GmbH |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
41 * |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 * Author(s): |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 * Thomas Junk <thomas.junk@intevation.de> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
44 */ |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
45 |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
46 import { mapState } from "vuex"; |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
47 import { displayError } from "@/lib/errors.js"; |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
48 |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
49 export default { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
50 name: "logsection", |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
51 components: { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
52 LogDetail: () => import("./LogDetail.vue") |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
53 }, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
54 props: ["reload"], |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
55 data() { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
56 return { |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
57 loading: false, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
58 failed: false, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
59 pending: false, |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
60 declined: false, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
61 accepted: false, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
62 warning: false |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
63 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
64 }, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 computed: { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 ...mapState("imports", ["imports"]), |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 pendingStyle() { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
68 return { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
69 btn: true, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
70 "btn-sm": true, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
71 "btn-outline-info": !this.pending, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
72 "btn-info": this.pending |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
73 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 }, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
75 failedStyle() { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
76 return { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 btn: true, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
78 "btn-sm": true, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
79 "btn-outline-info": !this.failed, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
80 "btn-info": this.failed |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
81 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
82 }, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
83 rejectedStyle() { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 return { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 btn: true, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 "btn-sm": true, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
87 "btn-outline-info": !this.declined, |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
88 "btn-info": this.declined |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
89 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
90 }, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
91 acceptedStyle() { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
92 return { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
93 btn: true, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
94 "btn-sm": true, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
95 "btn-outline-info": !this.accepted, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 "btn-info": this.accepted |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
98 }, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
99 warningStyle() { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
100 return { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
101 btn: true, |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
102 "btn-sm": true, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
103 "btn-outline-info": !this.warning, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
104 "btn-info": this.warning |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
105 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
106 } |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
107 }, |
2449
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
108 watch: { |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
109 reload() { |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
110 if (!this.reload) return; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
111 this.warning = false; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
112 this.successful = false; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
113 this.failed = false; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
114 this.pending = false; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
115 this.accepted = false; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
116 this.declined = false; |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
117 } |
0c9121abf120
staging: reload button clears filtering
Thomas Junk <thomas.junk@intevation.de>
parents:
2447
diff
changeset
|
118 }, |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
119 methods: { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
120 setFilter(name) { |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
121 if (this.loading) return; |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
122 this[name] = !this[name]; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
123 const allSet = |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
124 this.failed && |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
125 this.pending && |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
126 this.accepted && |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
127 this.declined && |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
128 this.warning; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
129 if (allSet) { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
130 this.warning = false; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
131 this.successful = false; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
132 this.failed = false; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
133 this.pending = false; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
134 this.accepted = false; |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
135 this.declined = false; |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
136 } |
2447
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
137 this.loadFiltered(); |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
138 }, |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
139 loadFiltered() { |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
140 this.loading = true; |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
141 const filter = [ |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
142 "failed", |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
143 "pending", |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
144 "accepted", |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
145 "declined", |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
146 "warning" |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
147 ].filter(x => this[x]); |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
148 this.$store |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
149 .dispatch("imports/getImports", filter) |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
150 .then(() => { |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
151 this.loading = false; |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
152 }) |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
153 .catch(error => { |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
154 this.loading = false; |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
155 const { status, data } = error.response; |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
156 displayError({ |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
157 title: this.$gettext("Backend Error"), |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
158 message: `${status}: ${data.message || data}` |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
159 }); |
522024fa06eb
staging: filter logs on server
Thomas Junk <thomas.junk@intevation.de>
parents:
2443
diff
changeset
|
160 }); |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
161 } |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
162 } |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
163 }; |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
164 </script> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
165 |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
166 <style lang="scss" scoped> |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
167 .logdetails { |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
168 overflow-y: auto; |
2443
6694603471a5
staging: layout logs
Thomas Junk <thomas.junk@intevation.de>
parents:
2429
diff
changeset
|
169 max-height: 650px; |
2422
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
170 } |
77baf4f0ee1e
logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
171 </style> |