mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-28 19:47:49 +08:00
fix ui
This commit is contained in:
@@ -29,6 +29,8 @@ function getSchedulerColor(status: string) {
|
|||||||
switch (status) {
|
switch (status) {
|
||||||
case '正在运行':
|
case '正在运行':
|
||||||
return 'success'
|
return 'success'
|
||||||
|
case '已停止':
|
||||||
|
return 'error'
|
||||||
case '等待':
|
case '等待':
|
||||||
return ''
|
return ''
|
||||||
default:
|
default:
|
||||||
@@ -37,22 +39,21 @@ function getSchedulerColor(status: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 执行命令
|
// 执行命令
|
||||||
async function runCommand(id: string) {
|
function runCommand(id: string) {
|
||||||
// 取id|前面的命令
|
// 取id|前面的命令
|
||||||
id = `/${id.split('|')[0]}`
|
id = id.split('|')[0]
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/command', {
|
// 异步提交
|
||||||
|
api.get('system/runscheduler', {
|
||||||
params: {
|
params: {
|
||||||
cmd: id,
|
jobid: id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if (result.success) {
|
$toast.success('定时作业执行请求提交成功!')
|
||||||
$toast.success('执行请求提交成功!')
|
// 1秒后刷新数据
|
||||||
|
setTimeout(() => {
|
||||||
loadSchedulerList()
|
loadSchedulerList()
|
||||||
}
|
}, 1000)
|
||||||
else {
|
|
||||||
$toast.error(`执行请求提交失败:${result.message}`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
@@ -115,6 +116,7 @@ onUnmounted(() => {
|
|||||||
<td>
|
<td>
|
||||||
<VBtn
|
<VBtn
|
||||||
small
|
small
|
||||||
|
:disabled="scheduler.status === '正在运行'"
|
||||||
@click="runCommand(scheduler.id)"
|
@click="runCommand(scheduler.id)"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
|
|||||||
Reference in New Issue
Block a user