Skip to content

Commit

Permalink
handle correctly zero percen disk usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lmenezes committed Sep 23, 2017
1 parent 79542db commit 4012584
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions app/models/nodes/Node.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ object Node {
"available" -> JsNumber(a),
"percent" -> JsNumber(percent)
)
case _ =>
Json.obj(
"total" -> JsNull,
"available" -> JsNull,
"percent" -> JsNull
)
case _ => JsNull
}
}

Expand Down
4 changes: 2 additions & 2 deletions public/nodes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@
</div>
</td>
<td>
<div ng-show="node.disk.percent">
<div ng-show="node.disk">
<span class="main-stat">{{node.disk.percent}}%</span>
<span class="detail-stat">
<div>available: {{node.disk.available | bytes}}</div>
<div>total: {{node.disk.total | bytes}}</div>
</span>
</div>
<div class="empty-stat" ng-hide="node.disk.percent">
<div class="empty-stat" ng-hide="node.disk">
-
</div>
</td>
Expand Down

0 comments on commit 4012584

Please sign in to comment.