First, there was an additional space between "'" and ")" which lead
me to this.
I could never trigger the case where vmname is undefined, and saw
that we have a almost same default handling in data/ResourceStore.js

So, just use that one instead here - it misses the single-quotes
inside the parentheses, but as there are already said parentheses
this is visually still very OK, IMO.

Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---
 www/manager6/lxc/Config.js  | 8 +++-----
 www/manager6/qemu/Config.js | 8 +++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index fbaccefe..ef403ec8 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -109,21 +109,19 @@ Ext.define('PVE.lxc.Config', {
            iconCls: 'fa fa-trash-o'
        });
 
-       var vmname = me.pveSelNode.data.name;
+       var vm = me.pveSelNode.data;
 
        var consoleBtn = Ext.create('PVE.button.ConsoleButton', {
            disabled: !caps.vms['VM.Console'],
            consoleType: 'lxc',
-           consoleName: vmname,
+           consoleName: vm.name,
            nodename: nodename,
            vmid: vmid,
            iconCls: 'fa fa-terminal'
        });
 
-       var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'CT " + vmid 
+ "'") + ")";
-
        Ext.apply(me, {
-           title: Ext.String.format(gettext("Container {0} on node {1}"), 
descr, "'" + nodename + "'"),
+           title: Ext.String.format(gettext("Container {0} on node '{1}'"), 
vm.text, nodename),
            hstateid: 'lxctab',
            tbar: [ startBtn, shutdownBtn, umountBtn, removeBtn,
                    migrateBtn, consoleBtn ],
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index 75454d8e..ecab3515 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -146,22 +146,20 @@ Ext.define('PVE.qemu.Config', {
            iconCls: 'fa fa-trash-o'
        });
 
-       var vmname = me.pveSelNode.data.name;
+       var vm = me.pveSelNode.data;
 
        var consoleBtn = Ext.create('PVE.button.ConsoleButton', {
            disabled: !caps.vms['VM.Console'],
            hidden: template,
            consoleType: 'kvm',
-           consoleName: vmname,
+           consoleName: vm.name,
            nodename: nodename,
            vmid: vmid,
            iconCls: 'fa fa-terminal'
        });
 
-       var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'VM " + vmid 
+ "'") + ")";
-
        Ext.apply(me, {
-           title: Ext.String.format(gettext("Virtual Machine {0} on node 
{1}"), descr, "'" + nodename + "'"),
+           title: Ext.String.format(gettext("Virtual Machine {0} on node 
'{1}'"), vm.text, nodename),
            hstateid: 'kvmtab',
            tbar: [ resumeBtn, startBtn, shutdownBtn,
                    removeBtn, migrateBtn, cloneBtn, consoleBtn],
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to