ui add ec shard statuses

This commit is contained in:
Chris Lu
2019-06-04 21:52:37 -07:00
parent 0e52862586
commit 2215e81be7
8 changed files with 81 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
<th>Rack</th>
<th>RemoteAddr</th>
<th>#Volumes</th>
<th>#ErasureCodingShards</th>
<th>Max</th>
</tr>
</thead>
@@ -88,6 +89,7 @@ var StatusTpl = template.Must(template.New("status").Parse(`<!DOCTYPE html>
<td>{{ $rack.Id }}</td>
<td><a href="http://{{ $dn.Url }}/ui/index.html">{{ $dn.Url }}</a></td>
<td>{{ $dn.Volumes }}</td>
<td>{{ $dn.EcShards }}</td>
<td>{{ $dn.Max }}</td>
</tr>
{{ end }}

View File

@@ -24,6 +24,7 @@ func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request)
Version string
Masters []string
Volumes interface{}
EcVolumes interface{}
DiskStatuses interface{}
Stats interface{}
Counters *stats.ServerStats
@@ -31,6 +32,7 @@ func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request)
util.VERSION,
vs.SeedMasterNodes,
vs.store.Status(),
vs.store.EcVolumes(),
ds,
infos,
serverStats,

View File

@@ -128,6 +128,32 @@ var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`<!DOC
</table>
</div>
<div class="row">
<h2>Erasure Coding Shards</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Id</th>
<th>Collection</th>
<th>Shard Size</th>
<th>Shards</th>
<th>CreatedAt</th>
</tr>
</thead>
<tbody>
{{ range .EcVolumes }}
<tr>
<td><code>{{ .VolumeId }}</code></td>
<td>{{ .Collection }}</td>
<td>{{ .ShardSize }} Bytes</td>
<td>{{ .ShardIdList }}</td>
<td>{{ .CreatedAt.Format "02 Jan 06 15:04 -0700" }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
</body>
</html>