[pve-devel] r6210 - in pve-manager/pve2/www/manager: . form qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jun 30 12:32:19 CEST 2011


Author: dietmar
Date: 2011-06-30 12:32:19 +0200 (Thu, 30 Jun 2011)
New Revision: 6210

Added:
   pve-manager/pve2/www/manager/form/DisplaySelector.js
Modified:
   pve-manager/pve2/www/manager/Makefile.am
   pve-manager/pve2/www/manager/PVEUtils.js
   pve-manager/pve2/www/manager/qemu/HardwareView.js
Log:
impl. PVE.qemu.DisplayEdit


Modified: pve-manager/pve2/www/manager/Makefile.am
===================================================================
--- pve-manager/pve2/www/manager/Makefile.am	2011-06-30 10:05:01 UTC (rev 6209)
+++ pve-manager/pve2/www/manager/Makefile.am	2011-06-30 10:32:19 UTC (rev 6210)
@@ -28,6 +28,7 @@
 	form/StorageSelector.js				\
 	form/CPUModelSelector.js			\
 	form/VNCKeyboardSelector.js			\
+	form/DisplaySelector.js				\
 	dc/Tasks.js					\
 	dc/Log.js					\
 	panel/StatusPanel.js				\

Modified: pve-manager/pve2/www/manager/PVEUtils.js
===================================================================
--- pve-manager/pve2/www/manager/PVEUtils.js	2011-06-30 10:05:01 UTC (rev 6209)
+++ pve-manager/pve2/www/manager/PVEUtils.js	2011-06-30 10:32:19 UTC (rev 6210)
@@ -99,20 +99,55 @@
 	    sv: 'Swedish',
 	    th: 'Thai',
 	    tr: 'Turkish'
+	},
+
+	kvm_vga_drivers: {
+	    std: 'Standard VGA',
+	    vmware: 'VMWare compatible',
+	    cirrus: 'Cirrus Logic GD5446'
 	}
     },
 
+    render_kvm_language: function (value) {
+	if (!value)
+	    return 'Default';
+	var text = PVE.Utils.statics().kvm_keymaps[value];
+	if (text) 
+	    return text + ' (' + value + ')';
+	return value;
+    },
+
     kvm_keymap_array: function() {
 	var keymaps = PVE.Utils.statics().kvm_keymaps;
 
-	var data = [['', 'Default']];
+	var data = [['', PVE.Utils.render_kvm_language('')]];
 	Ext.Object.each(keymaps, function(key, value) {
-	    data.push([key, value]);
+	    data.push([key, PVE.Utils.render_kvm_language(value)]);
 	});
 
 	return data;
     },
 
+    render_kvm_vga_driver: function (value) {
+	if (!value)
+	    return 'Default (cirrus)';
+	var text = PVE.Utils.statics().kvm_vga_drivers[value];
+	if (text) 
+	    return text + ' (' + value + ')';
+	return value;
+    },
+
+    kvm_vga_driver_array: function() {
+	var drivers = PVE.Utils.statics().kvm_vga_drivers;
+
+	var data = [['', PVE.Utils.render_kvm_vga_driver('')]];
+	Ext.Object.each(drivers, function(key, value) {
+	    data.push([key, PVE.Utils.render_kvm_vga_driver(value)]);
+	});
+
+	return data;
+    },
+
     authOK: function() {
 	return Ext.util.Cookies.get('PVEAuthCookie');
     },
@@ -393,13 +428,6 @@
 	return PVE.Utils.statics().log_severity_hash[value] || value;
     },
 
-    render_kvm_language: function (value) {
-	var text = PVE.Utils.statics().kvm_keymaps[value];
-	if (text) 
-	    return text + ' (' + value + ')';
-	return value;
-    },
-
     render_cpu: function(value, metaData, record, rowIndex, colIndex, store) {
 
 	var maxcpu = record.data.maxcpu;

Added: pve-manager/pve2/www/manager/form/DisplaySelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/DisplaySelector.js	                        (rev 0)
+++ pve-manager/pve2/www/manager/form/DisplaySelector.js	2011-06-30 10:32:19 UTC (rev 6210)
@@ -0,0 +1,11 @@
+Ext.define('PVE.form.DisplaySelector', {
+    extend: 'PVE.form.KVComboBox',
+    alias: ['widget.DisplaySelector'],
+  
+    initComponent: function() {
+	var me = this;
+
+	me.data = PVE.Utils.kvm_vga_driver_array();
+	me.callParent();
+    }
+});

Modified: pve-manager/pve2/www/manager/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-06-30 10:05:01 UTC (rev 6209)
+++ pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-06-30 10:32:19 UTC (rev 6210)
@@ -1,3 +1,25 @@
+Ext.define('PVE.qemu.DisplayEdit', {
+    extend: 'PVE.window.Edit',
+
+    initComponent : function() {
+	var me = this;
+
+	Ext.applyIf(me, {
+	    title: "Edit display settings",
+	    width: 350,
+	    items: {
+		xtype: 'DisplaySelector',
+		name: 'vga',
+		value: '',
+		fieldLabel: 'Graphic card',
+	    }
+	});
+
+	me.callParent();
+
+	me.load();
+    }
+});
 Ext.define('PVE.qemu.KeyboardEdit', {
     extend: 'PVE.window.Edit',
 
@@ -153,14 +175,16 @@
 		never_delete: true,
 		editor: 'PVE.qemu.KeyboardEdit',
 		tdCls: 'pve-itype-icon-keyboard',
-		defaultValue: 'default',
+		defaultValue: '',
 		renderer: PVE.Utils.render_kvm_language
 	    },
 	    vga: {
 		header: 'Display',
+		editor: 'PVE.qemu.DisplayEdit',
 		never_delete: true,
 		tdCls: 'pve-itype-icon-display',
-		defaultValue: 'default'		
+		defaultValue: '',
+		renderer: PVE.Utils.render_kvm_vga_driver		
 	    },
 	    cores: {
 		visible: false



More information about the pve-devel mailing list