+
+
+
+
+
+
+
+
+
+
+
+ {{$t('Cancel')}}
+
+ {{$t('Confirm')}}
+
+
+
+
{{$t('Scrapy Spiders')}}
+
+
+ {{$t('Add Spider')}}
+
+
{
+ if (!valid) return
+ this.isAddSpiderLoading = true
+ const res = await this.$store.dispatch('spider/addSpiderScrapySpider', {
+ id: this.$route.params.id,
+ form: this.addSpiderForm
+ })
+ console.log(res)
+ if (!res.data.error) {
+ this.$message.success('Saved successfully')
+ }
+ this.isAddSpiderVisible = false
+ this.isAddSpiderLoading = false
+ })
}
}
}
@@ -334,6 +406,11 @@ export default {
padding-bottom: 15px;
}
+ .spiders .action-wrapper {
+ margin-bottom: 10px;
+ text-align: right;
+ }
+
.spiders .spider-list {
list-style: none;
padding: 0;
diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js
index 821b24e7..4a64d2cc 100644
--- a/frontend/src/i18n/zh.js
+++ b/frontend/src/i18n/zh.js
@@ -195,6 +195,8 @@ export default {
'Variable Name': '变量名',
'Variable Type': '变量类型',
'Variable Value': '变量值',
+ 'Parameter Edit': '参数编辑',
+ 'Add Scrapy Spider': '添加 Scrapy 爬虫',
// 爬虫列表
'Name': '名称',
diff --git a/frontend/src/store/modules/spider.js b/frontend/src/store/modules/spider.js
index d93679d6..c5a84ef1 100644
--- a/frontend/src/store/modules/spider.js
+++ b/frontend/src/store/modules/spider.js
@@ -150,6 +150,10 @@ const actions = {
async saveSpiderScrapySettings ({ state }, id) {
return request.post(`/spiders/${id}/scrapy/settings`, state.spiderScrapySettings)
},
+ addSpiderScrapySpider ({ state }, payload) {
+ const { id, form } = payload
+ return request.put(`/spiders/${id}/scrapy/spiders`, form)
+ },
crawlSpider ({ state, dispatch }, payload) {
const { spiderId, runType, nodeIds, param } = payload
return request.put(`/tasks`, {