mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-31 07:27:02 +00:00
Commands: Fix xray api bi balancer1 balancer2 (#7299)
https://github.com/XTLS/Xray-core/pull/7279#issuecomment-6468250523 --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
@@ -47,18 +47,19 @@ func executeBalancerInfo(cmd *base.Command, args []string) {
|
||||
conn, ctx, close := dialAPIServer()
|
||||
defer close()
|
||||
client := routerService.NewRoutingServiceClient(conn)
|
||||
r := &routerService.GetBalancerInfoRequest{Tag: unnamedArgs[0]}
|
||||
resp, err := client.GetBalancerInfo(ctx, r)
|
||||
if err != nil {
|
||||
base.Fatalf("failed to get health information: %s", err)
|
||||
}
|
||||
for _, tag := range unnamedArgs {
|
||||
r := &routerService.GetBalancerInfoRequest{Tag: tag}
|
||||
resp, err := client.GetBalancerInfo(ctx, r)
|
||||
if err != nil {
|
||||
base.Fatalf("failed to get health information: %s", err)
|
||||
}
|
||||
|
||||
if apiJSON {
|
||||
showJSONResponse(resp)
|
||||
return
|
||||
if apiJSON {
|
||||
showJSONResponse(resp)
|
||||
} else {
|
||||
showBalancerInfo(resp.Balancer)
|
||||
}
|
||||
}
|
||||
|
||||
showBalancerInfo(resp.Balancer)
|
||||
}
|
||||
|
||||
func showBalancerInfo(b *routerService.BalancerMsg) {
|
||||
|
||||
Reference in New Issue
Block a user