Mercurial > gemma
annotate client/src/components/importschedule/Importschedule.vue @ 2782:615b0a9b8098
Client: correct strings marking for translations
* correct strings marking passing to UITableHeader
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Fri, 22 Mar 2019 16:23:40 +0100 |
parents | c6fba10926cc |
children | b9a6abef9f1c |
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> |
2534
bb5286acfee2
client: reduced spacings between and inside boxes and more compact main menu
Markus Kottlaender <markus@intevation.de>
parents:
2462
diff
changeset
|
4 <div class="mt-2 w-100"> |
1532
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"> |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2738
diff
changeset
|
6 <UIBoxHeader icon="clock" :title="importScheduleLabel" /> |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
7 <div class="searchandfilter p-3 w-50 mx-auto"> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
8 <div class="searchgroup input-group"> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
9 <div class="input-group-prepend"> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
10 <span class="input-group-text" id="search"> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
11 <font-awesome-icon icon="search"></font-awesome-icon> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
12 </span> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 </div> |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
14 <input |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
15 v-model="searchQuery" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
16 type="text" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
17 class="form-control" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
18 placeholder |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
19 aria-label="Search" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
20 aria-describedby="search" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
21 /> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
22 </div> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
23 </div> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
24 <UITableHeader |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
25 :columns="[ |
2782
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
26 { id: 'id', title: `${idLabel}`, class: 'col-1' }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
27 { id: 'kind', title: `${typeLabel}`, class: 'col-2' }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
28 { id: 'user', title: `${authorLabel}`, class: 'col-2' }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
29 { id: 'config.cron', title: `${scheduleLabel}`, class: 'col-2' }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
30 { id: 'config.send-email', title: `${emailLabel}`, class: 'col-2' } |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
31 ]" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
32 /> |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
33 <UITableBody |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
34 :data="filteredSchedules() | sortTable(sortColumn, sortDirection)" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
35 v-slot="{ item: schedule }" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
36 > |
2640
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
37 <div class="py-1 col-1">{{ schedule.id }}</div> |
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
38 <div class="py-1 col-2">{{ schedule.kind.toUpperCase() }}</div> |
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
39 <div class="py-1 col-2">{{ schedule.user }}</div> |
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
40 <div class="py-1 col-2">{{ schedule.config.cron }}</div> |
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
41 <div class="py-1 col-2 text-center"> |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
42 <font-awesome-icon |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
43 v-if="schedule.config['send-email']" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
44 class="fa-fw mr-2" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
45 fixed-width |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
46 icon="check" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
47 ></font-awesome-icon> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
48 </div> |
2640
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
49 <div class="py-1 col text-right"> |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
50 <button |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
51 @click="editSchedule(schedule.id)" |
2640
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
52 class="btn btn-xs btn-dark mr-1" |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
53 :disabled="importScheduleDetailVisible" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
54 > |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
55 <font-awesome-icon |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
56 icon="pencil-alt" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
57 fixed-width |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
58 ></font-awesome-icon> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
59 </button> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
60 <button |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
61 @click="deleteSchedule(schedule)" |
2640
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
62 class="btn btn-xs btn-dark mr-1" |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
63 :disabled="importScheduleDetailVisible" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
64 > |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
65 <font-awesome-icon icon="trash" fixed-width></font-awesome-icon> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
66 </button> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
67 <button |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
68 @click="triggerManualImport(schedule.id)" |
2640
4bcb26542767
client: use new btn-xs class in tables
Markus Kottlaender <markus@intevation.de>
parents:
2595
diff
changeset
|
69 class="btn btn-xs btn-dark" |
2462
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
70 :disabled="importScheduleDetailVisible" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
71 > |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
72 <font-awesome-icon icon="play" fixed-width></font-awesome-icon> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
73 </button> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
74 </div> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
75 </UITableBody> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
76 <div class="p-3 text-right"> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
77 <button |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
78 :disabled="importScheduleDetailVisible" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
79 @click="newImport" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
80 class="btn btn-info newbutton" |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
81 > |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
82 <translate>New Import</translate> |
9ae2a2f758bb
client: make use of new table header/body components
Markus Kottlaender <markus@intevation.de>
parents:
2387
diff
changeset
|
83 </button> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
87 <Importscheduledetail></Importscheduledetail> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
88 </div> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
89 </template> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
90 |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
91 <style lang="sass" scoped> |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
92 th |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
93 border-top: 0px |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
94 |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
95 .card-body |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
96 padding-bottom: $small-offset |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
97 |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
98 .schedulecard |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
99 margin-right: $small-offset |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
100 min-height: 20rem |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
101 |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
102 .schedulecard-body |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
103 width: 100% |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
104 margin-left: auto |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
105 margin-right: auto |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
106 </style> |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
107 |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
108 <script> |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
109 /* 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
|
110 * without warranty, see README.md and license for details. |
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 * SPDX-License-Identifier: AGPL-3.0-or-later |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
113 * License-Filename: LICENSES/AGPL-3.0.txt |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
114 * |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
115 * Copyright (C) 2018 by via donau |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
116 * – Österreichische Wasserstraßen-Gesellschaft mbH |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
117 * Software engineering by Intevation GmbH |
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 * Author(s): |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
120 * Thomas Junk <thomas.junk@intevation.de> |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
121 * Markus Kottländer <markus.kottlaender@intevation.de> |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
122 */ |
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 import { mapState } from "vuex"; |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
125 import { HTTP } from "@/lib/http"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
126 import { displayInfo, displayError } from "@/lib/errors"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
127 import { sortTable } from "@/lib/mixins"; |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
128 |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
129 export default { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
130 name: "importschedule", |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
131 mixins: [sortTable], |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
132 components: { |
1669
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
133 Importscheduledetail: () => import("./Importscheduledetail"), |
16fb9667ddf8
refac: use dynamic imports for components
Thomas Junk <thomas.junk@intevation.de>
parents:
1613
diff
changeset
|
134 Spacer: () => import("@/components/Spacer") |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
135 }, |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
136 data() { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
137 return { |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
138 searchQuery: "" |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
139 }; |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
140 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
141 computed: { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
142 ...mapState("application", ["showSidebar"]), |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
143 ...mapState("importschedule", ["schedules", "importScheduleDetailVisible"]), |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2738
diff
changeset
|
144 importScheduleLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2738
diff
changeset
|
145 return this.$gettext("Import Schedule"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2738
diff
changeset
|
146 }, |
2782
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
147 idLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
148 return this.$gettext("ID"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
149 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
150 typeLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
151 return this.$gettext("Type"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
152 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
153 authorLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
154 return this.$gettext("Author"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
155 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
156 scheduleLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
157 return this.$gettext("Schedule"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
158 }, |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
159 emailLabel() { |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
160 return this.$gettext("Email"); |
615b0a9b8098
Client: correct strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
161 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
162 spacerStyle() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
163 return [ |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
164 "spacer ml-3", |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
165 { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
166 "spacer-expanded": this.showSidebar, |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
167 "spacer-collapsed": !this.showSidebar |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
168 } |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
169 ]; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
170 } |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
171 }, |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
172 methods: { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
173 filteredSchedules() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
174 return this.schedules.filter(s => { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
175 return (s.id + s.kind) |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
176 .toLowerCase() |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
177 .includes(this.searchQuery.toLowerCase()); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
178 }); |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
179 }, |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
180 editSchedule(id) { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
181 this.$store |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
182 .dispatch("importschedule/loadSchedule", id) |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
183 .then(() => { |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
184 this.$store.commit("importschedule/setImportScheduleDetailVisible"); |
1731
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
185 }) |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
186 .catch(error => { |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
187 const { status, data } = error.response; |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
188 displayError({ |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
189 title: this.$gettext("Backend Error"), |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
190 message: `${status}: ${data.message || data}` |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
191 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
192 }); |
8dd7452929ca
WIP: edit scheduled imports
Thomas Junk <thomas.junk@intevation.de>
parents:
1728
diff
changeset
|
193 }, |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
194 triggerManualImport(id) { |
1745
6eb099690279
importschedule: play button active
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
195 HTTP.get("/imports/config/" + id + "/run", { |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
196 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
197 }) |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
198 .then(response => { |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
199 const { id } = response.data; |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
200 displayInfo({ |
1745
6eb099690279
importschedule: play button active
Thomas Junk <thomas.junk@intevation.de>
parents:
1731
diff
changeset
|
201 title: this.$gettext("Imports"), |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
202 message: this.$gettext("Manually triggered import: #") + id |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
203 }); |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
204 }) |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
205 .catch(error => { |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
206 const { status, data } = error.response; |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
207 displayError({ |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
208 title: this.$gettext("Backend Error"), |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
209 message: `${status}: ${data.message || data}` |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
210 }); |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
211 }); |
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
212 }, |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
213 getSchedules() { |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
214 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
|
215 const { status, data } = error.response; |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
216 displayError({ |
1725
b24a54c684bd
importschedule: UI improvements
Thomas Junk <thomas.junk@intevation.de>
parents:
1724
diff
changeset
|
217 title: this.$gettext("Backend Error"), |
1711
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
218 message: `${status}: ${data.message || data}` |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
219 }); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
220 }); |
aec17976528e
feat: scheduled import loaded from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1669
diff
changeset
|
221 }, |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
222 newImport() { |
2033
431f97fd873b
importschedule: extracted to separate store
Thomas Junk <thomas.junk@intevation.de>
parents:
1892
diff
changeset
|
223 this.$store.commit("importschedule/setImportScheduleDetailVisible"); |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
224 }, |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
225 deleteSchedule(schedule) { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
226 console.log(schedule); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
227 this.$store.commit("application/popup", { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
228 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
229 title: this.$gettext("Delete Import"), |
2595
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
230 content: |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
231 this.$gettext("Do you really want to delete the import with ID") + |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
232 `<b>${schedule.id}</b>` + |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
233 this.$gettext("of type") + |
dda4cec8e67b
client:translations: correct some strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
234 `<b>${schedule.kind.toUpperCase()}</b>?`, |
2384
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
235 confirm: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
236 label: this.$gettext("Delete"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
237 icon: "trash", |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
238 callback: () => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
239 this.$store |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
240 .dispatch("importschedule/deleteSchedule", schedule.id) |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
241 .then(() => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
242 this.getSchedules(); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
243 displayInfo({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
244 title: this.$gettext("Imports"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
245 message: this.$gettext("Deleted import: #") + schedule.id |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
246 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
247 }) |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
248 .catch(error => { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
249 const { status, data } = error.response; |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
250 displayError({ |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
251 title: this.$gettext("Backend Error"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
252 message: `${status}: ${data.message || data}` |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
253 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
254 }); |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
255 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
256 }, |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
257 cancel: { |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
258 label: this.$gettext("Cancel"), |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
259 icon: "times" |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
260 } |
c06b001dc26b
client: improved popup implementation
Markus Kottlaender <markus@intevation.de>
parents:
2379
diff
changeset
|
261 }); |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
262 } |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
263 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
264 mounted() { |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2640
diff
changeset
|
265 this.getSchedules(); |
1430
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
266 } |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
267 }; |
4e24c2db0bf5
automatic imports: added missing components
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
268 </script> |