Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -36,9 +33,7 @@ <h3 class="box-title">Configure</h3>
</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>
Expand Down
13 changes: 2 additions & 11 deletions eagle-server/src/main/webapp/app/dev/public/js/ctrls/metricCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down