diff --git a/src/app/controllers/all.js b/src/app/controllers/all.js index 0765b82d1aa..09cce803f55 100644 --- a/src/app/controllers/all.js +++ b/src/app/controllers/all.js @@ -8,7 +8,6 @@ define([ './search', './metricKeys', './graphiteImport', - './influxTargetCtrl', './playlistCtrl', './inspectCtrl', './opentsdbTargetCtrl', diff --git a/src/app/directives/all.js b/src/app/directives/all.js index d75410f3d33..879b61e2512 100644 --- a/src/app/directives/all.js +++ b/src/app/directives/all.js @@ -12,11 +12,8 @@ define([ './spectrumPicker', './bootstrap-tagsinput', './bodyClass', - './addGraphiteFunc', - './graphiteFuncEditor', './templateParamSelector', './graphiteSegment', './grafanaVersionCheck', './dropdown.typeahead', - './influxdbFuncEditor' ], function () {}); diff --git a/src/app/features/all.js b/src/app/features/all.js index 64ae3fdf794..93d986b90d4 100644 --- a/src/app/features/all.js +++ b/src/app/features/all.js @@ -1,4 +1,5 @@ define([ './panellinkeditor/module', './graphite/datasource', + './influxdb/datasource', ], function () {}); diff --git a/src/app/directives/addGraphiteFunc.js b/src/app/features/graphite/addGraphiteFunc.js similarity index 98% rename from src/app/directives/addGraphiteFunc.js rename to src/app/features/graphite/addGraphiteFunc.js index cf2d5069962..5ea45618ce1 100644 --- a/src/app/directives/addGraphiteFunc.js +++ b/src/app/features/graphite/addGraphiteFunc.js @@ -3,7 +3,7 @@ define([ 'app', 'lodash', 'jquery', - '../features/graphite/gfunc', + './gfunc', ], function (angular, app, _, $, gfunc) { 'use strict'; diff --git a/src/app/features/graphite/datasource.js b/src/app/features/graphite/datasource.js index 1041703d0fc..74fc47cd7a5 100644 --- a/src/app/features/graphite/datasource.js +++ b/src/app/features/graphite/datasource.js @@ -6,6 +6,8 @@ define([ 'kbn', 'moment', './queryCtrl', + './funcEditor', + './addGraphiteFunc', ], function (angular, _, $, config, kbn, moment) { 'use strict'; @@ -18,14 +20,15 @@ function (angular, _, $, config, kbn, moment) { this.type = 'graphite'; this.basicAuth = datasource.basicAuth; this.url = datasource.url; - 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/features/graphite/partials/annotation.editor.html'; this.cacheTimeout = datasource.cacheTimeout; this.withCredentials = datasource.withCredentials; + this.render_method = datasource.render_method || 'POST'; + + this.supportAnnotations = true; + this.supportMetrics = true; + this.editorSrc = 'app/features/graphite/partials/query.editor.html'; + this.annotationEditorSrc = 'app/features/graphite/partials/annotation.editor.html'; } GraphiteDatasource.prototype.query = function(options) { diff --git a/src/app/directives/graphiteFuncEditor.js b/src/app/features/graphite/funcEditor.js similarity index 100% rename from src/app/directives/graphiteFuncEditor.js rename to src/app/features/graphite/funcEditor.js diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/features/influxdb/datasource.js similarity index 98% rename from src/app/services/influxdb/influxdbDatasource.js rename to src/app/features/influxdb/datasource.js index c30f950e51b..dc542ec3cfd 100644 --- a/src/app/services/influxdb/influxdbDatasource.js +++ b/src/app/features/influxdb/datasource.js @@ -3,7 +3,9 @@ define([ 'lodash', 'kbn', './influxSeries', - './influxQueryBuilder' + './queryBuilder', + './queryCtrl', + './funcEditor', ], function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) { 'use strict'; @@ -14,20 +16,20 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) { function InfluxDatasource(datasource) { this.type = 'influxDB'; - this.editorSrc = 'app/partials/influxdb/editor.html'; this.urls = datasource.urls; this.username = datasource.username; this.password = datasource.password; this.name = datasource.name; this.basicAuth = datasource.basicAuth; + this.grafanaDB = datasource.grafanaDB; this.saveTemp = _.isUndefined(datasource.save_temp) ? true : datasource.save_temp; this.saveTempTTL = _.isUndefined(datasource.save_temp_ttl) ? '30d' : datasource.save_temp_ttl; - this.grafanaDB = datasource.grafanaDB; this.supportAnnotations = true; this.supportMetrics = true; - this.annotationEditorSrc = 'app/partials/influxdb/annotation_editor.html'; + this.editorSrc = 'app/features/influxdb/partials/query.editor.html'; + this.annotationEditorSrc = 'app/features/influxdb/partials/annotations.editor.html'; } InfluxDatasource.prototype.query = function(options) { diff --git a/src/app/directives/influxdbFuncEditor.js b/src/app/features/influxdb/funcEditor.js similarity index 100% rename from src/app/directives/influxdbFuncEditor.js rename to src/app/features/influxdb/funcEditor.js diff --git a/src/app/services/influxdb/influxSeries.js b/src/app/features/influxdb/influxSeries.js similarity index 100% rename from src/app/services/influxdb/influxSeries.js rename to src/app/features/influxdb/influxSeries.js diff --git a/src/app/partials/influxdb/annotation_editor.html b/src/app/features/influxdb/partials/annotations.editor.html similarity index 100% rename from src/app/partials/influxdb/annotation_editor.html rename to src/app/features/influxdb/partials/annotations.editor.html diff --git a/src/app/partials/influxdb/editor.html b/src/app/features/influxdb/partials/query.editor.html similarity index 99% rename from src/app/partials/influxdb/editor.html rename to src/app/features/influxdb/partials/query.editor.html index 7fe41c1d268..44d19c80d89 100644 --- a/src/app/partials/influxdb/editor.html +++ b/src/app/features/influxdb/partials/query.editor.html @@ -3,7 +3,7 @@
diff --git a/src/app/services/influxdb/influxQueryBuilder.js b/src/app/features/influxdb/queryBuilder.js similarity index 100% rename from src/app/services/influxdb/influxQueryBuilder.js rename to src/app/features/influxdb/queryBuilder.js diff --git a/src/app/controllers/influxTargetCtrl.js b/src/app/features/influxdb/queryCtrl.js similarity index 97% rename from src/app/controllers/influxTargetCtrl.js rename to src/app/features/influxdb/queryCtrl.js index e2b1a5234d4..0d33445117b 100644 --- a/src/app/controllers/influxTargetCtrl.js +++ b/src/app/features/influxdb/queryCtrl.js @@ -9,7 +9,7 @@ function (angular, _) { var seriesList = null; - module.controller('InfluxTargetCtrl', function($scope, $timeout) { + module.controller('InfluxQueryCtrl', function($scope, $timeout) { $scope.init = function() { var target = $scope.target; diff --git a/src/app/services/datasourceSrv.js b/src/app/services/datasourceSrv.js index 1a924afb485..0fb1c6f4acf 100644 --- a/src/app/services/datasourceSrv.js +++ b/src/app/services/datasourceSrv.js @@ -2,7 +2,6 @@ define([ 'angular', 'lodash', 'config', - './influxdb/influxdbDatasource', './opentsdb/opentsdbDatasource', './elasticsearch/es-datasource', ], diff --git a/src/test/specs/influxQueryBuilder-specs.js b/src/test/specs/influxQueryBuilder-specs.js index b4e052a23af..47e3a317c36 100644 --- a/src/test/specs/influxQueryBuilder-specs.js +++ b/src/test/specs/influxQueryBuilder-specs.js @@ -1,5 +1,5 @@ define([ - 'services/influxdb/influxQueryBuilder' + 'features/influxdb/queryBuilder' ], function(InfluxQueryBuilder) { 'use strict'; @@ -68,7 +68,7 @@ define([ var query = builder.build(); expect(query).to.be('select mean(value) from "merge.google.test" where $timeFilter ' + - 'group by time($interval) order asc'); + 'group by time($interval) order asc'); }); }); diff --git a/src/test/specs/influxSeries-specs.js b/src/test/specs/influxSeries-specs.js index 9a38eb7f46d..1c3d079797b 100644 --- a/src/test/specs/influxSeries-specs.js +++ b/src/test/specs/influxSeries-specs.js @@ -1,5 +1,5 @@ define([ - 'services/influxdb/influxSeries' + 'features/influxdb/influxSeries' ], function(InfluxSeries) { 'use strict'; diff --git a/src/test/specs/influxdb-datasource-specs.js b/src/test/specs/influxdb-datasource-specs.js index 11d8a9e80c4..f8b545e7db2 100644 --- a/src/test/specs/influxdb-datasource-specs.js +++ b/src/test/specs/influxdb-datasource-specs.js @@ -1,6 +1,6 @@ define([ 'helpers', - 'services/influxdb/influxdbDatasource' + 'features/influxdb/datasource' ], function(helpers) { 'use strict';