commit
827665dd50
|
|
@ -61,3 +61,9 @@ export const runJob = (id: number) => {
|
|||
export const getJobNextTimes = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get_next_times?id=' + id })
|
||||
}
|
||||
|
||||
|
||||
// 同步定时任务到 Quartz
|
||||
export const syncJob = () => {
|
||||
return request.post({ url: '/infra/job/sync' })
|
||||
}
|
||||
|
|
@ -68,6 +68,9 @@
|
|||
<el-button type="info" plain @click="handleJobLog()" v-hasPermi="['infra:job:query']">
|
||||
<Icon icon="ep:zoom-in" class="mr-5px" /> 执行日志
|
||||
</el-button>
|
||||
<el-button type="warning" plain @click="handleSyncJob()" :loading="syncLoading">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> 同步任务
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
|
@ -174,6 +177,7 @@ const queryParams = reactive({
|
|||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
const syncLoading = ref(false) // 同步的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
|
@ -214,6 +218,20 @@ const handleExport = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
/** 同步任务到 Quartz */
|
||||
const handleSyncJob = async () => {
|
||||
try {
|
||||
await message.confirm('确认要同步所有任务到调度器?', t('common.reminder'))
|
||||
syncLoading.value = true
|
||||
await JobApi.syncJob()
|
||||
message.success('同步成功')
|
||||
await getList()
|
||||
} catch {
|
||||
} finally {
|
||||
syncLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue