From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 5/6 v2] importwizard: Move buttons from bottom bar into panel
Date: Fri, 20 Nov 2020 10:38:11 +0100 [thread overview]
Message-ID: <20201120093812.65554-6-d.jaeger@proxmox.com> (raw)
In-Reply-To: <20201120093812.65554-1-d.jaeger@proxmox.com>
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
next prev parent reply other threads:[~2020-11-20 9:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 9:38 [pve-devel] [PATCH qemu-server 0/1 v2] Importwizard Dominic Jäger
2020-11-20 9:38 ` [pve-devel] [PATCH qemu-server 1/6 v2] Move importdisk from qm to API Dominic Jäger
2020-11-20 9:38 ` [pve-devel] [PATCH manager 2/6 v2] gui: Hardware View: Add GUI for importdisk Dominic Jäger
2020-11-20 9:38 ` [pve-devel] [PATCH manager 3/6 v2] gui: Add button & cmdmenu Dominic Jäger
2020-11-20 9:38 ` [pve-devel] [PATCH manager 4/6 v2] gui: Add import VM wizard Dominic Jäger
2020-11-20 9:38 ` Dominic Jäger [this message]
2020-11-20 9:38 ` [pve-devel] [PATCH manager 6/6 v2] importdisk gui: Make storages selectable again Dominic Jäger
2020-11-23 13:21 ` [pve-devel] [PATCH qemu-server 0/1 v2] Importwizard Oguz Bektas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201120093812.65554-6-d.jaeger@proxmox.com \
--to=d.jaeger@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.