mirror of
https://github.com/alireza0/s-ui.git
synced 2026-09-01 01:19:09 +00:00
fix numbered external links #774
This commit is contained in:
parent
2d28d9b409
commit
97d1694bfa
2 changed files with 10 additions and 2 deletions
|
|
@ -73,8 +73,12 @@ func (s *ClashService) GetClash(subId string) (*string, []string, error) {
|
|||
}
|
||||
|
||||
links := s.LinkService.GetLinks(&client.Links, "external", "")
|
||||
tagNumEnable := 0
|
||||
if len(links) > 1 {
|
||||
tagNumEnable = 1
|
||||
}
|
||||
for index, link := range links {
|
||||
json, tag, err := util.GetOutbound(link, index)
|
||||
json, tag, err := util.GetOutbound(link, (index+1)*tagNumEnable)
|
||||
if err == nil && len(tag) > 0 {
|
||||
*outbounds = append(*outbounds, *json)
|
||||
*outTags = append(*outTags, tag)
|
||||
|
|
|
|||
|
|
@ -61,8 +61,12 @@ func (j *JsonService) GetJson(subId string, format string) (*string, []string, e
|
|||
}
|
||||
|
||||
links := j.LinkService.GetLinks(&client.Links, "external", "")
|
||||
tagNumEnable := 0
|
||||
if len(links) > 1 {
|
||||
tagNumEnable = 1
|
||||
}
|
||||
for index, link := range links {
|
||||
json, tag, err := util.GetOutbound(link, index)
|
||||
json, tag, err := util.GetOutbound(link, (index+1)*tagNumEnable)
|
||||
if err == nil && len(tag) > 0 {
|
||||
*outbounds = append(*outbounds, *json)
|
||||
*outTags = append(*outTags, tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue