Skip to content

Commit

Permalink
mod
Browse files Browse the repository at this point in the history
  • Loading branch information
nitezs committed Sep 14, 2023
1 parent 0f2dba2 commit f627394
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Push to GHCR

on:
push:
tags:
- '*'
branches:
- dev
workflow_dispatch:

jobs:
Expand Down
9 changes: 4 additions & 5 deletions api/controller/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,19 @@ func BuildSub(query validator.SubQuery, template string) (
func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
// 只合并节点、策略组
// 统计所有国家策略组名称
var newCountryGroupNames []string
var countryGroupNames []string
for _, proxyGroup := range sub.ProxyGroups {
if proxyGroup.IsCountryGrop {
newCountryGroupNames = append(
newCountryGroupNames, proxyGroup.Name,
countryGroupNames = append(
countryGroupNames, proxyGroup.Name,
)
}
}
// 将订阅中的节点添加到模板中
temp.Proxies = append(temp.Proxies, sub.Proxies...)
// 将订阅中的策略组添加到模板中
for i := range temp.ProxyGroups {
temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, newCountryGroupNames...)
temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, countryGroupNames...)
}
temp.ProxyGroups = append(temp.ProxyGroups, sub.ProxyGroups...)
temp.Rules = append(temp.Rules, sub.Rules...)
}

0 comments on commit f627394

Please sign in to comment.