changeset 2597:02d5de05291f

overview2 WIP
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 12 Mar 2019 12:25:41 +0100
parents 8774054959a7
children 5fa1ad39e1bc
files client/src/components/importoverview/AdditionalLog.vue client/src/components/importoverview/LogDetail.vue client/src/components/importoverview/LogEntry.vue
diffstat 3 files changed, 41 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importoverview/AdditionalLog.vue	Tue Mar 12 12:07:02 2019 +0100
+++ b/client/src/components/importoverview/AdditionalLog.vue	Tue Mar 12 12:25:41 2019 +0100
@@ -1,6 +1,10 @@
 <template>
-  <div>
-    <h1>Additional Logs</h1>
+  <div class="d-flex flex-column text-left">
+    <div class="d-flex flex-row" v-for="(line, index) in logLines" :key="index">
+      <small>{{ line.kind }}</small>
+      <small>{{ line.message }}</small>
+      <small>{{ line.time }}</small>
+    </div>
   </div>
 </template>
 
@@ -18,9 +22,38 @@
  * Author(s):
  * Thomas Junk <thomas.junk@intevation.de>
  */
+import { displayError } from "@/lib/errors.js";
+import { HTTP } from "@/lib/http.js";
+
 export default {
   name: "additionallogs",
-  props: ["entry"]
+  props: ["entry"],
+  data() {
+    return {
+      logLines: []
+    };
+  },
+  methods: {
+    loadEntries() {
+      HTTP.get("/imports/" + this.entry.id, {
+        headers: { "X-Gemma-Auth": localStorage.getItem("token") }
+      })
+        .then(response => {
+          const { entries } = response.data;
+          this.logLines = entries;
+        })
+        .catch(error => {
+          const { status, data } = error.response;
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${data.message || data}`
+          });
+        });
+    }
+  },
+  mounted() {
+    this.loadEntries();
+  }
 };
 </script>
 
--- a/client/src/components/importoverview/LogDetail.vue	Tue Mar 12 12:07:02 2019 +0100
+++ b/client/src/components/importoverview/LogDetail.vue	Tue Mar 12 12:25:41 2019 +0100
@@ -20,6 +20,7 @@
     <AdditionalDetail
       v-if="entry.id === showAdditional"
       class="ml-2 d-flex flex-row"
+      :entry="entry"
     ></AdditionalDetail>
     <div class="d-flex fex-row">
       <font-awesome-icon
@@ -42,6 +43,7 @@
     <AdditionalLog
       v-if="entry.id === showLogs"
       class="ml-2 d-flex flex-row"
+      :entry="entry"
     ></AdditionalLog>
   </div>
 </template>
--- a/client/src/components/importoverview/LogEntry.vue	Tue Mar 12 12:07:02 2019 +0100
+++ b/client/src/components/importoverview/LogEntry.vue	Tue Mar 12 12:25:41 2019 +0100
@@ -65,7 +65,7 @@
       </div>
     </div>
     <div class="ml-1 d-flex flex-row">
-      <LogDetail entry="entry" v-if="show === entry.id"></LogDetail>
+      <LogDetail :entry="entry" v-if="show === entry.id"></LogDetail>
     </div>
   </div>
 </template>
@@ -104,6 +104,8 @@
       const { id } = this.entry;
       if (id === this.show) {
         this.$store.commit("imports/hideDetails");
+        this.$store.commit("imports/hideAdditionalInfo");
+        this.$store.commit("imports/hideAdditionalLogs");
       } else {
         this.$store.commit("imports/showDetailsFor", id);
       }