mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-08-28 19:47:17 +08:00
🔨 Refactor: compress all assets image to improve loading speed
This commit is contained in:
@@ -73,7 +73,7 @@ export function formatLink (url: string, fileName: string, type: string, format?
|
||||
|
||||
export function getFileIconPath (fileName: string) {
|
||||
const ext = path.extname(fileName).slice(1)
|
||||
return availableIconList.includes(ext) ? `${ext}.png` : 'unknown.png'
|
||||
return availableIconList.includes(ext) ? `${ext}.webp` : 'unknown.webp'
|
||||
}
|
||||
|
||||
export function formatFileSize (size: number) {
|
||||
|
||||
@@ -756,5 +756,63 @@ export const supportedPicBedList: IStringKeyMap = {
|
||||
options: ['alias', 'endpoint', 'username', 'password', 'bucketName', 'baseDir', 'customUrl', 'proxy', 'sslEnabled'],
|
||||
refLink: 'https://pichoro.horosama.com/#/PicHoroDocs/configure?id=webdav',
|
||||
referenceText: '配置教程请参考:'
|
||||
},
|
||||
localplist: {
|
||||
name: '本地',
|
||||
icon: 'localplist',
|
||||
configOptions: {
|
||||
alias: {
|
||||
required: true,
|
||||
description: '配置别名-必需',
|
||||
placeholder: '该配置的唯一标识',
|
||||
type: 'string',
|
||||
rule: aliasRule,
|
||||
default: 'localplist-A',
|
||||
tooltip: aliasTooltip
|
||||
},
|
||||
baseDir: {
|
||||
required: false,
|
||||
description: '起始目录-可选',
|
||||
placeholder: '例如:/test1',
|
||||
type: 'string',
|
||||
default: '/',
|
||||
tooltip: '请填写完整的本地路径,例如:/test1'
|
||||
},
|
||||
customUrl: {
|
||||
required: false,
|
||||
description: '自定义域名-可选',
|
||||
placeholder: '例如:https://example.com',
|
||||
type: 'string',
|
||||
tooltip: '如果您的本地服务器支持自定义域名,请填写完整的自定义域名,例如:https://example.com',
|
||||
rule: [
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value) {
|
||||
if (!/^https?:\/\/.+/.test(value)) {
|
||||
callback(new Error('自定义域名请以http://或https://开头'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
webDir: {
|
||||
required: false,
|
||||
description: 'Web目录-可选',
|
||||
placeholder: '例如:/test1',
|
||||
type: 'string',
|
||||
default: '/',
|
||||
tooltip: '请填写您的Web服务器的根目录,例如:/test1'
|
||||
}
|
||||
},
|
||||
explain: '本地配置',
|
||||
options: ['alias', 'baseDir', 'customUrl', 'webDir'],
|
||||
refLink: '',
|
||||
referenceText: ''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user