cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: CS-15329: Instances with Error states appear in Instances list after creating.
Date Tue, 26 Jun 2012 23:38:06 GMT
Updated Branches:
  refs/heads/master cefbbb385 -> 367e32adb


CS-15329: Instances with Error states appear in Instances list after creating.


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

Branch: refs/heads/master
Commit: 367e32adbc294c52a991866d1cf6e94b3d473201
Parents: cefbbb3
Author: olgasmola <olya.smola@gmail.com>
Authored: Mon Jun 25 14:41:47 2012 +0300
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Tue Jun 26 16:28:59 2012 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js           |   15 ++++++++++++++-
 ui/scripts/sharedFunctions.js     |    9 ++++++++-
 ui/scripts/ui/widgets/listView.js |   12 +++++++++++-
 3 files changed, 33 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/367e32ad/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 4a14360..969a657 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -541,6 +541,7 @@
                   dataType: "json",
                   success: function(json) {
                     var jid = json.deployvirtualmachineresponse.jobid;
+					var vmid = json.deployvirtualmachineresponse.id;
                     args.response.success(
                       {_custom:
                        {jobId: jid,
@@ -552,7 +553,19 @@
                         },
                         getActionFilter: function() {
                           return vmActionfilter;
-                        }
+                        },
+						getUpdatedData: function() {
+							var item;
+							$.ajax({
+							  url: createURL("listVirtualMachines&id="+vmid),
+							  dataType: "json",
+							  async: false,
+							  success: function(json) {
+								item = json.listvirtualmachinesresponse.virtualmachine[0];
+							  }
+							});
+							return item;
+						}
                        }
                       }
                     );

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/367e32ad/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index b1d771c..8fc5c78 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -86,7 +86,14 @@ var pollAsyncJobResult = function(args) {
         }
         else if (result.jobstatus == 2) { // Failed          
           var msg = (result.jobresult.errortext == null)? "": result.jobresult.errortext;
-          args.error({message: msg});
+		  if (args._custom.getUpdatedData != null && args._custom.getActionFilter != null)
{
+			args.error({message: msg, updatedData: args._custom.getUpdatedData(), actionFilter: args._custom.getActionFilter()});
+		  } else if (args._custom.getUpdatedData != null && args._custom.getActionFilter
== null) {
+			args.error({message: msg, updatedData: args._custom.getUpdatedData()});
+		  }
+		  else {
+			args.error({message: msg});
+		  }
         }
       }
     },

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/367e32ad/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index 92a8624..c893b1f 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -97,7 +97,17 @@
 
                 // Error
                 function(args) {
-                  $item.remove();
+					if (args && args.updatedData) {
+						if ($item.is(':visible') && !isHeader) {
+							replaceItem(
+							  $item,
+							  args.updatedData,
+							  args.actionFilter
+							);
+						}
+					} else {
+						$item.remove();
+					}
                 }
               );
             }


Mime
View raw message