Skip to content

Commit

Permalink
feat: 远程订阅支持透传请求的 User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Dec 29, 2024
1 parent 14e60fe commit 8187ca4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.317",
"version": "2.14.318",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ export default {
label: "Subscription-Userinfo",
placeholder: "Value or URL(use response content)",
},
passThroughUA: {
label: 'Pass Through Request User-Agent'
},
proxy: {
label: "Proxy/Policy",
placeholder: "The proxy/node/policy for downloading resource(s)",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ export default {
label: '订阅流量信息',
placeholder: '填写值或链接(使用响应内容)',
},
passThroughUA: {
label: '透传请求的 User-Agent'
},
proxy: {
label: '代理/策略',
placeholder: '通过代理/节点/策略获取远程资源,不填使用默认',
Expand Down
12 changes: 12 additions & 0 deletions src/views/SubEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,16 @@
</div>
</nut-form-item>
<!-- ua -->
<nut-form-item
:label="$t(`editorPage.subConfig.basic.passThroughUA.label`)"
prop="passThroughUA"
class="ignore-failed-wrapper"
v-if="form.source === 'remote'"
>
<div class="switch-wrapper">
<nut-switch v-model="form.passThroughUA" />
</div>
</nut-form-item>
<nut-form-item
:label="$t(`editorPage.subConfig.basic.ua.label`)"
prop="ua"
Expand Down Expand Up @@ -586,6 +596,7 @@ const form = reactive<any>({
remark: "",
mergeSources: "",
ignoreFailedRemoteSub: false,
passThroughUA: false,
icon: "",
process: [
{
Expand Down Expand Up @@ -629,6 +640,7 @@ watchEffect(() => {
const newProcess = JSON.parse(JSON.stringify(sourceData.process));
form.mergeSources = sourceData.mergeSources;
form.ignoreFailedRemoteSub = sourceData.ignoreFailedRemoteSub;
form.passThroughUA = sourceData.passThroughUA;
form.name = sourceData.name;
form.displayName = sourceData.displayName || sourceData["display-name"];
form.remark = sourceData.remark;
Expand Down

0 comments on commit 8187ca4

Please sign in to comment.