From a10c6ff33a63e3d59999ee03e5d4ce698d94b45f Mon Sep 17 00:00:00 2001 From: ljf Date: Sat, 2 Jun 2018 13:44:40 +0200 Subject: [PATCH] [enh] Adapt log view to the new api, and add paste option --- src/js/yunohost/controllers/tools.js | 12 +++++++++++- src/views/tools/tools_logs.ms | 18 +++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index cc2c6a1c..6acb2051 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -98,8 +98,18 @@ // Display journals list app.get('#/tools/logs', function (c) { c.api("/logs", function(categories) { + data = []; + for (var category in categories) { + if (categories.hasOwnProperty(category)) { + data.push({ + key:category, + value:categories[category] + }); + } + } + c.view('tools/tools_logs', { - "data": categories, + "data": data, formatDate: function() { return this.started_at.getDate(); } diff --git a/src/views/tools/tools_logs.ms b/src/views/tools/tools_logs.ms index 12e4e43e..ca3ca26f 100644 --- a/src/views/tools/tools_logs.ms +++ b/src/views/tools/tools_logs.ms @@ -7,22 +7,22 @@
{{#if data}} -{{#data}}
+{{#data}}
- {{/data}} +
{{/if}}