Mercurial > gemma
view client/src/components/importoverview/AdditionalLog.vue @ 2599:61aba7e78d3a
overview2 WIP
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 12 Mar 2019 14:06:22 +0100 |
parents | 02d5de05291f |
children | 13377f2a5c42 |
line wrap: on
line source
<template> <div class="additionallog d-flex flex-column text-left"> <div class="d-flex flex-row" v-for="(line, index) in logLines" :key="index"> <small class="kind">{{ line.kind }}</small> <small class="time">{{ line.time }}</small> <small class="message">{{ line.message }}</small> </div> </div> </template> <script> /* This is Free Software under GNU Affero General Public License v >= 3.0 * without warranty, see README.md and license for details. * * SPDX-License-Identifier: AGPL-3.0-or-later * License-Filename: LICENSES/AGPL-3.0.txt * * Copyright (C) 2018 by via donau * – Österreichische Wasserstraßen-Gesellschaft mbH * Software engineering by Intevation GmbH * * 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"], 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> <style lang="scss" scoped> .kind { width: 30px; } .time { width: 150px; } </style>