[pve-devel] r5964 - in pve-manager/pve2/www/new: . node

svn-commits at proxmox.com svn-commits at proxmox.com
Wed May 11 13:20:56 CEST 2011


Author: dietmar
Date: 2011-05-11 13:20:56 +0200 (Wed, 11 May 2011)
New Revision: 5964

Modified:
   pve-manager/pve2/www/new/VNCConsole.js
   pve-manager/pve2/www/new/index.pl
   pve-manager/pve2/www/new/node/Config.js
Log:
impl. Shell


Modified: pve-manager/pve2/www/new/VNCConsole.js
===================================================================
--- pve-manager/pve2/www/new/VNCConsole.js	2011-05-11 11:03:40 UTC (rev 5963)
+++ pve-manager/pve2/www/new/VNCConsole.js	2011-05-11 11:20:56 UTC (rev 5964)
@@ -285,4 +285,50 @@
 
 	me.callParent();
     }
+});
+
+Ext.define('PVE.Shell', {
+    extend: 'PVE.VNCConsole',
+    alias: ['widget.pveShell'],
+
+    initComponent : function() {
+	var me = this;
+ 
+	if (!me.nodename) 
+	    throw "no node name specified";
+
+	var tbar = [ 
+           '->',
+	    {
+                text: 'Refresh',
+		handler: function() { 
+		    var applet = Ext.getDom(me.appletID);
+		    applet.sendRefreshRequest();
+ 		}
+	    },
+ 	    {
+                text: 'Reload',
+                handler: function () { me.reloadApplet(); }
+	    },
+	    { 
+		text: 'Shell',
+		handler: function() {
+		    var url = Ext.urlEncode({
+			console: 'shell',
+			node: me.nodename
+		    });
+		    var nw = window.open("?" + url, '_blank', 
+					 "innerWidth=745,innerheight=427");
+		    nw.focus();
+		}
+	    }
+ 	];
+
+	Ext.apply(me, {
+	    tbar: tbar,
+	    url: "/api2/json/nodes/" + me.nodename + "/vncshell"
+	});
+
+	me.callParent();
+    }
 });
\ No newline at end of file

Modified: pve-manager/pve2/www/new/index.pl
===================================================================
--- pve-manager/pve2/www/new/index.pl	2011-05-11 11:03:40 UTC (rev 5963)
+++ pve-manager/pve2/www/new/index.pl	2011-05-11 11:20:56 UTC (rev 5964)
@@ -51,6 +51,8 @@
 	$title = "$name - Proxmox Console";
     } elsif ($console eq 'shell') {
 	$title = "node $node - Proxmox Shell";
+    } else {
+	die "unsupported console type";
     }
 }
 
@@ -71,25 +73,43 @@
     'PVE.VNCConsole', 
     'PVE.Workspace']);
 
+Ext.tip.QuickTipManager.init();
+
 _EOJS
 
 if (defined($console)) {
 
-    $jssrc .= <<_EOJS;
-    Ext.onReady(function() {
-	Ext.tip.QuickTipManager.init();
-	Ext.create('Ext.container.Viewport', {
-	  layout: 'fit',
-	  renderTo: Ext.getBody(),
-	  items: {
-	    xtype: 'pveKVMConsole',
-	    vmid: '$vmid',
-	    nodename: '$node',
-	    toplevel: true
-	  }
+    if ($console eq 'kvm') {
+
+	$jssrc .= <<_EOJS;
+	Ext.onReady(function() {
+	    Ext.create('Ext.container.Viewport', {
+	      layout: 'fit',
+	      renderTo: Ext.getBody(),
+	      items: {
+		xtype: 'pveKVMConsole',
+		vmid: '$vmid',
+		nodename: '$node',
+		toplevel: true
+	      }
+	   });
         });
-    });
 _EOJS
+    } elsif ($console eq 'shell') {
+	$jssrc .= <<_EOJS;
+	Ext.onReady(function() {
+	    Ext.create('Ext.container.Viewport', {
+	      layout: 'fit',
+	      renderTo: Ext.getBody(),
+	      items: {
+		xtype: 'pveShell',
+		nodename: '$node',
+		toplevel: true
+	      }
+	   });
+        });
+_EOJS
+}
 
 } else {
 
@@ -99,7 +119,6 @@
 
     Ext.onReady(function() {
 	Ext.History.init();
-	Ext.tip.QuickTipManager.init();
 	Ext.state.Manager.setProvider(Ext.create('PVE.StateProvider'));
 	Ext.create('PVE.Workspace');
     });

Modified: pve-manager/pve2/www/new/node/Config.js
===================================================================
--- pve-manager/pve2/www/new/node/Config.js	2011-05-11 11:03:40 UTC (rev 5963)
+++ pve-manager/pve2/www/new/node/Config.js	2011-05-11 11:20:56 UTC (rev 5964)
@@ -17,6 +17,21 @@
 		    title: 'Summary',
 		    itemId: 'summary',
 		    //xtype: 'pveNodeSummaryView',
+		    tbar: [
+			'->',
+			{ 
+			    text: 'Shell',
+			    handler: function() {
+				var url = Ext.urlEncode({
+				    console: 'shell',
+				    node: nodename
+				});
+				var nw = window.open("?" + url, '_blank', 
+						     "innerWidth=745,innerheight=427");
+				nw.focus();
+			    }
+			}
+		    ],
 		    html: 'summary'
 		},
 		{




More information about the pve-devel mailing list