mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 13:40:06 +00:00
✨ [dashboard v0.3.9] 手动即时触发计划任务
This commit is contained in:
@@ -149,7 +149,7 @@ function addOrEditCron(cron) {
|
||||
modal.find('input[name=ID]').val(cron ? cron.ID : null)
|
||||
modal.find('input[name=Name]').val(cron ? cron.Name : null)
|
||||
modal.find('input[name=Scheduler]').val(cron ? cron.Scheduler : null)
|
||||
modal.find('a.ui.label.visible').each((i,el) => {
|
||||
modal.find('a.ui.label.visible').each((i, el) => {
|
||||
el.remove()
|
||||
})
|
||||
var servers
|
||||
@@ -192,6 +192,42 @@ function deleteRequest(api) {
|
||||
});
|
||||
}
|
||||
|
||||
function manualTrigger(btn, cronId) {
|
||||
$(btn).toggleClass('loading')
|
||||
$.ajax({
|
||||
url: '/api/cron/' + cronId + '/manual',
|
||||
type: 'GET',
|
||||
}).done(resp => {
|
||||
$(btn).toggleClass('loading')
|
||||
if (resp.code == 200) {
|
||||
$.suiAlert({
|
||||
title: '触发成功,等待执行结果',
|
||||
type: 'success',
|
||||
description: resp.message,
|
||||
time: '3',
|
||||
position: 'top-center',
|
||||
});
|
||||
} else {
|
||||
$.suiAlert({
|
||||
title: '触发失败 ',
|
||||
type: 'error',
|
||||
description: resp.code + ':' + resp.message,
|
||||
time: '3',
|
||||
position: 'top-center',
|
||||
});
|
||||
}
|
||||
}).fail(err => {
|
||||
$(btn).toggleClass('loading')
|
||||
$.suiAlert({
|
||||
title: '触发失败 ',
|
||||
type: 'error',
|
||||
description: '网络错误:' + err.responseText,
|
||||
time: '3',
|
||||
position: 'top-center',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function logout(id) {
|
||||
$.post('/api/logout', JSON.stringify({ id: id })).done(function (resp) {
|
||||
if (resp.code == 200) {
|
||||
|
||||
Reference in New Issue
Block a user