You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/01/14 21:07:32 UTC

[4/4] git commit: Snapshots list UI: Support filtering by instance

Updated Branches:
  refs/heads/ui-quick-view-v2 d9689395c -> e52f1b6a7


Snapshots list UI: Support filtering by instance


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

Branch: refs/heads/ui-quick-view-v2
Commit: e52f1b6a7c41df7d311708463cbc7b1170f97df7
Parents: c95e896
Author: Brian Federle <br...@citrix.com>
Authored: Mon Jan 14 12:07:11 2013 -0800
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Jan 14 12:07:11 2013 -0800

----------------------------------------------------------------------
 ui/scripts/storage.js |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e52f1b6a/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index dd81378..98ba396 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1186,6 +1186,7 @@
 					
           dataProvider: function(args) {					  
 						var data = {};
+            var instanceVolumeIds = [];
 						listViewDataProvider(args, data);		
             
             if(args.context != null) {
@@ -1193,6 +1194,21 @@
 							  $.extend(data, {
 								  volumeid: args.context.volumes[0].id
 								});                
+              } else if (args.context.instances) {
+                $.ajax({
+                  url: createURL('listVolumes'),
+                  data: {
+                    virtualmachineid: args.context.instances[0].id,
+                    listAll: true
+                  },
+                  async: false,
+                  success: function(json) {
+                    instanceVolumeIds = $.map(json.listvolumesresponse.volume, function(volume) {
+                      return volume.id;
+                    })
+                  }
+                });
+                data.volumeid = instanceVolumeIds.join(',');
               }
             }