mirror of
https://github.com/knadh/listmonk.git
synced 2025-11-08 08:41:34 +08:00
Fix broken log rendering on importer UI.
This commit is contained in:
parent
1b43e1a013
commit
0be7a79dac
3 changed files with 17 additions and 7 deletions
|
|
@ -3,11 +3,13 @@
|
|||
<b-loading :active="loading" :is-full-page="false" />
|
||||
<div class="lines" ref="lines">
|
||||
<template v-for="(l, i) in lines">
|
||||
<span :set="line = splitLine(l)" :key="i" class="line">
|
||||
<span class="timestamp">{{ line.timestamp }} </span>
|
||||
<span class="file">{{ line.file }}: </span>
|
||||
<span class="log-message">{{ line.message }}</span>
|
||||
</span>
|
||||
<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 class="log-message">{{ line.message }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -33,6 +35,14 @@ export default {
|
|||
methods: {
|
||||
splitLine: (l) => {
|
||||
const parts = l.split(reFormatLine);
|
||||
if (parts.length !== 5) {
|
||||
return {
|
||||
timestamp: '',
|
||||
file: '',
|
||||
message: l,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
timestamp: parts[1],
|
||||
file: parts[2],
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ export default Vue.extend({
|
|||
|
||||
isProcessing: false,
|
||||
status: { status: '' },
|
||||
logs: '',
|
||||
logs: [],
|
||||
pollID: null,
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ func (im *Importer) NewSession(opt SessionOpt) (*Session, error) {
|
|||
|
||||
s := &Session{
|
||||
im: im,
|
||||
log: log.New(im.status.logBuf, "", log.Ldate|log.Ltime|log.Lshortfile),
|
||||
log: log.New(im.status.logBuf, "", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile),
|
||||
subQueue: make(chan SubReq, commitBatchSize),
|
||||
opt: opt,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue