Skip to content

Commit

Permalink
feat: 文件支持设置代理/策略, 链接支持传入 proxy 参数指定代理/策略
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Oct 7, 2024
1 parent 75cfc1c commit 54c7422
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
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.267",
"version": "2.14.268",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export default {
},
proxy: {
label: '代理/策略',
placeholder: '通过代理/节点/策略获取订阅,不填使用默认',
placeholder: '通过代理/节点/策略获取远程资源,不填使用默认',
},
},
commonOptions: {
Expand Down
28 changes: 27 additions & 1 deletion src/views/FileEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,21 @@
type="text"
/>
</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.subInfoUrl.label`)"
prop="subInfoUrl"
Expand Down Expand Up @@ -521,6 +535,18 @@ const submit = () => {
Toast.hide("submits");
});
};
const proxyTips = () => {
Dialog({
title: '通过代理/节点/策略获取远程文件',
content: '1. Surge(参数 policy/policy-descriptor)\n\n可设置节点代理 例: Test = snell, 1.2.3.4, 80, psk=password, version=4\n\n或设置策略/节点 例: 国外加速\n\n2. Loon(参数 node)\n\nLoon 官方文档: \n\n指定该请求使用哪一个节点或者策略组(可以使节点名称、策略组名称,也可以说是一个Loon格式的节点描述,如:shadowsocksr,example.com,1070,chacha20-ietf,"password",protocol=auth_aes128_sha1,protocol-param=test,obfs=plain,obfs-param=edge.microsoft.com)\n\n3. Stash(参数 headers["X-Surge-Policy"])/Shadowrocket(参数 headers.X-Surge-Policy)/QX(参数 opts.policy)\n\n可设置策略/节点\n\n4. Node.js 版(模块 request 的 proxy 参数):\n\n例: http://127.0.0.1:8888\n\n※ 优先级由高到低: 文件配置, 默认配置',
popClass: 'auto-dialog',
textAlign: 'left',
okText: 'OK',
noCancelBtn: true,
closeOnPopstate: true,
lockScroll: false,
});
};
const iconTips = () => {
router.push(`/icon/collection`);
};
Expand Down

0 comments on commit 54c7422

Please sign in to comment.