We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
场景是这样的,有一些小机场的场景想单独测试,而默认的 filter 机制,大部分是基于地域、国别或者应用,无法直接筛出指定 provider 的
目前自己使用了重命名节点+自定义 filter 的方式来跑通实现
provider 配置重命名节点
provider/self-build.js 中 renameNode: name => { return "SELF|" + name; // SELF 是自建的节点 }
surgio.conf.js 中增加自定义过滤
customFilters: { selfFilter: utils.useKeywords(['SELF']), },
模板中使用 🚀 Proxy = select, {{ getNodeNames(nodeList, customFilters.selfFilter) }}
🚀 Proxy = select, {{ getNodeNames(nodeList, customFilters.selfFilter) }}
虽然能实现,但是不够优雅,因为每新接入一个订阅会都需要这样配置一下,是否 surgio 原生可以支持
可以考虑如下方式
getNodeNames(nodeList, filter?, separator?)
新接口签名 getNodeNames(nodeList, filter?, separator?, provider?)
getNodeNames(nodeList, filter?, separator?, provider?)
增加默认的过滤器 providerFilter,支持传入多个 provider,这样 getNodeNames 无需改动 providerFilter(['demo', 'self-build'])
增加一个 util 的内置方法 useProviders,支持传入多个 provider utils.useProviders(['demo', 'self-build'])
utils.useProviders(['demo', 'self-build'])
The text was updated successfully, but these errors were encountered:
提议不错,我比较倾向使用过滤器。方式 2 和 3 都不错,不过方式 3 比较符合目前的使用习惯。
Sorry, something went wrong.
好的~ 期待能支持
feat: useProviders, discardProviders
e11cb75
#51
No branches or pull requests
场景是这样的,有一些小机场的场景想单独测试,而默认的 filter 机制,大部分是基于地域、国别或者应用,无法直接筛出指定 provider 的
目前自己使用了重命名节点+自定义 filter 的方式来跑通实现
provider 配置重命名节点
surgio.conf.js 中增加自定义过滤
模板中使用
🚀 Proxy = select, {{ getNodeNames(nodeList, customFilters.selfFilter) }}
虽然能实现,但是不够优雅,因为每新接入一个订阅会都需要这样配置一下,是否 surgio 原生可以支持
可以考虑如下方式
getNodeNames(nodeList, filter?, separator?)
接口增加 provider ,实现指定在某个 provider 下新接口签名
getNodeNames(nodeList, filter?, separator?, provider?)
增加默认的过滤器 providerFilter,支持传入多个 provider,这样 getNodeNames 无需改动
providerFilter(['demo', 'self-build'])
增加一个 util 的内置方法 useProviders,支持传入多个 provider
utils.useProviders(['demo', 'self-build'])
The text was updated successfully, but these errors were encountered: