File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments