You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2015/09/19 03:31:28 UTC

[22/50] git commit: updated refs/heads/sf-plugins to 157efc3

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/9ecc358a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9ecc358a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9ecc358a

Branch: refs/heads/sf-plugins
Commit: 9ecc358a2d99740fda1cdd2107453d77305a8519
Parents: 6456534
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Fri Jul 10 13:49:02 2015 -0600
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Fri Sep 18 19:28:20 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/9ecc358a/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);