mirror of
https://github.com/Afilmory/afilmory
synced 2026-04-24 23:05:05 +00:00
Co-authored-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -457,6 +457,12 @@ const enUiSchema = {
|
||||
description: 'Optional path within the repository to limit syncing.',
|
||||
placeholder: 'public/photos',
|
||||
},
|
||||
'custom-domain': {
|
||||
label: 'Custom CDN domain',
|
||||
description: 'CDN or proxy domain used when generating public URLs.',
|
||||
placeholder: 'cdn.jsdelivr.net/gh/owner/repo@branch',
|
||||
helper: 'Leave empty to keep raw.githubusercontent.com URLs.',
|
||||
},
|
||||
'use-raw': {
|
||||
label: 'Use raw URL',
|
||||
description: 'Use raw.githubusercontent.com when generating public URLs.',
|
||||
|
||||
@@ -451,6 +451,12 @@ const zhCnUiSchema = {
|
||||
description: '可选,限制同步的仓库路径。',
|
||||
placeholder: 'public/photos(可选)',
|
||||
},
|
||||
'custom-domain': {
|
||||
label: '自定义 CDN 域名',
|
||||
description: '用于生成公开链接的 CDN 或代理域名。',
|
||||
placeholder: 'cdn.jsdelivr.net/gh/owner/repo@branch(示例)',
|
||||
helper: '留空则继续使用 raw.githubusercontent.com。',
|
||||
},
|
||||
'use-raw': {
|
||||
label: '使用 raw 链接',
|
||||
description: '生成公开链接时使用 raw.githubusercontent.com。',
|
||||
|
||||
@@ -135,6 +135,13 @@ const STORAGE_PROVIDER_FIELD_CONFIG: Record<StorageProviderType, readonly Storag
|
||||
placeholderKey: 'storage.providers.fields.github.path.placeholder',
|
||||
descriptionKey: 'storage.providers.fields.github.path.description',
|
||||
},
|
||||
{
|
||||
key: 'customDomain',
|
||||
labelKey: 'storage.providers.fields.github.custom-domain.label',
|
||||
placeholderKey: 'storage.providers.fields.github.custom-domain.placeholder',
|
||||
descriptionKey: 'storage.providers.fields.github.custom-domain.description',
|
||||
helperKey: 'storage.providers.fields.github.custom-domain.helper',
|
||||
},
|
||||
{
|
||||
key: 'useRawUrl',
|
||||
labelKey: 'storage.providers.fields.github.use-raw.label',
|
||||
|
||||
@@ -191,6 +191,8 @@ export class PhotoStorageService {
|
||||
if (pathValue) result.path = pathValue
|
||||
const useRawUrl = parseBoolean(config.useRawUrl)
|
||||
if (typeof useRawUrl === 'boolean') result.useRawUrl = useRawUrl
|
||||
const customDomain = normalizeStringToUndefined(config.customDomain)
|
||||
if (customDomain) result.customDomain = customDomain
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ const githubConfigSchema = z.object({
|
||||
branch: z.string().optional(),
|
||||
token: z.string().optional(),
|
||||
path: z.string().optional(),
|
||||
customDomain: z.string().optional(),
|
||||
useRawUrl: z.boolean().optional(),
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user