mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-27 17:50:53 +01:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -163,6 +163,7 @@ export default {
|
||||
this.spiderForm.crawl_type = value
|
||||
},
|
||||
onSave () {
|
||||
this.$st.sendEv('爬虫详情-配置', '保存')
|
||||
return new Promise((resolve, reject) => {
|
||||
this.saveLoading = true
|
||||
this.$store.dispatch('spider/updateSpiderFields')
|
||||
@@ -207,6 +208,7 @@ export default {
|
||||
.finally(() => {
|
||||
this.previewLoading = false
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-配置', '预览')
|
||||
})
|
||||
},
|
||||
onCrawl () {
|
||||
@@ -219,6 +221,7 @@ export default {
|
||||
.then(() => {
|
||||
this.$message.success(this.$t(`Spider task has been scheduled`))
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-配置', '运行')
|
||||
})
|
||||
},
|
||||
onExtractFields () {
|
||||
@@ -239,6 +242,7 @@ export default {
|
||||
.finally(() => {
|
||||
this.extractFieldsLoading = false
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-配置', '提取字段')
|
||||
})
|
||||
},
|
||||
renderHeader (h, { column }) {
|
||||
|
||||
@@ -49,10 +49,11 @@ export default {
|
||||
name: '',
|
||||
value: ''
|
||||
})
|
||||
console.log(this.spiderForm)
|
||||
this.$st.sendEv('爬虫详情-环境', '添加')
|
||||
},
|
||||
deleteEnv (index) {
|
||||
this.spiderForm.envs.splice(index, 1)
|
||||
this.$st.sendEv('爬虫详情-环境', '删除')
|
||||
},
|
||||
save () {
|
||||
this.$store.dispatch('spider/updateSpiderEnvs')
|
||||
@@ -62,6 +63,7 @@ export default {
|
||||
.catch(error => {
|
||||
this.$message.error(error)
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-环境', '保存')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
this.$st.sendEv('节点详情', '保存')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ export default {
|
||||
.then(() => {
|
||||
this.$message.success(this.$t(`Spider task has been scheduled`))
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-概览', '运行')
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -149,6 +150,7 @@ export default {
|
||||
.then(() => {
|
||||
this.$message.success(this.$t(`Spider has been deployed`))
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-概览', '部署')
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -165,6 +167,7 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-概览', '保存')
|
||||
},
|
||||
fetchSiteSuggestions (keyword, callback) {
|
||||
this.$request.get('/sites', {
|
||||
|
||||
@@ -52,9 +52,11 @@ export default {
|
||||
methods: {
|
||||
onClickNodeTitle () {
|
||||
this.$router.push(`/nodes/${this.nodeForm._id}`)
|
||||
this.$st.sendEv('任务详情-概览', '点击节点详情')
|
||||
},
|
||||
onClickSpiderTitle () {
|
||||
this.$router.push(`/spiders/${this.spiderForm._id}`)
|
||||
this.$st.sendEv('任务详情-概览', '点击爬虫详情')
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
@@ -109,14 +109,17 @@ export default {
|
||||
type: 'css',
|
||||
extract_type: 'text'
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-配置', '添加字段')
|
||||
},
|
||||
deleteField (index) {
|
||||
this.fields.splice(index, 1)
|
||||
this.$st.sendEv('爬虫详情-配置', '删除字段')
|
||||
},
|
||||
onNameChange (row) {
|
||||
if (this.fields.filter(d => d.name === row.name).length > 1) {
|
||||
this.$message.error(this.$t(`Duplicated field names for ${row.name}`))
|
||||
}
|
||||
this.$st.sendEv('爬虫详情-配置', '更改字段')
|
||||
},
|
||||
onCheck (row) {
|
||||
this.fields.forEach(d => {
|
||||
@@ -124,6 +127,7 @@ export default {
|
||||
this.$set(d, 'is_detail', false)
|
||||
}
|
||||
})
|
||||
this.$st.sendEv('爬虫详情-配置', '设置详情页URL')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,18 +58,18 @@ export default {
|
||||
computed: {
|
||||
filteredData () {
|
||||
return this.data
|
||||
.map(d => d)
|
||||
.filter((d, index) => {
|
||||
// pagination
|
||||
const pageNum = this.pageNum
|
||||
const pageSize = this.pageSize
|
||||
return (pageSize * (pageNum - 1) <= index) && (index < pageSize * pageNum)
|
||||
})
|
||||
// .map(d => d)
|
||||
// .filter((d, index) => {
|
||||
// // pagination
|
||||
// const pageNum = this.pageNum
|
||||
// const pageSize = this.pageSize
|
||||
// return (pageSize * (pageNum - 1) <= index) && (index < pageSize * pageNum)
|
||||
// })
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChange () {
|
||||
this.$emit('page-change')
|
||||
this.$emit('page-change', { pageNum: this.pageNum, pageSize: this.pageSize })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user