aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/data_node.go
diff options
context:
space:
mode:
authorbingoohuang <bingoo.huang@gmail.com>2020-05-29 16:15:33 +0800
committerbingoohuang <bingoo.huang@gmail.com>2020-05-29 16:15:33 +0800
commit1f8782a1ed504e5f7e7b62218bcf4502903d350f (patch)
tree6dad9d73f5fd3dbe96fbdf2d3eb0b018fae5a84a /weed/topology/data_node.go
parent1a642b98769ea604dfb74fa4d875bf42c24fda9f (diff)
downloadseaweedfs-1f8782a1ed504e5f7e7b62218bcf4502903d350f.tar.xz
seaweedfs-1f8782a1ed504e5f7e7b62218bcf4502903d350f.zip
try showing the first 100 volume ids and an extra ...
Diffstat (limited to 'weed/topology/data_node.go')
-rw-r--r--weed/topology/data_node.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go
index f6e96e235..0dccdd0f2 100644
--- a/weed/topology/data_node.go
+++ b/weed/topology/data_node.go
@@ -195,16 +195,11 @@ func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo {
// GetVolumeIds returns the human readable volume ids limited to count of max 100.
func (dn *DataNode) GetVolumeIds() string {
- volumesLen := len(dn.volumes)
- if volumesLen > 100 {
- return "..."
- }
-
- ids := make([]int, 0, volumesLen)
+ ids := make([]int, 0, len(dn.volumes))
for k := range dn.volumes {
ids = append(ids, int(k))
}
- return util.HumanReadableInts(ids...)
+ return util.HumanReadableIntsMax(100, ids...)
}