fix: 调整任务卡片操作,并让标题图标显示出来
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
import { NButton, NCheckbox, NEmpty, NIcon, NInputNumber, NProgress, NTag, NTooltip, useDialog, useMessage } from "naive-ui";
|
||||
import { ChevronBackOutline, FolderOpenOutline, HelpCircleOutline, PauseOutline, PlayOutline, StopCircleOutline, TrashOutline } from "@vicons/ionicons5";
|
||||
import { ApiError, openLocal, revealLocal } from "../../shared/http";
|
||||
import { ApiError, revealLocal } from "../../shared/http";
|
||||
import { cancelJob, deleteJob, loadDownloadSettings, loadJobs, pauseJob, resumeJob, saveDownloadSettings, updateConcurrency, type DownloadJob } from "./api";
|
||||
|
||||
const props = defineProps<{ focusId: string }>();
|
||||
@@ -228,11 +228,6 @@ async function resume(job: DownloadJob) {
|
||||
}
|
||||
}
|
||||
|
||||
async function openFile(job: DownloadJob) {
|
||||
const opened = await openLocal(job.csvPath).catch(() => false);
|
||||
if (!opened) message.info(job.csvPath);
|
||||
}
|
||||
|
||||
async function openDir(job: DownloadJob) {
|
||||
const revealed = await revealLocal(job.csvPath).catch(() => false);
|
||||
if (!revealed) message.info(job.csvPath);
|
||||
@@ -377,7 +372,6 @@ async function removeJob(job: DownloadJob, files: boolean) {
|
||||
<template #icon><n-icon><PlayOutline /></n-icon></template>
|
||||
继续
|
||||
</n-button>
|
||||
<n-button size="small" quaternary @click="openFile(opened)">打开</n-button>
|
||||
<n-button size="small" quaternary @click="openDir(opened)">
|
||||
<template #icon><n-icon><FolderOpenOutline /></n-icon></template>
|
||||
</n-button>
|
||||
@@ -505,9 +499,6 @@ async function removeJob(job: DownloadJob, files: boolean) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-actions" @click.stop>
|
||||
<n-tag size="small" :type="job.status === 'running' ? 'info' : job.status === 'done' ? 'success' : job.status === 'paused' ? 'warning' : 'default'">
|
||||
{{ statusLabel(job) }}
|
||||
</n-tag>
|
||||
<template v-if="job.status === 'running'">
|
||||
<n-button v-if="!job.stopping" size="small" @click="pause(job)">
|
||||
<template #icon><n-icon><PauseOutline /></n-icon></template>
|
||||
@@ -535,7 +526,6 @@ async function removeJob(job: DownloadJob, files: boolean) {
|
||||
<template #icon><n-icon><PlayOutline /></n-icon></template>
|
||||
继续
|
||||
</n-button>
|
||||
<n-button size="small" quaternary @click="openFile(job)">打开</n-button>
|
||||
<n-button size="small" quaternary @click="openDir(job)">
|
||||
<template #icon><n-icon><FolderOpenOutline /></n-icon></template>
|
||||
</n-button>
|
||||
@@ -553,7 +543,9 @@ async function removeJob(job: DownloadJob, files: boolean) {
|
||||
:processing="job.status === 'running'"
|
||||
/>
|
||||
<div class="task-foot">
|
||||
<span class="sub">{{ noteText(job) }}</span>
|
||||
<n-tag size="small" :type="job.status === 'running' ? 'info' : job.status === 'done' ? 'success' : job.status === 'paused' ? 'warning' : 'default'">
|
||||
{{ statusLabel(job) }}
|
||||
</n-tag>
|
||||
<span class="sub">失败 {{ job.failed }} · {{ formatSize(job.fileBytes) }}</span>
|
||||
</div>
|
||||
<ul v-if="job.failures?.length" class="fail-list">
|
||||
|
||||
Reference in New Issue
Block a user