🔨 Refactor: compress all assets image to improve loading speed

This commit is contained in:
萌萌哒赫萝
2023-03-02 11:41:06 +08:00
parent 8ba46d9272
commit 8911217780
469 changed files with 82 additions and 25 deletions
+1 -1
View File
@@ -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) {
+58
View File
@@ -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: ''
}
}