feat: 添加扫描目录功能,支持将目录文件扫描到队列

This commit is contained in:
jxxghp
2025-02-28 21:11:21 +08:00
parent 8cdd4b4af5
commit cb6be91538
6 changed files with 67 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ onMounted(() => {
<VSelect v-model="data.downloader" :items="downloaderOptions" label="下载器" outlined dense />
</VCol>
<VCol cols="12">
<VTextField v-model="data.save_path" label="保存路径" outlined dense clearable placeholder="留空自动" />
<VPathField v-model="data.save_path" storage="local" label="保存路径" clearable placeholder="留空自动" />
</VCol>
<VCol cols="12">
<VSwitch v-model="data.only_lack" label="仅下载缺失的资源" />

View File

@@ -22,7 +22,7 @@ defineProps({
</VAvatar>
</template>
<VCardTitle>获取下载任务</VCardTitle>
<VCardSubtitle>获取下载任务更新任务状态</VCardSubtitle>
<VCardSubtitle>获取下载队列中的任务状态</VCardSubtitle>
</VCardItem>
<VDivider />
<VCardText>

View File

@@ -77,7 +77,7 @@ onMounted(() => {
</VAvatar>
</template>
<VCardTitle>搜索站点资源</VCardTitle>
<VCardSubtitle>根据关键字搜索站点种子资源</VCardSubtitle>
<VCardSubtitle>搜索站点种子资源列表</VCardSubtitle>
</VCardItem>
<VDivider />
<VCardText>

View File

@@ -0,0 +1,41 @@
<script setup lang="ts">
import { Handle, Position } from '@vue-flow/core'
import { storageOptions } from '@/api/constants'
defineProps({
id: {
type: String,
required: true,
},
data: {
type: Object,
required: true,
},
})
</script>
<template>
<VCard max-width="20rem">
<Handle id="edge_in" type="target" :position="Position.Left" />
<VCardItem>
<template v-slot:prepend>
<VAvatar>
<VIcon icon="mdi-file-move" size="x-large"></VIcon>
</VAvatar>
</template>
<VCardTitle>扫描目录</VCardTitle>
<VCardSubtitle>扫描目录文件到队列</VCardSubtitle>
</VCardItem>
<VDivider />
<VCardText>
<VRow>
<VCol cols="12">
<VSelect v-model="data.storage" label="存储" :items="storageOptions" outlined dense />
</VCol>
<VCol cols="12">
<VPathField v-model="data.directory" :storage="data.storage" label="目录" clearable />
</VCol>
</VRow>
</VCardText>
<Handle id="edge_out" type="source" :position="Position.Right" />
</VCard>
</template>

View File

@@ -11,6 +11,18 @@ defineProps({
required: true,
},
})
// 来源下拉框
const sourceOptions = ref([
{
title: '文件列表',
value: 'files',
},
{
title: '下载任务',
value: 'downloads',
},
])
</script>
<template>
<VCard max-width="20rem">
@@ -22,8 +34,16 @@ defineProps({
</VAvatar>
</template>
<VCardTitle>整理文件</VCardTitle>
<VCardSubtitle>整理下载队列中的文件</VCardSubtitle>
<VCardSubtitle>整理重命名队列中的文件</VCardSubtitle>
</VCardItem>
<VDivider />
<VCardText>
<VRow>
<VCol cols="12">
<VSelect v-model="data.source" label="来源" :items="sourceOptions" outlined dense />
</VCol>
</VRow>
</VCardText>
<Handle id="edge_out" type="source" :position="Position.Right" />
</VCard>
</template>