[pve-devel] [PATCH manager 2/4] optimize 'text' field in resourcestore
Dietmar Maurer
dietmar at proxmox.com
Thu May 4 07:02:26 CEST 2017
comments inline
> diff --git a/www/manager6/data/ResourceStore.js
> b/www/manager6/data/ResourceStore.js
> index 8770d152..93caa6c8 100644
> --- a/www/manager6/data/ResourceStore.js
> +++ b/www/manager6/data/ResourceStore.js
> @@ -69,20 +69,18 @@ Ext.define('PVE.data.ResourceStore', {
> return value;
> }
>
> - if (info.type === 'node') {
> - text = info.node;
> - } else if (info.type === 'pool') {
> - text = info.pool;
> - } else if (info.type === 'storage') {
> - text = info.storage + ' (' + info.node + ')';
> - } else if (info.type === 'qemu' || info.type === 'lxc') {
> + if (Ext.isNumeric(info.vmid) && info.vmid > 0) {
> text = String(info.vmid);
> if (info.name) {
> text += " (" + info.name + ')';
> }
> } else {
> - text = info.id;
> + text = info[info.type] || info.id;
> + if (info.node && info.type !== 'node') {
Can't we avoid above test? What types triggers this case exactly?
> + text += " (" + info.node + ")";
> + }
> }
> +
> return text;
> }
> },
> --
> 2.11.0
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
More information about the pve-devel
mailing list