Skip to content

Commit

Permalink
feat: 支持使用代理/节点获取订阅(后端 > 2.14.249)
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Mar 12, 2024
1 parent 4b45ad2 commit 8238195
Show file tree
Hide file tree
Showing 4 changed files with 41 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.159",
"version": "2.14.160",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ export default {
label: 'Subscription-Userinfo',
placeholder: 'Set subscription usage info manually',
},
proxy: {
label: 'Proxy/Node',
placeholder: 'The prox/node for downloading resource(s)',
},
},
commonOptions: {
label: 'Common Settings',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ export default {
label: '订阅流量信息',
placeholder: '手动设置订阅流量信息',
},
proxy: {
label: '代理/节点',
placeholder: '通过代理/节点获取订阅',
},
},
commonOptions: {
label: '常用配置',
Expand Down
32 changes: 32 additions & 0 deletions src/views/SubEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,23 @@
/>
</nut-form-item>

<nut-form-item
:label="$t(`editorPage.subConfig.basic.proxy.label`)"
prop="proxy"
>

<nut-input
:border="false"
class="nut-input-text"
v-model.trim="form.proxy"
:placeholder="$t(`editorPage.subConfig.basic.proxy.placeholder`)"
type="text"
input-align="right"
left-icon="tips"
@click-left-icon="proxyTips"
/>
</nut-form-item>

<nut-form-item
:label="$t(`editorPage.subConfig.basic.source.mergeSources`)"
prop="mergeSources"
Expand Down Expand Up @@ -370,6 +387,7 @@
form.icon = sourceData.icon;
form.process = newProcess;
form.subUserinfo = sourceData.subUserinfo;
form.proxy = sourceData.proxy;
switch (editType) {
case 'collections':
Expand Down Expand Up @@ -633,6 +651,17 @@
lockScroll: false,
});
};
const proxyTips = () => {
Dialog({
title: '通过代理/节点获取订阅',
content: '代理 App 中可使用代理协议:\n\n1. Surge(需使用 有 ability=http-client-policy 的模块, 参数 policy-descriptor)\n\n例: Test = snell, 1.2.3.4, 8000, psk=password, version=4\n\n2. Loon(参数 node)\n\n例: Test=Hysteria2,1.2.3.4,8000,"abc",tls-name=www.bing.com\n\nNode.js 版(模块 request 的 proxy 参数):\n\n例: http://127.0.0.1:8888',
popClass: 'auto-dialog',
okText: 'OK',
noCancelBtn: true,
closeOnPopstate: true,
lockScroll: false,
});
};
</script>

<style lang="scss" scoped>
Expand All @@ -643,6 +672,9 @@
:deep(.nut-cell-group__warp) {
border-radius: var(--item-card-radios);
}
:deep(.nut-icon-tips:before) {
cursor: pointer;
}
}
.radio-wrapper {
Expand Down

0 comments on commit 8238195

Please sign in to comment.