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)));
|
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
|
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
|
// Look for supported type of storage to use
|
||||||
|
|
|
@ -142,7 +142,7 @@
|
||||||
{{#each network.usage}}
|
{{#each network.usage}}
|
||||||
<h4>
|
<h4>
|
||||||
{{@key}}
|
{{@key}}
|
||||||
<small>Time since update: {{time_since_update}}</small>
|
<small>Time since update: {{humanTime time_since_update}}</small>
|
||||||
</h4>
|
</h4>
|
||||||
<table class="table table-condensed">
|
<table class="table table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -199,7 +199,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<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">
|
<table class="table table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Read</td><td>{{humanSize io.read_bytes }}</td>
|
<td>Read</td><td>{{humanSize io.read_bytes }}</td>
|
||||||
|
|
Loading…
Add table
Reference in a new issue