Trying to organize code more around features than the standard controllers, services structure

This commit is contained in:
Torkel Ödegaard 2014-12-30 21:24:55 +01:00
parent f9b0a01c74
commit 8268c65c57
9 changed files with 9 additions and 9 deletions

View File

@ -10,7 +10,6 @@ define([
'./graphiteImport',
'./playlistCtrl',
'./inspectCtrl',
'./opentsdbTargetCtrl',
'./annotationsEditorCtrl',
'./templateEditorCtrl',
'./sharePanelCtrl',

View File

@ -2,4 +2,6 @@ define([
'./panellinkeditor/module',
'./graphite/datasource',
'./influxdb/datasource',
'./opentsdb/datasource',
'./elasticsearch/datasource',
], function () {});

View File

@ -24,7 +24,7 @@ function (angular, _, config, kbn, moment) {
this.saveTemp = _.isUndefined(datasource.save_temp) ? true : datasource.save_temp;
this.saveTempTTL = _.isUndefined(datasource.save_temp_ttl) ? '30d' : datasource.save_temp_ttl;
this.annotationEditorSrc = 'app/partials/elasticsearch/annotation_editor.html';
this.annotationEditorSrc = 'app/features/elasticsearch/partials/annotations.editor.html';
this.supportAnnotations = true;
this.supportMetrics = false;
}

View File

@ -28,7 +28,7 @@ function (angular, _, $, config, kbn, moment) {
this.supportAnnotations = true;
this.supportMetrics = true;
this.editorSrc = 'app/features/graphite/partials/query.editor.html';
this.annotationEditorSrc = 'app/features/graphite/partials/annotation.editor.html';
this.annotationEditorSrc = 'app/features/graphite/partials/annotations.editor.html';
}
GraphiteDatasource.prototype.query = function(options) {

View File

@ -2,7 +2,8 @@ define([
'angular',
'lodash',
'kbn',
'moment'
'moment',
'./queryCtrl',
],
function (angular, _, kbn) {
'use strict';
@ -13,7 +14,7 @@ function (angular, _, kbn) {
function OpenTSDBDatasource(datasource) {
this.type = 'opentsdb';
this.editorSrc = 'app/partials/opentsdb/editor.html';
this.editorSrc = 'app/features/opentsdb/partials/query.editor.html';
this.url = datasource.url;
this.name = datasource.name;
this.supportMetrics = true;

View File

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

View File

@ -8,7 +8,7 @@ function (angular, _, kbn) {
var module = angular.module('grafana.controllers');
module.controller('OpenTSDBTargetCtrl', function($scope, $timeout) {
module.controller('OpenTSDBQueryCtrl', function($scope, $timeout) {
$scope.init = function() {
$scope.target.errors = validateTarget($scope.target);

View File

@ -2,8 +2,6 @@ define([
'angular',
'lodash',
'config',
'./opentsdb/opentsdbDatasource',
'./elasticsearch/es-datasource',
],
function (angular, _, config) {
'use strict';