]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: cluster join: hide all fields in assited mode until we got some info
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 8 May 2020 11:33:06 +0000 (13:33 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 8 May 2020 11:33:39 +0000 (13:33 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/dc/ClusterEdit.js

index d4a0d8fed716f968ee720065a3bb6e4d7314aa9a..7e8bd56fc0bf78a1976d91e908b907f223b0d9a9 100644 (file)
@@ -147,7 +147,8 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                fp: '',
                ip: '',
                clusterName: ''
-           }
+           },
+           hasAssistedInfo: false,
        },
        formulas: {
            submittxt: function(get) {
@@ -157,6 +158,10 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                }
                return gettext('Join');
            },
+           showClusterFields: (get) => {
+               let manualMode = !get('assistedEntry.checked');
+               return get('hasAssistedInfo') || manualMode;
+           },
        },
     },
 
@@ -197,10 +202,10 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
            let vm = this.getViewModel();
 
            let assistedEntryBox = this.lookup('assistedEntry');
-           let linkEditorContainer = this.lookup('linkEditorContainer');
 
            if (!assistedEntryBox.getValue()) {
                // not in assisted entry mode, nothing to do
+               vm.set('hasAssistedInfo', false);
                return;
            }
 
@@ -219,7 +224,7 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                field.valid = false;
                linkEditor.setLinks([]);
                linkEditor.setInfoText();
-               linkEditorContainer.setVisible(false);
+               vm.set('hasAssistedInfo', false);
            } else {
                let interfaces = joinInfo.totem.interface;
                let links = Object.values(interfaces).map(iface => {
@@ -252,7 +257,7 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
                    clusterName: joinInfo.totem.cluster_name
                };
                field.valid = true;
-               linkEditorContainer.setVisible(true);
+               vm.set('hasAssistedInfo', true);
            }
            vm.set('info', info);
        }
@@ -320,6 +325,9 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
            type: 'hbox',
            align: 'center'
        },
+       bind: {
+           hidden: '{!showClusterFields}',
+       },
        items: [
            {
                xtype: 'textfield',
@@ -351,7 +359,8 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
        allowBlank: false,
        bind: {
            value: '{info.fp}',
-           readOnly: '{assistedEntry.checked}'
+           readOnly: '{assistedEntry.checked}',
+           hidden: '{!showClusterFields}',
        },
        name: 'fingerprint'
     },
@@ -359,9 +368,8 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
        xtype: 'fieldcontainer',
        fieldLabel: gettext("Cluster Network"),
        bind: {
-           hidden: '{assistedEntry.checked}'
+           hidden: '{!showClusterFields}',
        },
-       reference: 'linkEditorContainer',
        items: [
            {
                xtype: 'pveCorosyncLinkEditor',