mirror of
				https://git.proxmox.com/git/proxmox-widget-toolkit
				synced 2025-11-04 09:53:37 +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) {
 | 
			
		||||
	var farray = Proxmox.Utils.task_desc_table[type];
 | 
			
		||||
	var text;
 | 
			
		||||
	let farray = Proxmox.Utils.task_desc_table[type];
 | 
			
		||||
	let text;
 | 
			
		||||
	if (!farray) {
 | 
			
		||||
	    text = type;
 | 
			
		||||
	    if (id) {
 | 
			
		||||
		type += ' ' + id;
 | 
			
		||||
	    }
 | 
			
		||||
	    return text;
 | 
			
		||||
	} else if (Ext.isFunction(farray)) {
 | 
			
		||||
	    return farray(type, id);
 | 
			
		||||
	}
 | 
			
		||||
	var prefix = farray[0];
 | 
			
		||||
	let prefix = farray[0];
 | 
			
		||||
	text = farray[1];
 | 
			
		||||
	if (prefix) {
 | 
			
		||||
	    return prefix + ' ' + id + ' - ' + text;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user