mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
added analytics for spider
This commit is contained in:
@@ -14,7 +14,16 @@ const state = {
|
||||
importForm: {
|
||||
url: '',
|
||||
type: 'github'
|
||||
}
|
||||
},
|
||||
|
||||
// spider overview stats
|
||||
overviewStats: {},
|
||||
|
||||
// spider status stats
|
||||
statusStats: [],
|
||||
|
||||
// spider daily stats
|
||||
dailyStats: []
|
||||
}
|
||||
|
||||
const getters = {}
|
||||
@@ -31,6 +40,15 @@ const mutations = {
|
||||
},
|
||||
SET_IMPORT_FORM (state, value) {
|
||||
state.importForm = value
|
||||
},
|
||||
SET_OVERVIEW_STATS (state, value) {
|
||||
state.overviewStats = value
|
||||
},
|
||||
SET_STATUS_STATS (state, value) {
|
||||
state.statusStats = value
|
||||
},
|
||||
SET_DAILY_STATS (state, value) {
|
||||
state.dailyStats = value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +156,14 @@ const actions = {
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
})
|
||||
},
|
||||
getSpiderStats ({ state, commit }) {
|
||||
return request.get('/stats/get_spider_stats?spider_id=' + state.spiderForm._id)
|
||||
.then(response => {
|
||||
commit('SET_OVERVIEW_STATS', response.data.overview)
|
||||
commit('SET_STATUS_STATS', response.data.task_count_by_status)
|
||||
commit('SET_DAILY_STATS', response.data.daily_stats)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user