{{$t('Add Schedule')}}
@@ -233,7 +259,125 @@ export default {
showCron: false,
expression: '',
spiderList: [],
- nodeList: []
+ nodeList: [],
+ isShowCron: false,
+
+ // tutorial
+ tourSteps: [
+ {
+ target: '.table',
+ content: this.$t('This is a list of schedules (cron jobs) to periodically run spider tasks. You can add/modify/edit your schedules here.
For more information, please refer to the
Documentation (Chinese) for detail.')
+ },
+ {
+ target: '.btn-add',
+ content: this.$t('You can add a new schedule by clicking this button.')
+ }
+ ],
+ tourCallbacks: {
+ onStop: () => {
+ this.$utils.tour.finishTour('schedule-list')
+ },
+ onPreviousStep: (currentStep) => {
+ if (currentStep === 2) {
+ this.dialogVisible = false
+ }
+ this.$utils.tour.prevStep('schedule-list', currentStep)
+ },
+ onNextStep: (currentStep) => {
+ if (currentStep === 1) {
+ this.isEdit = false
+ this.dialogVisible = true
+ this.$store.commit('schedule/SET_SCHEDULE_FORM', { node_ids: [] })
+ }
+ this.$utils.tour.nextStep('schedule-list', currentStep)
+ }
+ },
+ tourAddSteps: [
+ {
+ target: '.add-form',
+ content: this.$t('You should fill the form before adding the new schedule.'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#schedule-name',
+ content: this.$t('The name of the schedule'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#run-type',
+ content: this.$t('The type of how to run the task.
Please refer to the
Documentation (Chinese) for detailed explanation for the options.
Let\'s select
Selected Nodes for example.'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#spider-id',
+ content: this.$t('The spider to run'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#cron',
+ content: this.$t('
Cron expression for the schedule.
If you are not sure what a cron expression is, please refer to this
Article.'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#change-crontab',
+ content: this.$t('You can select the correct options in the cron config box to configure the cron expression.'),
+ params: {
+ placement: 'top'
+ }
+ },
+ {
+ target: '#param',
+ content: this.$t('The parameters which will be passed into the spider program.'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#schedule-description',
+ content: this.$t('The description for the schedule'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '#btn-submit',
+ content: this.$t('Once you have filled all fields, click this button to submit.'),
+ params: {
+ placement: 'right'
+ }
+ }
+ ],
+ tourAddCallbacks: {
+ onStop: () => {
+ this.$utils.tour.finishTour('schedule-list-add')
+ },
+ onPreviousStep: (currentStep) => {
+ if (currentStep === 4) {
+ this.isShowCron = false
+ } else if (currentStep === 6) {
+ this.isShowCron = true
+ }
+ this.$utils.tour.prevStep('schedule-list-add', currentStep)
+ },
+ onNextStep: (currentStep) => {
+ if (currentStep === 3) {
+ this.isShowCron = true
+ } else if (currentStep === 5) {
+ this.isShowCron = false
+ }
+ this.$utils.tour.nextStep('schedule-list-add', currentStep)
+ }
+ }
}
},
computed: {
@@ -274,6 +418,13 @@ export default {
this.dialogVisible = true
this.$store.commit('schedule/SET_SCHEDULE_FORM', { node_ids: [] })
this.$st.sendEv('定时任务', '添加定时任务')
+
+ if (!this.$utils.tour.isFinishedTour('schedule-list-add')) {
+ setTimeout(() => {
+ this.$tours['schedule-list-add'].start()
+ this.$st.sendEv('教程', '开始', 'schedule-list-add')
+ }, 500)
+ }
},
onAddSubmit () {
this.$refs.scheduleForm.validate(res => {
@@ -377,6 +528,14 @@ export default {
.then(response => {
this.spiderList = response.data.data.list || []
})
+ },
+ mounted () {
+ if (!this.isDisabledSpiderSchedule) {
+ if (!this.$utils.tour.isFinishedTour('schedule-list')) {
+ this.$tours['schedule-list'].start()
+ this.$st.sendEv('教程', '开始', 'schedule-list')
+ }
+ }
}
}
diff --git a/frontend/src/views/setting/Setting.vue b/frontend/src/views/setting/Setting.vue
index e82d47b6..27e79b9c 100644
--- a/frontend/src/views/setting/Setting.vue
+++ b/frontend/src/views/setting/Setting.vue
@@ -1,54 +1,112 @@
-
-
-
-
-
-
-
-
-
-
-
- {{$t('On Task End')}}
-
-
- {{$t('On Task Error')}}
-
-
- {{$t('Never')}}
-
-
-
-
-
- {{$t('邮件')}}
- {{$t('钉钉')}}
- {{$t('企业微信')}}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/spider/SpiderDetail.vue b/frontend/src/views/spider/SpiderDetail.vue
index 4a30341b..9bc49984 100644
--- a/frontend/src/views/spider/SpiderDetail.vue
+++ b/frontend/src/views/spider/SpiderDetail.vue
@@ -143,6 +143,7 @@ export default {
} else if (currentStep === 9) {
this.activeTabName = 'environment'
}
+ this.$utils.tour.prevStep('spider-detail', currentStep)
},
onNextStep: (currentStep) => {
if (currentStep === 4) {
@@ -152,6 +153,7 @@ export default {
} else if (currentStep === 8) {
this.activeTabName = 'schedules'
}
+ this.$utils.tour.nextStep('spider-detail', currentStep)
}
}
}
@@ -188,6 +190,7 @@ export default {
if (!this.$utils.tour.isFinishedTour('spider-detail-config')) {
setTimeout(() => {
this.$tours['spider-detail-config'].start()
+ this.$st.sendEv('教程', '开始', 'spider-detail-config')
}, 100)
}
}
@@ -222,6 +225,7 @@ export default {
mounted () {
if (!this.$utils.tour.isFinishedTour('spider-detail')) {
this.$tours['spider-detail'].start()
+ this.$st.sendEv('教程', '开始', 'spider-detail')
}
}
}
diff --git a/frontend/src/views/spider/SpiderList.vue b/frontend/src/views/spider/SpiderList.vue
index 45372b7d..c7107f11 100644
--- a/frontend/src/views/spider/SpiderList.vue
+++ b/frontend/src/views/spider/SpiderList.vue
@@ -380,12 +380,18 @@ export default {
},
{
target: '.btn.add',
- content: this.$t('Click to add a new spider')
+ content: this.$t('Click to add a new spider.
You can also add a Customized Spider through CLI Tool.')
}
],
tourCallbacks: {
onStop: () => {
this.$utils.tour.finishTour('spider-list')
+ },
+ onPreviousStep: (currentStep) => {
+ this.$utils.tour.prevStep('spider-list', currentStep)
+ },
+ onNextStep: (currentStep) => {
+ this.$utils.tour.nextStep('spider-list', currentStep)
}
},
tourAddSteps: [
@@ -463,11 +469,13 @@ export default {
if (currentStep === 7) {
this.spiderType = 'customized'
}
+ this.$utils.tour.prevStep('spider-list-add', currentStep)
},
onNextStep: (currentStep) => {
if (currentStep === 6) {
this.spiderType = 'configurable'
}
+ this.$utils.tour.nextStep('spider-list-add', currentStep)
}
}
}
@@ -517,6 +525,7 @@ export default {
setTimeout(() => {
if (!this.$utils.tour.isFinishedTour('spider-list-add')) {
this.$tours['spider-list-add'].start()
+ this.$st.sendEv('教程', '开始', 'spider-list-add')
}
}, 300)
},
@@ -751,6 +760,7 @@ export default {
if (!this.$utils.tour.isFinishedTour('spider-list')) {
this.$tours['spider-list'].start()
+ this.$st.sendEv('教程', '开始', 'spider-list')
}
}
}
diff --git a/frontend/src/views/task/TaskDetail.vue b/frontend/src/views/task/TaskDetail.vue
index 9097344e..f52597ca 100644
--- a/frontend/src/views/task/TaskDetail.vue
+++ b/frontend/src/views/task/TaskDetail.vue
@@ -1,5 +1,14 @@
+
+
+
+
@@ -12,7 +21,7 @@
-
+
{{$t('Download CSV')}}
@@ -48,7 +57,82 @@ export default {
return {
activeTabName: 'overview',
handle: undefined,
- taskLog: ''
+ taskLog: '',
+
+ // tutorial
+ tourSteps: [
+ // overview
+ {
+ target: '.task-info-overview-wrapper',
+ content: this.$t('This is the info of the task detail.'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '.task-info-spider-wrapper',
+ content: this.$t('This is the spider info of the task.'),
+ params: {
+ placement: 'left'
+ }
+ },
+ {
+ target: '.spider-title',
+ content: this.$t('You can click to view the spider detail for the task.'),
+ params: {
+ placement: 'left'
+ }
+ },
+ {
+ target: '.task-info-node-wrapper',
+ content: this.$t('This is the node info of the task.'),
+ params: {
+ placement: 'left'
+ }
+ },
+ {
+ target: '.node-title',
+ content: this.$t('You can click to view the node detail for the task.'),
+ params: {
+ placement: 'left'
+ }
+ },
+ // log
+ {
+ target: '#tab-log',
+ content: this.$t('Here you can view the log
details for the task. The
log is automatically updated.')
+ },
+ // results
+ {
+ target: '#tab-results',
+ content: this.$t('Here you can view the results scraped by the spider.
Note: If you find your results here are empty, please refer to the Documentation (Chinese) about how to integrate your spider into Crawlab.')
+ },
+ {
+ target: '.btn-download',
+ content: this.$t('You can download your results as a CSV file by clicking this button.')
+ }
+ ],
+ tourCallbacks: {
+ onStop: () => {
+ this.$utils.tour.finishTour('task-detail')
+ },
+ onPreviousStep: (currentStep) => {
+ if (currentStep === 5) {
+ this.activeTabName = 'overview'
+ } else if (currentStep === 6) {
+ this.activeTabName = 'log'
+ }
+ this.$utils.tour.prevStep('task-detail', currentStep)
+ },
+ onNextStep: (currentStep) => {
+ if (currentStep === 4) {
+ this.activeTabName = 'log'
+ } else if (currentStep === 5) {
+ this.activeTabName = 'results'
+ }
+ this.$utils.tour.nextStep('task-detail', currentStep)
+ }
+ }
}
},
computed: {
@@ -116,6 +200,12 @@ export default {
this.getTaskLog()
}, 5000)
},
+ mounted () {
+ if (!this.$utils.tour.isFinishedTour('task-detail')) {
+ this.$tours['task-detail'].start()
+ this.$st.sendEv('教程', '开始', 'task-detail')
+ }
+ },
destroyed () {
clearInterval(this.handle)
}
diff --git a/frontend/src/views/task/TaskList.vue b/frontend/src/views/task/TaskList.vue
index b6001a5e..1eb5d484 100644
--- a/frontend/src/views/task/TaskList.vue
+++ b/frontend/src/views/task/TaskList.vue
@@ -1,10 +1,19 @@
+
+
+
+
-
+
@@ -29,7 +38,7 @@
-
+
删除任务
@@ -191,7 +200,48 @@ export default {
// { name: 'avg_num_results', label: 'Average Results Count per Second', width: '80' }
],
- multipleSelection: []
+ multipleSelection: [],
+
+ // tutorial
+ tourSteps: [
+ {
+ target: '.filter-form',
+ content: this.$t('You can filter tasks from this area.')
+ },
+ {
+ target: '.table',
+ content: this.$t('This is a list of spider tasks executed sorted in a time descending order.')
+ },
+ {
+ target: '.table .el-table__body-wrapper tr:nth-child(1)',
+ content: this.$t('Click the row to or the view button to view the task detail.')
+ },
+ {
+ target: '.table tr td:nth-child(1)',
+ content: this.$t('Tick and select the tasks you would like to delete in batches.'),
+ params: {
+ placement: 'right'
+ }
+ },
+ {
+ target: '.btn-delete',
+ content: this.$t('Click this button to delete selected tasks.'),
+ params: {
+ placement: 'left'
+ }
+ }
+ ],
+ tourCallbacks: {
+ onStop: () => {
+ this.$utils.tour.finishTour('task-list')
+ },
+ onPreviousStep: (currentStep) => {
+ this.$utils.tour.prevStep('task-list', currentStep)
+ },
+ onNextStep: (currentStep) => {
+ this.$utils.tour.nextStep('task-list', currentStep)
+ }
+ }
}
},
computed: {
@@ -350,6 +400,11 @@ export default {
this.handle = setInterval(() => {
this.$store.dispatch('task/getTaskList')
}, 5000)
+
+ if (!this.$utils.tour.isFinishedTour('task-list')) {
+ this.$tours['task-list'].start()
+ this.$st.sendEv('教程', '开始', 'task-list')
+ }
},
destroyed () {
clearInterval(this.handle)