mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-12 16:11:27 +08:00
✨ Feature: add webPath for webdav picBed manage
This commit is contained in:
@@ -2792,10 +2792,14 @@ async function getBucketFileListBackStage () {
|
||||
currentPage: currentPage.value,
|
||||
cancelToken: cancelToken.value,
|
||||
cdnUrl: configMap.cdnUrl
|
||||
}
|
||||
} as IStringKeyMap
|
||||
isLoadingData.value = true
|
||||
const fileTransferStore = useFileTransferStore()
|
||||
fileTransferStore.resetFileTransferList()
|
||||
if (currentPicBedName.value === 'webdavplist') {
|
||||
param.baseDir = configMap.baseDir
|
||||
param.webPath = configMap.webPath
|
||||
}
|
||||
ipcRenderer.send('getBucketListBackstage', configMap.alias, param)
|
||||
ipcRenderer.on('refreshFileTransferList', (evt: IpcRendererEvent, data) => {
|
||||
fileTransferStore.refreshFileTransferList(data)
|
||||
|
||||
@@ -61,24 +61,24 @@
|
||||
/>
|
||||
</el-table>
|
||||
<template #reference>
|
||||
<el-tooltip
|
||||
effect="light"
|
||||
:content="item.alias"
|
||||
placement="top"
|
||||
:disabled="item.alias.length <= 15"
|
||||
<el-button
|
||||
style="width: 100%; text-align: center;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
|
||||
>
|
||||
<el-button
|
||||
style="width: 100%; text-align: center;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"
|
||||
<template #icon>
|
||||
<img
|
||||
:src="require(`./assets/${item.picBedName}.webp`)"
|
||||
style="width: 25px; height: 25px;"
|
||||
>
|
||||
</template>
|
||||
<el-tooltip
|
||||
effect="light"
|
||||
:content="item.alias"
|
||||
placement="top"
|
||||
:disabled="item.alias.length <= 15"
|
||||
>
|
||||
<template #icon>
|
||||
<img
|
||||
:src="require(`./assets/${item.picBedName}.webp`)"
|
||||
style="width: 25px; height: 25px;"
|
||||
>
|
||||
</template>
|
||||
{{ item.alias.length > 15 ? item.alias.slice(0, 8) + '...' + item.alias.slice(-6) : item.alias }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
<br>
|
||||
|
||||
@@ -319,7 +319,8 @@ const urlMap : IStringKeyMap = {
|
||||
tcyun: 'https://console.cloud.tencent.com/cos',
|
||||
upyun: 'https://console.upyun.com',
|
||||
s3plist: 'https://aws.amazon.com/cn/s3/',
|
||||
webdavplist: 'https://baike.baidu.com/item/WebDAV/4610909'
|
||||
webdavplist: 'https://baike.baidu.com/item/WebDAV/4610909',
|
||||
local: 'https://piclist.cn'
|
||||
}
|
||||
|
||||
const openPicBedUrl = () => shell.openExternal(urlMap[currentPagePicBedConfig.picBedName])
|
||||
@@ -417,6 +418,7 @@ const handleSelectMenu = (bucketName: string) => {
|
||||
const alias = currentAlias.value
|
||||
const cdnUrl = manageStore.config.picBed[currentAlias.value].customUrl
|
||||
const bucketConfig = bucketList.value[bucketName]
|
||||
const webPath = manageStore.config.picBed[currentAlias.value].webPath || ''
|
||||
const configMap = {
|
||||
prefix,
|
||||
bucketName,
|
||||
@@ -424,7 +426,9 @@ const handleSelectMenu = (bucketName: string) => {
|
||||
picBedName,
|
||||
alias,
|
||||
bucketConfig,
|
||||
cdnUrl
|
||||
cdnUrl,
|
||||
baseDir: prefix,
|
||||
webPath
|
||||
}
|
||||
currentSelectedBucket.value = bucketName
|
||||
router.push({
|
||||
@@ -450,7 +454,8 @@ const menuTitleMap:IStringKeyMap = {
|
||||
smms: galleryT,
|
||||
imgur: galleryT,
|
||||
github: repositoryT,
|
||||
webdavplist: ''
|
||||
webdavplist: '',
|
||||
local: ''
|
||||
}
|
||||
|
||||
const showNewIconList = ['aliyun', 'qiniu', 'tcyun']
|
||||
|
||||
@@ -28,16 +28,17 @@ export class FileCacheDb extends Dexie {
|
||||
imgur: Table<IFileCache, string>
|
||||
s3plist: Table<IFileCache, string>
|
||||
webdavplist: Table<IFileCache, string>
|
||||
localplist: Table<IFileCache, string>
|
||||
local: Table<IFileCache, string>
|
||||
sftpplist: Table<IFileCache, string>
|
||||
|
||||
constructor () {
|
||||
super('bucketFileDb')
|
||||
const tableNames = ['tcyun', 'aliyun', 'qiniu', 'github', 'smms', 'upyun', 'imgur', 's3plist', 'webdavplist', 'localplist']
|
||||
const tableNames = ['tcyun', 'aliyun', 'qiniu', 'github', 'smms', 'upyun', 'imgur', 's3plist', 'webdavplist', 'local', 'sftpplist']
|
||||
const tableNamesMap = tableNames.reduce((acc, cur) => {
|
||||
acc[cur] = '&key, value'
|
||||
return acc
|
||||
}, {} as IStringKeyMap)
|
||||
this.version(3).stores(tableNamesMap)
|
||||
this.version(4).stores(tableNamesMap)
|
||||
this.tcyun = this.table('tcyun')
|
||||
this.aliyun = this.table('aliyun')
|
||||
this.qiniu = this.table('qiniu')
|
||||
@@ -47,7 +48,8 @@ export class FileCacheDb extends Dexie {
|
||||
this.imgur = this.table('imgur')
|
||||
this.s3plist = this.table('s3plist')
|
||||
this.webdavplist = this.table('webdavplist')
|
||||
this.localplist = this.table('localplist')
|
||||
this.local = this.table('local')
|
||||
this.sftpplist = this.table('sftpplist')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -819,6 +819,15 @@ export const supportedPicBedList: IStringKeyMap = {
|
||||
}
|
||||
]
|
||||
},
|
||||
bucketName: {
|
||||
required: true,
|
||||
description: $T('MANAGE_CONSTANT_LOCAL_BUCKET_DESC'),
|
||||
placeholder: $T('MANAGE_CONSTANT_LOCAL_BUCKET_PLACEHOLDER'),
|
||||
type: 'string',
|
||||
default: 'local',
|
||||
disabled: true,
|
||||
tooltip: $T('MANAGE_CONSTANT_LOCAL_BUCKET_TOOLTIP')
|
||||
},
|
||||
webPath: {
|
||||
required: false,
|
||||
description: $T('MANAGE_CONSTANT_LOCAL_WEB_PATH'),
|
||||
|
||||
Reference in New Issue
Block a user