From 4d74cf4520a8fb28742d61512d7756eae02c1b09 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 3 Aug 2025 19:17:41 +0530 Subject: [PATCH] Tweak log viewer to optionally hide filename from log lines (on the import UI). --- frontend/src/assets/style.scss | 3 +++ frontend/src/components/LogView.vue | 4 ++-- frontend/src/views/Import.vue | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/assets/style.scss b/frontend/src/assets/style.scss index d32104f4..61d2caf2 100644 --- a/frontend/src/assets/style.scss +++ b/frontend/src/assets/style.scss @@ -1117,6 +1117,9 @@ section.analytics { margin-right: 5px; user-select: auto; } + .timestamp { + margin-right: 15px; + } .line:hover { background: $white-bis; diff --git a/frontend/src/components/LogView.vue b/frontend/src/components/LogView.vue index 7b554ee2..910de0a0 100644 --- a/frontend/src/components/LogView.vue +++ b/frontend/src/components/LogView.vue @@ -6,7 +6,7 @@ @@ -19,7 +19,7 @@ // Regexp for splitting log lines in the following format to // [timestamp] [file] [message]. // 2021/05/01 00:00:00:00 init.go:99: reading config: config.toml -const reFormatLine = /^([0-9\s:/]+\.[0-9]{6}) (.+?\.go:[0-9]+):\s(.+)$/; +const reFormatLine = /^([0-9\s:/]+\.[0-9]{6}) (.+?\.go:[0-9]+|\*):\s(.+)$/; export default { name: 'LogView', diff --git a/frontend/src/views/Import.vue b/frontend/src/views/Import.vue index d7db5792..b9ed1263 100644 --- a/frontend/src/views/Import.vue +++ b/frontend/src/views/Import.vue @@ -256,8 +256,7 @@ export default Vue.extend({ getLogs() { this.$api.getImportLogs().then((data) => { - this.logs = data.split('\n'); - + this.logs = data.split('\n').map((line) => line.replace(/\s+importer\.go:\d+:\s*/, ' *: ')); Vue.nextTick(() => { // vue.$refs doesn't work as the logs textarea is rendered dynamically. const ref = document.getElementById('import-log');