annotate client/src/components/importqueue/Importqueuedetail.vue @ 1562:7ac802add1b9

reload strategy for details on refreshing
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 12 Dec 2018 11:55:16 +0100
parents ad3a19e222bb
children 20815bf5862f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
45 <th class="type pb-0">
1555
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>
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
48 <th class="datetime 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>
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
58 <th class="message pb-0">
1555
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 >
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
69 <td class="type">
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>
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
72 <td class="datetime">
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
73 <span class="condensed">{{ formatDateTime(entry.time) }}</span>
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 </td>
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
75 <td class="message">
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",
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
107 props: ["job", "reload"],
1554
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 },
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
116 watch: {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
117 reload() {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
118 if (this.reload) {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
119 this.entries = [];
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
120 this.show = false;
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
121 }
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
122 }
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
123 },
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
124 methods: {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
125 formatDate(date) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
126 return date
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
127 ? new Date(date).toLocaleDateString(locale2, {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
128 day: "2-digit",
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
129 month: "2-digit",
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
130 year: "numeric"
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
131 })
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
132 : "";
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
133 },
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
134 formatDateTime(date) {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
135 if (!date) return "";
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
136 const d = new Date(date);
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
137 return (
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
138 d.toLocaleDateString(locale2, {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
139 day: "2-digit",
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
140 month: "2-digit",
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
141 year: "numeric"
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
142 }) +
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
143 " - " +
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
144 d.toLocaleTimeString(locale2)
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
145 );
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
146 },
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
147 showDetails(id) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
148 if (this.show) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
149 this.show = false;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
150 return;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
151 }
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
152 if (this.entries.length === 0) {
1561
ad3a19e222bb importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents: 1559
diff changeset
153 this.loading = true;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
154 HTTP.get("/imports/" + id, {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
155 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
156 })
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
157 .then(response => {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
158 const { entries } = response.data;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
159 this.entries = entries;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
160 this.show = true;
1561
ad3a19e222bb importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents: 1559
diff changeset
161 this.loading = false;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
162 })
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
163 .catch(error => {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
164 const { status, data } = error.response;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
165 displayError({
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
166 title: this.$gettext("Backend Error"),
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
167 message: `${status}: ${data.message || data}`
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
168 });
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
169 });
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
170 } else {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
171 this.show = true;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
172 }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
173 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
174 },
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
175 computed: {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
176 sortedEntries() {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
177 let sorted = this.entries.slice();
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
178 sorted.sort((r1, r2) => {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
179 let d1 = new Date(r1.time);
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
180 let d2 = new Date(r2.time);
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
181 if (d2 < d1) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
182 return !this.sortAsc ? -1 : 1;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
183 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
184 if (d2 > d1) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
185 return !this.sortAsc ? 1 : -1;
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 return 0;
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 return sorted;
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 sortIcon() {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
192 return this.sortAsc ? "sort-amount-down" : "sort-amount-up";
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
193 },
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
194 icon() {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
195 return {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
196 "angle-up": !this.show,
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
197 "angle-down": this.show
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
198 };
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
199 },
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
200 collapse() {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
201 return {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
202 details: true,
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
203 collapse: true,
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
204 show: this.show,
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
205 "w-100": true
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
206 };
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
207 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
208 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
209 };
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
210 </script>
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
211
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
212 <style lang="scss" scoped>
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
213 .condensed {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
214 font-stretch: condensed;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
215 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
216
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
217 .entry {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
218 background-color: white;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
219 cursor: pointer;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
220 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
221
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
222 .entry:hover {
1559
5d84dcb79a54 layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents: 1558
diff changeset
223 background-color: #efefef;
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
224 transition: 1.6s;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
225 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
226
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
227 .detailstable {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
228 margin-left: $offset;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
229 margin-right: $large-offset;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
230 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
231
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
232 .detailsbutton {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
233 position: absolute;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
234 top: 0;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
235 right: 0;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
236 height: 100%;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
237 }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
238 .jobid {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
239 width: 80px;
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
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
242 .enqueued {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
243 width: 120px;
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
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
246 .user {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
247 width: 80px;
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
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
250 .signer {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
251 width: 80px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
252 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
253
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
254 .kind {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
255 width: 80px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
256 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
257
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
258 .state {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
259 width: 80px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
260 }
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 .details {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
263 width: 50%;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
264 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
265
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
266 .detailsrow {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
267 line-height: 0.1em;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
268 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
269
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
270 .type {
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
271 width: 65px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
272 padding-left: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
273 border-top: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
274 padding-bottom: $small-offset;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
275 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
276
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
277 .datetime {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
278 width: 200px;
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
279 padding-left: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
280 border-top: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
281 padding-bottom: $small-offset;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
282 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
283
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
284 .message {
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
285 width: 600px;
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
286 padding-left: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
287 border-top: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
288 padding-bottom: $small-offset;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
289 }
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
290
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
291 thead,
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
292 tbody {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
293 display: block;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
294 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
295
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
296 tbody {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
297 height: 150px;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
298 overflow-y: auto;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
299 overflow-x: hidden;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
300 }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
301 </style>