Mercurial > gemma
annotate client/src/components/importqueue/Importqueuedetail.vue @ 1561:ad3a19e222bb
importqueue: loading indicator
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 12 Dec 2018 11:24:47 +0100 |
parents | 5d84dcb79a54 |
children | 7ac802add1b9 |
rev | line source |
---|---|
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
2 <div class="entry d-flex flex-column py-1 border-bottom w-50"> |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
3 <div class="d-flex flex-row position-relative"> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
4 <div @click="showDetails(job.id)" class="jobid ml-2 mt-1 mr-2"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
5 {{ job.id }} |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
6 </div> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
7 <div @click="showDetails(job.id)" class="enqueued mt-1 mr-2"> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 {{ formatDate(job.enqueued) }} |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 </div> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
10 <div @click="showDetails(job.id)" class="kind mt-1 mr-2"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
11 {{ job.kind }} |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
12 </div> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
13 <div @click="showDetails(job.id)" class="user mt-1 mr-2"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
14 {{ job.user }} |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
15 </div> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
16 <div @click="showDetails(job.id)" class="signer mt-1 mr-2"> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 {{ job.signer }} |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 </div> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
19 <div @click="showDetails(job.id)" class="state mt-1 mr-2"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
20 {{ job.state }} |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
21 </div> |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
22 <div @click="showDetails(job.id)" class="mt-1 text-info detailsbutton"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
23 <font-awesome-icon |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
24 v-if="show" |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
25 icon="angle-up" |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
26 fixed-width |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
27 ></font-awesome-icon> |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
28 <font-awesome-icon |
1561
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
29 v-if="loading" |
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
30 icon="spinner" |
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
31 fixed-width |
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
32 ></font-awesome-icon> |
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
33 <font-awesome-icon |
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
34 v-if="!show && !loading" |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
35 icon="angle-down" |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
36 fixed-width |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
37 ></font-awesome-icon> |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
38 </div> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 </div> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
40 <div class="detailstable d-flex flex-row"> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
41 <div :class="collapse"> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 <table class="table table-responsive"> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 <thead> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
44 <tr> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
45 <th class="first pb-0"> |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
46 <small class="condensed"><translate>Kind</translate></small> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
47 </th> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
48 <th class="second pb-0"> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
49 <a href="#" @click="sortAsc = !sortAsc" class="sort-link" |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
50 ><small class="condensed"><translate>Date</translate></small> |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
51 <small class="condensed" |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
52 ><font-awesome-icon |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
53 :icon="sortIcon" |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
54 class="ml-1" |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
55 ></font-awesome-icon></small |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
56 ></a> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
57 </th> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
58 <th class="third pb-0"> |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
59 <small class="condensed"><translate>Message</translate></small> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
60 </th> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
61 </tr> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
62 </thead> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
63 <tbody> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
64 <tr |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 v-for="(entry, index) in sortedEntries" |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 :key="index" |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
67 class="detailsrow" |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
68 > |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
69 <td class="first"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
70 <span class="condensed">{{ entry.kind }}</span> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
71 </td> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
72 <td class="second"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
73 <span class="condensed">{{ formatDate(entry.time) }}</span> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 </td> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
75 <td class="third"> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
76 <span class="condensed">{{ entry.message }}</span> |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 </td> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
78 </tr> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
79 </tbody> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
80 </table> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
81 </div> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
82 </div> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
83 </div> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 </template> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 <script> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
87 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
88 * without warranty, see README.md and license for details. |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
89 * |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
90 * SPDX-License-Identifier: AGPL-3.0-or-later |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
91 * License-Filename: LICENSES/AGPL-3.0.txt |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
92 * |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
93 * Copyright (C) 2018 by via donau |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
94 * – Österreichische Wasserstraßen-Gesellschaft mbH |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
95 * Software engineering by Intevation GmbH |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 * |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 * Author(s): |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
98 * Thomas Junk <thomas.junk@intevation.de> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
99 */ |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
100 |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
101 import { HTTP } from "../../lib/http.js"; |
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
102 import { displayError } from "../../lib/errors.js"; |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
103 import locale2 from "locale2"; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
104 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
105 export default { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
106 name: "importqueuedetail", |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
107 props: ["job"], |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
108 data() { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
109 return { |
1561
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
110 loading: false, |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
111 show: false, |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
112 entries: [], |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
113 sortAsc: true |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
114 }; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
115 }, |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
116 methods: { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
117 formatDate(date) { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
118 return date |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
119 ? new Date(date).toLocaleDateString(locale2, { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
120 day: "2-digit", |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
121 month: "2-digit", |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
122 year: "numeric" |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
123 }) |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
124 : ""; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
125 }, |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
126 showDetails(id) { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
127 if (this.show) { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
128 this.show = false; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
129 return; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
130 } |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
131 if (this.entries.length === 0) { |
1561
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
132 this.loading = true; |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
133 HTTP.get("/imports/" + id, { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
134 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
135 }) |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
136 .then(response => { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
137 const { entries } = response.data; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
138 this.entries = entries; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
139 this.show = true; |
1561
ad3a19e222bb
importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents:
1559
diff
changeset
|
140 this.loading = false; |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
141 }) |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
142 .catch(error => { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
143 const { status, data } = error.response; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
144 displayError({ |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
145 title: this.$gettext("Backend Error"), |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
146 message: `${status}: ${data.message || data}` |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
147 }); |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
148 }); |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
149 } else { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
150 this.show = true; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
151 } |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
152 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
153 }, |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
154 computed: { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
155 sortedEntries() { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
156 let sorted = this.entries.slice(); |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
157 sorted.sort((r1, r2) => { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
158 let d1 = new Date(r1.time); |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
159 let d2 = new Date(r2.time); |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
160 if (d2 < d1) { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
161 return !this.sortAsc ? -1 : 1; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
162 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
163 if (d2 > d1) { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
164 return !this.sortAsc ? 1 : -1; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
165 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
166 return 0; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
167 }); |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
168 return sorted; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
169 }, |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
170 sortIcon() { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
171 return this.sortAsc ? "sort-amount-down" : "sort-amount-up"; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
172 }, |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
173 icon() { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
174 return { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
175 "angle-up": !this.show, |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
176 "angle-down": this.show |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
177 }; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
178 }, |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
179 collapse() { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
180 return { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
181 details: true, |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
182 collapse: true, |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
183 show: this.show, |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
184 "w-100": true |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
185 }; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
186 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
187 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
188 }; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
189 </script> |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
190 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
191 <style lang="scss" scoped> |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
192 .condensed { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
193 font-stretch: condensed; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
194 } |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
195 |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
196 .entry { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
197 background-color: white; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
198 cursor: pointer; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
199 } |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
200 |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
201 .entry:hover { |
1559
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
202 background-color: #efefef; |
5d84dcb79a54
layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents:
1558
diff
changeset
|
203 transition: 1.5s; |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
204 } |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
205 |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
206 .detailstable { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
207 margin-left: $offset; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
208 margin-right: $large-offset; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
209 } |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
210 |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
211 .detailsbutton { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
212 position: absolute; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
213 top: 0; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
214 right: 0; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
215 height: 100%; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
216 } |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
217 .jobid { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
218 width: 80px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
219 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
220 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
221 .enqueued { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
222 width: 120px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
223 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
224 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
225 .user { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
226 width: 80px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
227 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
228 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
229 .signer { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
230 width: 80px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
231 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
232 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
233 .kind { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
234 width: 80px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
235 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
236 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
237 .state { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
238 width: 80px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
239 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
240 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
241 .details { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
242 width: 50%; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
243 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
244 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
245 .detailsrow { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
246 line-height: 0.1em; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
247 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
248 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
249 .first { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
250 width: 65px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
251 padding-left: 0px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
252 border-top: 0px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
253 padding-bottom: $small-offset; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
254 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
255 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
256 .second { |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
257 width: 100px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
258 padding-left: 0px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
259 border-top: 0px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
260 padding-bottom: $small-offset; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
261 } |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
262 |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
263 .third { |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
264 width: 600px; |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
265 padding-left: 0px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
266 border-top: 0px; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
267 padding-bottom: $small-offset; |
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
268 } |
1555
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
269 |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
270 thead, |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
271 tbody { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
272 display: block; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
273 } |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
274 |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
275 tbody { |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
276 height: 150px; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
277 overflow-y: auto; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
278 overflow-x: hidden; |
a3c2b192daa2
importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents:
1554
diff
changeset
|
279 } |
1554
15d736a402c9
importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
280 </style> |