@@ -112,6 +112,7 @@ const SystemSettings = ref<any>({
112112 DOH_RESOLVERS: null ,
113113 DOH_DOMAINS: null ,
114114 SECURITY_IMAGE_DOMAINS: [],
115+ IMAGE_PROXY_ALLOWED_PRIVATE_RANGES: [],
115116 // 日志
116117 DEBUG: false ,
117118 LOG_LEVEL: ' INFO' ,
@@ -494,6 +495,8 @@ const dataCleanupFieldRules = [
494495
495496// 安全域名添加变量
496497const newSecurityDomain = ref (' ' )
498+ // 图片代理允许非公网网段添加变量
499+ const newImageProxyAllowedPrivateRange = ref (' ' )
497500
498501// 加载 LLM 模型列表与 provider 目录
499502async function refreshLlmModels(forceRefresh = true ) {
@@ -544,6 +547,19 @@ function addSecurityDomain() {
544547 }
545548}
546549
550+ // 添加图片代理允许访问的非公网网段
551+ function addImageProxyAllowedPrivateRange() {
552+ if (
553+ newImageProxyAllowedPrivateRange .value &&
554+ ! SystemSettings .value .Advanced .IMAGE_PROXY_ALLOWED_PRIVATE_RANGES .includes (
555+ newImageProxyAllowedPrivateRange .value ,
556+ )
557+ ) {
558+ SystemSettings .value .Advanced .IMAGE_PROXY_ALLOWED_PRIVATE_RANGES .push (newImageProxyAllowedPrivateRange .value )
559+ newImageProxyAllowedPrivateRange .value = ' '
560+ }
561+ }
562+
547563// 调用API查询下载器设置
548564async function loadDownloaderSetting() {
549565 try {
@@ -2103,6 +2119,51 @@ watch(currentLlmSnapshotKey, (snapshotKey, previousSnapshotKey) => {
21032119 </template >
21042120 </VTextField >
21052121 </div >
2122+ <VDivider class =" my-4" />
2123+ <div class =" text-subtitle-2 mb-1" >
2124+ {{ t('setting.system.imageProxyAllowedPrivateRanges') }}
2125+ </div >
2126+ <div class =" text-caption text-medium-emphasis mb-3" >
2127+ {{ t('setting.system.imageProxyAllowedPrivateRangesHint') }}
2128+ </div >
2129+ <div class =" d-flex flex-wrap gap-2 mb-3" >
2130+ <VChip
2131+ v-for =" (range, index) in SystemSettings.Advanced.IMAGE_PROXY_ALLOWED_PRIVATE_RANGES"
2132+ :key =" index"
2133+ closable
2134+ @click:close ="
2135+ SystemSettings.Advanced.IMAGE_PROXY_ALLOWED_PRIVATE_RANGES.splice(index, 1)
2136+ "
2137+ >
2138+ {{ range }}
2139+ </VChip >
2140+ <VChip
2141+ v-if =" SystemSettings.Advanced.IMAGE_PROXY_ALLOWED_PRIVATE_RANGES.length === 0"
2142+ color =" warning"
2143+ >
2144+ {{ t('setting.system.noImageProxyAllowedPrivateRanges') }}
2145+ </VChip >
2146+ </div >
2147+ <div class =" d-flex align-center gap-2" >
2148+ <VTextField
2149+ v-model =" newImageProxyAllowedPrivateRange"
2150+ :placeholder =" t('setting.system.imageProxyAllowedPrivateRangeAdd')"
2151+ hide-details
2152+ density =" compact"
2153+ prepend-inner-icon =" mdi-ip-network"
2154+ >
2155+ <template #append >
2156+ <VBtn
2157+ icon
2158+ color =" primary"
2159+ @click =" addImageProxyAllowedPrivateRange"
2160+ :disabled =" !newImageProxyAllowedPrivateRange"
2161+ >
2162+ <VIcon icon =" mdi-plus" />
2163+ </VBtn >
2164+ </template >
2165+ </VTextField >
2166+ </div >
21062167 </VExpansionPanelText >
21072168 </VExpansionPanel >
21082169 </VExpansionPanels >
0 commit comments