mirror of
https://github.com/knadh/listmonk.git
synced 2025-10-25 06:56:03 +08:00
Tweak log viewer to optionally hide filename from log lines (on the import UI).
This commit is contained in:
parent
26c61f8ea1
commit
4d74cf4520
3 changed files with 6 additions and 4 deletions
|
|
@ -1117,6 +1117,9 @@ section.analytics {
|
|||
margin-right: 5px;
|
||||
user-select: auto;
|
||||
}
|
||||
.timestamp {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.line:hover {
|
||||
background: $white-bis;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<template v-if="l">
|
||||
<span :set="line = splitLine(l)" :key="i" class="line">
|
||||
<span class="timestamp">{{ line.timestamp }} </span>
|
||||
<span class="file">{{ line.file }}: </span>
|
||||
<span v-if="line.file !== '*'" class="file">{{ line.file }}: </span>
|
||||
<span class="log-message">{{ line.message }}</span>
|
||||
</span>
|
||||
</template>
|
||||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue