Repository: eagle
Updated Branches:
  refs/heads/master a4f953516 -> a51bf5e1a


[EAGLE-1053] Support typeahead in Eagle UI

https://issues.apache.org/jira/browse/EAGLE-1053

Support typeahead in Eagle UI (metric preview page)

Author: zombieJ <[email protected]>

Closes #957 from zombieJ/EAGLE-1053.


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

Branch: refs/heads/master
Commit: a51bf5e1ab054fbd03d7679e48847b9caa85ebfc
Parents: a4f9535
Author: zombieJ <[email protected]>
Authored: Wed Jun 21 13:21:05 2017 +0800
Committer: Zhao, Qingwen <[email protected]>
Committed: Wed Jun 21 13:21:05 2017 +0800

----------------------------------------------------------------------
 .../main/webapp/app/dev/partials/metric/preview.html   |  7 +------
 .../main/webapp/app/dev/public/js/ctrls/metricCtrl.js  | 13 ++-----------
 2 files changed, 3 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/a51bf5e1/eagle-server/src/main/webapp/app/dev/partials/metric/preview.html
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/partials/metric/preview.html 
b/eagle-server/src/main/webapp/app/dev/partials/metric/preview.html
index 9957c3b..3578500 100644
--- a/eagle-server/src/main/webapp/app/dev/partials/metric/preview.html
+++ b/eagle-server/src/main/webapp/app/dev/partials/metric/preview.html
@@ -21,9 +21,6 @@
                <div class="box box-primary">
                        <div class="box-header with-border">
                                <h3 class="box-title">Configure</h3>
-                               <div class="box-tools pull-right">
-                                       <input class="form-control input-sm" 
type="text" placeholder="Metric Filter" ng-model="metricFilter" 
ng-change="updateMetricFilter()" />
-                               </div>
                        </div>
                        <div class="box-body">
                                <div class="form-group">
@@ -36,9 +33,7 @@
                                </div>
                                <div class="form-group">
                                        <label>Metric Name</label>
-                                       <select class="form-control" 
ng-model="metricName">
-                                               <option ng-repeat="metric in 
metricList track by metric">{{metric}}</option>
-                                       </select>
+                                       <input type="text" class="form-control" 
ng-model="metricName" uib-typeahead="state for state in metricList | 
filter:$viewValue | limitTo:8" />
                                </div>
                                <div class="form-group">
                                        <label>Groups</label>

http://git-wip-us.apache.org/repos/asf/eagle/blob/a51bf5e1/eagle-server/src/main/webapp/app/dev/public/js/ctrls/metricCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/metricCtrl.js 
b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/metricCtrl.js
index bb50de9..e2a32e5 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/metricCtrl.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/metricCtrl.js
@@ -40,27 +40,18 @@
 
                $scope.commonOption = {};
 
-               $scope.originMetricList = $scope.metricList = 
[$scope.metricName];
+               $scope.metricList = [$scope.metricName];
                CompatibleEntity.groups({
                        query: 'MetricSchemaService',
                        groups: 'metricName',
                        fields: 'count',
                        limit: 9999,
                })._promise.then(function (res) {
-                       $scope.originMetricList = $.map(res.data.obj, function 
(obj) {
+                       $scope.metricList = $.map(res.data.obj, function (obj) {
                                return obj.key[0];
                        }).sort();
-                       $scope.updateMetricFilter();
                });
 
-               $scope.updateMetricFilter = function () {
-                       var filter = $scope.metricFilter.toUpperCase();
-
-                       $scope.metricList = $.grep($scope.originMetricList, 
function (name) {
-                               return name.toUpperCase().indexOf(filter) !== 
-1;
-                       });
-               };
-
                $scope.loadSeries = function() {
                        $scope.currentMetricName = $scope.metricName;
 

Reply via email to