[pve-devel] r5891 - in pve-manager/pve2/www/new: . openvz qemu window

svn-commits at proxmox.com svn-commits at proxmox.com
Tue May 3 08:19:56 CEST 2011


Author: dietmar
Date: 2011-05-03 08:19:55 +0200 (Tue, 03 May 2011)
New Revision: 5891

Added:
   pve-manager/pve2/www/new/openvz/
   pve-manager/pve2/www/new/openvz/CreateWizard.js
   pve-manager/pve2/www/new/qemu/CreateWizard.js
Modified:
   pve-manager/pve2/www/new/Makefile.am
   pve-manager/pve2/www/new/Workspace.js
   pve-manager/pve2/www/new/window/Wizard.js
Log:
use simpler wizard layout


Modified: pve-manager/pve2/www/new/Makefile.am
===================================================================
--- pve-manager/pve2/www/new/Makefile.am	2011-05-02 12:31:50 UTC (rev 5890)
+++ pve-manager/pve2/www/new/Makefile.am	2011-05-03 06:19:55 UTC (rev 5891)
@@ -24,6 +24,8 @@
 	node/Config.js					\
 	qemu/Config.js					\
 	qemu/HardwareView.js				\
+	qemu/CreateWizard.js				\
+	openvz/CreateWizard.js				\
 	storage/Browser.js				\
 	dc/Config.js					\
 	Workspace.js

Modified: pve-manager/pve2/www/new/Workspace.js
===================================================================
--- pve-manager/pve2/www/new/Workspace.js	2011-05-02 12:31:50 UTC (rev 5890)
+++ pve-manager/pve2/www/new/Workspace.js	2011-05-03 06:19:55 UTC (rev 5891)
@@ -178,7 +178,7 @@
 			    baseCls: 'x-btn',
 			    text: "Create VM",
 			    handler: function() {
-				var wiz = Ext.create('PVE.CreateVMWizard', {});
+				var wiz = Ext.create('PVE.qemu.CreateWizard', {});
 				wiz.show();
 			    } 
 			},
@@ -189,7 +189,7 @@
 			    baseCls: 'x-btn',
 			    text: "Create CT",
 			    handler: function() {
-				var wiz = Ext.create('PVE.CreateCTWizard', {});
+				var wiz = Ext.create('PVE.openvz.CreateWizard', {});
 				wiz.show();
 			    } 
 			}

Added: pve-manager/pve2/www/new/openvz/CreateWizard.js
===================================================================
--- pve-manager/pve2/www/new/openvz/CreateWizard.js	                        (rev 0)
+++ pve-manager/pve2/www/new/openvz/CreateWizard.js	2011-05-03 06:19:55 UTC (rev 5891)
@@ -0,0 +1,24 @@
+Ext.define('PVE.openvz.CreateWizard', {
+    extend: 'PVE.window.Wizard',
+
+    initComponent: function() {
+	var me = this;
+
+	Ext.applyIf(me, {
+	    title: 'Create new container',
+	    items: [
+		{
+		    title: 'Not implemented',
+		    descr: 'Sorry, this fuctionality is not implelemnted',
+		    layout: 'fit',
+		    html: 'not implemented'
+		}
+	    ]
+	});
+
+	me.callParent();
+    }
+});
+
+
+

Added: pve-manager/pve2/www/new/qemu/CreateWizard.js
===================================================================
--- pve-manager/pve2/www/new/qemu/CreateWizard.js	                        (rev 0)
+++ pve-manager/pve2/www/new/qemu/CreateWizard.js	2011-05-03 06:19:55 UTC (rev 5891)
@@ -0,0 +1,252 @@
+
+Ext.define('PVE.qemu.CreateWizard', {
+    extend: 'PVE.window.Wizard',
+
+    initComponent: function() {
+	var me = this;
+
+	cardTypeStore =Ext.create('Ext.data.ArrayStore', {
+            fields: ['key'],
+            data : [ 
+		['rtl8139'], 
+		['e1000'],
+		['virtio']
+	    ]
+        }), 
+
+	Ext.applyIf(me, {
+	    title: 'Create new virtual machine',
+	    items: [
+		{
+		    title: 'Name',
+		    descr: 'Please choose name and ID of your virtual machine.',
+		    items: [
+			{
+			    xtype: 'textfield',
+			    name: 'name',
+			    fieldLabel: 'VM name',
+			    allowBlank: true
+			},
+			{
+			    xtype: 'numberfield',
+			    name: 'vmid',
+			    minValue: 101,
+			    maxValue: 999999999,
+			    fieldLabel: 'Unique ID',
+			    allowBlank: false
+			}
+		    ]
+		},
+		{
+		    title: 'CPU',
+		    descr: 'Specify the number of CPUs for this VM.',
+		    items: [
+			{
+			    xtype: 'numberfield',
+			    name: 'sockets',
+			    minValue: 1,
+			    maxValue: 4,
+			    value: 1,
+			    fieldLabel: 'Sockets',
+			    allowBlank: false
+			},
+			{
+			    xtype: 'numberfield',
+			    name: 'cores',
+			    minValue: 1,
+			    maxValue: 32,
+			    value: 1,
+			    fieldLabel: 'Cores',
+			    allowBlank: false
+			},
+		    ]
+		},
+		{
+		    title: 'Memory',
+		    descr: 'Physical memory allocation.',
+		    items: [
+			{
+			    xtype: 'numberfield',
+			    name: 'mem',
+			    minValue: 32,
+			    maxValue: 128*1024,
+			    value: 512,
+			    step: 32,
+			    fieldLabel: 'Memory (MB)',
+			    allowBlank: false
+			}
+		    ]
+		},
+		{
+		    title: 'Harddisk',
+		    descr: 'Harddisk size',
+		    items: [
+			{
+			    xtype: 'textfield',
+			    name: 'diskstorage',
+			    fieldLabel: 'Storage',
+			    allowBlank: false
+			},
+			{
+			    xtype: 'numberfield',
+			    name: 'disksize',
+			    minValue: 1,
+			    maxValue: 128*1024,
+			    value: 32,
+			    fieldLabel: 'Disk size (GB)',
+			    allowBlank: false
+			}
+		    ]
+		},	
+		{
+		    title: 'Network',
+		    descr: 'Please select the network type.',
+		    items: [
+			{
+			    xtype: 'textfield',
+			    name: 'bridge',
+			    fieldLabel: 'Bridge',
+			    allowBlank: false
+			},
+			{
+			    xtype: 'combobox',
+			    name: 'netcard',
+			    fieldLabel: 'Network card',
+			    store: cardTypeStore,
+			    queryMode: 'local',
+			    typeAhead: true,
+			    value: 'rtl8139',
+			    displayField: 'key',
+			    valueField: 'key',
+			    allowBlank: false
+			},
+			{
+			    xtype: 'textfield',
+			    name: 'mac',
+			    fieldLabel: 'MAC address',
+			    value: 'auto',
+			    allowBlank: false
+			}
+		    ]
+		},
+		{
+		    title: 'Installation Media',
+		    descr: 'Please choose the installation media.',
+		    items: [
+			{
+			    xtype: 'radiofield',
+			    name: 'mediaType',
+			    inputValue: 'iso',
+			    boxLabel: 'Use CD/DVD disc image file (iso)',
+			   // hideLabel: true,
+			    //checked: true
+ 
+			},
+			{
+			    xtype: 'textfield',
+			    name: 'cdstorage',
+			    fieldLabel: 'Storage',
+			    allowBlank: false
+			},
+			{
+			    xtype: 'textfield',
+			    name: 'cdimage',
+			    fieldLabel: 'ISO Image',
+			    allowBlank: false
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'mediaType',
+			    inputValue: 'cdrom',
+			    boxLabel: 'Use physical CD/DVD Drive',
+			   // hideLabel: true,
+			    //checked: true
+ 
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'mediaType',
+			    inputValue: 'none',
+			    boxLabel: 'Do not use any installation media',
+			   // hideLabel: true,
+			    //checked: true
+			}
+		    ]
+		},
+		{
+		    title: 'OS Type',
+		    descr: 'Which operating system will be installed?',
+		    items: [
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'win7',
+			    checked: true,
+			    boxLabel: 'Microsoft Windows 7/2008r2'
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'w2k8',
+			    boxLabel: 'Microsoft Windows Vista/2008'
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'wxp',
+			    boxLabel: 'Microsoft Windows XP/2003'
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'w2k',
+			    boxLabel: 'Microsoft Windows 2000'
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'l26',
+			    boxLabel: 'Linux 2.6 Kernel'
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'l24',
+			    boxLabel: 'Linux 2.4 Kernel'
+			},
+			{
+			    xtype: 'radiofield',
+			    name: 'ostype',
+			    inputValue: 'other',
+			    boxLabel: 'Other'
+			}
+		    ]
+		},
+		{
+		    title: 'Confirm',
+		    descr: 'Please verify',
+		    listeners: {
+			show: function() {
+			    var form = me.down('form').getForm();
+			    var kv = form.getFieldValues();
+			    this.update(Ext.JSON.encode(kv));
+
+			}
+		    },
+		    onSubmit: function() {
+			var form = me.down('form').getForm();
+			var kv = form.getFieldValues();
+			console.dir(kv);
+		    },
+		    html: 'no content'
+		}
+	    ]
+	});
+
+	me.callParent();
+    }
+});
+
+
+
+

