From 02bec9360c82bd828f32aebdc7b22257498e076d Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 4 May 2011 11:51:03 +0200 Subject: [PATCH] Feature #564: Update vnc server and client side. Server side: corrected path to vnc proxy script. Enabled returning the proxy details when we believe it is running, instead of an error saying it is running. Client side: vms-plugin loads dynamically the noVNC web client. This way someone may actually change it into a different client without having to modify a hardcoded '; + document.write(script); +} +loadVNC(); var vms_tab_content = '
\ diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 912a71f982..83a01f550d 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -172,7 +172,7 @@ post '/vm/:id/stopvnc' do return [403, OpenNebula::Error.new(msg).to_json] end - rc = @SunstoneServer.stopvnc(vm_id, vnc_hash[vm_id]) + rc = @SunstoneServer.stopvnc(vm_id, vnc_hash[vm_id][:pipe]) if rc[0] == 200 session['vnc'].delete(vm_id) end @@ -188,14 +188,17 @@ post '/vm/:id/startvnc' do if !vnc_hash session['vnc']= {} elsif vnc_hash[vm_id] - msg = "There is a VNC server running for this VM" - return [403, OpenNebula::Error.new(msg).to_json] + #return existing information + info = vnc_hash[vm_id].clone + info.delete(:pipe) + + return [200, info.to_json] end rc = @SunstoneServer.startvnc(vm_id) if rc[0] == 200 info = rc[1] - session['vnc'][vm_id] = info[:pipe] + session['vnc'][vm_id] = info.clone info.delete(:pipe) [200, info.to_json] diff --git a/src/sunstone/templates/index.html b/src/sunstone/templates/index.html index 4f09996395..ba030497ea 100644 --- a/src/sunstone/templates/index.html +++ b/src/sunstone/templates/index.html @@ -16,7 +16,7 @@ - +