Skip to content

Commit e07b915

Browse files
committed
Fix proxy group selector
1 parent 7a89da7 commit e07b915

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

model/string.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ const (
4343
PROMPT_MODEL_LABEL = "Select Proxy Mode"
4444

4545
PROMPT_PROXY_LABEL = "Proxy Mode"
46-
PROMPT_PROXY_ITEM_PROXY = "Proxy"
47-
PROMPT_PROXY_ITEM_DOMESTIC = "Domestic"
48-
PROMPT_PROXY_ITEM_GLOBAL = "Global"
49-
PROMPT_PROXY_ITEM_OTHERS = "Others"
46+
PROMPT_PROXY_ITEM_ALL = "GLOBAL"
5047
PROMPT_PROXY_ITEM_LATENCY_TEST = "Latency Test"
5148

5249
PROMPT_PROXY_GLOBAL_GROUPNAME = "GLOBAL"

step/switch_proxy.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ func (sp SwitchProxy) Run() error {
3737
Name string
3838
}
3939

40+
var proxyGroup []string
41+
for name, group := range proxies.Proxies {
42+
if group.Type.Is(C.Selector) && name != model.PROMPT_PROXY_ITEM_ALL {
43+
proxyGroup = append(proxyGroup, name)
44+
}
45+
}
46+
4047
prompt := promptui.Select{
4148
Label: model.PROMPT_PROXY_LABEL,
42-
Items: []string{model.PROMPT_PROXY_ITEM_PROXY, model.PROMPT_PROXY_ITEM_DOMESTIC,
43-
model.PROMPT_PROXY_ITEM_GLOBAL, model.PROMPT_PROXY_ITEM_OTHERS},
49+
Items: proxyGroup,
4450
}
4551
_, proxyMode, err := prompt.Run()
4652
if err != nil {

0 commit comments

Comments
 (0)