annotate client/src/components/importoverview/AdditionalLog.vue @ 2605:11fd7ee37f10

overview2: added stretch zoom functionality
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 12 Mar 2019 17:08:49 +0100
parents 61aba7e78d3a
children 13377f2a5c42
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2594
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
2599
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
2 <div class="additionallog d-flex flex-column text-left">
2597
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
3 <div class="d-flex flex-row" v-for="(line, index) in logLines" :key="index">
2599
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
4 <small class="kind">{{ line.kind }}</small>
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
5 <small class="time">{{ line.time }}</small>
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
6 <small class="message">{{ line.message }}</small>
2597
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
7 </div>
2594
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 </div>
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 </template>
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 <script>
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 /* This is Free Software under GNU Affero General Public License v >= 3.0
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 * without warranty, see README.md and license for details.
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 *
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 * SPDX-License-Identifier: AGPL-3.0-or-later
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 * License-Filename: LICENSES/AGPL-3.0.txt
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 *
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 * Copyright (C) 2018 by via donau
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 * – Österreichische Wasserstraßen-Gesellschaft mbH
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 * Software engineering by Intevation GmbH
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 *
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 * Author(s):
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 * Thomas Junk <thomas.junk@intevation.de>
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 */
2597
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
25 import { displayError } from "@/lib/errors.js";
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
26 import { HTTP } from "@/lib/http.js";
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
27
2594
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 export default {
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 name: "additionallogs",
2597
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
30 props: ["entry"],
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
31 data() {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
32 return {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
33 logLines: []
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
34 };
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
35 },
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
36 methods: {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
37 loadEntries() {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
38 HTTP.get("/imports/" + this.entry.id, {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
39 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
40 })
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
41 .then(response => {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
42 const { entries } = response.data;
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
43 this.logLines = entries;
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
44 })
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
45 .catch(error => {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
46 const { status, data } = error.response;
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
47 displayError({
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
48 title: this.$gettext("Backend Error"),
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
49 message: `${status}: ${data.message || data}`
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
50 });
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
51 });
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
52 }
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
53 },
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
54 mounted() {
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
55 this.loadEntries();
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
56 }
2594
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 };
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 </script>
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59
2599
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
60 <style lang="scss" scoped>
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
61 .kind {
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
62 width: 30px;
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
63 }
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
64 .time {
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
65 width: 150px;
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
66 }
61aba7e78d3a overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2597
diff changeset
67 </style>