From 06c3dc8a8e6cdf332703abfcb4d89784488bdf93 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 26 May 2020 13:37:57 +0200 Subject: [PATCH] ui: task: improve rendering of backup/prune worker entries Signed-off-by: Thomas Lamprecht --- www/Utils.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/www/Utils.js b/www/Utils.js index c63390e5..0dad644a 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -25,13 +25,27 @@ Ext.define('PBS.Utils', { return path.indexOf(PBS.Utils.dataStorePrefix) === 0; }, + render_datastore_worker_id: function(id, what) { + const result = id.match(/^(\S+)_([^_\s]+)_([^_\s]+)$/); + if (result) { + let datastore = result[1], type = result[2], id = result[3]; + return `Datastore ${datastore} - ${what} ${type}/${id}`; + } + return what; + }, + constructor: function() { var me = this; // do whatever you want here Proxmox.Utils.override_task_descriptions({ garbage_collection: ['Datastore', gettext('Garbage collect') ], - backup: [ '', gettext('Backup') ], + prune: (type, id) => { + return PBS.Utils.render_datastore_worker_id(id, gettext('Prune')); + }, + backup: (type, id) => { + return PBS.Utils.render_datastore_worker_id(id, gettext('Backup')); + }, reader: [ '', gettext('Read datastore objects') ], // FIXME: better one }); }