mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-12 00:54:42 +08:00
feat: 添加 AList 存储选项
This commit is contained in:
@@ -26,6 +26,11 @@ export const storageAttributes = [
|
||||
icon: 'mdi-server-network-outline',
|
||||
remote: true,
|
||||
},
|
||||
{
|
||||
type: 'alistgo',
|
||||
icon: 'mdi-server-network-outline',
|
||||
remote: true,
|
||||
},
|
||||
{
|
||||
type: 'smb',
|
||||
icon: 'mdi-folder-network-outline',
|
||||
|
||||
@@ -12,6 +12,7 @@ const STORAGE_ACCENT_COLOR_MAP = {
|
||||
u115: '#17B26A',
|
||||
rclone: '#6675FF',
|
||||
alist: '#12B8D7',
|
||||
alistgo: '#1BA0D8',
|
||||
smb: '#3B82F6',
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import alipan_png from '@images/misc/alipan.webp'
|
||||
import u115_png from '@images/misc/u115.png'
|
||||
import rclone_png from '@images/misc/rclone.png'
|
||||
import alist_png from '@images/misc/openlist.svg'
|
||||
import alistgo_png from '@images/misc/alist.svg'
|
||||
import custom_png from '@images/misc/database.png'
|
||||
import smb_png from '@images/misc/smb.png'
|
||||
import api from '@/api'
|
||||
@@ -58,6 +59,7 @@ function openStorageDialog() {
|
||||
u115: U115AuthDialog,
|
||||
rclone: RcloneConfigDialog,
|
||||
alist: AlistConfigDialog,
|
||||
alistgo: AlistConfigDialog,
|
||||
smb: SmbConfigDialog,
|
||||
}
|
||||
|
||||
@@ -69,7 +71,9 @@ function openStorageDialog() {
|
||||
const dialog = dialogMap[props.storage.type] || StorageCustomConfigDialog
|
||||
const dialogProps = dialog === StorageCustomConfigDialog
|
||||
? { storage: props.storage }
|
||||
: { conf: props.storage.config || {} }
|
||||
: dialog === AlistConfigDialog
|
||||
? { conf: props.storage.config || {}, type: props.storage.type }
|
||||
: { conf: props.storage.config || {} }
|
||||
|
||||
openSharedDialog(
|
||||
dialog,
|
||||
@@ -94,6 +98,8 @@ const getIcon = computed(() => {
|
||||
return rclone_png
|
||||
case 'alist':
|
||||
return alist_png
|
||||
case 'alistgo':
|
||||
return alistgo_png
|
||||
case 'smb':
|
||||
return smb_png
|
||||
default:
|
||||
|
||||
@@ -15,6 +15,10 @@ const props = defineProps({
|
||||
type: Object as PropType<{ [key: string]: any }>,
|
||||
required: true,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'alist',
|
||||
},
|
||||
})
|
||||
|
||||
// 定义事件
|
||||
@@ -29,7 +33,7 @@ async function handleDone() {
|
||||
// 重置配置
|
||||
async function handleReset() {
|
||||
try {
|
||||
const result: { [key: string]: any } = await api.get('/storage/reset/alist')
|
||||
const result: { [key: string]: any } = await api.get(`/storage/reset/${props.type}`)
|
||||
if (result.success) {
|
||||
// 重置成功
|
||||
handleDone()
|
||||
@@ -62,7 +66,7 @@ const sourceItems = [
|
||||
// 保存alist设置
|
||||
async function savaAlistConfig() {
|
||||
try {
|
||||
await api.post(`storage/save/alist`, props.conf)
|
||||
await api.post(`storage/save/${props.type}`, props.conf)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
@@ -78,7 +82,7 @@ async function savaAlistConfig() {
|
||||
<VIcon icon="mdi-cog-outline" class="me-2" />
|
||||
</template>
|
||||
<VCardTitle>
|
||||
{{ t('dialog.alistConfig.title') }}
|
||||
{{ t(`dialog.${props.type}Config.title`) }}
|
||||
</VCardTitle>
|
||||
</VCardItem>
|
||||
<VDivider />
|
||||
@@ -87,8 +91,8 @@ async function savaAlistConfig() {
|
||||
<VCol cols="12">
|
||||
<VTextField
|
||||
v-model="props.conf.url"
|
||||
:hint="t('dialog.alistConfig.serverUrl')"
|
||||
:label="t('dialog.alistConfig.serverUrl')"
|
||||
:hint="t(`dialog.${props.type}Config.serverUrl`)"
|
||||
:label="t(`dialog.${props.type}Config.serverUrl`)"
|
||||
persistent-hint
|
||||
prepend-inner-icon="mdi-server"
|
||||
/>
|
||||
|
||||
@@ -1480,6 +1480,7 @@ export default {
|
||||
u115: '115 Cloud',
|
||||
rclone: 'RClone',
|
||||
alist: 'OpenList',
|
||||
alistgo: 'AList',
|
||||
smb: 'SMB Network Share',
|
||||
custom: 'Custom',
|
||||
},
|
||||
@@ -3006,6 +3007,10 @@ export default {
|
||||
complete: 'Complete',
|
||||
reset: 'Reset',
|
||||
},
|
||||
alistgoConfig: {
|
||||
title: 'AList Configuration',
|
||||
serverUrl: 'AList server address',
|
||||
},
|
||||
smbConfig: {
|
||||
title: 'SMB Network Share Configuration',
|
||||
host: 'SMB Server Address',
|
||||
|
||||
@@ -1470,6 +1470,7 @@ export default {
|
||||
u115: '115网盘',
|
||||
rclone: 'RClone',
|
||||
alist: 'OpenList',
|
||||
alistgo: 'AList',
|
||||
smb: 'SMB网络共享',
|
||||
custom: '自定义',
|
||||
},
|
||||
@@ -2951,6 +2952,10 @@ export default {
|
||||
complete: '完成',
|
||||
reset: '重置',
|
||||
},
|
||||
alistgoConfig: {
|
||||
title: 'AList配置',
|
||||
serverUrl: 'AList服务地址',
|
||||
},
|
||||
smbConfig: {
|
||||
title: 'SMB网络共享配置',
|
||||
host: 'SMB服务器地址',
|
||||
|
||||
@@ -1468,6 +1468,7 @@ export default {
|
||||
u115: '115網盤',
|
||||
rclone: 'RClone',
|
||||
alist: 'OpenList',
|
||||
alistgo: 'AList',
|
||||
smb: 'SMB網路共享',
|
||||
custom: '自定義',
|
||||
},
|
||||
@@ -2950,6 +2951,10 @@ export default {
|
||||
complete: '完成',
|
||||
reset: '重置',
|
||||
},
|
||||
alistgoConfig: {
|
||||
title: 'AList配置',
|
||||
serverUrl: 'AList服務地址',
|
||||
},
|
||||
smbConfig: {
|
||||
title: 'SMB網路共享配置',
|
||||
host: 'SMB伺服器地址',
|
||||
|
||||
Reference in New Issue
Block a user