]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui dc: move cluster name info into join button
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Jan 2020 15:08:07 +0000 (16:08 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 30 Jan 2020 15:08:10 +0000 (16:08 +0100)
Avoids another textfield while still giving the information to the
user.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/dc/ClusterEdit.js

index 132029c18f6b71788cc5261247dde2434270c274..e0fa5d9d169f99e596a2551bc054586a21c30271 100644 (file)
@@ -136,7 +136,9 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
 
     defaultFocus: 'textarea[name=serializedinfo]',
     isCreate: true,
-    submitText: gettext('Join'),
+    bind: {
+       submitText: '{submittxt}',
+    },
     showTaskViewer: true,
 
     onlineHelp: 'pvecm_join_node_to_cluster',
@@ -160,8 +162,15 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                } else {
                    return gettext("Default: IP resolved by node's hostname");
                }
-           }
-       }
+           },
+           submittxt: function(get) {
+               let cn = get('info.clusterName');
+               if (cn) {
+                   return `${gettext('Join')} '${cn}'`;
+               }
+               return gettext('Join');
+           },
+       },
     },
 
     controller: {
@@ -291,16 +300,6 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
        },
        value: ''
     },
-    {
-       xtype: 'textfield',
-       fieldLabel: gettext('Cluster name'),
-       readOnly: true,
-       submitValue: false,
-       bind: {
-           hidden: '{!assistedEntry.checked}',
-           value: '{info.clusterName}'
-       },
-    },
     {
        xtype: 'inputpanel',
        column1: [