diff --git a/src/app/controllers/metricKeys.js b/src/app/controllers/metricKeys.js index 14e3b86a308..6a6e10fbd87 100644 --- a/src/app/controllers/metricKeys.js +++ b/src/app/controllers/metricKeys.js @@ -16,6 +16,43 @@ function (angular, _, config) { $scope.metricCounter = 0; }; + $scope.createIndex = function () { + $scope.errorText = null; + $scope.infoText = null; + + deleteIndex() + .then(createIndex) + .then(function () { + $scope.infoText = "Index created!"; + }) + .then(null, function (err) { + $scope.errorText = angular.toJson(err); + }); + }; + + $scope.loadMetricsFromPath = function() { + $scope.errorText = null; + $scope.infoText = null; + $scope.metricCounter = 0; + + return loadMetricsRecursive($scope.metricPath) + .then(function() { + $scope.infoText = "Indexing completed!"; + }, function(err) { + $scope.errorText = "Error: " + err; + }); + }; + + $scope.loadAll = function() { + return $http.get(config.graphiteUrl + "/metrics/index.json") + .then(function (data) { + + }) + .then(null, function(err) { + $scope.errorText = "Failed to fetch index.json metrics file from graphite: " + err; + }); + }; + function deleteIndex() { var deferred = $q.defer(); @@ -57,10 +94,6 @@ function (angular, _, config) { metricKey: { properties: { metricPath: { -/* type: "string", - index: "analyzed", - index_analyzer: "metric_path_ngram" -*/ type: "multi_field", fields: { "metricPath": { type: "string", index: "analyzed", index_analyzer: "standard" }, @@ -73,33 +106,6 @@ function (angular, _, config) { }); } - $scope.createIndex = function () { - $scope.errorText = null; - $scope.infoText = null; - - deleteIndex() - .then(createIndex) - .then(function () { - $scope.infoText = "Index created!"; - }) - .then(null, function (err) { - $scope.errorText = angular.toJson(err); - }); - }; - - $scope.loadMetricsFromPath = function () { - $scope.errorText = null; - $scope.infoText = null; - $scope.metricCounter = 0; - - return loadMetricsRecursive($scope.metricPath) - .then(function() { - $scope.infoText = "Indexing completed!"; - }, function(err) { - $scope.errorText = "Error: " + err; - }); - }; - function receiveMetric(result) { var data = result.data; if (!data || data.length === 0) { diff --git a/src/app/panels/graphite/editor.html b/src/app/panels/graphite/editor.html index be93d66691b..06ab8844cd8 100644 --- a/src/app/panels/graphite/editor.html +++ b/src/app/panels/graphite/editor.html @@ -4,7 +4,7 @@
- +
diff --git a/src/app/panels/graphite/module.js b/src/app/panels/graphite/module.js index a7cf612c7f9..69ef1512d5e 100644 --- a/src/app/panels/graphite/module.js +++ b/src/app/panels/graphite/module.js @@ -229,8 +229,8 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv, RQ) { } }; - $scope.typeAheadSource = function (str) { - return ["test", "asd", "testing2" + str]; + $scope.typeAheadSource = function () { + return ["test", "asd", "testing2"]; }; $scope.remove_panel_from_row = function(row, panel) {