Explorar o código

moved all graphite code into features/graphite

Torkel Ödegaard %!s(int64=11) %!d(string=hai) anos
pai
achega
0a4ccdcef2

+ 0 - 1
src/app/controllers/all.js

@@ -7,7 +7,6 @@ define([
   './pulldown',
   './search',
   './metricKeys',
-  './graphiteTarget',
   './graphiteImport',
   './influxTargetCtrl',
   './playlistCtrl',

+ 1 - 1
src/app/directives/addGraphiteFunc.js

@@ -3,7 +3,7 @@ define([
   'app',
   'lodash',
   'jquery',
-  '../services/graphite/gfunc',
+  '../features/graphite/gfunc',
 ],
 function (angular, app, _, $, gfunc) {
   'use strict';

+ 1 - 0
src/app/features/all.js

@@ -1,3 +1,4 @@
 define([
   './panellinkeditor/module',
+  './graphite/datasource',
 ], function () {});

+ 4 - 3
src/app/services/graphite/graphiteDatasource.js → src/app/features/graphite/datasource.js

@@ -4,7 +4,8 @@ define([
   'jquery',
   'config',
   'kbn',
-  'moment'
+  'moment',
+  './queryCtrl',
 ],
 function (angular, _, $, config, kbn, moment) {
   'use strict';
@@ -17,12 +18,12 @@ function (angular, _, $, config, kbn, moment) {
       this.type = 'graphite';
       this.basicAuth = datasource.basicAuth;
       this.url = datasource.url;
-      this.editorSrc = 'app/partials/graphite/editor.html';
+      this.editorSrc = 'app/features/graphite/partials/query.editor.html';
       this.name = datasource.name;
       this.render_method = datasource.render_method || 'POST';
       this.supportAnnotations = true;
       this.supportMetrics = true;
-      this.annotationEditorSrc = 'app/partials/graphite/annotation_editor.html';
+      this.annotationEditorSrc = 'app/features/graphite/partials/annotation.editor.html';
       this.cacheTimeout = datasource.cacheTimeout;
       this.withCredentials = datasource.withCredentials;
     }

+ 0 - 0
src/app/services/graphite/gfunc.js → src/app/features/graphite/gfunc.js


+ 0 - 0
src/app/services/graphite/lexer.js → src/app/features/graphite/lexer.js


+ 0 - 0
src/app/services/graphite/parser.js → src/app/features/graphite/parser.js


+ 0 - 0
src/app/partials/graphite/annotation_editor.html → src/app/features/graphite/partials/annotations.editor.html


+ 1 - 1
src/app/partials/graphite/editor.html → src/app/features/graphite/partials/query.editor.html

@@ -3,7 +3,7 @@
 	<div  ng-repeat="target in panel.targets"
         class="grafana-target"
         ng-class="{'grafana-target-hidden': target.hide}"
-        ng-controller="GraphiteTargetCtrl"
+        ng-controller="GraphiteQueryCtrl"
         ng-init="init()">
 
     <div class="grafana-target-inner">

+ 3 - 3
src/app/controllers/graphiteTarget.js → src/app/features/graphite/queryCtrl.js

@@ -2,8 +2,8 @@ define([
   'angular',
   'lodash',
   'config',
-  '../services/graphite/gfunc',
-  '../services/graphite/parser'
+  './gfunc',
+  './parser'
 ],
 function (angular, _, config, gfunc, Parser) {
   'use strict';
@@ -11,7 +11,7 @@ function (angular, _, config, gfunc, Parser) {
   var module = angular.module('grafana.controllers');
   var targetLetters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O'];
 
-  module.controller('GraphiteTargetCtrl', function($scope, $sce, templateSrv) {
+  module.controller('GraphiteQueryCtrl', function($scope, $sce, templateSrv) {
 
     $scope.init = function() {
       $scope.target.target = $scope.target.target || '';

+ 0 - 1
src/app/services/datasourceSrv.js

@@ -2,7 +2,6 @@ define([
   'angular',
   'lodash',
   'config',
-  './graphite/graphiteDatasource',
   './influxdb/influxdbDatasource',
   './opentsdb/opentsdbDatasource',
   './elasticsearch/es-datasource',

+ 1 - 1
src/test/specs/gfunc-specs.js

@@ -1,5 +1,5 @@
 define([
-  'services/graphite/gfunc'
+  'features/graphite/gfunc'
 ], function(gfunc) {
   'use strict';
 

+ 1 - 1
src/test/specs/graphiteDatasource-specs.js

@@ -1,6 +1,6 @@
 define([
   'helpers',
-  'services/graphite/graphiteDatasource'
+  'features/graphite/datasource'
 ], function(helpers) {
   'use strict';
 

+ 4 - 4
src/test/specs/graphiteTargetCtrl-specs.js

@@ -1,16 +1,16 @@
 define([
   'helpers',
-  'services/graphite/gfunc',
-  'controllers/graphiteTarget'
+  'features/graphite/gfunc',
+  'features/graphite/queryCtrl'
 ], function(helpers, gfunc) {
   'use strict';
 
-  describe('GraphiteTargetCtrl', function() {
+  describe('GraphiteQueryCtrl', function() {
     var ctx = new helpers.ControllerTestContext();
 
     beforeEach(module('grafana.controllers'));
     beforeEach(ctx.providePhase());
-    beforeEach(ctx.createControllerPhase('GraphiteTargetCtrl'));
+    beforeEach(ctx.createControllerPhase('GraphiteQueryCtrl'));
 
     beforeEach(function() {
       ctx.scope.target = {

+ 1 - 1
src/test/specs/lexer-specs.js

@@ -1,5 +1,5 @@
 define([
-  'services/graphite/lexer'
+  'features/graphite/lexer'
 ], function(Lexer) {
   'use strict';
 

+ 1 - 1
src/test/specs/parser-specs.js

@@ -1,5 +1,5 @@
 define([
-  'services/graphite/parser'
+  'features/graphite/parser'
 ], function(Parser) {
   'use strict';