mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Add humanTime Handlerbar helper.
This commit is contained in:
parent
82de203482
commit
c9afc3edde
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue