ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: # IGNITE-843 Fixed search.
Date Tue, 22 Sep 2015 10:19:17 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 b1e309171 -> 10b0c878a


# IGNITE-843 Fixed search.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/10b0c878
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/10b0c878
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/10b0c878

Branch: refs/heads/ignite-843
Commit: 10b0c878a1901155bab56623633629ed136a3ec0
Parents: b1e3091
Author: Andrey <anovikov@gridgain.com>
Authored: Tue Sep 22 17:19:21 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Sep 22 17:19:21 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/common-module.js    | 58 ++++++++++++++++++++
 .../src/main/js/views/includes/controls.jade    |  2 +-
 2 files changed, 59 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/10b0c878/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 4d21341..d90bb9b 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -1506,6 +1506,64 @@ controlCenterModule.filter('displayValue', function () {
     }
 });
 
+controlCenterModule.filter('clustersSearch', function() {
+    return function(array, query) {
+        if (!angular.isUndefined(array) && !angular.isUndefined(query) &&
!angular.isUndefined(query.$)) {
+            var filtredArray = [];
+
+            var matchString = query.$.toLowerCase();
+
+            angular.forEach(array, function (row) {
+                var label = (row.name + ', ' + row.discovery.kind).toLowerCase();
+
+                if (label.indexOf(matchString) >= 0)
+                    filtredArray.push(row);
+            });
+
+            return filtredArray;
+        } else
+            return array;
+    }
+});
+
+controlCenterModule.filter('cachesSearch', function() {
+    return function(array, query) {
+        if (!angular.isUndefined(array) && !angular.isUndefined(query) &&
!angular.isUndefined(query.$)) {
+            var filtredArray = [];
+
+            var matchString = query.$.toLowerCase();
+
+            angular.forEach(array, function (row) {
+                var label = (row.name + ', ' + row.cacheMode + ', ' + atomicityMode).toLowerCase();
+
+                if (label.indexOf(matchString) >= 0)
+                    filtredArray.push(row);
+            });
+
+            return filtredArray;
+        } else
+            return array;
+    }
+});
+
+controlCenterModule.filter('metadatasSearch', function() {
+    return function(array, query) {
+        if (!angular.isUndefined(array) && !angular.isUndefined(query) &&
!angular.isUndefined(query.$)) {
+            var filtredArray = [];
+
+            var matchString = query.$.toLowerCase();
+
+            angular.forEach(array, function (row) {
+                if (row.valueType.toLowerCase().indexOf(matchString) >= 0)
+                    filtredArray.push(row);
+            });
+
+            return filtredArray;
+        } else
+            return array;
+    }
+});
+
 // Directive to enable validation for IP addresses.
 controlCenterModule.directive('ipaddress', function () {
     const ip = '(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])';

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b0c878/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index 1bd8474..6a2995b 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -435,7 +435,7 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
 
 mixin main-table(title,  rows, focusId, click, rowTemplate)
     .padding-dflt(ng-show='#{rows} && #{rows}.length > 0')
-        table.links(st-table='displayedRows' st-safe-src='#{rows}')
+        table.links(st-set-filter='#{rows}Search' st-table='displayedRows' st-safe-src='#{rows}')
             thead
                 tr
                     th


Mime
View raw message