cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtutkow...@apache.org
Subject [28/50] git commit: updated refs/heads/sf-plugins to bcf1c72
Date Tue, 28 Jul 2015 20:15:14 GMT
Support filtering volumes by name (in a case-insensitive fashion)


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

Branch: refs/heads/sf-plugins
Commit: 32e0e2bd36659c0cf0224c69d1673a01994864de
Parents: 2ef0de9
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Fri Jul 10 13:49:02 2015 -0600
Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)>
Committed: Tue Jul 28 13:42:42 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfSharedVolume/sfSharedVolume.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/32e0e2bd/ui/plugins/sfSharedVolume/sfSharedVolume.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfSharedVolume/sfSharedVolume.js b/ui/plugins/sfSharedVolume/sfSharedVolume.js
index f2182f6..6d4c791 100644
--- a/ui/plugins/sfSharedVolume/sfSharedVolume.js
+++ b/ui/plugins/sfSharedVolume/sfSharedVolume.js
@@ -19,9 +19,24 @@
         dataProvider: function(args) {
           plugin.ui.apiCall('listSolidFireVolumes', {
             success: function(json) {
+              var sfvolumesfiltered = [];
               var sfvolumes = json.listsolidfirevolumesresponse.sfvolume;
+              var search = args.filterBy.search.value == null ? "" : args.filterBy.search.value.toLowerCase();
 
-              args.response.success({ data: sfvolumes });
+              if (search == "") {
+                sfvolumesfiltered = sfvolumes;
+              }
+              else {
+                for (i = 0; i < sfvolumes.length; i++) {
+                  sfvolume = sfvolumes[i];
+
+                  if (sfvolume.name.toLowerCase().indexOf(search) > -1 ) {
+                    sfvolumesfiltered.push(sfvolume);
+                  }
+                }
+              }
+
+              args.response.success({ data: sfvolumesfiltered });
             },
             error: function(errorMessage) {
               args.response.error(errorMessage);


Mime
View raw message