Created
September 14, 2025 12:50
-
-
Save woq/ae76b5d42b80bcdd9d22afa4e0f41d3a to your computer and use it in GitHub Desktop.
Substore ReName
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // === 自定义前缀 === | |
| const PREFIX = 'NX'; // 你只改这一行即可 | |
| const PREFIX_STR = PREFIX + ' - '; // 自动拼接成 "NX - " | |
| // ========== Script Operator ========== | |
| // 单条服务器处理($server 模式) | |
| if (typeof $server !== 'undefined' && $server.name) { | |
| if (!$server.name.startsWith(PREFIX_STR)) { | |
| $server.name = PREFIX_STR + $server.name; | |
| } | |
| } | |
| // ========== operator() 批量处理 ========== | |
| // 批量节点处理 | |
| function operator(proxies, targetPlatform, context) { | |
| return proxies.map(proxy => { | |
| if (!proxy.name.startsWith(PREFIX_STR)) { | |
| proxy.name = PREFIX_STR + proxy.name; | |
| } | |
| return proxy; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment