You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2012/09/10 22:55:52 UTC

[34/50] [abbrv] git commit: CLOUDSTACK-61 Console proxy has plenty of files with CRLF line ending.

CLOUDSTACK-61 Console proxy has plenty of files with CRLF line ending.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/0bf8c5a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/0bf8c5a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/0bf8c5a1

Branch: refs/heads/4.0
Commit: 0bf8c5a18f6eb964ee70387d8eb5c30cc47ea0fc
Parents: f03d438
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Sat Sep 8 09:24:34 2012 +0800
Committer: Mice Xia <mi...@tcloudcomputing.com>
Committed: Sat Sep 8 09:26:14 2012 +0800

----------------------------------------------------------------------
 console-proxy/.classpath                           |   50 +-
 console-proxy/.project                             |   82 +-
 console-proxy/conf.dom0/agent.properties.in        |   92 +-
 console-proxy/conf.dom0/consoleproxy.properties.in |   46 +-
 console-proxy/conf/agent.properties                |   38 +-
 console-proxy/conf/consoleproxy.properties         |   46 +-
 console-proxy/css/ajaxviewer.css                   |  288 ++--
 console-proxy/js/ajaxviewer.js                     | 1214 +++++++-------
 console-proxy/scripts/run.bat                      |   36 +-
 .../com/cloud/consoleproxy/AjaxFIFOImageCache.java |   88 +-
 .../consoleproxy/AuthenticationException.java      |   32 +-
 .../consoleproxy/ConsoleProxyAjaxHandler.java      |  752 +++++-----
 .../consoleproxy/ConsoleProxyAjaxImageHandler.java |  246 ++--
 .../ConsoleProxyAuthenticationResult.java          |  130 +-
 .../ConsoleProxyBaseServerFactoryImpl.java         |   50 +-
 .../consoleproxy/ConsoleProxyClientListener.java   |   18 +-
 .../cloud/consoleproxy/ConsoleProxyCmdHandler.java |  106 +-
 .../ConsoleProxyHttpHandlerHelper.java             |  116 +-
 .../consoleproxy/ConsoleProxyLoggerFactory.java    |  140 +-
 .../cloud/consoleproxy/ConsoleProxyMonitor.java    |  226 ++--
 .../consoleproxy/ConsoleProxyResourceHandler.java  |  328 ++--
 .../ConsoleProxySecureServerFactoryImpl.java       |  214 ++--
 .../consoleproxy/ConsoleProxyServerFactory.java    |   14 +-
 .../consoleproxy/ConsoleProxyThumbnailHandler.java |  386 +++---
 .../src/com/cloud/consoleproxy/InputEventType.java |   84 +-
 .../cloud/consoleproxy/util/ITileScanListener.java |   18 +-
 .../com/cloud/consoleproxy/util/ImageHelper.java   |   32 +-
 .../src/com/cloud/consoleproxy/util/Logger.java    |  414 +++---
 .../com/cloud/consoleproxy/util/LoggerFactory.java |   10 +-
 .../src/com/cloud/consoleproxy/util/RawHTTP.java   |  466 +++---
 .../src/com/cloud/consoleproxy/util/Region.java    |  148 +-
 .../cloud/consoleproxy/util/RegionClassifier.java  |   84 +-
 .../src/com/cloud/consoleproxy/util/TileInfo.java  |   78 +-
 .../com/cloud/consoleproxy/util/TileTracker.java   |  506 +++---
 .../consoleproxy/vnc/BufferedImageCanvas.java      |  212 ++--
 .../cloud/consoleproxy/vnc/FrameBufferCanvas.java  |   26 +-
 .../vnc/FrameBufferUpdateListener.java             |   10 +-
 .../vnc/PaintNotificationListener.java             |   10 +-
 .../com/cloud/consoleproxy/vnc/RfbConstants.java   |  117 +-
 .../src/com/cloud/consoleproxy/vnc/VncClient.java  |  747 +++++-----
 .../consoleproxy/vnc/VncClientPacketSender.java    |  380 +++---
 .../consoleproxy/vnc/VncScreenDescription.java     |  129 +-
 .../consoleproxy/vnc/VncServerPacketReceiver.java  |  176 ++--
 .../vnc/packet/client/ClientPacket.java            |    2 +-
 .../client/FramebufferUpdateRequestPacket.java     |   43 +-
 .../vnc/packet/client/KeyboardEventPacket.java     |   30 +-
 .../vnc/packet/client/MouseEventPacket.java        |   32 +-
 .../vnc/packet/client/SetEncodingsPacket.java      |   37 +-
 .../vnc/packet/client/SetPixelFormatPacket.java    |   82 +-
 .../vnc/packet/server/AbstractRect.java            |   62 +-
 .../consoleproxy/vnc/packet/server/CopyRect.java   |   20 +-
 .../server/FrameBufferSizeChangeRequest.java       |   22 +-
 .../vnc/packet/server/FramebufferUpdatePacket.java |  133 +-
 .../consoleproxy/vnc/packet/server/RawRect.java    |   67 +-
 .../cloud/consoleproxy/vnc/packet/server/Rect.java |   15 +-
 .../vnc/packet/server/ServerCutText.java           |   32 +-
 console-proxy/ui/viewer-update.ftl                 |   48 +-
 57 files changed, 4501 insertions(+), 4509 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/.classpath
----------------------------------------------------------------------
diff --git a/console-proxy/.classpath b/console-proxy/.classpath
index 1a61b02..eeed44e 100644
--- a/console-proxy/.classpath
+++ b/console-proxy/.classpath
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/.project
----------------------------------------------------------------------
diff --git a/console-proxy/.project b/console-proxy/.project
index d3efcb5..5fae244 100644
--- a/console-proxy/.project
+++ b/console-proxy/.project
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<projectDescription>
-	<name>console-proxy</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<projectDescription>
+	<name>console-proxy</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/conf.dom0/agent.properties.in
----------------------------------------------------------------------
diff --git a/console-proxy/conf.dom0/agent.properties.in b/console-proxy/conf.dom0/agent.properties.in
index 285587a..1920481 100644
--- a/console-proxy/conf.dom0/agent.properties.in
+++ b/console-proxy/conf.dom0/agent.properties.in
@@ -1,46 +1,46 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# Sample configuration file for VMOPS console proxy
-
-instance=ConsoleProxy
-consoleproxy.httpListenPort=8002
-
-#resource= the java class, which agent load to execute
-resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource
-
-#host= The IP address of management server
-host=localhost
-
-#port = The port management server listening on, default is 8250
-port=8250
-
-#pod= The pod, which agent belonged to
-pod=default
-
-#zone= The zone, which agent belonged to
-zone=default
-
-#private.network.device= the private nic device
-# if this is commented, it is autodetected on service startup
-# private.network.device=cloudbr0
-
-#public.network.device= the public nic device
-# if this is commented, it is autodetected on service startup
-# public.network.device=cloudbr0
-
-#guid= a GUID to identify the agent
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Sample configuration file for VMOPS console proxy
+
+instance=ConsoleProxy
+consoleproxy.httpListenPort=8002
+
+#resource= the java class, which agent load to execute
+resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource
+
+#host= The IP address of management server
+host=localhost
+
+#port = The port management server listening on, default is 8250
+port=8250
+
+#pod= The pod, which agent belonged to
+pod=default
+
+#zone= The zone, which agent belonged to
+zone=default
+
+#private.network.device= the private nic device
+# if this is commented, it is autodetected on service startup
+# private.network.device=cloudbr0
+
+#public.network.device= the public nic device
+# if this is commented, it is autodetected on service startup
+# public.network.device=cloudbr0
+
+#guid= a GUID to identify the agent

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/conf.dom0/consoleproxy.properties.in
----------------------------------------------------------------------
diff --git a/console-proxy/conf.dom0/consoleproxy.properties.in b/console-proxy/conf.dom0/consoleproxy.properties.in
index 858ef44..a3cddbc 100644
--- a/console-proxy/conf.dom0/consoleproxy.properties.in
+++ b/console-proxy/conf.dom0/consoleproxy.properties.in
@@ -1,23 +1,23 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-consoleproxy.tcpListenPort=0
-consoleproxy.httpListenPort=80
-consoleproxy.httpCmdListenPort=8001
-consoleproxy.jarDir=./applet/
-consoleproxy.viewerLinger=180
-consoleproxy.reconnectMaxRetry=5
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+consoleproxy.tcpListenPort=0
+consoleproxy.httpListenPort=80
+consoleproxy.httpCmdListenPort=8001
+consoleproxy.jarDir=./applet/
+consoleproxy.viewerLinger=180
+consoleproxy.reconnectMaxRetry=5

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/conf/agent.properties
----------------------------------------------------------------------
diff --git a/console-proxy/conf/agent.properties b/console-proxy/conf/agent.properties
index 11853ba..4e217f2 100644
--- a/console-proxy/conf/agent.properties
+++ b/console-proxy/conf/agent.properties
@@ -1,19 +1,19 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-instance=ConsoleProxy
-resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+instance=ConsoleProxy
+resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/conf/consoleproxy.properties
----------------------------------------------------------------------
diff --git a/console-proxy/conf/consoleproxy.properties b/console-proxy/conf/consoleproxy.properties
index 3e5f69a..bb452f5 100644
--- a/console-proxy/conf/consoleproxy.properties
+++ b/console-proxy/conf/consoleproxy.properties
@@ -1,23 +1,23 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-consoleproxy.tcpListenPort=0
-consoleproxy.httpListenPort=8088
-consoleproxy.httpCmdListenPort=8001
-consoleproxy.jarDir=./applet/
-consoleproxy.viewerLinger=180
-consoleproxy.reconnectMaxRetry=5
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+consoleproxy.tcpListenPort=0
+consoleproxy.httpListenPort=8088
+consoleproxy.httpCmdListenPort=8001
+consoleproxy.jarDir=./applet/
+consoleproxy.viewerLinger=180
+consoleproxy.reconnectMaxRetry=5

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/css/ajaxviewer.css
----------------------------------------------------------------------
diff --git a/console-proxy/css/ajaxviewer.css b/console-proxy/css/ajaxviewer.css
index 90c1a63..5ea552b 100644
--- a/console-proxy/css/ajaxviewer.css
+++ b/console-proxy/css/ajaxviewer.css
@@ -1,144 +1,144 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
- 
-  http://www.apache.org/licenses/LICENSE-2.0
- 
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-body {
-	margin:0 0;
-	text-align: center;
-}
-	
-#main_panel {
-	clear:both;
-	margin: 0 auto;
-	text-align: left;
-}
-
-.canvas_tile {
-	cursor:crosshair;
-}
-
-#toolbar {
-	font:normal 12px 'Trebuchet MS','Arial'; 
-	margin:0 auto; 
-	text-align: left;
-	padding:0 0; 
-	height:32px;
-	background-image:url(/resource/images/back.gif); 
-	background-repeat:repeat-x; 
-}
-
-#toolbar ul { 
-	margin:0 0; 
-	padding:0 10px 0 10px; 
-	float:left;
-	display:block;
-	line-height:32px;
-	list-style:none; 
-}
-
-#toolbar li {
-	float:left; 
-	display:inline; 
-	padding:0;
-	height:32px;
-}
-
-#toolbar a { 
-	color:white; 
-	float:left;
-	display:block;
-	padding:0 3px 0 3px; 
-	text-decoration:none;
-	line-height:32px;
-}
-
-#toolbar a span { 
-	display:block; 
-	float:none; 
-	padding:0 10px 0 7px; 
-} 
-
-#toolbar a span img { 
-	border:none; 
-	margin:8px 4px 0 0; 
-} 
-
-#toolbar a:hover { 
-	background: url(/resource/images/left.png) no-repeat left center; 
-} 
-
-#toolbar a:hover span { 
-	background:url(/resource/images/right.png) no-repeat right center; 
-}
-
-
-#toolbar ul li ul {
-    position: absolute;
-    top:32;
-    width: 260;
-    height: 65;
-    display: block;
-    display: none;
-    border-top: 1px solid black;
-    background-image:url(/resource/images/back.gif); 
-    background-repeat:repeat-x repeat-y; 
-}
-
-#toolbar ul li ul li {
-    display: list-item;
-    float:none;
-    padding-left: 20;
-}
-
-#toolbar ul li ul li.current {
-    background: url(/resource/images/cad.gif) no-repeat left center; 
-}
-
-#toolbar ul li ul li a {
-    display:block;
-    padding:0 3px 0 3px; 
-    text-decoration:none;
-    line-height:32px;
-    vertical-align: bottom;    /* this is to fix the list gap in IE */
-}
-
-#toolbar ul li ul li a:hover {
-    background: url(/resource/images/left.png) no-repeat left center; 
-}
-
-#toolbar ul li ul li a:hover span {
-    background: url(/resource/images/right2.png) no-repeat right center; 
-}
-
-span.dark {
-	margin-right:20px;
-	float:right;
-	display:block;
-	width:32px;
-	height:30px;
-	background:url(/resource/images/gray-green.png) no-repeat center center; 
-}
-
-span.bright {
-	margin-right:20px;
-	float:right;
-	display:block;
-	width:32px;
-	height:30px;
-	background:url(/resource/images/bright-green.png) no-repeat center center; 
-}
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+body {
+	margin:0 0;
+	text-align: center;
+}
+	
+#main_panel {
+	clear:both;
+	margin: 0 auto;
+	text-align: left;
+}
+
+.canvas_tile {
+	cursor:crosshair;
+}
+
+#toolbar {
+	font:normal 12px 'Trebuchet MS','Arial'; 
+	margin:0 auto; 
+	text-align: left;
+	padding:0 0; 
+	height:32px;
+	background-image:url(/resource/images/back.gif); 
+	background-repeat:repeat-x; 
+}
+
+#toolbar ul { 
+	margin:0 0; 
+	padding:0 10px 0 10px; 
+	float:left;
+	display:block;
+	line-height:32px;
+	list-style:none; 
+}
+
+#toolbar li {
+	float:left; 
+	display:inline; 
+	padding:0;
+	height:32px;
+}
+
+#toolbar a { 
+	color:white; 
+	float:left;
+	display:block;
+	padding:0 3px 0 3px; 
+	text-decoration:none;
+	line-height:32px;
+}
+
+#toolbar a span { 
+	display:block; 
+	float:none; 
+	padding:0 10px 0 7px; 
+} 
+
+#toolbar a span img { 
+	border:none; 
+	margin:8px 4px 0 0; 
+} 
+
+#toolbar a:hover { 
+	background: url(/resource/images/left.png) no-repeat left center; 
+} 
+
+#toolbar a:hover span { 
+	background:url(/resource/images/right.png) no-repeat right center; 
+}
+
+
+#toolbar ul li ul {
+    position: absolute;
+    top:32;
+    width: 260;
+    height: 65;
+    display: block;
+    display: none;
+    border-top: 1px solid black;
+    background-image:url(/resource/images/back.gif); 
+    background-repeat:repeat-x repeat-y; 
+}
+
+#toolbar ul li ul li {
+    display: list-item;
+    float:none;
+    padding-left: 20;
+}
+
+#toolbar ul li ul li.current {
+    background: url(/resource/images/cad.gif) no-repeat left center; 
+}
+
+#toolbar ul li ul li a {
+    display:block;
+    padding:0 3px 0 3px; 
+    text-decoration:none;
+    line-height:32px;
+    vertical-align: bottom;    /* this is to fix the list gap in IE */
+}
+
+#toolbar ul li ul li a:hover {
+    background: url(/resource/images/left.png) no-repeat left center; 
+}
+
+#toolbar ul li ul li a:hover span {
+    background: url(/resource/images/right2.png) no-repeat right center; 
+}
+
+span.dark {
+	margin-right:20px;
+	float:right;
+	display:block;
+	width:32px;
+	height:30px;
+	background:url(/resource/images/gray-green.png) no-repeat center center; 
+}
+
+span.bright {
+	margin-right:20px;
+	float:right;
+	display:block;
+	width:32px;
+	height:30px;
+	background:url(/resource/images/bright-green.png) no-repeat center center; 
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/js/ajaxviewer.js
----------------------------------------------------------------------
diff --git a/console-proxy/js/ajaxviewer.js b/console-proxy/js/ajaxviewer.js
index b15642a..355cc82 100644
--- a/console-proxy/js/ajaxviewer.js
+++ b/console-proxy/js/ajaxviewer.js
@@ -22,27 +22,27 @@ var g_logger;
 /////////////////////////////////////////////////////////////////////////////
 // class StringBuilder
 //
-function StringBuilder(initStr) {
-    this.strings = new Array("");
-    this.append(initStr);
-}
-
-StringBuilder.prototype = {
-	append : function (str) {
-	    if (str) {
-	        this.strings.push(str);
-	    }
-	    return this;
-	},
-	
-	clear : function() {
-	    this.strings.length = 1;
-	    return this;
-	},
-	
-	toString: function() {
-	    return this.strings.join("");
-	}
+function StringBuilder(initStr) {
+    this.strings = new Array("");
+    this.append(initStr);
+}
+
+StringBuilder.prototype = {
+	append : function (str) {
+	    if (str) {
+	        this.strings.push(str);
+	    }
+	    return this;
+	},
+	
+	clear : function() {
+	    this.strings.length = 1;
+	    return this;
+	},
+	
+	toString: function() {
+	    return this.strings.join("");
+	}
 };
 
 
@@ -335,36 +335,36 @@ function AjaxViewer(panelId, imageUrl, updateUrl, tileMap, width, height, tileWi
 	// g_logger.enable(true);
 	// g_logger.open();
 	
-	var ajaxViewer = this;
-	this.imageLoaded = false;
-	this.fullImage = true;
-	this.imgUrl = imageUrl;
-	this.img = new Image();
-	$(this.img).attr('src', imageUrl).load(function() {
-		ajaxViewer.imageLoaded = true;
-	});
-	
-	this.updateUrl = updateUrl;
-	this.tileMap = tileMap;
-	this.dirty = true;
-	this.width = width;
-	this.height = height;
-	this.tileWidth = tileWidth;
+	var ajaxViewer = this;
+	this.imageLoaded = false;
+	this.fullImage = true;
+	this.imgUrl = imageUrl;
+	this.img = new Image();
+	$(this.img).attr('src', imageUrl).load(function() {
+		ajaxViewer.imageLoaded = true;
+	});
+	
+	this.updateUrl = updateUrl;
+	this.tileMap = tileMap;
+	this.dirty = true;
+	this.width = width;
+	this.height = height;
+	this.tileWidth = tileWidth;
 	this.tileHeight = tileHeight;
 	this.maxTileZIndex = 1;
 	
 	this.currentKeyboard = AjaxViewer.KEYBOARD_TYPE_ENGLISH;
 	this.keyboardMappers = [];
 	
-	this.timer = 0;
-	this.eventQueue = [];
-	this.sendingEventInProgress = false;
-	
-	this.lastClickEvent = { x: 0, y: 0, button: 0, modifiers: 0, time: new Date().getTime() };
-	
-	if(window.onStatusNotify == undefined)
-		window.onStatusNotify = function(status) {};
-	
+	this.timer = 0;
+	this.eventQueue = [];
+	this.sendingEventInProgress = false;
+	
+	this.lastClickEvent = { x: 0, y: 0, button: 0, modifiers: 0, time: new Date().getTime() };
+	
+	if(window.onStatusNotify == undefined)
+		window.onStatusNotify = function(status) {};
+	
 	this.panel = this.generateCanvas(panelId, width, height, tileWidth, tileHeight);
 	
 	this.setupKeyboardTranslationTable();
@@ -569,86 +569,86 @@ AjaxViewer.getEventName = function(type) {
 	
 	return "N/A";
 };
-
-AjaxViewer.prototype = {
-	setDirty: function(value) {
-		this.dirty = value;
-	},
-	
-	isDirty: function() {
-		return this.dirty;
-	},
-	
-	isImageLoaded: function() {
-		return this.imageLoaded;
-	},
-	
-	refresh: function(imageUrl, tileMap, fullImage) {
-		var ajaxViewer = this;
-		var img = $(this.img); 
-		this.fullImage = fullImage;
-		this.imgUrl=imageUrl;
-
-		img.attr('src', imageUrl).load(function() {
-			ajaxViewer.imageLoaded = true;
-		});
-		this.tileMap = tileMap;
-	},
-	
-	resize: function(panelId, width, height, tileWidth, tileHeight) {
-		$(".canvas_tile", document.body).each(function() {
-			$(this).remove();
-		});
-		$("table", $("#" + panelId)).remove();
-		
-		this.width = width;
-		this.height = height;
-		this.tileWidth = tileWidth;
-		this.tileHeight = tileHeight;
-		this.panel = this.generateCanvas(panelId, width, height, tileWidth, tileHeight);
-	},
-	
-	start: function() {
-		var ajaxViewer = this;
-		this.timer = setInterval(function() { ajaxViewer.heartbeat(); }, 50);
-		
-		$(document).bind("ajaxError", function(event, XMLHttpRequest, ajaxOptions, thrownError) {
-			ajaxViewer.onAjaxError(event, XMLHttpRequest, ajaxOptions, thrownError);
-		});
-		
-		this.eventQueue = [];	// reset event queue
-		this.sendingEventInProgress = false;
-		ajaxViewer.installMouseHook();
-		ajaxViewer.installKeyboardHook();
-
-		$(window).bind("resize", function() {
-			ajaxViewer.onWindowResize();
-		});
-	},
-	
-	stop: function() {
-		clearInterval(this.timer);
-		this.deleteCanvas();
-
-		this.uninstallMouseHook();
-		this.uninstallKeyboardHook();	
-		this.eventQueue = [];
-		this.sendingEventInProgress = false;
-
-		$(document).unbind("ajaxError");
-		$(window).unbind("resize");
-	},
-	
-	sendMouseEvent: function(event, x, y, whichButton, modifiers) {
-		this.eventQueue.push({
-			type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT,
-			event: event,
-			x: x,
-			y: y,
-			code: whichButton,
-			modifiers: modifiers
-		});
-		this.checkEventQueue();
+
+AjaxViewer.prototype = {
+	setDirty: function(value) {
+		this.dirty = value;
+	},
+	
+	isDirty: function() {
+		return this.dirty;
+	},
+	
+	isImageLoaded: function() {
+		return this.imageLoaded;
+	},
+	
+	refresh: function(imageUrl, tileMap, fullImage) {
+		var ajaxViewer = this;
+		var img = $(this.img); 
+		this.fullImage = fullImage;
+		this.imgUrl=imageUrl;
+
+		img.attr('src', imageUrl).load(function() {
+			ajaxViewer.imageLoaded = true;
+		});
+		this.tileMap = tileMap;
+	},
+	
+	resize: function(panelId, width, height, tileWidth, tileHeight) {
+		$(".canvas_tile", document.body).each(function() {
+			$(this).remove();
+		});
+		$("table", $("#" + panelId)).remove();
+		
+		this.width = width;
+		this.height = height;
+		this.tileWidth = tileWidth;
+		this.tileHeight = tileHeight;
+		this.panel = this.generateCanvas(panelId, width, height, tileWidth, tileHeight);
+	},
+	
+	start: function() {
+		var ajaxViewer = this;
+		this.timer = setInterval(function() { ajaxViewer.heartbeat(); }, 50);
+		
+		$(document).bind("ajaxError", function(event, XMLHttpRequest, ajaxOptions, thrownError) {
+			ajaxViewer.onAjaxError(event, XMLHttpRequest, ajaxOptions, thrownError);
+		});
+		
+		this.eventQueue = [];	// reset event queue
+		this.sendingEventInProgress = false;
+		ajaxViewer.installMouseHook();
+		ajaxViewer.installKeyboardHook();
+
+		$(window).bind("resize", function() {
+			ajaxViewer.onWindowResize();
+		});
+	},
+	
+	stop: function() {
+		clearInterval(this.timer);
+		this.deleteCanvas();
+
+		this.uninstallMouseHook();
+		this.uninstallKeyboardHook();	
+		this.eventQueue = [];
+		this.sendingEventInProgress = false;
+
+		$(document).unbind("ajaxError");
+		$(window).unbind("resize");
+	},
+	
+	sendMouseEvent: function(event, x, y, whichButton, modifiers) {
+		this.eventQueue.push({
+			type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT,
+			event: event,
+			x: x,
+			y: y,
+			code: whichButton,
+			modifiers: modifiers
+		});
+		this.checkEventQueue();
 	},
 	
 	setupKeyboardTranslationTable : function() {
@@ -799,487 +799,487 @@ AjaxViewer.prototype = {
 			}
 		}
 			
-		var len;
+		var len;
 		g_logger.log(Logger.LEVEL_INFO, "Keyboard event: " + AjaxViewer.getEventName(event) + ", code: " + code + ", modifiers: " + modifiers + ', char: ' + String.fromCharCode(code));
-		this.eventQueue.push({
-			type: AjaxViewer.EVENT_QUEUE_KEYBOARD_EVENT,
-			event: event,
-			code: code,
-			modifiers: modifiers
+		this.eventQueue.push({
+			type: AjaxViewer.EVENT_QUEUE_KEYBOARD_EVENT,
+			event: event,
+			code: code,
+			modifiers: modifiers
 		});
 
-		if(event != AjaxViewer.KEY_DOWN)
-			this.checkEventQueue();
-	},
-	
-	aggregateEvents: function() {
-		var ajaxViewer = this;
-		var aggratedQueue = [];
-		
-		var aggregating = false;
-		var mouseX;
-		var mouseY;
-		$.each(ajaxViewer.eventQueue, function(index, item) {
-			if(item.type != AjaxViewer.EVENT_QUEUE_MOUSE_EVENT) {
-				aggratedQueue.push(item);
-			} else {
-				if(!aggregating) {
-					if(item.event == AjaxViewer.MOUSE_MOVE) {
-						aggregating = true;
-						mouseX = item.x;
-						mouseY = item.y;
-					} else {
-						aggratedQueue.push(item);
-					}
-				} else {
-					if(item.event == AjaxViewer.MOUSE_MOVE) {
-						// continue to aggregate mouse move event
-						mouseX = item.x;
-						mouseY = item.y;
-					} else {
-						aggratedQueue.push({
-							type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT,
-							event: AjaxViewer.MOUSE_MOVE,
-							x: mouseX,
-							y: mouseY,
-							code: 0,
-							modifiers: 0
-						});
-						aggregating = false;
-						
-						aggratedQueue.push(item);
-					}
-				}
-			}
-		});
-		
-		if(aggregating) {
-			aggratedQueue.push({
-				type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT,
-				event: AjaxViewer.MOUSE_MOVE,
-				x: mouseX,
-				y: mouseY,
-				code: 0,
-				modifiers: 0
-			});
-		}
-		
-		this.eventQueue = aggratedQueue; 
-	},
-	
-	checkEventQueue: function() {
+		if(event != AjaxViewer.KEY_DOWN)
+			this.checkEventQueue();
+	},
+	
+	aggregateEvents: function() {
+		var ajaxViewer = this;
+		var aggratedQueue = [];
+		
+		var aggregating = false;
+		var mouseX;
+		var mouseY;
+		$.each(ajaxViewer.eventQueue, function(index, item) {
+			if(item.type != AjaxViewer.EVENT_QUEUE_MOUSE_EVENT) {
+				aggratedQueue.push(item);
+			} else {
+				if(!aggregating) {
+					if(item.event == AjaxViewer.MOUSE_MOVE) {
+						aggregating = true;
+						mouseX = item.x;
+						mouseY = item.y;
+					} else {
+						aggratedQueue.push(item);
+					}
+				} else {
+					if(item.event == AjaxViewer.MOUSE_MOVE) {
+						// continue to aggregate mouse move event
+						mouseX = item.x;
+						mouseY = item.y;
+					} else {
+						aggratedQueue.push({
+							type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT,
+							event: AjaxViewer.MOUSE_MOVE,
+							x: mouseX,
+							y: mouseY,
+							code: 0,
+							modifiers: 0
+						});
+						aggregating = false;
+						
+						aggratedQueue.push(item);
+					}
+				}
+			}
+		});
+		
+		if(aggregating) {
+			aggratedQueue.push({
+				type: AjaxViewer.EVENT_QUEUE_MOUSE_EVENT,
+				event: AjaxViewer.MOUSE_MOVE,
+				x: mouseX,
+				y: mouseY,
+				code: 0,
+				modifiers: 0
+			});
+		}
+		
+		this.eventQueue = aggratedQueue; 
+	},
+	
+	checkEventQueue: function() {
 		var ajaxViewer = this;
-		
+		
 		if(!this.sendingEventInProgress && this.eventQueue.length > 0) {
-			var sb = new StringBuilder();
-			sb.append(""+this.eventQueue.length).append("|");
-			$.each(this.eventQueue, function() {
-				var item = this;
-				if(item.type == AjaxViewer.EVENT_QUEUE_MOUSE_EVENT) {
-					sb.append(""+item.type).append("|");
-					sb.append(""+item.event).append("|");
-					sb.append(""+item.x).append("|");
-					sb.append(""+item.y).append("|");
-					sb.append(""+item.code).append("|");
-					sb.append(""+item.modifiers).append("|");
-				} else {
-					sb.append(""+item.type).append("|");
-					sb.append(""+item.event).append("|");
-					sb.append(""+item.code).append("|");
-					sb.append(""+item.modifiers).append("|");
-				}
-			});
-			this.eventQueue.length = 0;
-			
+			var sb = new StringBuilder();
+			sb.append(""+this.eventQueue.length).append("|");
+			$.each(this.eventQueue, function() {
+				var item = this;
+				if(item.type == AjaxViewer.EVENT_QUEUE_MOUSE_EVENT) {
+					sb.append(""+item.type).append("|");
+					sb.append(""+item.event).append("|");
+					sb.append(""+item.x).append("|");
+					sb.append(""+item.y).append("|");
+					sb.append(""+item.code).append("|");
+					sb.append(""+item.modifiers).append("|");
+				} else {
+					sb.append(""+item.type).append("|");
+					sb.append(""+item.event).append("|");
+					sb.append(""+item.code).append("|");
+					sb.append(""+item.modifiers).append("|");
+				}
+			});
+			this.eventQueue.length = 0;
+			
 			var url = ajaxViewer.updateUrl + "&event=" + AjaxViewer.EVENT_BAG;
 			
 			g_logger.log(Logger.LEVEL_TRACE, "Posting client event " + sb.toString() + "...");
-			
-			ajaxViewer.sendingEventInProgress = true;
-			window.onStatusNotify(AjaxViewer.STATUS_SENDING);
+			
+			ajaxViewer.sendingEventInProgress = true;
+			window.onStatusNotify(AjaxViewer.STATUS_SENDING);
 			$.post(url, {data: sb.toString()}, function(data, textStatus) {
 				g_logger.log(Logger.LEVEL_TRACE, "Client event " + sb.toString() + " is posted");
-				
-				ajaxViewer.sendingEventInProgress = false;
-				window.onStatusNotify(AjaxViewer.STATUS_SENT);
-				
-				ajaxViewer.checkUpdate();
-			}, 'html');
-		}
-	},
-	
-	onAjaxError: function(event, XMLHttpRequest, ajaxOptions, thrownError) {
-		if(window.onClientError != undefined && jQuery.isFunction(window.onClientError)) {
-			window.onClientError();
-		}
-	},
-	
-	onWindowResize: function() {
-		var offset = this.panel.offset();
-		
-		var row = $('tr:first', this.panel);
-		var cell = $('td:first', row);
-		var tile = this.getTile(cell, 'tile');
-		
-		var tileOffset = tile.offset();
-		var deltaX = offset.left - tileOffset.left;
-		var deltaY = offset.top - tileOffset.top;
-		
-		if(deltaX != 0 || deltaY != 0) {
-			$(".canvas_tile").each(function() {
-				var offsetFrom = $(this).offset();
-				$(this).css('left', offsetFrom.left + deltaX).css('top', offsetFrom.top + deltaY);
-			});
-		}
-	},
-	
-	deleteCanvas: function() {
-		$('.canvas_tile', $(document.body)).each(function() {
-			$(this).remove();
-		});
-	},
-	
-	generateCanvas: function(wrapperDivId, width, height, tileWidth, tileHeight) {
-		var canvasParent = $('#' + wrapperDivId);
-		canvasParent.width(width);
-		canvasParent.height(height);
-		
-		if(window.onCanvasSizeChange != undefined && jQuery.isFunction(window.onCanvasSizeChange))
-			window.onCanvasSizeChange(width, height);
-		
-		var tableDef = '<table cellpadding="0px" cellspacing="0px">\r\n';
-		var i = 0;
-		var j = 0;
-		for(i = 0; i < Math.ceil((height + tileHeight - 1) / tileHeight); i++) {
-			var rowHeight = Math.min(height - i*tileHeight, tileHeight);
-			tableDef += '<tr style="height:' + rowHeight + 'px">\r\n';
-			
-			for(j = 0; j < Math.ceil((width + tileWidth - 1) / tileWidth); j++) {
-				var colWidth = Math.min(width - j*tileWidth, tileWidth);
-				tableDef += '<td width="' + colWidth + 'px"></td>\r\n';
-			}
-			tableDef += '</tr>\r\n';
-		}
-		tableDef += '</table>\r\n';
-		
-		return $(tableDef).appendTo(canvasParent);
-	},
-	
-	getTile: function(cell, name) {
-		var clonedDiv = cell.data(name);
-		if(!clonedDiv) {
-			var offset = cell.offset();
-			var divDef = "<div class=\"canvas_tile\" style=\"z-index:1;position:absolute;overflow:hidden;width:" + cell.width() + "px;height:" 
-				+ cell.height() + "px;left:" + offset.left + "px;top:" + offset.top+"px\"></div>";
-			
-			clonedDiv = $(divDef).appendTo($(document.body));
-			cell.data(name, clonedDiv);
-		}
-		
-		return clonedDiv;
-	},
-	
-	initCell: function(cell) {
-		if(!cell.data("init")) {
-			cell.data("init", true);
-			
-			cell.data("current", 0);
-			this.getTile(cell, "tile2");
-			this.getTile(cell, "tile");
-		}
-	},
-	
-	displayCell: function(cell, bg) {
-		var div;
-		var divPrev;
-		if(!cell.data("current")) {
-			cell.data("current", 1);
-			
-			divPrev = this.getTile(cell, "tile");
-			div = this.getTile(cell, "tile2");
-		} else {
-			cell.data("current", 0);
-			divPrev = this.getTile(cell, "tile2");
-			div = this.getTile(cell, "tile");
-		}
+				
+				ajaxViewer.sendingEventInProgress = false;
+				window.onStatusNotify(AjaxViewer.STATUS_SENT);
+				
+				ajaxViewer.checkUpdate();
+			}, 'html');
+		}
+	},
+	
+	onAjaxError: function(event, XMLHttpRequest, ajaxOptions, thrownError) {
+		if(window.onClientError != undefined && jQuery.isFunction(window.onClientError)) {
+			window.onClientError();
+		}
+	},
+	
+	onWindowResize: function() {
+		var offset = this.panel.offset();
+		
+		var row = $('tr:first', this.panel);
+		var cell = $('td:first', row);
+		var tile = this.getTile(cell, 'tile');
+		
+		var tileOffset = tile.offset();
+		var deltaX = offset.left - tileOffset.left;
+		var deltaY = offset.top - tileOffset.top;
+		
+		if(deltaX != 0 || deltaY != 0) {
+			$(".canvas_tile").each(function() {
+				var offsetFrom = $(this).offset();
+				$(this).css('left', offsetFrom.left + deltaX).css('top', offsetFrom.top + deltaY);
+			});
+		}
+	},
+	
+	deleteCanvas: function() {
+		$('.canvas_tile', $(document.body)).each(function() {
+			$(this).remove();
+		});
+	},
+	
+	generateCanvas: function(wrapperDivId, width, height, tileWidth, tileHeight) {
+		var canvasParent = $('#' + wrapperDivId);
+		canvasParent.width(width);
+		canvasParent.height(height);
+		
+		if(window.onCanvasSizeChange != undefined && jQuery.isFunction(window.onCanvasSizeChange))
+			window.onCanvasSizeChange(width, height);
+		
+		var tableDef = '<table cellpadding="0px" cellspacing="0px">\r\n';
+		var i = 0;
+		var j = 0;
+		for(i = 0; i < Math.ceil((height + tileHeight - 1) / tileHeight); i++) {
+			var rowHeight = Math.min(height - i*tileHeight, tileHeight);
+			tableDef += '<tr style="height:' + rowHeight + 'px">\r\n';
+			
+			for(j = 0; j < Math.ceil((width + tileWidth - 1) / tileWidth); j++) {
+				var colWidth = Math.min(width - j*tileWidth, tileWidth);
+				tableDef += '<td width="' + colWidth + 'px"></td>\r\n';
+			}
+			tableDef += '</tr>\r\n';
+		}
+		tableDef += '</table>\r\n';
+		
+		return $(tableDef).appendTo(canvasParent);
+	},
+	
+	getTile: function(cell, name) {
+		var clonedDiv = cell.data(name);
+		if(!clonedDiv) {
+			var offset = cell.offset();
+			var divDef = "<div class=\"canvas_tile\" style=\"z-index:1;position:absolute;overflow:hidden;width:" + cell.width() + "px;height:" 
+				+ cell.height() + "px;left:" + offset.left + "px;top:" + offset.top+"px\"></div>";
+			
+			clonedDiv = $(divDef).appendTo($(document.body));
+			cell.data(name, clonedDiv);
+		}
+		
+		return clonedDiv;
+	},
+	
+	initCell: function(cell) {
+		if(!cell.data("init")) {
+			cell.data("init", true);
+			
+			cell.data("current", 0);
+			this.getTile(cell, "tile2");
+			this.getTile(cell, "tile");
+		}
+	},
+	
+	displayCell: function(cell, bg) {
+		var div;
+		var divPrev;
+		if(!cell.data("current")) {
+			cell.data("current", 1);
+			
+			divPrev = this.getTile(cell, "tile");
+			div = this.getTile(cell, "tile2");
+		} else {
+			cell.data("current", 0);
+			divPrev = this.getTile(cell, "tile2");
+			div = this.getTile(cell, "tile");
+		}
 		
 		var zIndex = parseInt(divPrev.css("z-index")) + 1;
-		this.maxTileZIndex = Math.max(this.maxTileZIndex, zIndex);
-		div.css("z-index", zIndex);
-		div.css("background", bg);
-	},
-	
-	updateTile: function() {
-		if(this.dirty) {
-			var ajaxViewer = this;
-			var tileWidth = this.tileWidth;
-			var tileHeight = this.tileHeight;
-			var imgUrl = this.imgUrl;
-			var panel = this.panel;
-			
-			if(this.fullImage) {
-				$.each(this.tileMap, function() {
-					var i = $(this)[0];
-					var j = $(this)[1];
-					var row = $("TR:eq("+i+")", panel);
-					var cell = $("TD:eq("+j+")", row);
-					var attr = "url(" + imgUrl + ") -"+j*tileWidth+"px -"+i*tileHeight + "px";
-					
-					ajaxViewer.initCell(cell);
-					ajaxViewer.displayCell(cell, attr);
-				});
-			} else {
-				$.each(this.tileMap, function(index) {
-					var i = $(this)[0];
-					var j = $(this)[1];
-					var offset = index*tileWidth;
-					var attr = "url(" + imgUrl + ") no-repeat -"+offset+"px 0px";
-					var row = $("TR:eq("+i+")", panel);
-					var cell = $("TD:eq("+j+")", row);
-					
-					ajaxViewer.initCell(cell);
-					ajaxViewer.displayCell(cell, attr);
-				});
-			}
-			
-			this.dirty = false;
-		}
-	},
-	
-	heartbeat: function() {
-		this.checkEventQueue();
-		this.checkUpdate();
-	},
-	
-	checkUpdate: function() {
-		if(!this.isDirty())
-			return;
-		
-		if(this.isImageLoaded()) {
-			this.updateTile();
-			var url = this.updateUrl;
-			var ajaxViewer = this;
-
-			window.onStatusNotify(AjaxViewer.STATUS_RECEIVING);
-			$.getScript(url, function(data, textStatus) {
-				if(/^<html>/.test(data)) {
-					ajaxViewer.stop();
-					$(document.body).html(data);
-				} else {
-					eval(data);
-					ajaxViewer.setDirty(true);
-					window.onStatusNotify(AjaxViewer.STATUS_RECEIVED);
-					
-					ajaxViewer.checkUpdate();
-				}
-			});
-		} 
-	},
-	
-	ptInPanel: function(pageX, pageY) {
-		var mainPanel = this.panel;
-		
-		var offset = mainPanel.offset();
-		var x = pageX - offset.left;
-		var y = pageY - offset.top;
-		
-		if(x < 0 || y < 0 || x > mainPanel.width() - 1 || y > mainPanel.height() - 1)
-			return false;
-		return true;
-	},
-	
-	pageToPanel: function(pageX, pageY) {
-		var mainPanel = this.panel;
-		
-		var offset = mainPanel.offset();
-		var x = pageX - offset.left;
-		var y = pageY - offset.top;
-		
-		if(x < 0)
-			x = 0;
-		if(x > mainPanel.width() - 1)
-			x = mainPanel.width() - 1;
-		
-		if(y < 0)
-			y = 0;
-		if(y > mainPanel.height() - 1)
-			y = mainPanel.height() - 1;
-		
-		return { x: Math.ceil(x), y: Math.ceil(y) };
-	},
-	
-	installMouseHook: function() {
-		var ajaxViewer = this;
-		var target = $(document.body);
-		
-		target.mousemove(function(e) {
-			if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
+		this.maxTileZIndex = Math.max(this.maxTileZIndex, zIndex);
+		div.css("z-index", zIndex);
+		div.css("background", bg);
+	},
+	
+	updateTile: function() {
+		if(this.dirty) {
+			var ajaxViewer = this;
+			var tileWidth = this.tileWidth;
+			var tileHeight = this.tileHeight;
+			var imgUrl = this.imgUrl;
+			var panel = this.panel;
+			
+			if(this.fullImage) {
+				$.each(this.tileMap, function() {
+					var i = $(this)[0];
+					var j = $(this)[1];
+					var row = $("TR:eq("+i+")", panel);
+					var cell = $("TD:eq("+j+")", row);
+					var attr = "url(" + imgUrl + ") -"+j*tileWidth+"px -"+i*tileHeight + "px";
+					
+					ajaxViewer.initCell(cell);
+					ajaxViewer.displayCell(cell, attr);
+				});
+			} else {
+				$.each(this.tileMap, function(index) {
+					var i = $(this)[0];
+					var j = $(this)[1];
+					var offset = index*tileWidth;
+					var attr = "url(" + imgUrl + ") no-repeat -"+offset+"px 0px";
+					var row = $("TR:eq("+i+")", panel);
+					var cell = $("TD:eq("+j+")", row);
+					
+					ajaxViewer.initCell(cell);
+					ajaxViewer.displayCell(cell, attr);
+				});
+			}
+			
+			this.dirty = false;
+		}
+	},
+	
+	heartbeat: function() {
+		this.checkEventQueue();
+		this.checkUpdate();
+	},
+	
+	checkUpdate: function() {
+		if(!this.isDirty())
+			return;
+		
+		if(this.isImageLoaded()) {
+			this.updateTile();
+			var url = this.updateUrl;
+			var ajaxViewer = this;
+
+			window.onStatusNotify(AjaxViewer.STATUS_RECEIVING);
+			$.getScript(url, function(data, textStatus) {
+				if(/^<html>/.test(data)) {
+					ajaxViewer.stop();
+					$(document.body).html(data);
+				} else {
+					eval(data);
+					ajaxViewer.setDirty(true);
+					window.onStatusNotify(AjaxViewer.STATUS_RECEIVED);
+					
+					ajaxViewer.checkUpdate();
+				}
+			});
+		} 
+	},
+	
+	ptInPanel: function(pageX, pageY) {
+		var mainPanel = this.panel;
+		
+		var offset = mainPanel.offset();
+		var x = pageX - offset.left;
+		var y = pageY - offset.top;
+		
+		if(x < 0 || y < 0 || x > mainPanel.width() - 1 || y > mainPanel.height() - 1)
+			return false;
+		return true;
+	},
+	
+	pageToPanel: function(pageX, pageY) {
+		var mainPanel = this.panel;
+		
+		var offset = mainPanel.offset();
+		var x = pageX - offset.left;
+		var y = pageY - offset.top;
+		
+		if(x < 0)
+			x = 0;
+		if(x > mainPanel.width() - 1)
+			x = mainPanel.width() - 1;
+		
+		if(y < 0)
+			y = 0;
+		if(y > mainPanel.height() - 1)
+			y = mainPanel.height() - 1;
+		
+		return { x: Math.ceil(x), y: Math.ceil(y) };
+	},
+	
+	installMouseHook: function() {
+		var ajaxViewer = this;
+		var target = $(document.body);
+		
+		target.mousemove(function(e) {
+			if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
 				return true;
-			
-			var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY);  
-			ajaxViewer.onMouseMove(pt.x, pt.y);
-			
-			e.stopPropagation();
-			return false;
-		});
-		
-		target.mousedown(function(e) {
-			ajaxViewer.panel.parent().focus();
-			
-			if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
-				return true;
 			
-			var modifiers = ajaxViewer.getKeyModifiers(e);
-			var whichButton = e.button;
-			
 			var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY);  
-			ajaxViewer.onMouseDown(pt.x, pt.y, whichButton, modifiers);
-			
-			e.stopPropagation();
-			return false;
-		});
-		
-		target.mouseup(function(e) {
-			if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
+			ajaxViewer.onMouseMove(pt.x, pt.y);
+			
+			e.stopPropagation();
+			return false;
+		});
+		
+		target.mousedown(function(e) {
+			ajaxViewer.panel.parent().focus();
+			
+			if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
 				return true;
-			
-			var modifiers = ajaxViewer.getKeyModifiers(e);
-			var whichButton = e.button;
-			
-			var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY);  
+			
+			var modifiers = ajaxViewer.getKeyModifiers(e);
+			var whichButton = e.button;
+			
+			var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY);  
+			ajaxViewer.onMouseDown(pt.x, pt.y, whichButton, modifiers);
+			
+			e.stopPropagation();
+			return false;
+		});
+		
+		target.mouseup(function(e) {
+			if(!ajaxViewer.ptInPanel(e.pageX, e.pageY))
+				return true;
+			
+			var modifiers = ajaxViewer.getKeyModifiers(e);
+			var whichButton = e.button;
+			
+			var pt = ajaxViewer.pageToPanel(e.pageX, e.pageY);  
+
+			ajaxViewer.onMouseUp(pt.x, pt.y, whichButton, modifiers);
+			e.stopPropagation();
+			return false;
+		});
+		
+		// disable browser right-click context menu
+		target.bind("contextmenu", function() { return false; });
+	},
+	
+	uninstallMouseHook : function() {
+		var target = $(document);
+		target.unbind("mousemove");
+		target.unbind("mousedown");
+		target.unbind("mouseup");
+		target.unbind("contextmenu");
+	},
+	
+	requiresDefaultKeyProcess : function(e) {
+		switch(e.which) {
+		case 8 :		// backspace
+		case 9 :		// TAB
+		case 19 :		// PAUSE/BREAK
+		case 20 :		// CAPSLOCK
+		case 27 :		// ESCAPE
+		case 16 :		// SHIFT key
+		case 17 :		// CTRL key
+		case 18 :		// ALT key
+		case 33 :		// PGUP
+		case 34 :		// PGDN
+		case 35 :		// END
+		case 36 :		// HOME
+		case 37 :		// LEFT
+		case 38 :		// UP
+		case 39 :		// RIGHT
+		case 40 :		// DOWN
+			return false;
+		}
+		
+		if(this.getKeyModifiers(e) == AjaxViewer.SHIFT_KEY_MASK)
+			return true;
+		
+		if(this.getKeyModifiers(e) != 0)
+			return false;
+		
+		return true;
+	},
+	
+	installKeyboardHook: function() {
+		var ajaxViewer = this;
+		var target = $(document);
 
-			ajaxViewer.onMouseUp(pt.x, pt.y, whichButton, modifiers);
-			e.stopPropagation();
-			return false;
-		});
-		
-		// disable browser right-click context menu
-		target.bind("contextmenu", function() { return false; });
-	},
-	
-	uninstallMouseHook : function() {
-		var target = $(document);
-		target.unbind("mousemove");
-		target.unbind("mousedown");
-		target.unbind("mouseup");
-		target.unbind("contextmenu");
-	},
-	
-	requiresDefaultKeyProcess : function(e) {
-		switch(e.which) {
-		case 8 :		// backspace
-		case 9 :		// TAB
-		case 19 :		// PAUSE/BREAK
-		case 20 :		// CAPSLOCK
-		case 27 :		// ESCAPE
-		case 16 :		// SHIFT key
-		case 17 :		// CTRL key
-		case 18 :		// ALT key
-		case 33 :		// PGUP
-		case 34 :		// PGDN
-		case 35 :		// END
-		case 36 :		// HOME
-		case 37 :		// LEFT
-		case 38 :		// UP
-		case 39 :		// RIGHT
-		case 40 :		// DOWN
-			return false;
-		}
-		
-		if(this.getKeyModifiers(e) == AjaxViewer.SHIFT_KEY_MASK)
-			return true;
-		
-		if(this.getKeyModifiers(e) != 0)
-			return false;
-		
-		return true;
-	},
-	
-	installKeyboardHook: function() {
-		var ajaxViewer = this;
-		var target = $(document);
-
 		target.keypress(function(e) {
-			ajaxViewer.onKeyPress(e.which, ajaxViewer.getKeyModifiers(e));
-
-			e.stopPropagation();
-			if(ajaxViewer.requiresDefaultKeyProcess(e))
-				return true;
-			
-			e.preventDefault();
-			return false;
-		});
-		
-		target.keydown(function(e) {
+			ajaxViewer.onKeyPress(e.which, ajaxViewer.getKeyModifiers(e));
+
+			e.stopPropagation();
+			if(ajaxViewer.requiresDefaultKeyProcess(e))
+				return true;
+			
+			e.preventDefault();
+			return false;
+		});
+		
+		target.keydown(function(e) {
 			ajaxViewer.onKeyDown(e.which, ajaxViewer.getKeyModifiers(e));
-			
-			e.stopPropagation();
-			if(ajaxViewer.requiresDefaultKeyProcess(e))
-				return true;
-			
-			e.preventDefault();
-			return false;
-		});
-		
-		target.keyup(function(e) {
-			ajaxViewer.onKeyUp(e.which, ajaxViewer.getKeyModifiers(e));
-
-			e.stopPropagation();
-			if(ajaxViewer.requiresDefaultKeyProcess(e))
-				return true;
-			
-			e.preventDefault();
-			return false;
-		});
-	},
-	
-	uninstallKeyboardHook : function() {
-		var target = $(document);
-		target.unbind("keypress");
-		target.unbind("keydown");
-		target.unbind("keyup");
-	},
-	
-	onMouseMove: function(x, y) {
-		this.sendMouseEvent(AjaxViewer.MOUSE_MOVE, x, y, 0, 0);
-	},
-	
-	onMouseDown: function(x, y, whichButton, modifiers) {
-		this.sendMouseEvent(AjaxViewer.MOUSE_DOWN, x, y, whichButton, modifiers);
-	},
-	
-	onMouseUp: function(x, y, whichButton, modifiers) {
-		this.sendMouseEvent(AjaxViewer.MOUSE_UP, x, y, whichButton, modifiers);
-		
-		var curTick = new Date().getTime();
-		if(this.lastClickEvent.time && (curTick - this.lastClickEvent.time < 300)) {
-			this.onMouseDblClick(this.lastClickEvent.x, this.lastClickEvent.y, 
-				this.lastClickEvent.button, this.lastClickEvent.modifiers);
-		}
-		
-		this.lastClickEvent.x = x;
-		this.lastClickEvent.y = y;
-		this.lastClickEvent.button = whichButton;
-		this.lastClickEvent.modifiers = modifiers;
-		this.lastClickEvent.time = curTick;
-	},
-	
-	onMouseDblClick: function(x, y, whichButton, modifiers) {
-		this.sendMouseEvent(AjaxViewer.MOUSE_DBLCLK, x, y, whichButton, modifiers);
-	},
-	
+			
+			e.stopPropagation();
+			if(ajaxViewer.requiresDefaultKeyProcess(e))
+				return true;
+			
+			e.preventDefault();
+			return false;
+		});
+		
+		target.keyup(function(e) {
+			ajaxViewer.onKeyUp(e.which, ajaxViewer.getKeyModifiers(e));
+
+			e.stopPropagation();
+			if(ajaxViewer.requiresDefaultKeyProcess(e))
+				return true;
+			
+			e.preventDefault();
+			return false;
+		});
+	},
+	
+	uninstallKeyboardHook : function() {
+		var target = $(document);
+		target.unbind("keypress");
+		target.unbind("keydown");
+		target.unbind("keyup");
+	},
+	
+	onMouseMove: function(x, y) {
+		this.sendMouseEvent(AjaxViewer.MOUSE_MOVE, x, y, 0, 0);
+	},
+	
+	onMouseDown: function(x, y, whichButton, modifiers) {
+		this.sendMouseEvent(AjaxViewer.MOUSE_DOWN, x, y, whichButton, modifiers);
+	},
+	
+	onMouseUp: function(x, y, whichButton, modifiers) {
+		this.sendMouseEvent(AjaxViewer.MOUSE_UP, x, y, whichButton, modifiers);
+		
+		var curTick = new Date().getTime();
+		if(this.lastClickEvent.time && (curTick - this.lastClickEvent.time < 300)) {
+			this.onMouseDblClick(this.lastClickEvent.x, this.lastClickEvent.y, 
+				this.lastClickEvent.button, this.lastClickEvent.modifiers);
+		}
+		
+		this.lastClickEvent.x = x;
+		this.lastClickEvent.y = y;
+		this.lastClickEvent.button = whichButton;
+		this.lastClickEvent.modifiers = modifiers;
+		this.lastClickEvent.time = curTick;
+	},
+	
+	onMouseDblClick: function(x, y, whichButton, modifiers) {
+		this.sendMouseEvent(AjaxViewer.MOUSE_DBLCLK, x, y, whichButton, modifiers);
+	},
+	
 	onKeyPress: function(code, modifiers) {
 		g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-PRESS: " + code + ", modifers: " + modifiers);
 		
 		this.dispatchKeyboardInput(AjaxViewer.KEY_PRESS, code, modifiers);
-	},
-	
+	},
+	
 	onKeyDown: function(code, modifiers) {
 		g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-DOWN: " + code + ", modifers: " + modifiers);
 		
 		this.dispatchKeyboardInput(AjaxViewer.KEY_DOWN, code, modifiers);
-	},
-	
+	},
+	
 	onKeyUp: function(code, modifiers) {
 		g_logger.log(Logger.LEVEL_WARN, "RAW KEYBOARD EVENT. KEY-UP: " + code + ", modifers: " + modifiers);
 		
@@ -1308,32 +1308,32 @@ AjaxViewer.prototype = {
 				break;
 			}
 		}
