Mercurial > gemma
annotate client/src/components/importschedule/Importschedule.vue @ 2299:41218dd386a9
import_schedule: display of cron and email again
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 18 Feb 2019 12:07:03 +0100 |
parents | 431f97fd873b |
children | 7b79d4966a87 |
rev | line source |
---|---|
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 <div class="d-flex flex-row"> |
1606
a4d8f284db93
spacer in admin interface added
Thomas Junk <thomas.junk@intevation.de>
parents:
1575
diff
changeset
|
3 <Spacer></Spacer> |
1532
44e094330272
automatic imports: fields added
Thomas Junk <thomas.junk@intevation.de>
parents:
1529
diff
changeset
|
4 <div class="mt-3 w-100"> |
44e094330272
automatic imports: fields added
Thomas Junk <thomas.junk@intevation.de>
parents:
1529
diff
changeset
|
5 <div class="card flex-grow-1 schedulecard shadow-xs"> |
1480 | 6 <h6 |
7 class="mb-0 py-2 px-3 border-bottom d-flex text-info align-items-center" | |
8 > | |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
9 <font-awesome-icon icon="clock" class="mr-2"></font-awesome-icon> |
1607
38f91897ca69
import sounding result in new section
Thomas Junk <thomas.junk@intevation.de>
parents:
1606
diff
changeset
|
10 <translate class="headline">Imports</translate> |
1455
33dda08d67be
unified layout for adminsection
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
11 </h6> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 <div class="card-body schedulecardbody"> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 <div class="card-body schedulecardbody"> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
14 <div class="searchandfilter mb-3 w-50 d-flex flex-row"> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 <div class="searchgroup input-group"> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
16 <div class="input-group-prepend"> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 <span class="input-group-text" id="search"> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 <font-awesome-icon icon="search"></font-awesome-icon> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
19 </span> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
20 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
21 <input |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
22 v-model="searchQuery" |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
23 type="text" |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
24 class="form-control" |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
25 placeholder |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 aria-label="Search" |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
27 aria-describedby="search" |
1480 | 28 /> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
31 <table v-if="schedules.length" class="table"> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
32 <thead> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
33 <tr> |
1480 | 34 <th><translate>Import</translate></th> |
35 <th><translate>Type</translate></th> | |
36 <th><translate>Author</translate></th> | |
37 <th><translate>Schedule</translate></th> | |
38 <th><translate>Email</translate></th> | |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 <th> </th> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
40 <th> </th> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
41 <th> </th> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
42 </tr> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
43 </thead> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
44 <tbody> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
45 <tr v-for="schedule in schedules" :key="schedule.id"> |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
46 <td>{{ schedule.id }}</td> |
1892
b43ee5f73c05
fix: consequentially uppercasing import kind in all overviews
Thomas Junk <thomas.junk@intevation.de>
parents:
1774
diff
changeset
|
47 <td>{{ schedule.kind.toUpperCase() }}</td> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
48 <td>{{ schedule.user }}</td> |
2299
41218dd386a9
import_schedule: display of cron and email again
Thomas Junk <thomas.junk@intevation.de>
parents:
2033
diff
changeset
|
49 <td>{{ schedule.config.cron }}</td> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
50 <td> |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
51 <font-awesome-icon |
2299
41218dd386a9
import_schedule: display of cron and email again
Thomas Junk <thomas.junk@intevation.de>
parents:
2033
diff
changeset
|
52 v-if="schedule.config['send-email']" |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
53 class="fa-fw mr-2" |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
54 fixed-width |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
55 icon="check" |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
56 ></font-awesome-icon> |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
57 </td> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
58 <td> |
1480 | 59 <font-awesome-icon |
1771
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
60 :style="activeStyle" |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
61 @click="editSchedule(schedule.id)" |
1480 | 62 icon="pencil-alt" |
63 fixed-width | |
64 ></font-awesome-icon> | |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 </td> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
66 <td> |
1480 | 67 <font-awesome-icon |
1771
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
68 :style="activeStyle" |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
69 @click="deleteSchedule(schedule.id)" |
1480 | 70 icon="trash" |
71 fixed-width | |
72 ></font-awesome-icon> | |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
73 </td> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
74 <td> |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
75 <font-awesome-icon |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
76 @click="triggerManualImport(schedule.id)" |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
77 class="fa-fw mr-2" |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
78 fixed-width |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
79 icon="play" |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
80 ></font-awesome-icon> |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
81 </td> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
82 </tr> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
83 </tbody> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 </table> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 <div v-else class="mt-4 small text-center py-3"> |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
86 <translate>No scheduled imports</translate> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
87 </div> |
1774
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
88 <div class="text-right"> |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
89 <button |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
90 :disabled="importScheduleDetailVisible" |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
91 @click="newImport" |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
92 class="btn btn-info newbutton" |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
93 > |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
94 <translate>New Import</translate> |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
95 </button> |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
96 </div> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
98 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
99 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
100 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
101 <Importscheduledetail></Importscheduledetail> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
102 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
103 </template> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
104 |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
105 <script> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
106 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
107 * without warranty, see README.md and license for details. |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
108 * |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
109 * SPDX-License-Identifier: AGPL-3.0-or-later |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
110 * License-Filename: LICENSES/AGPL-3.0.txt |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
111 * |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
112 * Copyright (C) 2018 by via donau |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
113 * – Österreichische Wasserstraßen-Gesellschaft mbH |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
114 * Software engineering by Intevation GmbH |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
115 * |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
116 * Author(s): |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
117 * Thomas Junk <thomas.junk@intevation.de> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
118 */ |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
119 |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
120 import { mapState } from "vuex"; |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
121 import { HTTP } from "@/lib/http"; |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
122 import { displayInfo, displayError } from "@/lib/errors.js"; |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
123 |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
124 export default { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
125 name: "importschedule", |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
126 components: { |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
127 Importscheduledetail: () => import("./Importscheduledetail"), |
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
128 Spacer: () => import("@/components/Spacer") |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
129 }, |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
130 data() { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
131 return { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
132 searchQuery: "" |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
133 }; |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
134 }, |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
135 mounted() { |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
136 this.getSchedules(); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
137 }, |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
138 methods: { |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
139 editSchedule(id) { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
140 this.$store |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
141 .dispatch("importschedule/loadSchedule", id) |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
142 .then(() => { |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
143 this.$store.commit("importschedule/setImportScheduleDetailVisible"); |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
144 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
145 .catch(error => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
146 const { status, data } = error.response; |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
147 displayError({ |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
148 title: this.$gettext("Backend Error"), |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
149 message: `${status}: ${data.message || data}` |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
150 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
151 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
152 }, |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
153 triggerManualImport(id) { |
1745
6eb099690279
importschedule: play button active
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
154 HTTP.get("/imports/config/" + id + "/run", { |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
155 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
156 }) |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
157 .then(response => { |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
158 const { id } = response.data; |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
159 displayInfo({ |
1745
6eb099690279
importschedule: play button active
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
160 title: this.$gettext("Imports"), |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
161 message: this.$gettext("Manually triggered import: #") + id |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
162 }); |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
163 }) |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
164 .catch(error => { |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
165 const { status, data } = error.response; |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
166 displayError({ |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
167 title: this.$gettext("Backend Error"), |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
168 message: `${status}: ${data.message || data}` |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
169 }); |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
170 }); |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
171 }, |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
172 getSchedules() { |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
173 this.$store.dispatch("importschedule/loadSchedules").catch(error => { |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
174 const { status, data } = error.response; |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
175 displayError({ |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
176 title: this.$gettext("Backend Error"), |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
177 message: `${status}: ${data.message || data}` |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
178 }); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
179 }); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
180 }, |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
181 newImport() { |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
182 this.$store.commit("importschedule/setImportScheduleDetailVisible"); |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
183 }, |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
184 deleteSchedule(index) { |
1771
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
185 if (this.importScheduleDetailVisible) return; |
1728
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
186 this.$store |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
187 .dispatch("importschedule/deleteSchedule", index) |
1728
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
188 .then(() => { |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
189 this.getSchedules(); |
1771
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
190 displayInfo({ |
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
191 title: this.$gettext("Imports"), |
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
192 message: this.$gettext("Deleted import: #") + index |
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
193 }); |
1728
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
194 }) |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
195 .catch(error => { |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
196 const { status, data } = error.response; |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
197 displayError({ |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
198 title: this.$gettext("Backend Error"), |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
199 message: `${status}: ${data.message || data}` |
647195199dc8
importschedule: now with display of cron and delete function
Thomas Junk <thomas.junk@intevation.de>
parents:
1725
diff
changeset
|
200 }); |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
201 }); |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
202 } |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
203 }, |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
204 computed: { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
205 ...mapState("application", ["showSidebar"]), |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
206 ...mapState("importschedule", ["schedules", "importScheduleDetailVisible"]), |
1771
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
207 activeStyle() { |
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
208 const color = this.importScheduleDetailVisible ? "#aeaeae" : "#000000"; |
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
209 return { color: color }; |
88b8da513944
deactivate delete and edit action during editing
Thomas Junk <thomas.junk@intevation.de>
parents:
1768
diff
changeset
|
210 }, |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
211 spacerStyle() { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
212 return [ |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
213 "spacer ml-3", |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
214 { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
215 "spacer-expanded": this.showSidebar, |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
216 "spacer-collapsed": !this.showSidebar |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
217 } |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
218 ]; |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
219 } |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
220 } |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
221 }; |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
222 </script> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
223 |
1449 | 224 <style lang="scss" scoped> |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
225 th { |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
226 border-top: 0px; |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
227 } |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
228 |
1774
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
229 .card-body { |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
230 padding-bottom: $small-offset; |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
231 } |
f9ac2d4d2069
new button relayouted
Thomas Junk <thomas.junk@intevation.de>
parents:
1771
diff
changeset
|
232 |
1449 | 233 .schedulecard { |
1529 | 234 margin-right: $offset; |
1449 | 235 min-height: 20rem; |
236 } | |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
237 |
1449 | 238 .schedulecard-body { |
239 width: 100%; | |
240 margin-left: auto; | |
241 margin-right: auto; | |
242 } | |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
243 </style> |