Commit ca3405af by Torkel Ödegaard

feat(plugins): moved http settings to directive instad of just ng-include partial

parent 36ebfc74
define([
'./list_ctrl',
'./edit_ctrl',
], function () {});
......@@ -9,9 +9,11 @@ function (angular, _, config) {
var module = angular.module('grafana.controllers');
var datasourceTypes = [];
module.controller('DataSourceEditCtrl', function($scope, $q, backendSrv, $routeParams, $location, datasourceSrv) {
module.directive('datasourceHttpSettings', function() {
return {templateUrl: 'app/features/datasources/partials/http_settings.html'};
});
$scope.httpConfigPartialSrc = 'app/features/org/partials/datasourceHttpConfig.html';
module.controller('DataSourceEditCtrl', function($scope, $q, backendSrv, $routeParams, $location, datasourceSrv) {
var defaults = {name: '', type: 'graphite', url: '', access: 'proxy', jsonData: {}};
......@@ -114,6 +116,5 @@ function (angular, _, config) {
};
$scope.init();
});
});
define([
'./datasourcesCtrl',
'./datasourceEditCtrl',
'./orgUsersCtrl',
'./newOrgCtrl',
'./userInviteCtrl',
'./orgApiKeysCtrl',
'./orgDetailsCtrl',
'../datasources/all',
], function () {});
<div ng-include="httpConfigPartialSrc"></div>
<br>
<datasource-http-settings></datasource-http-settings>
<h5>Elasticsearch details</h5>
......
declare var Datasource: any;
export {Datasource};
export default Datasource;
......@@ -4,7 +4,6 @@ define([
'jquery',
'app/core/config',
'app/core/utils/datemath',
'./directives',
'./query_ctrl',
'./func_editor',
'./add_graphite_func',
......@@ -293,7 +292,5 @@ function (angular, _, $, config, dateMath) {
};
}
return {
Datasource: GraphiteDatasource
};
return GraphiteDatasource;
});
define([
'angular',
'./datasource',
],
function (angular) {
function (angular, GraphiteDatasource) {
'use strict';
var module = angular.module('grafana.directives');
......@@ -18,4 +19,7 @@ function (angular) {
return {templateUrl: 'app/plugins/datasource/graphite/partials/annotations.editor.html'};
});
return {
Datasource: GraphiteDatasource,
};
});
<div ng-include="httpConfigPartialSrc"></div>
<datasource-http-settings></datasource-http-settings>
......@@ -3,11 +3,7 @@
"type": "datasource",
"id": "graphite",
"module": "app/plugins/datasource/graphite/datasource",
"partials": {
"config": "app/plugins/datasource/graphite/partials/config.html"
},
"module": "app/plugins/datasource/graphite/module",
"defaultMatchFormat": "glob",
"metrics": true,
......
import {describe, beforeEach, it, sinon, expect, angularMocks} from 'test/lib/common';
import helpers from 'test/specs/helpers';
import {Datasource} from "../datasource";
import Datasource from "../datasource";
describe('graphiteDatasource', function() {
var ctx = new helpers.ServiceTestContext();
......
<div ng-include="httpConfigPartialSrc"></div>
<br>
<datasource-http-settings></datasource-http-settings>
<h5>InfluxDB Details</h5>
......
<div ng-include="httpConfigPartialSrc"></div>
<br>
<datasource-http-settings></datasource-http-settings>
<div ng-include="httpConfigPartialSrc"></div>
<br>
<datasource-http-settings></datasource-http-settings>
......@@ -6,7 +6,7 @@ module.exports = function(config, grunt) {
grunt.log.writeln('File Changed: ' + filepath);
if (/(\.html)$/.test(filepath)) {
if (/(\.html)|(\.json)$/.test(filepath)) {
newPath = filepath.replace(/^public/, 'public_gen');
grunt.log.writeln('Copying to ' + newPath);
grunt.file.copy(filepath, newPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment