From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 6FE3461589 for ; Fri, 20 Nov 2020 10:38:17 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 50ED3EF72 for ; Fri, 20 Nov 2020 10:38:17 +0100 (CET) Received: from dev.dominic.proxmox.com (212-186-127-178.static.upcbusiness.at [212.186.127.178]) by firstgate.proxmox.com (Proxmox) with ESMTP id E74B6EF46 for ; Fri, 20 Nov 2020 10:38:14 +0100 (CET) Received: by dev.dominic.proxmox.com (Postfix, from userid 0) id 82E8622367; Fri, 20 Nov 2020 10:38:14 +0100 (CET) From: =?UTF-8?q?Dominic=20J=C3=A4ger?= To: pve-devel@lists.proxmox.com Date: Fri, 20 Nov 2020 10:38:11 +0100 Message-Id: <20201120093812.65554-6-d.jaeger@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201120093812.65554-1-d.jaeger@proxmox.com> References: <20201120093812.65554-1-d.jaeger@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.380 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods KHOP_HELO_FCRDNS 0.399 Relay HELO differs from its IP's reverse DNS NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH manager 5/6 v2] importwizard: Move buttons from bottom bar into panel X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2020 09:38:17 -0000 As we've dropped the idea of using a single tab for each disk --- v2: Added www/manager6/qemu/ImportWizard.js | 42 +------------------------------ www/manager6/qemu/MultiHDEdit.js | 27 ++++++++++++++++++-- www/manager6/window/Wizard.js | 14 ----------- 3 files changed, 26 insertions(+), 57 deletions(-) diff --git a/www/manager6/qemu/ImportWizard.js b/www/manager6/qemu/ImportWizard.js index c6e91a48..0b382303 100644 --- a/www/manager6/qemu/ImportWizard.js +++ b/www/manager6/qemu/ImportWizard.js @@ -335,45 +335,5 @@ Ext.define('PVE.qemu.ImportWizard', { } } ], - initComponent: function () { - var me = this; - me.callParent(); - - let addDiskButton = { - text: gettext('Add disk'), - disabled: true, - itemId: 'addDisk', - minWidth: 60, - handler: me.addDiskFunction, - isValid: function () { - let isValid = true; - if (!me.isImport) { - isValid = false; - } - let type = me.down('#wizcontent').getActiveTab().xtype; - if (type !== 'pveQemuHDInputPanel') { - isValid=false; - } - return isValid; - }, - }; - - let removeDiskButton = { - text: gettext('Remove disk'), // TODO implement - disabled: false, - itemId: 'removeDisk', - minWidth: 60, - handler: function() { - console.assert(me.xtype === 'pveQemuImportWizard'); - let multihd = me.down('pveQemuMultiHDInputPanel'); - multihd.removeCurrentDisk(); - }, - }; - me.down('toolbar').insert(4, addDiskButton); - me.down('toolbar').insert(5, removeDiskButton); - }, -}); - - - +}); \ No newline at end of file diff --git a/www/manager6/qemu/MultiHDEdit.js b/www/manager6/qemu/MultiHDEdit.js index 632199ba..d81e96f6 100644 --- a/www/manager6/qemu/MultiHDEdit.js +++ b/www/manager6/qemu/MultiHDEdit.js @@ -45,8 +45,31 @@ Ext.define('PVE.qemu.MultiHDInputPanel', { .setActiveItem(record.data.panel); }, }, - anchor: '100% 100%', // Required because resize does not happen yet - }, + anchor: '100% 90%', // TODO Resize to parent + },{ + xtype: 'container', + layout: 'hbox', + center: true, // TODO fix me + defaults: { + margin: '5', + xtype: 'button', + }, + items: [ + { + iconCls: 'fa fa-plus-circle', + itemId: 'addDisk', + handler: function(button) { + button.up('pveQemuMultiHDInputPanel').addDiskFunction(); + }, + },{ + iconCls: 'fa fa-trash-o', + itemId: 'removeDisk', + handler: function(button) { + button.up('pveQemuMultiHDInputPanel').removeCurrentDisk(); + }, + } + ], + } ], column2: [ { diff --git a/www/manager6/window/Wizard.js b/www/manager6/window/Wizard.js index f16ba107..d31afd8e 100644 --- a/www/manager6/window/Wizard.js +++ b/www/manager6/window/Wizard.js @@ -81,13 +81,6 @@ Ext.define('PVE.window.Wizard', { // only set the buttons on the current panel if (i === topbar.curidx) { - if (window.isImport) { - console.debug('valid in window?'); - console.debug(valid); - console.debug('because tab is'); - console.debug(tab); - window.down('#addDisk').setDisabled(!valid); - } window.down('#next').setDisabled(!valid); window.down('#submit').setDisabled(!valid); } @@ -131,13 +124,6 @@ Ext.define('PVE.window.Wizard', { me.down('#submit').setVisible(false); } var valid = me.check_card(newcard); - let addDiskButton = me.down('#addDisk'); // TODO undefined in first invocation? - if (me.isImport && addDiskButton) { - addDiskButton.setDisabled(!valid); // TODO check me - addDiskButton.setHidden(!addDiskButton.isValid()); - addDiskButton.setDisabled(false); - addDiskButton.setHidden(false); - } me.down('#next').setDisabled(!valid); me.down('#submit').setDisabled(!valid); me.down('#back').setDisabled(tp.items.indexOf(newcard) == 0); -- 2.20.1