utils: task descriptions: allow to add/override entries

Allows having only the common ones here, and more special ones in the
per product code. Sometimes there are simple worker IDs which can
have a very different meaning for one product, with this that clash
can be resolved in a standardized way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-05-25 18:20:24 +02:00
parent f4d366dc85
commit 4afd5b2f9d

View File

@ -552,6 +552,13 @@ Ext.define('Proxmox.Utils', { utilities: {
zfscreate: [ gettext('ZFS Storage'), gettext('Create') ] zfscreate: [ gettext('ZFS Storage'), gettext('Create') ]
}, },
// to add or change existing for product specific ones
override_task_descriptions: function(extra) {
for (const [key, value] of Object.entries(extra)) {
Proxmox.Utils.task_desc_table[key] = value;
}
},
format_task_description: function(type, id) { format_task_description: function(type, id) {
var farray = Proxmox.Utils.task_desc_table[type]; var farray = Proxmox.Utils.task_desc_table[type];
var text; var text;