annotate client/src/components/importoverview/importlogs/Logs.vue @ 2429:9bc34e1f002c

staging: optics
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 28 Feb 2019 17:26:59 +0100
parents 78d4ce079f9b
children 6694603471a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2422
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 <div class="w-95">
2428
78d4ce079f9b staging: optics
Thomas Junk <thomas.junk@intevation.de>
parents: 2427
diff changeset
3 <div class="text-left">
78d4ce079f9b staging: optics
Thomas Junk <thomas.junk@intevation.de>
parents: 2427
diff changeset
4 <h6><translate>Logs</translate></h6>
78d4ce079f9b staging: optics
Thomas Junk <thomas.junk@intevation.de>
parents: 2427
diff changeset
5 </div>
2422
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 <div class="d-flex justify-content-between flex-row">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 <button @click="setFilter('failed')" :class="failedStyle">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 <translate>Failed</translate>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 </button>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 <button @click="setFilter('pending')" :class="pendingStyle">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 <translate>Pending</translate>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 </button>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 <button @click="setFilter('rejected')" :class="rejectedStyle">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 <translate>Rejected</translate>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 </button>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 <button @click="setFilter('accepted')" :class="acceptedStyle">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 <translate>Accepted</translate>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 </button>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 <button @click="setFilter('warning')" :class="warningStyle">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 <translate>Warning</translate>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 </button>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 </div>
2429
9bc34e1f002c staging: optics
Thomas Junk <thomas.junk@intevation.de>
parents: 2428
diff changeset
23 <div class="mt-3 logdetails">
2422
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 <div v-for="job in imports" :key="job.id" class="d-flex flex-row">
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 <LogDetail :job="job"></LogDetail>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 </div>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 </div>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 </div>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 </template>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 <script>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 /* This is Free Software under GNU Affero General Public License v >= 3.0
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 * without warranty, see README.md and license for details.
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 *
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 * SPDX-License-Identifier: AGPL-3.0-or-later
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 * License-Filename: LICENSES/AGPL-3.0.txt
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
37 *
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
38 * Copyright (C) 2018 by via donau
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
39 * – Österreichische Wasserstraßen-Gesellschaft mbH
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
40 * Software engineering by Intevation GmbH
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
41 *
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
42 * Author(s):
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
43 * Thomas Junk <thomas.junk@intevation.de>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
44 */
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
45
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
46 import { mapState } from "vuex";
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
47
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
48 export default {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
49 name: "logsection",
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
50 components: {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
51 LogDetail: () => import("./LogDetail.vue")
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
52 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
53 data() {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
54 return {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
55 failed: false,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
56 pending: false,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 rejected: false,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 accepted: false,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59 warning: false
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
60 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
61 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
62 computed: {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
63 ...mapState("imports", ["imports"]),
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
64 pendingStyle() {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
65 return {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
66 btn: true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
67 "btn-sm": true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
68 "btn-light": !this.pending,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
69 "btn-info": this.pending
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
70 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
71 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
72 failedStyle() {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
73 return {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 btn: true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
75 "btn-sm": true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 "btn-light": !this.failed,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 "btn-info": this.failed
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
78 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
80 rejectedStyle() {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
81 return {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
82 btn: true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
83 "btn-sm": true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
84 "btn-light": !this.rejected,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
85 "btn-info": this.rejected
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
86 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
87 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
88 acceptedStyle() {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
89 return {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
90 btn: true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
91 "btn-sm": true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
92 "btn-light": !this.accepted,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
93 "btn-info": this.accepted
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
94 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
95 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
96 warningStyle() {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
97 return {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
98 btn: true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
99 "btn-sm": true,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
100 "btn-light": !this.warning,
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
101 "btn-info": this.warning
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
102 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
103 }
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
104 },
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
105 methods: {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
106 setFilter(name) {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
107 this[name] = !this[name];
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
108 const allSet =
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
109 this.failed &&
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
110 this.pending &&
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
111 this.accepted &&
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
112 this.rejected &&
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
113 this.warning;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
114 if (allSet) {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
115 this.warning = false;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
116 this.successful = false;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
117 this.failed = false;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
118 this.pending = false;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
119 this.accepted = false;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
120 this.rejected = false;
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
121 }
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
122 }
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
123 }
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
124 };
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
125 </script>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
126
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
127 <style lang="scss" scoped>
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
128 .logdetails {
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
129 overflow-y: auto;
2427
171ea4b5e8dc staging_area: more space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2422
diff changeset
130 height: 650px;
2422
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
131 }
77baf4f0ee1e logs->importlogs due to .hgignore
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
132 </style>