[pve-devel] [PATCH manager 2/7] gui: add qemu/SystemEdit

Dominik Csapak d.csapak at proxmox.com
Wed Mar 27 14:13:18 CET 2019


contains the inputpanel for the coming system tab in the vm creation
wizard, where the user can configure the vm system hardware like
the scsi controller, display, etc.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Makefile           |  1 +
 www/manager6/Utils.js           |  4 ++
 www/manager6/qemu/SystemEdit.js | 86 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+)
 create mode 100644 www/manager6/qemu/SystemEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index f1d59c46..962a3f4d 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -151,6 +151,7 @@ JSSRC= 				                 	\
 	qemu/CIDriveEdit.js				\
 	qemu/SSHKey.js					\
 	qemu/IPConfigEdit.js				\
+	qemu/SystemEdit.js				\
 	lxc/Summary.js					\
 	lxc/Network.js					\
 	lxc/Resources.js				\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 50e8c297..d8e6f275 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -228,6 +228,10 @@ Ext.define('PVE.Utils', { utilities: {
 	return agentstring;
     },
 
+    render_qemu_machine: function(value) {
+	return value || (Proxmox.Utils.defaultText + ' (i440fx)');
+    },
+
     render_qemu_bios: function(value) {
 	if (!value) {
 	    return Proxmox.Utils.defaultText + ' (SeaBIOS)';
diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js
new file mode 100644
index 00000000..89e348bb
--- /dev/null
+++ b/www/manager6/qemu/SystemEdit.js
@@ -0,0 +1,86 @@
+/*jslint confusion: true*/
+Ext.define('PVE.qemu.SystemInputPanel', {
+    extend: 'Proxmox.panel.InputPanel',
+    xtype: 'pveQemuSystemPanel',
+
+    onlineHelp: 'qm_virtual_machines_settings',
+
+    onGetValues: function(values) {
+	if (values.vga && values.vga.substr(0,6) === 'serial') {
+	    values['serial' + values.vga.substr(6,1)] = 'socket';
+	}
+
+	return values;
+    },
+
+    controller: {
+	xclass: 'Ext.app.ViewController',
+
+	scsihwChange: function(field, value) {
+	    var me = this;
+	    if (me.getView().inisdeWizard) {
+		me.getViewModel().set('current.scsihw', value);
+	    }
+	},
+
+	control: {
+	    'pveScsiHwSelector': {
+		change: 'scsihwChange'
+	    }
+	}
+    },
+
+    column1: [
+	{
+	    xtype: 'proxmoxKVComboBox',
+	    value: '__default__',
+	    deleteEmpty: false,
+	    fieldLabel: gettext('Graphic card'),
+	    name: 'vga',
+	    comboItems: PVE.Utils.kvm_vga_driver_array()
+	},
+	{
+	    xtype: 'proxmoxcheckbox',
+	    name: 'agent',
+	    uncheckedValue: 0,
+	    defaultValue: 0,
+	    deleteDefaultValue: true,
+	    fieldLabel: gettext('Qemu Agent')
+	}
+    ],
+
+    column2: [
+	{
+	    xtype: 'pveScsiHwSelector',
+	    name: 'scsihw',
+	    value: '__default__',
+	    bind: {
+		value: '{current.scsihw}'
+	    },
+	    fieldLabel: gettext('SCSI Controller')
+	}
+    ],
+
+    advancedColumn1: [
+	{
+	    xtype: 'pveQemuBiosSelector',
+	    name: 'bios',
+	    value: '__default__',
+	    fieldLabel: 'BIOS'
+	}
+    ],
+
+    advancedColumn2: [
+	{
+	    xtype: 'proxmoxKVComboBox',
+	    name: 'machine',
+	    value: '__default__',
+	    fieldLabel: gettext('Machine'),
+	    comboItems: [
+		['__default__', PVE.Utils.render_qemu_machine('')],
+		['q35', 'q35']
+	    ]
+	}
+    ]
+
+});
-- 
2.11.0





More information about the pve-devel mailing list