Mercurial > gemma
comparison client/src/components/importoverview/AdditionalLog.vue @ 2685:39a05f8c34e6 import-overview-rework
import_overview: Refactoring of detailed information.
When the entry is opened, a request is made to retrieve the
detailed information for this entry. It contains the log
protocol information as well as the executive summary.
This is passed down to child components of the entry.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 15 Mar 2019 13:42:49 +0100 |
parents | b219ca1514f4 |
children | c887666b110f |
comparison
equal
deleted
inserted
replaced
2683:4d460b2b439f | 2685:39a05f8c34e6 |
---|---|
47 * Software engineering by Intevation GmbH | 47 * Software engineering by Intevation GmbH |
48 * | 48 * |
49 * Author(s): | 49 * Author(s): |
50 * Thomas Junk <thomas.junk@intevation.de> | 50 * Thomas Junk <thomas.junk@intevation.de> |
51 */ | 51 */ |
52 import { displayError } from "@/lib/errors.js"; | |
53 import { HTTP } from "@/lib/http.js"; | |
54 | |
55 export default { | 52 export default { |
56 name: "additionallogs", | 53 name: "additionallogs", |
57 props: ["entry"], | 54 props: ["details"], |
58 data() { | 55 data() { |
59 return { | 56 return { |
60 logLines: [] | 57 logLines: this.details.entries |
61 }; | 58 }; |
62 }, | |
63 methods: { | |
64 loadEntries() { | |
65 HTTP.get("/imports/" + this.entry.id, { | |
66 headers: { "X-Gemma-Auth": localStorage.getItem("token") } | |
67 }) | |
68 .then(response => { | |
69 const { entries } = response.data; | |
70 this.logLines = entries; | |
71 }) | |
72 .catch(error => { | |
73 const { status, data } = error.response; | |
74 displayError({ | |
75 title: this.$gettext("Backend Error"), | |
76 message: `${status}: ${data.message || data}` | |
77 }); | |
78 }); | |
79 } | |
80 }, | |
81 mounted() { | |
82 this.loadEntries(); | |
83 } | 59 } |
84 }; | 60 }; |
85 </script> | 61 </script> |
86 | 62 |
87 <style lang="scss" scoped> | 63 <style lang="scss" scoped> |