mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-11-05 08:01:30 +00:00
utils: task descriptions: allow to use functions
Useful if we need to split the ID, or do some more complex rendering for a task type. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4afd5b2f9d
commit
5e80efaeea
8
Utils.js
8
Utils.js
@ -560,16 +560,18 @@ Ext.define('Proxmox.Utils', { utilities: {
|
|||||||
},
|
},
|
||||||
|
|
||||||
format_task_description: function(type, id) {
|
format_task_description: function(type, id) {
|
||||||
var farray = Proxmox.Utils.task_desc_table[type];
|
let farray = Proxmox.Utils.task_desc_table[type];
|
||||||
var text;
|
let text;
|
||||||
if (!farray) {
|
if (!farray) {
|
||||||
text = type;
|
text = type;
|
||||||
if (id) {
|
if (id) {
|
||||||
type += ' ' + id;
|
type += ' ' + id;
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
|
} else if (Ext.isFunction(farray)) {
|
||||||
|
return farray(type, id);
|
||||||
}
|
}
|
||||||
var prefix = farray[0];
|
let prefix = farray[0];
|
||||||
text = farray[1];
|
text = farray[1];
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
return prefix + ' ' + id + ' - ' + text;
|
return prefix + ' ' + id + ' - ' + text;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user