From aeee4329b062a1cd1cfff183353eacffd42c8d77 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 26 Mar 2020 18:01:04 +0100 Subject: [PATCH] gui - DataStoreContent: avoid useless icons, display file path --- www/DataStoreContent.js | 21 ++++++++++++++++++++- www/css/ext6-pbs.css | 5 +++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/www/DataStoreContent.js b/www/DataStoreContent.js index 8c9d24af..f14b40ea 100644 --- a/www/DataStoreContent.js +++ b/www/DataStoreContent.js @@ -80,13 +80,32 @@ Ext.define('PBS.DataStoreContent', { }; }); + let backup_time_to_string = function(backup_time) { + let pad = function(number) { + if (number < 10) { + return '0' + number; + } + return number; + }; + return backup_time.getUTCFullYear() + + '-' + pad(backup_time.getUTCMonth() + 1) + + '-' + pad(backup_time.getUTCDate()) + + 'T' + pad(backup_time.getUTCHours()) + + ':' + pad(backup_time.getUTCMinutes()) + + ':' + pad(backup_time.getUTCSeconds()) + + 'Z'; + }; + records.forEach(function(item) { let group = item.data["backup-type"] + "/" + item.data["backup-id"]; let children = groups[group].children; let data = item.data; + data.text = Ext.Date.format(data["backup-time"], 'Y-m-d H:i:s'); + data.text = group + '/' + backup_time_to_string(data["backup-time"]); data.leaf = true; + data.cls = 'no-leaf-icons'; children.push(data); }); @@ -182,7 +201,7 @@ Ext.define('PBS.DataStoreContent', { header: gettext("Files"), sortable: false, dataIndex: 'files', - flex: 4 + flex: 2 } ], diff --git a/www/css/ext6-pbs.css b/www/css/ext6-pbs.css index e9533c56..d165b265 100644 --- a/www/css/ext6-pbs.css +++ b/www/css/ext6-pbs.css @@ -180,3 +180,8 @@ p.logs { color: #555; margin-right: 5px; } + +.no-leaf-icons .x-tree-icon-leaf { + visibility: hidden; + width: 5px; +}