diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js index 852e79be..ecb0bd82 100644 --- a/frontend/src/i18n/zh.js +++ b/frontend/src/i18n/zh.js @@ -223,6 +223,8 @@ export default { 'error': '错误', 'Not Found Node': '节点配置错误', 'Not Found Spider': '爬虫配置错误', + '[minute] [hour] [day] [month] [day of week]': '[分] [时] [天] [月] [星期几]', + 'Enable/Disable': '启用/禁用', // 网站 'Site': '网站', @@ -313,6 +315,13 @@ export default { 'Installing language failed': '安装语言失败', 'You have successfully installed a language: ': '您已成功安装语言: ', 'The language installation is unsuccessful: ': '安装语言失败: ', + 'Enabling the schedule successful': '启用定时任务成功', + 'Disabling the schedule successful': '禁用定时任务成功', + 'Enabling the schedule unsuccessful': '启用定时任务失败', + 'Disabling the schedule unsuccessful': '禁用定时任务失败', + 'The schedule has been removed': '已删除定时任务', + 'The schedule has been added': '已添加定时任务', + 'The schedule has been saved': '已保存定时任务', // 登录 'Sign in': '登录', diff --git a/frontend/src/store/modules/schedule.js b/frontend/src/store/modules/schedule.js index e71d5f03..9fde4e84 100644 --- a/frontend/src/store/modules/schedule.js +++ b/frontend/src/store/modules/schedule.js @@ -21,7 +21,12 @@ const actions = { getScheduleList ({ state, commit }) { request.get('/schedules') .then(response => { - commit('SET_SCHEDULE_LIST', response.data.data) + commit('SET_SCHEDULE_LIST', response.data.data.map(d => { + const arr = d.cron.split(' ') + arr.splice(0, 1) + d.cron = arr.join(' ') + return d + })) }) }, addSchedule ({ state }) { @@ -33,11 +38,11 @@ const actions = { removeSchedule ({ state }, id) { request.delete(`/schedules/${id}`) }, - stopSchedule ({ state, dispatch }, id) { - return request.post(`/schedules/${id}/stop`) + enableSchedule ({ state, dispatch }, id) { + return request.post(`/schedules/${id}/enable`) }, - runSchedule ({ state, dispatch }, id) { - return request.post(`/schedules/${id}/run`) + disableSchedule ({ state, dispatch }, id) { + return request.post(`/schedules/${id}/disable`) } } diff --git a/frontend/src/views/schedule/ScheduleList.vue b/frontend/src/views/schedule/ScheduleList.vue index 0cfbb6d2..ab9e7636 100644 --- a/frontend/src/views/schedule/ScheduleList.vue +++ b/frontend/src/views/schedule/ScheduleList.vue @@ -67,8 +67,10 @@ - + @@ -137,13 +139,28 @@ - + + + + + + + - +