-
-
+
+
-
diff --git a/src/app/panels/filtering/module.js b/src/app/panels/filtering/module.js
index e1ca31b2b68..d2405827df4 100644
--- a/src/app/panels/filtering/module.js
+++ b/src/app/panels/filtering/module.js
@@ -26,10 +26,6 @@ function (angular, app, _) {
};
_.defaults($scope.panel,_d);
- $scope.$on('filter', function() {
- $scope.row.notice = true;
- });
-
$scope.init = function() {
$scope.filterSrv = filterSrv;
};
@@ -39,22 +35,21 @@ function (angular, app, _) {
};
$scope.applyFilter = function(filter) {
- filterSrv.list[id].editing=undefined;
- $scope.refresh()
+ graphiteSrv.metricFindQuery(filter.query)
+ .then(function (results) {
+ filter.editing=undefined;
+ filter.options = results;
+ });
};
$scope.add = function() {
- filterSrv.set({
- editing : true,
+ filterSrv.add({
type : 'filter',
name : 'filter name',
+ editing : true,
value : '*',
query : 'metric.path.query.*',
- },undefined,true);
- };
-
- $scope.getMetricFilterOptions = function(filter) {
- return graphiteSrv.metricFindQuery(filter.query);
+ });
};
$scope.refresh = function() {
@@ -65,22 +60,5 @@ function (angular, app, _) {
$rootScope.$broadcast('render');
};
- $scope.edit_key = function(key) {
- return !_.contains(['type','id','active','editing', 'value'],key);
- };
-
- $scope.show_key = function(key) {
- return !_.contains(['type','id','active','editing', 'name', 'query', 'value'],key);
- };
-
- $scope.isEditable = function(filter) {
- var uneditable = ['time'];
- if(_.contains(uneditable,filter.type)) {
- return false;
- } else {
- return true;
- }
- };
-
});
});
\ No newline at end of file
diff --git a/src/app/services/filterSrv.js b/src/app/services/filterSrv.js
index db954e5855b..8628a3ea966 100644
--- a/src/app/services/filterSrv.js
+++ b/src/app/services/filterSrv.js
@@ -26,14 +26,15 @@ define([
_.defaults(dashboard.current.services.filter, _d);
self.list = dashboard.current.services.filter.list;
self.time = dashboard.current.services.filter.time;
+
};
this.add = function(filter) {
- self.list.add(filter);
+ self.list.push(filter);
};
this.remove = function(filter) {
- self.list = dashboard.current.services.filters = _.without(self.list, filter);
+ self.list = dashboard.current.services.filter.list = _.without(self.list, filter);
if(!$rootScope.$$phase) {
$rootScope.$apply();