Add humanTime Handlerbar helper.

This commit is contained in:
opi 2014-02-14 20:28:16 +01:00
parent 82de203482
commit c9afc3edde
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,9 @@ app = Sammy('#main', function (sam) {
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
});
Handlebars.registerHelper('humanTime', function(time) {
return Math.round(time) + 's';
});
// Look for supported type of storage to use

View file

@ -142,7 +142,7 @@
{{#each network.usage}}
<h4>
{{@key}}
<small>Time since update: {{time_since_update}}</small>
<small>Time since update: {{humanTime time_since_update}}</small>
</h4>
<table class="table table-condensed">
<tr>
@ -199,7 +199,7 @@
</table>
</div>
<div class="col-md-6">
<h4>I/O <small>Time since update: {{ io.time_since_update }}</small></h4>
<h4>I/O <small>Time since update: {{humanTime io.time_since_update }}</small></h4>
<table class="table table-condensed">
<tr>
<td>Read</td><td>{{humanSize io.read_bytes }}</td>