Modified: pve-manager/pve2/www/new/window/Wizard.js
===================================================================
--- pve-manager/pve2/www/new/window/Wizard.js	2011-05-02 12:31:50 UTC (rev 5890)
+++ pve-manager/pve2/www/new/window/Wizard.js	2011-05-03 06:19:55 UTC (rev 5891)
@@ -77,23 +77,15 @@
 		    }
 		},
 		{
-		    text: 'Submit',
+		    text: 'Finish',
 		    minWidth: 60,
 		    hidden: true,
 		    itemId: 'submit',
 		    handler: function() {
-			console.log("SUBMIT");
 			var tp = me.down('#wizcontent');
 			var atab = tp.getActiveTab();
 			atab.onSubmit();
 		    }
-		},
-		{
-		    text: 'Cancel',
-		    minWidth: 60,
-		    handler: function() {
-			me.close();
-		    }
 		}
 	    ]
 	});
@@ -117,8 +109,8 @@
 	};
 
 	Ext.applyIf(me, {
-	    width: 800,
-	    height: 600,
+	    width: 600,
+	    height: 400,
 	    modal: true,
 	    border: false,
 	    draggable: true,
@@ -128,10 +120,12 @@
 	    title: 'Proxmox VE Wizard',
 	    items: [
 		{
+		    // disabled for now - not really needed
+		    hidden: true, 
 		    region: 'north',
 		    itemId: 'header',
 		    layout: 'fit',
-		    margins: '5 5 5 5',
+		    margins: '5 5 0 5',
 		    bodyPadding: 10,
 		    html: ''
 		},
@@ -140,13 +134,17 @@
 		    region: 'center',
 		    layout: 'fit',
 		    border: false,
-		    margins: '0 5 0 5',
+		    margins: '5 5 0 5',
+ 
 		    items: {
 			itemId: 'wizcontent',
 			xtype: 'tabpanel',
 			activeItem: 0,
 			bodyPadding: 10,
-			listeners: {
+			defaults: {
+			    layout: 'vbox'
+			},
+ 			listeners: {
 			    tabchange: function(tp, newcard, oldcard) {
 				display_header(newcard);
 				if (newcard.onSubmit) {
@@ -182,7 +180,6 @@
 
 	Ext.Array.each(me.query('field'), function(field) {
 	    field.on('validitychange', function(f) {
-		console.log("VCHANGEW " + f.name);
 		var tp = me.down('#wizcontent');
 		var atab = tp.getActiveTab();
 		var valid = check_card(atab);
@@ -200,320 +197,3 @@
 
     }
 });
-
-Ext.define('PVE.CreateVMWizard', {
-    extend: 'PVE.window.Wizard',
-
-    initComponent: function() {
-	var me = this;
-
-	cardTypeStore =Ext.create('Ext.data.ArrayStore', {
-            fields: ['key'],
-            data : [ 
-		['rtl8139'], 
-		['e1000'],
-		['virtio']
-	    ]
-        }), 
-
-	Ext.applyIf(me, {
-	    title: 'Create new virtual machine',
-	    items: [
-		{
-		    layout: {                        
-			type: 'vbox',
-			align: 'center'
-		    },
-		    title: 'Name',
-		    descr: 'Please choose name and ID of your virtual machine.',
-		    items: [
-			{
-			    xtype: 'textfield',
-			    name: 'name',
-			    fieldLabel: 'VM name',
-			    allowBlank: true
-			},
-			{
-			    xtype: 'numberfield',
-			    name: 'vmid',
-			    minValue: 101,
-			    maxValue: 999999999,
-			    fieldLabel: 'Unique ID',
-			    allowBlank: false
-			}
-		    ]
-		},
-		{
-		    layout: 'vbox',
-		    title: 'CPU',
-		    descr: 'Specify the number of CPUs for this VM.',
-		    items: [
-			{
-			    xtype: 'numberfield',
-			    name: 'sockets',
-			    minValue: 1,
-			    maxValue: 4,
-			    value: 1,
-			    fieldLabel: 'Sockets',
-			    allowBlank: false
-			},
-			{
-			    xtype: 'numberfield',
-			    name: 'cores',
-			    minValue: 1,
-			    maxValue: 32,
-			    value: 1,
-			    fieldLabel: 'Cores',
-			    allowBlank: false
-			},
-		    ]
-		},
-		{
-		    layout: 'anchor',
-		    title: 'Memory',
-		    descr: 'Physical memory allocation.',
-		    defaults: {
-			anchor: '100%'
-		    },
-		    items: [
-			{
-			    xtype: 'numberfield',
-			    name: 'mem',
-			    minValue: 32,
-			    maxValue: 128*1024,
-			    value: 512,
-			    step: 32,
-			    fieldLabel: 'Memory (MB)',
-			    allowBlank: false
-			}
-		    ]
-		},
-		{
-		    layout: 'anchor',
-		    title: 'Harddisk',
-		    descr: 'Harddisk size',
-		    defaults: {
-			anchor: '100%'
-		    },
-		    items: [
-			{
-			    xtype: 'textfield',
-			    name: 'diskstorage',
-			    fieldLabel: 'Storage',
-			    allowBlank: false
-			},
-			{
-			    xtype: 'numberfield',
-			    name: 'disksize',
-			    minValue: 1,
-			    maxValue: 128*1024,
-			    value: 32,
-			    fieldLabel: 'Disk size (GB)',
-			    allowBlank: false
-			}
-		    ]
-		},	
-		{
-		    layout: 'anchor',
-		    title: 'Network',
-		    descr: 'Please select the network type.',
-		    defaults: {
-			anchor: '100%'
-		    },
-		    items: [
-			{
-			    xtype: 'textfield',
-			    name: 'bridge',
-			    fieldLabel: 'Bridge',
-			    allowBlank: false
-			},
-			{
-			    xtype: 'combobox',
-			    name: 'netcard',
-			    fieldLabel: 'Network card',
-			    store: cardTypeStore,
-			    queryMode: 'local',
-			    typeAhead: true,
-			    value: 'rtl8139',
-			    displayField: 'key',
-			    valueField: 'key',
-			    allowBlank: false
-			},
-			{
-			    xtype: 'textfield',
-			    name: 'mac',
-			    fieldLabel: 'MAC address',
-			    value: 'auto',
-			    allowBlank: false
-			}
-		    ]
-		},
-		{
-		    title: 'Installation Media',
-		    descr: 'Please choose the installation media.',
-		    layout: 'anchor',
-		    defaults: {
-			anchor: '100%'
-		    },
-		    items: [
-			{
-			    xtype: 'radiofield',
-			    name: 'mediaType',
-			    inputValue: 'iso',
-			    boxLabel: 'Use CD/DVD disc image file (iso)',
-			   // hideLabel: true,
-			    //checked: true
- 
-			},
-			{
-			    xtype: 'textfield',
-			    name: 'cdstorage',
-			    fieldLabel: 'Storage',
-			    allowBlank: false
-			},
-			{
-			    xtype: 'textfield',
-			    name: 'cdimage',
-			    fieldLabel: 'ISO Image',
-			    allowBlank: false
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'mediaType',
-			    inputValue: 'cdrom',
-			    boxLabel: 'Use physical CD/DVD Drive',
-			   // hideLabel: true,
-			    //checked: true
- 
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'mediaType',
-			    inputValue: 'none',
-			    boxLabel: 'Do not use any installation media',
-			   // hideLabel: true,
-			    //checked: true
-			}
-		    ],
-		    olditems: {
-			xtype: 'textfield',
-			name: 'name1',
-			fieldLabel: 'Name',
-			allowBlank: false
-		    }
-		    
-		},
-		{
-		    title: 'OS Type',
-		    descr: 'Which operating system will be installed?',
-		    layout: 'anchor',
-		    defaults: {
-			anchor: '100%'
-		    },
-		    items: [
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'win7',
-			    checked: true,
-			    boxLabel: 'Microsoft Windows 7/2008r2'
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'w2k8',
-			    boxLabel: 'Microsoft Windows Vista/2008'
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'wxp',
-			    boxLabel: 'Microsoft Windows XP/2003'
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'w2k',
-			    boxLabel: 'Microsoft Windows 2000'
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'l26',
-			    boxLabel: 'Linux 2.6 Kernel'
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'l24',
-			    boxLabel: 'Linux 2.4 Kernel'
-			},
-			{
-			    xtype: 'radiofield',
-			    name: 'ostype',
-			    inputValue: 'other',
-			    boxLabel: 'Other'
-			}
-		    ]
-		},
-		{
-		    layout: 'vbox',
-		    title: 'Last tabg',
-		    descr: 'Just a test 3',
-		    items: {
-			xtype: 'textfield',
-			name: 'name3',
-			fieldLabel: 'Info3',
-			allowBlank: false
-		    }
-		},
-		{
-		    layout: 'fit',
-		    title: 'Summary',
-		    descr: 'Please verify',
-		    listeners: {
-			show: function() {
-			    var form = me.down('form').getForm();
-			    var kv = form.getFieldValues();
-			    this.update(Ext.JSON.encode(kv));
-
-			}
-		    },
-		    onSubmit: function() {
-			var form = me.down('form').getForm();
-			var kv = form.getFieldValues();
-			console.dir(kv);
-		    },
-		    html: 'no content'
-		}
-	    ]
-	});
-
-	me.callParent();
-    }
-});
-
-Ext.define('PVE.CreateCTWizard', {
-    extend: 'PVE.window.Wizard',
-
-    initComponent: function() {
-	var me = this;
-
-	Ext.applyIf(me, {
-	    title: 'Create new container',
-	    items: [
-		{
-		    title: 'Not implemented',
-		    descr: 'Sorry, this fuctionality is not implelemnted',
-		    layout: 'fit',
-		    html: 'not implemented'
-		}
-	    ]
-	});
-
-	me.callParent();
-    }
-});
-
-
-




More information about the pve-devel mailing list