fix: cron.run/update/remove参数修复(id→jobId匹配Gateway schema)

This commit is contained in:
晴天
2026-03-16 17:40:09 +08:00
parent f8d725e572
commit cff5d2ef1f

View File

@@ -247,7 +247,7 @@ function renderList(page, state) {
const btn = e.currentTarget
btn.disabled = true
try {
await wsClient.request('cron.run', { id: jid })
await wsClient.request('cron.run', { jobId: jid })
toast('任务已触发执行', 'success')
setTimeout(() => fetchJobs(page, state), 2000)
} catch (err) { toast('触发失败: ' + err, 'error') }
@@ -259,7 +259,7 @@ function renderList(page, state) {
btn.disabled = true
btn.innerHTML = icon('refresh-cw', 14)
try {
await wsClient.request('cron.update', { id: jid, patch: { enabled: !job.enabled } })
await wsClient.request('cron.update', { jobId: jid, patch: { enabled: !job.enabled } })
toast(job.enabled ? '已暂停' : '已启用', 'info')
await fetchJobs(page, state)
} catch (err) { toast('操作失败: ' + err, 'error'); btn.disabled = false; btn.innerHTML = job.enabled ? icon('pause', 14) : icon('play', 14) }
@@ -273,7 +273,7 @@ function renderList(page, state) {
if (!yes) return
if (btn) btn.disabled = true
try {
await wsClient.request('cron.remove', { id: jid })
await wsClient.request('cron.remove', { jobId: jid })
toast('已删除', 'info')
await fetchJobs(page, state)
} catch (err) { toast('删除失败: ' + err, 'error'); if (btn) btn.disabled = false }
@@ -426,7 +426,7 @@ async function openTaskDialog(job, page, state) {
if (deliveryChannel) {
patch.delivery = { mode: 'push', to: deliveryChannel, channel: deliveryChannel }
}
await wsClient.request('cron.update', { id: job.id, patch })
await wsClient.request('cron.update', { jobId: job.id, patch })
toast('任务已更新', 'success')
} else {
const params = {