diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 77cb3424..3d96c308 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1075,8 +1075,12 @@ export default { hour: 'hour', customizeWallpaperApi: 'Customize Wallpaper Api', customizeWallpaperApiHint: - 'It will get the image file extension format images that are allowed in all the settings in the content returned by the API.', + 'It will get the image file extension format images that are allowed in settings in the content returned by the API.', customizeWallpaperApiRequired: 'Required field; please enter Wallpaper API', + securityImageDomains: 'Security Image Domains', + securityImageDomainsHint: 'Allowed image domains whitelist for caching, used to control trusted image sources', + noSecurityImageDomains: 'No security domains', + securityImageDomainAdd: 'Add domain, e.g.: image.tmdb.org', }, site: { siteSync: 'Site Synchronization', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 9c524985..40f72988 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1064,9 +1064,13 @@ export default { }, mb: 'MB', hour: '小时', - customizeWallpaperApi: '自定义壁纸API', - customizeWallpaperApiHint: '会获取API返回内容中所有设置中允许的图片文件后缀格式图片', + customizeWallpaperApi: '自定义壁纸API地址', + customizeWallpaperApiHint: '会获取API返回内容中所有允许的安全域名地址的图片,需要同步设置安全域名地址', customizeWallpaperApiRequired: '必填项;请输入自定义壁纸API', + securityImageDomains: '安全图片域名', + securityImageDomainsHint: '允许缓存的图片域名白名单,用于控制可信任的图片来源', + noSecurityImageDomains: '暂无安全域名', + securityImageDomainAdd: '添加域名,如:image.tmdb.org', }, site: { siteSync: '站点同步', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 487f7bee..164a1dfd 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -1067,8 +1067,12 @@ export default { mb: 'MB', hour: '小時', customizeWallpaperApi: '自定義壁紙API', - customizeWallpaperApiHint: '會獲取 API 返回內容中所有設置中允許的圖片文件後綴格式圖片', + customizeWallpaperApiHint: '會獲取 API 返回內容中所有安全設置中允許的圖片地址,需要設置安全域名白名單', customizeWallpaperApiRequired: '必填項;請輸出自定義壁紙API', + securityImageDomains: '安全圖片域名', + securityImageDomainsHint: '允許緩存的圖片域名白名單,用於控制可信任的圖片來源', + noSecurityImageDomains: '暫無安全域名', + securityImageDomainAdd: '添加域名,如:image.tmdb.org', }, site: { siteSync: '站點同步', diff --git a/src/views/setting/AccountSettingSystem.vue b/src/views/setting/AccountSettingSystem.vue index eb8819ad..2f4e206f 100644 --- a/src/views/setting/AccountSettingSystem.vue +++ b/src/views/setting/AccountSettingSystem.vue @@ -52,6 +52,7 @@ const SystemSettings = ref({ DOH_ENABLE: false, DOH_RESOLVERS: null, DOH_DOMAINS: null, + SECURITY_IMAGE_DOMAINS: [], // 日志 DEBUG: false, LOG_LEVEL: 'INFO', @@ -92,6 +93,29 @@ const tmdbLanguageItems = [ { title: t('setting.system.tmdbLanguage.en'), value: 'en' }, ] +// 日志等级 +const logLevelItems = [ + { title: t('setting.system.logLevelItems.debug'), value: 'DEBUG' }, + { title: t('setting.system.logLevelItems.info'), value: 'INFO' }, + { title: t('setting.system.logLevelItems.warning'), value: 'WARNING' }, + { title: t('setting.system.logLevelItems.error'), value: 'ERROR' }, + { title: t('setting.system.logLevelItems.critical'), value: 'CRITICAL' }, +] + +// 安全域名添加变量 +const newSecurityDomain = ref('') + +// 添加安全域名 +function addSecurityDomain() { + if ( + newSecurityDomain.value && + !SystemSettings.value.Advanced.SECURITY_IMAGE_DOMAINS.includes(newSecurityDomain.value) + ) { + SystemSettings.value.Advanced.SECURITY_IMAGE_DOMAINS.push(newSecurityDomain.value) + newSecurityDomain.value = '' + } +} + // 调用API查询下载器设置 async function loadDownloaderSetting() { try { @@ -297,15 +321,6 @@ const pipProxyDisplay = computed({ }, }) -// 日志等级 -const logLevelItems = [ - { title: t('setting.system.logLevelItems.debug'), value: 'DEBUG' }, - { title: t('setting.system.logLevelItems.info'), value: 'INFO' }, - { title: t('setting.system.logLevelItems.warning'), value: 'WARNING' }, - { title: t('setting.system.logLevelItems.error'), value: 'ERROR' }, - { title: t('setting.system.logLevelItems.critical'), value: 'CRITICAL' }, -] - // 创建随机字符串 function createRandomString() { const charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_' @@ -832,6 +847,46 @@ onDeactivated(() => { /> + + + + + + {{ t('setting.system.securityImageDomains') }} + {{ t('setting.system.securityImageDomainsHint') }} + + +
+ + {{ domain }} + + + {{ t('setting.system.noSecurityImageDomains') }} + +
+
+ + + +
+
+
+
+