feat: 添加 AList 存储选项

This commit is contained in:
okatu-loli
2026-08-08 00:46:31 +08:00
committed by jxxghp
parent e242b881de
commit eabe8f6951
7 changed files with 37 additions and 6 deletions

View File

@@ -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',

View File

@@ -12,6 +12,7 @@ const STORAGE_ACCENT_COLOR_MAP = {
u115: '#17B26A',
rclone: '#6675FF',
alist: '#12B8D7',
alistgo: '#1BA0D8',
smb: '#3B82F6',
}

View File

@@ -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:

View File

@@ -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"
/>

View File

@@ -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',

View File

@@ -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服务器地址',

View File

@@ -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伺服器地址',