File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed
Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " sub-store-front-end" ,
3- "version" : " 2.15.79 " ,
3+ "version" : " 2.15.80 " ,
44 "private" : true ,
55 "scripts" : {
66 "dev" : " vite --host" ,
Original file line number Diff line number Diff line change @@ -333,6 +333,7 @@ export default {
333333 ua : {
334334 label : "User-Agent" ,
335335 placeholder : "The User-Agent for downloading resource(s)" ,
336+ placeholderDisabled : 'Disable custom UA when passing through' ,
336337 } ,
337338 subUserinfo : {
338339 label : "Subscription-Userinfo" ,
Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ export default {
351351 ua : {
352352 label : 'User-Agent' ,
353353 placeholder : '下载时使用的 UA,不填使用默认' ,
354+ placeholderDisabled : '透传时禁用自定义 UA' ,
354355 } ,
355356 subUserinfo : {
356357 label : '订阅流量信息' ,
Original file line number Diff line number Diff line change 215215 v-if =" form.source === 'remote'"
216216 >
217217 <div class =" switch-wrapper" >
218- <nut-switch v-model =" form.passThroughUA" />
218+ <nut-switch v-model =" form.passThroughUA" @change = " handlePassThroughUAChange " />
219219 </div >
220220 </nut-form-item >
221221 <nut-form-item
227227 :border =" false"
228228 class =" nut-input-text"
229229 v-model.trim =" form.ua"
230- :placeholder =" $t(`editorPage.subConfig.basic.ua.placeholder`) "
230+ :placeholder =" userAgentPlaceholder "
231231 type =" text"
232232 input-align =" right"
233233 left-icon =" tips"
234+ :readonly =" passThroughUAOn"
234235 @click-left-icon =" uaTips"
235236 />
236237 </nut-form-item >
@@ -906,6 +907,28 @@ const compare = () => {
906907 });
907908};
908909
910+ const passThroughUAOn = computed (() => {
911+ return form .source === " remote" && form .passThroughUA ;
912+ });
913+
914+ const userAgentPlaceholder = computed (() => {
915+ return passThroughUAOn .value
916+ ? t (` editorPage.subConfig.basic.ua.placeholderDisabled ` )
917+ : t (` editorPage.subConfig.basic.ua.placeholder ` );
918+ });
919+
920+ const handlePassThroughUAChange = (val ) => {
921+ if (val ) {
922+ form ._savedUA = form .ua ;
923+ form .ua = " " ;
924+ } else {
925+ if (form ._savedUA !== undefined ) {
926+ form .ua = form ._savedUA ;
927+ form ._savedUA = undefined ;
928+ }
929+ }
930+ };
931+
909932const submit = () => {
910933 if (isget .value ) {
911934 showNotify ({
You can’t perform that action at this time.
0 commit comments