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', icon: 'mdi-server-network-outline',
remote: true, remote: true,
}, },
{
type: 'alistgo',
icon: 'mdi-server-network-outline',
remote: true,
},
{ {
type: 'smb', type: 'smb',
icon: 'mdi-folder-network-outline', icon: 'mdi-folder-network-outline',

View File

@@ -12,6 +12,7 @@ const STORAGE_ACCENT_COLOR_MAP = {
u115: '#17B26A', u115: '#17B26A',
rclone: '#6675FF', rclone: '#6675FF',
alist: '#12B8D7', alist: '#12B8D7',
alistgo: '#1BA0D8',
smb: '#3B82F6', 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 u115_png from '@images/misc/u115.png'
import rclone_png from '@images/misc/rclone.png' import rclone_png from '@images/misc/rclone.png'
import alist_png from '@images/misc/openlist.svg' 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 custom_png from '@images/misc/database.png'
import smb_png from '@images/misc/smb.png' import smb_png from '@images/misc/smb.png'
import api from '@/api' import api from '@/api'
@@ -58,6 +59,7 @@ function openStorageDialog() {
u115: U115AuthDialog, u115: U115AuthDialog,
rclone: RcloneConfigDialog, rclone: RcloneConfigDialog,
alist: AlistConfigDialog, alist: AlistConfigDialog,
alistgo: AlistConfigDialog,
smb: SmbConfigDialog, smb: SmbConfigDialog,
} }
@@ -69,7 +71,9 @@ function openStorageDialog() {
const dialog = dialogMap[props.storage.type] || StorageCustomConfigDialog const dialog = dialogMap[props.storage.type] || StorageCustomConfigDialog
const dialogProps = dialog === StorageCustomConfigDialog const dialogProps = dialog === StorageCustomConfigDialog
? { storage: props.storage } ? { storage: props.storage }
: { conf: props.storage.config || {} } : dialog === AlistConfigDialog
? { conf: props.storage.config || {}, type: props.storage.type }
: { conf: props.storage.config || {} }
openSharedDialog( openSharedDialog(
dialog, dialog,
@@ -94,6 +98,8 @@ const getIcon = computed(() => {
return rclone_png return rclone_png
case 'alist': case 'alist':
return alist_png return alist_png
case 'alistgo':
return alistgo_png
case 'smb': case 'smb':
return smb_png return smb_png
default: default:

View File

@@ -15,6 +15,10 @@ const props = defineProps({
type: Object as PropType<{ [key: string]: any }>, type: Object as PropType<{ [key: string]: any }>,
required: true, required: true,
}, },
type: {
type: String,
default: 'alist',
},
}) })
// 定义事件 // 定义事件
@@ -29,7 +33,7 @@ async function handleDone() {
// 重置配置 // 重置配置
async function handleReset() { async function handleReset() {
try { 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) { if (result.success) {
// 重置成功 // 重置成功
handleDone() handleDone()
@@ -62,7 +66,7 @@ const sourceItems = [
// 保存alist设置 // 保存alist设置
async function savaAlistConfig() { async function savaAlistConfig() {
try { try {
await api.post(`storage/save/alist`, props.conf) await api.post(`storage/save/${props.type}`, props.conf)
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }
@@ -78,7 +82,7 @@ async function savaAlistConfig() {
<VIcon icon="mdi-cog-outline" class="me-2" /> <VIcon icon="mdi-cog-outline" class="me-2" />
</template> </template>
<VCardTitle> <VCardTitle>
{{ t('dialog.alistConfig.title') }} {{ t(`dialog.${props.type}Config.title`) }}
</VCardTitle> </VCardTitle>
</VCardItem> </VCardItem>
<VDivider /> <VDivider />
@@ -87,8 +91,8 @@ async function savaAlistConfig() {
<VCol cols="12"> <VCol cols="12">
<VTextField <VTextField
v-model="props.conf.url" v-model="props.conf.url"
:hint="t('dialog.alistConfig.serverUrl')" :hint="t(`dialog.${props.type}Config.serverUrl`)"
:label="t('dialog.alistConfig.serverUrl')" :label="t(`dialog.${props.type}Config.serverUrl`)"
persistent-hint persistent-hint
prepend-inner-icon="mdi-server" prepend-inner-icon="mdi-server"
/> />

View File

@@ -1480,6 +1480,7 @@ export default {
u115: '115 Cloud', u115: '115 Cloud',
rclone: 'RClone', rclone: 'RClone',
alist: 'OpenList', alist: 'OpenList',
alistgo: 'AList',
smb: 'SMB Network Share', smb: 'SMB Network Share',
custom: 'Custom', custom: 'Custom',
}, },
@@ -3006,6 +3007,10 @@ export default {
complete: 'Complete', complete: 'Complete',
reset: 'Reset', reset: 'Reset',
}, },
alistgoConfig: {
title: 'AList Configuration',
serverUrl: 'AList server address',
},
smbConfig: { smbConfig: {
title: 'SMB Network Share Configuration', title: 'SMB Network Share Configuration',
host: 'SMB Server Address', host: 'SMB Server Address',

View File

@@ -1470,6 +1470,7 @@ export default {
u115: '115网盘', u115: '115网盘',
rclone: 'RClone', rclone: 'RClone',
alist: 'OpenList', alist: 'OpenList',
alistgo: 'AList',
smb: 'SMB网络共享', smb: 'SMB网络共享',
custom: '自定义', custom: '自定义',
}, },
@@ -2951,6 +2952,10 @@ export default {
complete: '完成', complete: '完成',
reset: '重置', reset: '重置',
}, },
alistgoConfig: {
title: 'AList配置',
serverUrl: 'AList服务地址',
},
smbConfig: { smbConfig: {
title: 'SMB网络共享配置', title: 'SMB网络共享配置',
host: 'SMB服务器地址', host: 'SMB服务器地址',

View File

@@ -1468,6 +1468,7 @@ export default {
u115: '115網盤', u115: '115網盤',
rclone: 'RClone', rclone: 'RClone',
alist: 'OpenList', alist: 'OpenList',
alistgo: 'AList',
smb: 'SMB網路共享', smb: 'SMB網路共享',
custom: '自定義', custom: '自定義',
}, },
@@ -2950,6 +2951,10 @@ export default {
complete: '完成', complete: '完成',
reset: '重置', reset: '重置',
}, },
alistgoConfig: {
title: 'AList配置',
serverUrl: 'AList服務地址',
},
smbConfig: { smbConfig: {
title: 'SMB網路共享配置', title: 'SMB網路共享配置',
host: 'SMB伺服器地址', host: 'SMB伺服器地址',