mirror of
https://github.com/cuigh/swirl
synced 2025-06-26 18:16:50 +00:00
Add agent support for image and volume
This commit is contained in:
11
api/node.go
11
api/node.go
@@ -33,6 +33,17 @@ func nodeList(nb biz.NodeBiz) web.HandlerFunc {
|
||||
return err
|
||||
}
|
||||
|
||||
if ctx.Query("agent") == "true" {
|
||||
i := 0
|
||||
for j := 0; j < len(nodes); j++ {
|
||||
if nodes[j].Agent != "" {
|
||||
nodes[i] = nodes[j]
|
||||
i++
|
||||
}
|
||||
}
|
||||
nodes = nodes[:i]
|
||||
}
|
||||
|
||||
return success(ctx, nodes)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user