From 8004e899d83f0deb42ef2bc7ed10d9e25f643b28 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 30 Sep 2010 19:54:42 -0700 Subject: [PATCH] new UI - instance page, router page - keep getting the newest screenshot(image) of console proxy. --- ui/new/jsp/instance.jsp | 6 +++++- ui/new/jsp/router.jsp | 8 ++++++-- ui/new/scripts/cloud.core2.js | 28 ++++++++++++++++++++++++---- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/ui/new/jsp/instance.jsp b/ui/new/jsp/instance.jsp index 4f30a8420ab..50066ccf9be 100644 --- a/ui/new/jsp/instance.jsp +++ b/ui/new/jsp/instance.jsp @@ -31,7 +31,11 @@
-
+
+
+
+
diff --git a/ui/new/jsp/router.jsp b/ui/new/jsp/router.jsp index ba673a6417c..8607e59d9c5 100644 --- a/ui/new/jsp/router.jsp +++ b/ui/new/jsp/router.jsp @@ -49,8 +49,12 @@
-
-
+
+
+
+
+
diff --git a/ui/new/scripts/cloud.core2.js b/ui/new/scripts/cloud.core2.js index ee767ffa922..942814a1ea3 100644 --- a/ui/new/scripts/cloud.core2.js +++ b/ui/new/scripts/cloud.core2.js @@ -704,10 +704,30 @@ function setViewConsoleAction(jsonObj, $detailsTab) { $detailsTab.find("#vm_action_view_console").unbind("click"); } else if (jsonObj.state == 'Running') { -// $detailsTab.find("#vm_action_view_console").data("imgUrl", "console?cmd=thumbnail&vm=" + jsonObj.id + "&w=144&h=110"); -// var imgUrl = "console?cmd=thumbnail&vm=" + jsonObj.id + "&w=144&h=110"; -// var time = new Date(); -// $("#vm_action_view_console").css("background", "url("+imgUrl+"&t="+time.getTime()+")"); + + var imgUrl = "console?cmd=thumbnail&vm=" + jsonObj.id + "&w=144&h=110"; + imgUrl = "http://localhost:8080/client/" + imgUrl; //temporary hack. This line will be removed after new UI code (/ui/new/*) moves to /ui/* + var time = new Date(); + + $("#vm_action_view_console #box0").css("background", "url("+imgUrl+"&t="+time.getTime()+")"); + + //??? + var index = 0; + $detailsTab.everyTime(2000, function() { + var time = new Date(); + //$("#vm_action_view_console").css("background", "url("+imgUrl+"&t="+time.getTime()+")"); + + if ((index % 2) == 0) { + $("#vm_action_view_console #box0").hide().css("background", "url("+imgUrl+"&t="+time.getTime()+")"); + $("#vm_action_view_console #box1").show(); + } else { + $("#vm_action_view_console #box1").hide().css("background", "url("+imgUrl+"&t="+time.getTime()+")"); + $("#vm_action_view_console #box0").show(); + } + index++; + + }, 0); + //??? // Console Proxy UI $detailsTab.find("#vm_action_view_console").data("proxyUrl", "console?cmd=access&vm=" + jsonObj.id).data("vmId",jsonObj.id).click(function(event) {