mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-30 12:49:55 +08:00
feat: 优化任务执行功能,添加继续执行和重新开始选项;移除媒体过滤器中的类别选择
This commit is contained in:
@@ -111,13 +111,15 @@ async function handlePause(item: Workflow) {
|
||||
}
|
||||
|
||||
// 立即执行任务
|
||||
async function handleRun(item: Workflow) {
|
||||
async function handleRun(item: Workflow, from_begin: boolean) {
|
||||
loading.value = true
|
||||
try {
|
||||
setTimeout(() => {
|
||||
emit('refresh')
|
||||
}, 500)
|
||||
const result: { [key: string]: string } = await api.post(`workflow/${item.id}/run`)
|
||||
const result: { [key: string]: string } = await api.post(`workflow/${item.id}/run?from_begin=${from_begin}`, {
|
||||
from_begin,
|
||||
})
|
||||
if (result.success) {
|
||||
$toast.success('任务执行完成!')
|
||||
emit('refresh')
|
||||
@@ -180,7 +182,29 @@ const resolveProgress = (item: Workflow) => {
|
||||
</template>
|
||||
<VListItemTitle>编辑任务</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem variant="plain" base-color="info" @click="handleRun(workflow)">
|
||||
<VListItem
|
||||
v-if="workflow.current_action"
|
||||
variant="plain"
|
||||
base-color="info"
|
||||
@click="handleRun(workflow, false)"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-play-speed" />
|
||||
</template>
|
||||
<VListItemTitle>继续执行</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem
|
||||
v-if="workflow.current_action"
|
||||
variant="plain"
|
||||
base-color="warning"
|
||||
@click="handleRun(workflow, true)"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-replay" />
|
||||
</template>
|
||||
<VListItemTitle>重新开始</VListItemTitle>
|
||||
</VListItem>
|
||||
<VListItem v-else variant="plain" base-color="info" @click="handleRun(workflow, true)">
|
||||
<template #prepend>
|
||||
<VIcon icon="mdi-run" />
|
||||
</template>
|
||||
|
||||
@@ -67,9 +67,6 @@ onMounted(() => {
|
||||
<VCol cols="12">
|
||||
<VSelect v-model="data.type" label="类型" :items="typeOptions" outlined dense />
|
||||
</VCol>
|
||||
<VCol cols="12">
|
||||
<VSelect v-model="data.category" label="类别" :items="getCategories" outlined dense />
|
||||
</VCol>
|
||||
<VCol cols="6">
|
||||
<VTextField v-model="data.year" label="年份" outlined dense />
|
||||
</VCol>
|
||||
|
||||
Reference in New Issue
Block a user