public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 6/7] ui: create MachineEdit window
Date: Thu,  4 Mar 2021 13:52:08 +0100	[thread overview]
Message-ID: <20210304125209.24078-7-s.reiter@proxmox.com> (raw)
In-Reply-To: <20210304125209.24078-1-s.reiter@proxmox.com>

no functional change intended

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
 www/manager6/Makefile             |  1 +
 www/manager6/qemu/HardwareView.js | 16 +------------
 www/manager6/qemu/MachineEdit.js  | 38 +++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 15 deletions(-)
 create mode 100644 www/manager6/qemu/MachineEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 85f90ecd..a2f7be6d 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -204,6 +204,7 @@ JSSRC= 							\
 	qemu/HardwareView.js				\
 	qemu/IPConfigEdit.js				\
 	qemu/KeyboardEdit.js				\
+	qemu/MachineEdit.js				\
 	qemu/MemoryEdit.js				\
 	qemu/Monitor.js					\
 	qemu/NetworkEdit.js				\
diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index 41d65b40..470baa46 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -154,21 +154,7 @@ Ext.define('PVE.qemu.HardwareView', {
 	    },
 	    machine: {
 		header: gettext('Machine'),
-		editor: caps.vms['VM.Config.HWType'] ? {
-		    xtype: 'proxmoxWindowEdit',
-		    subject: gettext('Machine'),
-		    width: 350,
-		    items: [{
-			xtype: 'proxmoxKVComboBox',
-			name: 'machine',
-			value: '__default__',
-			fieldLabel: gettext('Machine'),
-			comboItems: [
-			    ['__default__', PVE.Utils.render_qemu_machine('')],
-			    ['q35', 'q35'],
-			],
-		    }],
-} : undefined,
+		editor: caps.vms['VM.Config.HWType'] ? 'PVE.qemu.MachineEdit' : undefined,
 		iconCls: 'cogs',
 		never_delete: true,
 		group: 6,
diff --git a/www/manager6/qemu/MachineEdit.js b/www/manager6/qemu/MachineEdit.js
new file mode 100644
index 00000000..8a3a6f7a
--- /dev/null
+++ b/www/manager6/qemu/MachineEdit.js
@@ -0,0 +1,38 @@
+Ext.define('PVE.qemu.MachineInputPanel', {
+    extend: 'Proxmox.panel.InputPanel',
+    xtype: 'pveMachineInputPanel',
+
+    items: [{
+	name: 'machine',
+	xtype: 'proxmoxKVComboBox',
+	fieldLabel: gettext('Machine'),
+	comboItems: [
+	    ['__default__', PVE.Utils.render_qemu_machine('')],
+	    ['q35', 'q35'],
+	],
+    }],
+});
+
+Ext.define('PVE.qemu.MachineEdit', {
+    extend: 'Proxmox.window.Edit',
+
+    subject: gettext('Machine'),
+
+    items: [{
+	xtype: 'pveMachineInputPanel',
+    }],
+
+    initComponent: function() {
+	let me = this;
+
+	me.callParent();
+
+	me.load({
+	    success: function(response) {
+		let vmconfig = response.result.data;
+		let machine = vmconfig.machine || '__default__';
+		me.setValues({ machine: machine });
+	    },
+	});
+    },
+});
-- 
2.20.1





  parent reply	other threads:[~2021-03-04 12:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 12:52 [pve-devel] [PATCH 0/7] Work around QEMU 5.2 windows incompatibility Stefan Reiter
2021-03-04 12:52 ` [pve-devel] [PATCH pve-qemu 1/7] add static supported machines file Stefan Reiter
2021-03-05 21:27   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-04 12:52 ` [pve-devel] [PATCH pve-qemu 2/7] add ACPI compat patch for 5.1 and older machine types Stefan Reiter
2021-03-05 21:27   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-04 12:52 ` [pve-devel] [PATCH qemu-server 3/7] api: add Machine module to query " Stefan Reiter
2021-03-05 21:28   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-04 12:52 ` [pve-devel] [PATCH qemu-server 4/7] add postinst with Windows device incompatibility workaround Stefan Reiter
2021-03-04 13:31   ` Stefan Reiter
2021-03-05  8:03   ` Fabian Ebner
2021-03-05 21:32   ` [pve-devel] NAK: " Thomas Lamprecht
2021-03-04 12:52 ` [pve-devel] [PATCH manager 5/7] api: register Qemu::Machine call Stefan Reiter
2021-03-05 21:33   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-04 12:52 ` Stefan Reiter [this message]
2021-03-05 21:33   ` [pve-devel] applied: [PATCH manager 6/7] ui: create MachineEdit window Thomas Lamprecht
2021-03-04 12:52 ` [pve-devel] [PATCH manager 7/7] ui: MachineEdit: add option for machine version pinning Stefan Reiter
2021-03-05 21:36   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-05  7:24 ` [pve-devel] [PATCH 0/7] Work around QEMU 5.2 windows incompatibility Fabian Ebner

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=20210304125209.24078-7-s.reiter@proxmox.com \
    --to=s.reiter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal