show RemoteVolumes/EcVolumes only if it is not empty

This commit is contained in:
bingoohuang
2021-07-06 15:20:18 +08:00
parent 44a2538f67
commit ed57a55eae
3 changed files with 45 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ var funcMap = template.FuncMap{
"join": join,
"bytesToHumanReadable": util.BytesToHumanReadable,
"percentFrom": percentFrom,
"isNotEmpty": util.IsNotEmpty,
}
//go:embed volume.html

View File

@@ -133,6 +133,7 @@
</table>
</div>
{{ if isNotEmpty .RemoteVolumes }}
<div class="row">
<h2>Remote Volumes</h2>
<table class="table table-striped">
@@ -162,7 +163,9 @@
</tbody>
</table>
</div>
{{ end }}
{{ if isNotEmpty .EcVolumes }}
<div class="row">
<h2>Erasure Coding Shards</h2>
<table class="table table-striped">
@@ -188,7 +191,7 @@
</tbody>
</table>
</div>
{{ end }}
</div>
</body>
</html>