mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
迁移日志到MongoDB
This commit is contained in:
@@ -20,6 +20,12 @@ export default {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
logItem: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
data: {
|
||||
type: String,
|
||||
default: ''
|
||||
|
||||
@@ -158,6 +158,7 @@ export default {
|
||||
// https://vuejs.org/v2/guide/render-function.html#createElement-Arguments
|
||||
props: {
|
||||
index: logItem.index,
|
||||
logItem,
|
||||
data: isAnsi ? convert.toHtml(logItem.data) : logItem.data,
|
||||
searchString: this.searchString,
|
||||
active: logItem.active,
|
||||
|
||||
@@ -6,7 +6,7 @@ const state = {
|
||||
taskList: [],
|
||||
taskListTotalCount: 0,
|
||||
taskForm: {},
|
||||
taskLog: '',
|
||||
taskLog: [],
|
||||
currentLogIndex: 0,
|
||||
taskResultsData: [],
|
||||
taskResultsColumns: [],
|
||||
@@ -41,12 +41,13 @@ const getters = {
|
||||
return keys
|
||||
},
|
||||
logData (state) {
|
||||
const data = state.taskLog.split('\n')
|
||||
const data = state.taskLog
|
||||
.map((d, i) => {
|
||||
return {
|
||||
index: i + 1,
|
||||
data: d,
|
||||
active: state.currentLogIndex === i + 1
|
||||
active: state.currentLogIndex === i + 1,
|
||||
data: d.msg,
|
||||
...d
|
||||
}
|
||||
})
|
||||
if (state.taskForm && state.taskForm.status === 'running') {
|
||||
@@ -151,7 +152,7 @@ const actions = {
|
||||
getTaskLog ({ state, commit }, id) {
|
||||
return request.get(`/tasks/${id}/log`)
|
||||
.then(response => {
|
||||
commit('SET_TASK_LOG', response.data.data)
|
||||
commit('SET_TASK_LOG', response.data.data || [])
|
||||
})
|
||||
},
|
||||
getTaskResults ({ state, commit }, id) {
|
||||
|
||||
Reference in New Issue
Block a user