annotate client/src/components/importqueue/Importqueuedetail.vue @ 1568:ce59e73a0cef

importqueue: internationalization 24h format
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 12 Dec 2018 14:50:28 +0100
parents ed67857a2079
children 98a1636c7255
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>
1566
Thomas Junk <thomas.junk@intevation.de>
parents: 1562
diff changeset
2 <div class="entry d-flex flex-column py-1 border-bottom">
1555
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 " - " +
1568
ce59e73a0cef importqueue: internationalization 24h format
Thomas Junk <thomas.junk@intevation.de>
parents: 1567
diff changeset
144 d.toLocaleTimeString(locale2, {
ce59e73a0cef importqueue: internationalization 24h format
Thomas Junk <thomas.junk@intevation.de>
parents: 1567
diff changeset
145 hour12: false
ce59e73a0cef importqueue: internationalization 24h format
Thomas Junk <thomas.junk@intevation.de>
parents: 1567
diff changeset
146 })
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
147 );
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
148 },
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
149 showDetails(id) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
150 if (this.show) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
151 this.show = false;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
152 return;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
153 }
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
154 if (this.entries.length === 0) {
1561
ad3a19e222bb importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents: 1559
diff changeset
155 this.loading = true;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
156 HTTP.get("/imports/" + id, {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
157 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
158 })
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
159 .then(response => {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
160 const { entries } = response.data;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
161 this.entries = entries;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
162 this.show = true;
1561
ad3a19e222bb importqueue: loading indicator
Thomas Junk <thomas.junk@intevation.de>
parents: 1559
diff changeset
163 this.loading = false;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
164 })
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
165 .catch(error => {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
166 const { status, data } = error.response;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
167 displayError({
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
168 title: this.$gettext("Backend Error"),
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
169 message: `${status}: ${data.message || data}`
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
170 });
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
171 });
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
172 } else {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
173 this.show = true;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
174 }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
175 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
176 },
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
177 computed: {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
178 sortedEntries() {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
179 let sorted = this.entries.slice();
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
180 sorted.sort((r1, r2) => {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
181 let d1 = new Date(r1.time);
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
182 let d2 = new Date(r2.time);
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
183 if (d2 < d1) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
184 return !this.sortAsc ? -1 : 1;
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 if (d2 > d1) {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
187 return !this.sortAsc ? 1 : -1;
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 0;
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 return sorted;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
192 },
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
193 sortIcon() {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
194 return this.sortAsc ? "sort-amount-down" : "sort-amount-up";
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
195 },
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
196 icon() {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
197 return {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
198 "angle-up": !this.show,
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
199 "angle-down": this.show
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 },
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
202 collapse() {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
203 return {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
204 details: true,
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
205 collapse: true,
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
206 show: this.show,
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
207 "w-100": true
1554
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 }
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 </script>
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
213
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
214 <style lang="scss" scoped>
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
215 .condensed {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
216 font-stretch: condensed;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
217 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
218
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
219 .entry {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
220 background-color: white;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
221 cursor: pointer;
1567
Thomas Junk <thomas.junk@intevation.de>
parents: 1566
diff changeset
222 width: 750px;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
223 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
224
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
225 .entry:hover {
1559
5d84dcb79a54 layout importqueue
Thomas Junk <thomas.junk@intevation.de>
parents: 1558
diff changeset
226 background-color: #efefef;
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
227 transition: 1.6s;
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
228 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
229
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
230 .detailstable {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
231 margin-left: $offset;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
232 margin-right: $large-offset;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
233 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
234
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
235 .detailsbutton {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
236 position: absolute;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
237 top: 0;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
238 right: 0;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
239 height: 100%;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
240 }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
241 .jobid {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
242 width: 80px;
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 .enqueued {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
246 width: 120px;
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 .user {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
250 width: 80px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
251 }
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 .signer {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
254 width: 80px;
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
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
257 .kind {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
258 width: 80px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
259 }
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 .state {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
262 width: 80px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
263 }
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 .details {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
266 width: 50%;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
267 }
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 .detailsrow {
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
270 line-height: 0.1em;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
271 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
272
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
273 .type {
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
274 width: 65px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
275 padding-left: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
276 border-top: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
277 padding-bottom: $small-offset;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
278 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
279
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
280 .datetime {
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
281 width: 200px;
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
282 padding-left: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
283 border-top: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
284 padding-bottom: $small-offset;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
285 }
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
286
1562
7ac802add1b9 reload strategy for details on refreshing
Thomas Junk <thomas.junk@intevation.de>
parents: 1561
diff changeset
287 .message {
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
288 width: 600px;
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
289 padding-left: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
290 border-top: 0px;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
291 padding-bottom: $small-offset;
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
292 }
1555
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
293
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
294 thead,
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
295 tbody {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
296 display: block;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
297 }
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
298
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
299 tbody {
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
300 height: 150px;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
301 overflow-y: auto;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
302 overflow-x: hidden;
a3c2b192daa2 importqueue better collapsible behaviour
Thomas Junk <thomas.junk@intevation.de>
parents: 1554
diff changeset
303 }
1554
15d736a402c9 importqueue as collapsible
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
304 </style>