-	},
-	
-	getKeyModifiers: function(e) {
-		var modifiers = 0;
-		if(e.altKey)
-			modifiers |= AjaxViewer.ALT_KEY_MASK;
-		
-		if(e.altLeft)
-			modifiers |= AjaxViewer.LEFT_ALT_MASK;
-		
-		if(e.ctrlKey)
-			modifiers |= AjaxViewer.CTRL_KEY_MASK;
-		
-		if(e.ctrlLeft)
-			modifiers |=  AjaxViewer.LEFT_CTRL_MASK;
-		
-		if(e.shiftKey)
-			modifiers |=  AjaxViewer.SHIFT_KEY_MASK;
-		
-		if(e.shiftLeft)
-			modifiers |= AjaxViewer.LEFT_SHIFT_MASK;
-		
-		if(e.metaKey)
-			modifiers |= AjaxViewer.META_KEY_MASK;
-		
-		return modifiers;
-	}
-};
+	},
+	
+	getKeyModifiers: function(e) {
+		var modifiers = 0;
+		if(e.altKey)
+			modifiers |= AjaxViewer.ALT_KEY_MASK;
+		
+		if(e.altLeft)
+			modifiers |= AjaxViewer.LEFT_ALT_MASK;
+		
+		if(e.ctrlKey)
+			modifiers |= AjaxViewer.CTRL_KEY_MASK;
+		
+		if(e.ctrlLeft)
+			modifiers |=  AjaxViewer.LEFT_CTRL_MASK;
+		
+		if(e.shiftKey)
+			modifiers |=  AjaxViewer.SHIFT_KEY_MASK;
+		
+		if(e.shiftLeft)
+			modifiers |= AjaxViewer.LEFT_SHIFT_MASK;
+		
+		if(e.metaKey)
+			modifiers |= AjaxViewer.META_KEY_MASK;
+		
+		return modifiers;
+	}
+};
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/scripts/run.bat
----------------------------------------------------------------------
diff --git a/console-proxy/scripts/run.bat b/console-proxy/scripts/run.bat
index 39655f9..ce6dc40 100644
--- a/console-proxy/scripts/run.bat
+++ b/console-proxy/scripts/run.bat
@@ -1,18 +1,18 @@
-rem  Licensed to the Apache Software Foundation (ASF) under one
-rem  or more contributor license agreements.  See the NOTICE file
-rem  distributed with this work for additional information
-rem  regarding copyright ownership.  The ASF licenses this file
-rem  to you under the Apache License, Version 2.0 (the
-rem  "License"); you may not use this file except in compliance
-rem  with the License.  You may obtain a copy of the License at
-rem  
-rem    http://www.apache.org/licenses/LICENSE-2.0
-rem  
-rem  Unless required by applicable law or agreed to in writing,
-rem  software distributed under the License is distributed on an
-rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem  KIND, either express or implied.  See the License for the
-rem  specific language governing permissions and limitations
-rem  under the License.
-
-java -mx700m -cp cloud-console-proxy.jar;;cloud-console-common.jar;log4j-1.2.15.jar;apache-log4j-extras-1.0.jar;gson-1.3.jar;commons-logging-1.1.1.jar;.;.\conf; com.cloud.consoleproxy.ConsoleProxy %*
+rem  Licensed to the Apache Software Foundation (ASF) under one
+rem  or more contributor license agreements.  See the NOTICE file
+rem  distributed with this work for additional information
+rem  regarding copyright ownership.  The ASF licenses this file
+rem  to you under the Apache License, Version 2.0 (the
+rem  "License"); you may not use this file except in compliance
+rem  with the License.  You may obtain a copy of the License at
+rem  
+rem    http://www.apache.org/licenses/LICENSE-2.0
+rem  
+rem  Unless required by applicable law or agreed to in writing,
+rem  software distributed under the License is distributed on an
+rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem  KIND, either express or implied.  See the License for the
+rem  specific language governing permissions and limitations
+rem  under the License.
+
+java -mx700m -cp cloud-console-proxy.jar;;cloud-console-common.jar;log4j-1.2.15.jar;apache-log4j-extras-1.0.jar;gson-1.3.jar;commons-logging-1.1.1.jar;.;.\conf; com.cloud.consoleproxy.ConsoleProxy %*

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java
----------------------------------------------------------------------
diff --git a/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java b/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java
index a745d0d..cff00b3 100644
--- a/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java
+++ b/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java
@@ -14,53 +14,53 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-package com.cloud.consoleproxy;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+package com.cloud.consoleproxy;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import com.cloud.consoleproxy.util.Logger;
-
-public class AjaxFIFOImageCache {
-	private static final Logger s_logger = Logger.getLogger(AjaxFIFOImageCache.class);
-	
-	private List<Integer> fifoQueue;
-	private Map<Integer, byte[]> cache;
-	private int cacheSize;
+
+public class AjaxFIFOImageCache {
+    private static final Logger s_logger = Logger.getLogger(AjaxFIFOImageCache.class);
+    
+    private List<Integer> fifoQueue;
+    private Map<Integer, byte[]> cache;
+    private int cacheSize;
     private int nextKey = 0;
-	
-	public AjaxFIFOImageCache(int cacheSize) {
-		this.cacheSize = cacheSize;
-		fifoQueue = new ArrayList<Integer>();
-		cache = new HashMap<Integer, byte[]>();
-	}
-	
-	public synchronized void clear() {
-		fifoQueue.clear();
-		cache.clear();
-	}
-	
-	public synchronized int putImage(byte[] image) {
-		while(cache.size() >= cacheSize) {
-			Integer keyToRemove = fifoQueue.remove(0);
-			cache.remove(keyToRemove);
-			
-			if(s_logger.isTraceEnabled())
-				s_logger.trace("Remove image from cache, key: " + keyToRemove);
-		}
-		
-		int key = getNextKey();
-		
-		if(s_logger.isTraceEnabled())
-			s_logger.trace("Add image to cache, key: " + key);
-		
-		cache.put(key, image);
-		fifoQueue.add(key);
-		return key;
-	}
-	
+    
+    public AjaxFIFOImageCache(int cacheSize) {
+        this.cacheSize = cacheSize;
+        fifoQueue = new ArrayList<Integer>();
+        cache = new HashMap<Integer, byte[]>();
+    }
+    
+    public synchronized void clear() {
+        fifoQueue.clear();
+        cache.clear();
+    }
+    
+    public synchronized int putImage(byte[] image) {
+        while(cache.size() >= cacheSize) {
+            Integer keyToRemove = fifoQueue.remove(0);
+            cache.remove(keyToRemove);
+            
+            if(s_logger.isTraceEnabled())
+                s_logger.trace("Remove image from cache, key: " + keyToRemove);
+        }
+        
+        int key = getNextKey();
+        
+        if(s_logger.isTraceEnabled())
+            s_logger.trace("Add image to cache, key: " + key);
+        
+        cache.put(key, image);
+        fifoQueue.add(key);
+        return key;
+    }
+    
     public synchronized byte[] getImage(int key) {
         if (key == 0) {
             key = nextKey;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/0bf8c5a1/console-proxy/src/com/cloud/consoleproxy/AuthenticationException.java
----------------------------------------------------------------------
diff --git a/console-proxy/src/com/cloud/consoleproxy/AuthenticationException.java b/console-proxy/src/com/cloud/consoleproxy/AuthenticationException.java
index aaf8e44..3fa2667 100644
--- a/console-proxy/src/com/cloud/consoleproxy/AuthenticationException.java
+++ b/console-proxy/src/com/cloud/consoleproxy/AuthenticationException.java
@@ -14,20 +14,20 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-package com.cloud.consoleproxy;
-
-public class AuthenticationException extends Exception {
-	private static final long serialVersionUID = -393139302884898842L;
-	public AuthenticationException() {
-		super();
-	}
-	public AuthenticationException(String s) {
-		super(s);
-	}
-	public AuthenticationException(String message, Throwable cause) {
-		super(message, cause);
-	}
-	 public AuthenticationException(Throwable cause) {
-		 super(cause);
-	 }
+package com.cloud.consoleproxy;
+
+public class AuthenticationException extends Exception {
+    private static final long serialVersionUID = -393139302884898842L;
+    public AuthenticationException() {
+        super();
+    }
+    public AuthenticationException(String s) {
+        super(s);
+    }
+    public AuthenticationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+     public AuthenticationException(Throwable cause) {
+         super(cause);
+     }
 }
\ No newline at end of file