fix(task): 任务窗口取消成功后提示,无任务时隐藏列表

- 取消任务成功后弹出取消成功提示
- 没有进行中的任务时不显示左侧列表和收起按钮,只留空状态

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
耗子
2026-09-24 21:36:13 +08:00
co-authored by Claude Opus 5.5
parent 231eba4a1a
commit 752c2ee96d
+5 -1
View File
@@ -48,7 +48,10 @@ const handleCancel = async (item: QueueTask) => {
title: $gettext('Cancel Task'),
content: $gettext('Are you sure you want to cancel task %{ name }?', { name: item.name }),
})
if (ok) useRequest(task.cancel(item.id))
if (!ok) return
useRequest(task.cancel(item.id)).onSuccess(() => {
window.$message.success($gettext('Canceled successfully'))
})
}
</script>
@@ -69,6 +72,7 @@ const handleCancel = async (item: QueueTask) => {
</template>
<n-layout has-sider class="h-full !bg-transparent">
<n-layout-sider
v-if="tasks.length"
v-model:collapsed="collapsed"
:width="200"
:collapsed-width="16"