Mercurial > gemma
view client/src/components/importoverview/AdditionalLog.vue @ 2654:3c04c8e46bd4
importoverview: reload reloads current selection
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 14 Mar 2019 15:37:10 +0100 |
parents | 13377f2a5c42 |
children | b219ca1514f4 |
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> .additionallog { width: 600px; max-height: 20vh; overflow-y: auto; } .kind { width: 30px; } .time { width: 150px; } </style>