From 90ef04ffe5b57c5c4d0c7e6ae7ad67967cddf6ce Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 17 Feb 2011 10:55:37 -0800 Subject: [PATCH] bug 8526: ISO page - Delete ISO action - avoid calling listIsos after delete action succeeds. --- ui/jsp/iso.jsp | 36 ++++++++++++++++++++++++------------ ui/scripts/cloud.core.iso.js | 36 +++++++++++++++++++++--------------- 2 files changed, 45 insertions(+), 27 deletions(-) diff --git a/ui/jsp/iso.jsp b/ui/jsp/iso.jsp index 57847af1748..8f33575e22d 100644 --- a/ui/jsp/iso.jsp +++ b/ui/jsp/iso.jsp @@ -86,7 +86,19 @@ dictionary = { +
+
+
+ :
+
+
+
+
+
+
+ +
:
@@ -98,7 +110,7 @@ dictionary = {
-
+
:
@@ -111,7 +123,7 @@ dictionary = {
-
+
:
@@ -121,7 +133,7 @@ dictionary = {
-
+
:
@@ -131,7 +143,7 @@ dictionary = {
-
+
:
@@ -146,7 +158,7 @@ dictionary = {
-
+
:
@@ -161,7 +173,7 @@ dictionary = {
-
+
:
@@ -171,7 +183,7 @@ dictionary = {
-
+
:
@@ -183,7 +195,7 @@ dictionary = {
-
+
:
@@ -193,7 +205,7 @@ dictionary = {
-
+
:
@@ -203,7 +215,7 @@ dictionary = {
-
+
:
@@ -213,7 +225,7 @@ dictionary = {
-
+
:
@@ -223,7 +235,7 @@ dictionary = {
-
+
:
diff --git a/ui/scripts/cloud.core.iso.js b/ui/scripts/cloud.core.iso.js index 5ac75f32e9f..ef5c91980da 100644 --- a/ui/scripts/cloud.core.iso.js +++ b/ui/scripts/cloud.core.iso.js @@ -332,6 +332,7 @@ function isoJsonToDetailsTab() { $thisTab.find("#id").text(fromdb(jsonObj.id)); $thisTab.find("#zonename").text(fromdb(jsonObj.zonename)); + $thisTab.find("#zoneid").text(fromdb(jsonObj.zoneid)); $thisTab.find("#name").text(fromdb(jsonObj.name)); $thisTab.find("#name_edit").val(fromdb(jsonObj.name)); @@ -342,24 +343,17 @@ function isoJsonToDetailsTab() { $thisTab.find("#ostypename_edit").val(fromdb(jsonObj.ostypeid)); $thisTab.find("#account").text(fromdb(jsonObj.account)); $thisTab.find("#domain").text(fromdb(jsonObj.domain)); - - /* - var status = "Ready"; - if (jsonObj.isready == false) - status = fromdb(jsonObj.status); - setTemplateStateInRightPanel(status, $thisTab.find("#status")); - */ - + + + //refresh status field every 2 seconds if ISO is in download progress var timerKey = "isoDownloadProgress"; - $("body").stopTime(timerKey); //stop timer on previously selected middle menu item in ISO page - + $("body").stopTime(timerKey); //stop timer on previously selected middle menu item in ISO page if(jsonObj.isready == true){ setTemplateStateInRightPanel("Ready", $thisTab.find("#status")); $("#progressbar_container").hide(); } else { - $("#progressbar_container").show(); - + $("#progressbar_container").show(); setTemplateStateInRightPanel(fromdb(jsonObj.status), $thisTab.find("#status")); var progressBarValue = 0; if(jsonObj.status != null && jsonObj.status.indexOf("%") != -1) { //e.g. jsonObj.status == "95% Downloaded" @@ -381,6 +375,7 @@ function isoJsonToDetailsTab() { ) } + if(jsonObj.size != null) $thisTab.find("#size").text(convertBytes(parseInt(jsonObj.size))); else @@ -514,6 +509,7 @@ function isoClearDetailsTab() { $thisTab.find("#id").text(""); $thisTab.find("#zonename").text(""); + $thisTab.find("#zoneid").text(""); $thisTab.find("#name").text(""); $thisTab.find("#name_edit").val(""); @@ -549,14 +545,24 @@ var isoActionMap = { asyncJobResponse: "deleteisosresponse", dialogBeforeActionFn: doDeleteIso, inProcessText: "label.action.delete.ISO.processing", - afterActionSeccessFn: function(json, $midmenuItem1, id){ + afterActionSeccessFn: function(json, $midmenuItem1, id){ + var jsonObj = $midmenuItem1.data("jsonObj"); + $midmenuItem1.remove(); + if((jsonObj.id == $("#right_panel_content").find("#tab_content_details").find("#id").text()) && (jsonObj.zoneid == $("#right_panel_content").find("#tab_content_details").find("#zoneid").text())) { + clearRightPanel(); + isoClearRightPanel(); + } + + /* $midmenuItem1.slideUp("slow", function() { + var jsonObj = $midmenuItem1.data("jsonObj"); $(this).remove(); - if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) { + if((jsonObj.id == $("#right_panel_content").find("#tab_content_details").find("#id").text()) && (jsonObj.zoneid == $("#right_panel_content").find("#tab_content_details").find("#zoneid").text())) { clearRightPanel(); isoClearRightPanel(); } - }); + }); + */ } }, "label.action.copy.ISO": {