mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-19 13:19:30 +08:00
fix TransferHistoryView
This commit is contained in:
23
src/api/constants.ts
Normal file
23
src/api/constants.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
export const storageOptions = [
|
||||
{
|
||||
title: '本地',
|
||||
value: 'local',
|
||||
},
|
||||
{
|
||||
title: '阿里云盘',
|
||||
value: 'alipan',
|
||||
},
|
||||
{
|
||||
title: '115网盘',
|
||||
value: 'u115',
|
||||
},
|
||||
{
|
||||
title: 'Rclone网盘',
|
||||
value: 'rclone',
|
||||
},
|
||||
]
|
||||
|
||||
export const storageDict = storageOptions.reduce((dict, item) => {
|
||||
dict[item.value] = item.title
|
||||
return dict
|
||||
}, {} as Record<string, string>)
|
||||
@@ -71,6 +71,10 @@ export interface Subscribe {
|
||||
export interface TransferHistory {
|
||||
// ID
|
||||
id: number
|
||||
// 源存储
|
||||
src_storage?: string
|
||||
// 目标存储
|
||||
dest_storage?: string
|
||||
// 源目录
|
||||
src?: string
|
||||
// 目的目录
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useToast } from 'vue-toast-notification'
|
||||
import MediaIdSelector from '../misc/MediaIdSelector.vue'
|
||||
import store from '@/store'
|
||||
import api from '@/api'
|
||||
import { storageOptions } from '@/api/constants'
|
||||
import { numberValidator } from '@/@validators'
|
||||
import { useDisplay } from 'vuetify'
|
||||
import ProgressDialog from './ProgressDialog.vue'
|
||||
@@ -36,25 +37,6 @@ const seasonItems = ref(
|
||||
})),
|
||||
)
|
||||
|
||||
const storageOptions = [
|
||||
{
|
||||
title: '本地',
|
||||
value: 'local',
|
||||
},
|
||||
{
|
||||
title: '阿里云盘',
|
||||
value: 'alipan',
|
||||
},
|
||||
{
|
||||
title: '115网盘',
|
||||
value: 'u115',
|
||||
},
|
||||
{
|
||||
title: 'Rclone网盘',
|
||||
value: 'rclone',
|
||||
},
|
||||
]
|
||||
|
||||
// 提示框
|
||||
const $toast = useToast()
|
||||
|
||||
@@ -226,7 +208,7 @@ onMounted(() => {
|
||||
<VForm @submit.prevent="() => {}">
|
||||
<VRow>
|
||||
<VCol cols="12" md="6">
|
||||
<VSelect
|
||||
<VCombobox
|
||||
v-model="transferForm.target_storage"
|
||||
:items="storageOptions"
|
||||
label="目的存储"
|
||||
|
||||
@@ -8,6 +8,7 @@ import ProgressDialog from '@/components/dialog/ProgressDialog.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import router from '@/router'
|
||||
import { useDisplay } from 'vuetify'
|
||||
import { storageDict } from '@/api/constants'
|
||||
|
||||
// 显示器宽度
|
||||
const display = useDisplay()
|
||||
@@ -413,7 +414,18 @@ onMounted(fetchData)
|
||||
</div>
|
||||
</template>
|
||||
<template #item.src="{ item }">
|
||||
<small>{{ item?.src }} <br />=> {{ item?.dest }}</small>
|
||||
<div>
|
||||
<span>
|
||||
<VChip size="small" label class="my-1"> {{ storageDict[item?.src_storage || ''] }}</VChip>
|
||||
<small>{{ item?.src }}</small>
|
||||
</span>
|
||||
<span class="text-high-emphasis text-bold"> => </span>
|
||||
<br />
|
||||
<span>
|
||||
<VChip size="small" label class="my-1"> {{ storageDict[item?.dest_storage || ''] }}</VChip>
|
||||
<small>{{ item?.dest }}</small>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #item.mode="{ item }">
|
||||
<VChip variant="outlined" color="primary" size="small">
|
||||
|
||||
Reference in New Issue
Block a user