From c9afc3edde29b51199cd1ee5fda5c476c3a13cbf Mon Sep 17 00:00:00 2001 From: opi Date: Fri, 14 Feb 2014 20:28:16 +0100 Subject: [PATCH] Add humanTime Handlerbar helper. --- js/app.js | 3 +++ views/monitor.ms | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index 30790b97..7b964c8c 100644 --- a/js/app.js +++ b/js/app.js @@ -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 diff --git a/views/monitor.ms b/views/monitor.ms index b7a75d64..41979dcc 100644 --- a/views/monitor.ms +++ b/views/monitor.ms @@ -142,7 +142,7 @@ {{#each network.usage}}

{{@key}} - Time since update: {{time_since_update}} + Time since update: {{humanTime time_since_update}}

@@ -199,7 +199,7 @@
-

I/O Time since update: {{ io.time_since_update }}

+

I/O Time since update: {{humanTime io.time_since_update }}

Read{{humanSize io.read_bytes }}