comparison client/src/components/importoverview/LogEntry.vue @ 2799:e19fac818aab

import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 25 Mar 2019 16:16:58 +0100
parents 0ab7985ef008
children b9a6abef9f1c
comparison
equal deleted inserted replaced
2798:c9032a57996e 2799:e19fac818aab
115 * Author(s): 115 * Author(s):
116 * Thomas Junk <thomas.junk@intevation.de> 116 * Thomas Junk <thomas.junk@intevation.de>
117 */ 117 */
118 import { mapState } from "vuex"; 118 import { mapState } from "vuex";
119 import { STATES } from "@/store/imports.js"; 119 import { STATES } from "@/store/imports.js";
120 import { displayError } from "@/lib/errors.js";
121 import { HTTP } from "@/lib/http.js";
120 122
121 export default { 123 export default {
122 name: "importlogentry", 124 name: "importlogentry",
123 props: ["entry"], 125 props: ["entry"],
124 data() { 126 data() {
141 if (id === this.show) { 143 if (id === this.show) {
142 this.$store.commit("imports/hideDetails"); 144 this.$store.commit("imports/hideDetails");
143 this.$store.commit("imports/hideAdditionalInfo"); 145 this.$store.commit("imports/hideAdditionalInfo");
144 this.$store.commit("imports/hideAdditionalLogs"); 146 this.$store.commit("imports/hideAdditionalLogs");
145 } else { 147 } else {
146 this.$store.commit("imports/showDetailsFor", id); 148 HTTP.get("/imports/" + this.entry.id, {
149 headers: { "X-Gemma-Auth": localStorage.getItem("token") }
150 })
151 .then(response => {
152 this.$store.commit("imports/showDetailsFor", id);
153 this.$store.commit("imports/setCurrentDetails", response.data);
154 })
155 .catch(error => {
156 const { status, data } = error.response;
157 displayError({
158 title: this.$gettext("Backend Error"),
159 message: `${status}: ${data.message || data}`
160 });
161 });
147 } 162 }
148 } 163 }
149 }, 164 },
150 computed: { 165 computed: {
151 ...mapState("imports", ["show"]), 166 ...mapState("imports", ["show"]),