From 966954d8f49b2ce1da5d40dff0cff930f6a335b4 Mon Sep 17 00:00:00 2001
From: Kailash Nadh
Date: Sat, 24 Oct 2020 11:42:28 +0530
Subject: [PATCH] Refactor log view UI into a component.
---
frontend/src/assets/style.scss | 5 +++--
frontend/src/views/Import.vue | 11 ++++++-----
frontend/src/views/Logs.vue | 21 +++++++--------------
internal/subimporter/importer.go | 2 +-
4 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/frontend/src/assets/style.scss b/frontend/src/assets/style.scss
index 15e4b74..714f699 100644
--- a/frontend/src/assets/style.scss
+++ b/frontend/src/assets/style.scss
@@ -438,8 +438,9 @@ section.import {
.status {
padding: 60px;
}
- .logs {
+ .log-view .lines {
max-height: 240px;
+ text-align: left;
}
}
@@ -607,7 +608,7 @@ section.campaign {
}
/* Logs */
-.logs {
+.log-view {
.lines {
height: 70vh;
overflow-y: scroll;
diff --git a/frontend/src/views/Import.vue b/frontend/src/views/Import.vue
index 82aff78..554d36f 100644
--- a/frontend/src/views/Import.vue
+++ b/frontend/src/views/Import.vue
@@ -127,10 +127,9 @@
-
-
-
+
+
+
@@ -139,10 +138,12 @@
import Vue from 'vue';
import { mapState } from 'vuex';
import ListSelector from '../components/ListSelector.vue';
+import LogView from '../components/LogView.vue';
export default Vue.extend({
components: {
ListSelector,
+ LogView,
},
props: {
@@ -242,7 +243,7 @@ export default Vue.extend({
getLogs() {
this.$api.getImportLogs().then((data) => {
- this.logs = data;
+ this.logs = data.split('\n');
Vue.nextTick(() => {
// vue.$refs doesn't work as the logs textarea is rendered dynamically.
diff --git a/frontend/src/views/Logs.vue b/frontend/src/views/Logs.vue
index 343d4d9..712862a 100644
--- a/frontend/src/views/Logs.vue
+++ b/frontend/src/views/Logs.vue
@@ -2,38 +2,31 @@