mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-27 11:10:12 +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
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
emit('refresh')
|
emit('refresh')
|
||||||
}, 500)
|
}, 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) {
|
if (result.success) {
|
||||||
$toast.success('任务执行完成!')
|
$toast.success('任务执行完成!')
|
||||||
emit('refresh')
|
emit('refresh')
|
||||||
@@ -180,7 +182,29 @@ const resolveProgress = (item: Workflow) => {
|
|||||||
</template>
|
</template>
|
||||||
<VListItemTitle>编辑任务</VListItemTitle>
|
<VListItemTitle>编辑任务</VListItemTitle>
|
||||||
</VListItem>
|
</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>
|
<template #prepend>
|
||||||
<VIcon icon="mdi-run" />
|
<VIcon icon="mdi-run" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -67,9 +67,6 @@ onMounted(() => {
|
|||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<VSelect v-model="data.type" label="类型" :items="typeOptions" outlined dense />
|
<VSelect v-model="data.type" label="类型" :items="typeOptions" outlined dense />
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12">
|
|
||||||
<VSelect v-model="data.category" label="类别" :items="getCategories" outlined dense />
|
|
||||||
</VCol>
|
|
||||||
<VCol cols="6">
|
<VCol cols="6">
|
||||||
<VTextField v-model="data.year" label="年份" outlined dense />
|
<VTextField v-model="data.year" label="年份" outlined dense />
|
||||||
</VCol>
|
</VCol>
|
||||||
|
|||||||
Reference in New Issue
Block a user