diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2022-07-22 02:43:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-22 02:43:07 -0700 |
| commit | 8d97add89cddb316466776d875e9dc1419932ae6 (patch) | |
| tree | ff08269bbead68cb88f3e98f854cbefa165e4edf /weed/topology/volume_layout.go | |
| parent | 7a6c559ab4a6b696bb574454b297ebefabec29ed (diff) | |
| parent | 58f2dd674061bb48f433abbebd604ba7a8fe1aa7 (diff) | |
| download | seaweedfs-8d97add89cddb316466776d875e9dc1419932ae6.tar.xz seaweedfs-8d97add89cddb316466776d875e9dc1419932ae6.zip | |
Merge pull request #3348 from ningfdx/remote
optimiz: master ui will render data in order
Diffstat (limited to 'weed/topology/volume_layout.go')
| -rw-r--r-- | weed/topology/volume_layout.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go index dee82762a..03c4c4adf 100644 --- a/weed/topology/volume_layout.go +++ b/weed/topology/volume_layout.go @@ -473,13 +473,19 @@ func (vl *VolumeLayout) SetVolumeCrowded(vid needle.VolumeId) { } } -func (vl *VolumeLayout) ToMap() map[string]interface{} { - m := make(map[string]interface{}) - m["replication"] = vl.rp.String() - m["ttl"] = vl.ttl.String() - m["writables"] = vl.writables +type VolumeLayoutInfo struct { + Replication string `json:"replication"` + TTL string `json:"ttl"` + Writables []needle.VolumeId `json:"writables"` + Collection string `json:"collection"` +} + +func (vl *VolumeLayout) ToInfo() (info VolumeLayoutInfo) { + info.Replication = vl.rp.String() + info.TTL = vl.ttl.String() + info.Writables = vl.writables //m["locations"] = vl.vid2location - return m + return } func (vl *VolumeLayout) Stats() *VolumeLayoutStats { |
