173
173
input-align =" left"
174
174
:left-icon =" iconKey"
175
175
/>
176
+ <nut-input
177
+ v-if =" storageType !== 'manual'"
178
+ class =" input"
179
+ v-model =" githubProxyInput"
180
+ :disabled =" !isEditing"
181
+ :placeholder =" $t(`myPage.placeholder.githubProxy`)"
182
+ type =" text"
183
+ input-align =" left"
184
+ :left-icon =" icongithubProxy"
185
+ right-icon =" tips"
186
+ @click-right-icon =" githubProxyTips"
187
+ />
176
188
<nut-input
177
189
class =" input"
178
190
v-model =" proxyInput"
@@ -275,6 +287,7 @@ import avatar from "@/assets/icons/avatar.svg?url";
275
287
import iconKey from " @/assets/icons/key-solid.png" ;
276
288
import iconUser from " @/assets/icons/user-solid.png" ;
277
289
import iconProxy from " @/assets/icons/proxy.svg" ;
290
+ import icongithubProxy from " @/assets/icons/githubProxy.svg" ;
278
291
import iconUA from " @/assets/icons/user-agent.svg" ;
279
292
import iconMax from " @/assets/icons/max.svg" ;
280
293
import iconTimeout from " @/assets/icons/timeout.svg" ;
@@ -298,7 +311,7 @@ const router = useRouter();
298
311
const { showNotify } = useAppNotifyStore ();
299
312
const { currentUrl : host } = useHostAPI ();
300
313
const settingsStore = useSettingsStore ();
301
- const { githubUser, gistToken, syncTime, avatarUrl, defaultUserAgent, defaultProxy, defaultTimeout, cacheThreshold, syncPlatform } =
314
+ const { githubUser, gistToken, syncTime, avatarUrl, defaultUserAgent, defaultProxy, defaultTimeout, cacheThreshold, syncPlatform, githubProxy } =
302
315
storeToRefs (settingsStore );
303
316
304
317
const displayAvatar = computed (() => {
@@ -330,6 +343,7 @@ const onClickAbout = () => {
330
343
const syncPlatformInput = ref (" " );
331
344
const userInput = ref (" " );
332
345
const tokenInput = ref (" " );
346
+ const githubProxyInput = ref (" " );
333
347
const uaInput = ref (" " );
334
348
const proxyInput = ref (" " );
335
349
const timeoutInput = ref (" " );
@@ -347,6 +361,7 @@ const toggleEditMode = async () => {
347
361
syncPlatform: syncPlatformInput .value ,
348
362
githubUser: userInput .value ,
349
363
gistToken: tokenInput .value ,
364
+ githubProxy: githubProxyInput .value ,
350
365
defaultUserAgent: uaInput .value ,
351
366
defaultProxy: proxyInput .value ,
352
367
defaultTimeout: timeoutInput .value ,
@@ -357,6 +372,7 @@ const toggleEditMode = async () => {
357
372
syncPlatformInput .value = syncPlatform .value ;
358
373
userInput .value = githubUser .value ;
359
374
tokenInput .value = gistToken .value ;
375
+ githubProxyInput .value = githubProxy .value ;
360
376
uaInput .value = defaultUserAgent .value ;
361
377
proxyInput .value = defaultProxy .value ;
362
378
timeoutInput .value = defaultTimeout .value ;
@@ -400,6 +416,7 @@ const toggleSyncPlatform = () => {
400
416
const setDisplayInfo = () => {
401
417
syncPlatformInput .value = syncPlatform .value || " " ;
402
418
userInput .value = githubUser .value || " " ;
419
+ githubProxyInput .value = githubProxy .value || " " ;
403
420
tokenInput .value = gistToken .value
404
421
? ` ${gistToken .value .slice (0 , 6 )}************ `
405
422
: " " ;
@@ -550,6 +567,18 @@ const downloadBtn = () => {
550
567
lockScroll: false ,
551
568
});
552
569
}
570
+ const githubProxyTips = () => {
571
+ Dialog ({
572
+ title: ' 请填写完整 GitHub 加速代理地址' ,
573
+ content: ' 后端需 >= 2.19.97\n\n 1. 仅用于上传/下载 Gist 和获取 GitHub 头像\n\n 2. 请填写完整 如 https://a.com\n\n 3. 需支持代理 https://api.github.com\n\n 测试方式:\n 浏览器打开\n https://a.com/https://api.github.com/users/xream\n 有正常的响应\n\n 3. 使用此方式时, 自行注意安全隐私问题' ,
574
+ popClass: ' auto-dialog' ,
575
+ textAlign: ' left' ,
576
+ okText: ' OK' ,
577
+ noCancelBtn: true ,
578
+ closeOnPopstate: true ,
579
+ lockScroll: false ,
580
+ });
581
+ };
553
582
const proxyTips = () => {
554
583
Dialog ({
555
584
title: ' 通过代理/节点/策略进行下载' ,
0 commit comments