diff --git a/README.md b/README.md index 2783dc2..fbc9882 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ | template | string | 否 | - | 外部模板链接或内部模板名称 | | ruleProvider | string | 否 | - | 格式 `[Behavior,Url,Group,Prepend,Name],[Behavior,Url,Group,Prepend,Name]...`,其中 `Group` 是该规则集所走的策略组名,`Prepend` 为 bool 类型,如果为 `true` 规则将被添加到规则列表顶部,否则添加到规则列表底部(会调整到MATCH规则之前) | | rule | string | 否 | - | 格式 `[Rule,Prepend],[Rule,Prepend]...`,其中 `Prepend` 为 bool 类型,如果为 `true` 规则将被添加到规则列表顶部,否则添加到规则列表底部(会调整到MATCH规则之前) | -| autoTest | bool | 否 | `false` | 指定国家策略组是否自动测速 | +| autoTest | bool | 否 | `false` | 国家策略组是否自动测速 | | lazy | bool | 否 | `false` | 自动测速是否启用 lazy | | sort | string | 否 | `nameasc` | 国家策略组排序策略,可选值 `nameasc`、`namedesc`、`sizeasc`、`sizedesc` | diff --git a/api/templates/index.html b/api/templates/index.html index abf7e5c..7ab734d 100644 --- a/api/templates/index.html +++ b/api/templates/index.html @@ -19,21 +19,35 @@ .container { max-width: 800px; } + + .btn-xs { + padding: 2px 2px; /* 调整内边距以减小按钮大小 */ + font-size: 10px; /* 设置字体大小 */ + line-height: 1.2; /* 调整行高 */ + border-radius: 3px; /* 可选的边框半径调整 */ + height: 25px; + width: 25px; + }
-

sub2clash

+
+

sub2clash

+ 通用订阅链接转 Clash(Meta) 配置工具 使用文档 +
+
- +
@@ -66,13 +80,13 @@

sub2clash

- +
- +
diff --git a/main.go b/main.go index 09297a3..19158a2 100644 --- a/main.go +++ b/main.go @@ -71,5 +71,3 @@ func main() { return } } - -// TODO: 校验 Rule-Provider 是否有重名 diff --git a/templates/template_meta.yaml b/templates/template_meta.yaml index ea0bcf0..ec264c5 100644 --- a/templates/template_meta.yaml +++ b/templates/template_meta.yaml @@ -13,6 +13,12 @@ proxy-groups: - name: 手动切换 type: select proxies: + - name: 微软服务 + type: select + proxies: + - 节点选择 + - 手动切换 + - DIRECT - name: 游戏平台 type: select proxies: @@ -48,14 +54,14 @@ proxy-groups: - 手动切换 - DIRECT rules: - - GEOSITE,private,全球直连 + - GEOSITE,private,全球直连,no-resolve - GEOIP,private,全球直连 - GEOSITE,category-ads-all,广告拦截 - - GEOSITE,CN,全球直连 - - GEOIP,CN,全球直连 - - GEOSITE,biliintl,哔哩哔哩 + - GEOSITE,microsoft,微软服务 - GEOSITE,bilibili,哔哩哔哩 - GEOSITE,bahamut,巴哈姆特 - GEOSITE,category-games,游戏平台 - GEOSITE,geolocation-!cn,节点选择 + - GEOSITE,CN,全球直连 + - GEOIP,CN,全球直连 - MATCH,漏网之鱼 \ No newline at end of file diff --git a/validator/sub.go b/validator/sub.go index fbf6214..4db8340 100644 --- a/validator/sub.go +++ b/validator/sub.go @@ -101,6 +101,14 @@ func ParseQuery(c *gin.Context) (SubQuery, error) { }, ) } + // 校验 Rule-Provider 是否有重名 + names := make(map[string]bool) + for _, ruleProvider := range query.RuleProviders { + if _, ok := names[ruleProvider.Name]; ok { + return SubQuery{}, errors.New("参数错误: Rule-Provider 名称重复") + } + names[ruleProvider.Name] = true + } } else { query.RuleProviders = nil }