diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js
index d8f1dbe2..1c46b88b 100644
--- a/frontend/src/i18n/zh.js
+++ b/frontend/src/i18n/zh.js
@@ -259,7 +259,7 @@ export default {
'Executables': '执行文件',
// 弹出框
- Notification: '提示',
+ 'Notification': '提示',
'Are you sure to delete this node?': '你确定要删除该节点?',
'Are you sure to run this spider?': '你确定要运行该爬虫?',
'Node info has been saved successfully': '节点信息已成功保存',
@@ -279,6 +279,7 @@ export default {
'Saved successfully': '成功保存',
'Please zip your spider files from the root directory': '爬虫文件请从根目录下开始压缩。',
'English': 'English',
+ 'Are you sure to delete the schedule task?': '确定删除定时任务?',
// 登录
'Sign in': '登录',
'Sign-in': '登录',
diff --git a/frontend/src/views/schedule/ScheduleList.vue b/frontend/src/views/schedule/ScheduleList.vue
index 0259247e..7a49f808 100644
--- a/frontend/src/views/schedule/ScheduleList.vue
+++ b/frontend/src/views/schedule/ScheduleList.vue
@@ -14,9 +14,15 @@
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -79,7 +75,7 @@
-
+
@@ -165,7 +161,7 @@ export default {
return {
columns: [
{ name: 'name', label: 'Name', width: '180' },
- { name: 'cron', label: 'schedules.cron', width: '120' },
+ { name: 'cron', label: 'Cron', width: '120' },
{ name: 'node_name', label: 'Node', width: '150' },
{ name: 'spider_name', label: 'Spider', width: '150' },
{ name: 'param', label: 'Parameters', width: '150' },
@@ -246,9 +242,9 @@ export default {
this.$st.sendEv('定时任务', '修改', 'id', row._id)
},
onRemove (row) {
- this.$confirm('确定删除定时任务?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ this.$confirm(this.$t('Are you sure to delete the schedule task?'), this.$t('Notification'), {
+ confirmButtonText: this.$t('Confirm'),
+ cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('schedule/removeSchedule', row._id)
@@ -258,15 +254,16 @@ export default {
this.$message.success(`Schedule "${row.name}" has been removed`)
}, 100)
})
- }).catch(() => {})
+ }).catch(() => {
+ })
this.$st.sendEv('定时任务', '删除', 'id', row._id)
},
onCrawl (row) {
// 停止定时任务
if (!row.status || row.status === 'running') {
- this.$confirm('确定停止定时任务?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ this.$confirm(this.$t('Are you sure to delete the schedule task?'), this.$t('Notification'), {
+ confirmButtonText: this.$t('Confirm'),
+ cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('schedule/stopSchedule', row._id)
@@ -280,13 +277,14 @@ export default {
message: resp.data.error
})
})
- }).catch(() => {})
+ }).catch(() => {
+ })
}
// 运行定时任务
if (row.status === 'stop') {
- this.$confirm('确定运行定时任务?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
+ this.$confirm(this.$t('Are you sure to delete the schedule task?'), this.$t('Notification'), {
+ confirmButtonText: this.$t('Confirm'),
+ cancelButtonText: this.$t('Cancel'),
type: 'warning'
}).then(() => {
this.$store.dispatch('schedule/runSchedule', row._id)
@@ -300,7 +298,15 @@ export default {
message: resp.data.error
})
})
- }).catch(() => {})
+ }).catch(() => {
+ })
+ }
+ },
+ isDisabledSpider (spider) {
+ if (spider.type === 'customized') {
+ return !spider.cmd
+ } else {
+ return false
}
}
},
@@ -338,6 +344,7 @@ export default {
min-height: 360px;
margin-top: 10px;
}
+
.status-tag {
cursor: pointer;
}