mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
feat(plugins): moved http settings to directive instad of just ng-include partial
This commit is contained in:
parent
36ebfc747a
commit
ca3405afc5
4
public/app/features/datasources/all.js
Normal file
4
public/app/features/datasources/all.js
Normal file
@ -0,0 +1,4 @@
|
||||
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();
|
||||
|
||||
});
|
||||
});
|
@ -53,3 +53,5 @@
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
@ -1,9 +1,8 @@
|
||||
define([
|
||||
'./datasourcesCtrl',
|
||||
'./datasourceEditCtrl',
|
||||
'./orgUsersCtrl',
|
||||
'./newOrgCtrl',
|
||||
'./userInviteCtrl',
|
||||
'./orgApiKeysCtrl',
|
||||
'./orgDetailsCtrl',
|
||||
'../datasources/all',
|
||||
], function () {});
|
||||
|
@ -1,5 +1,4 @@
|
||||
<div ng-include="httpConfigPartialSrc"></div>
|
||||
<br>
|
||||
<datasource-http-settings></datasource-http-settings>
|
||||
|
||||
<h5>Elasticsearch details</h5>
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
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;
|
||||
});
|
||||
|
@ -1,7 +1,8 @@
|
||||
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,
|
||||
};
|
||||
});
|
@ -1,3 +1,2 @@
|
||||
<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,
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
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();
|
||||
|
@ -1,5 +1,4 @@
|
||||
<div ng-include="httpConfigPartialSrc"></div>
|
||||
<br>
|
||||
<datasource-http-settings></datasource-http-settings>
|
||||
|
||||
<h5>InfluxDB Details</h5>
|
||||
|
||||
|
@ -1,4 +1,2 @@
|
||||
<div ng-include="httpConfigPartialSrc"></div>
|
||||
|
||||
<br>
|
||||
<datasource-http-settings></datasource-http-settings>
|
||||
|
||||
|
@ -1,4 +1,2 @@
|
||||
<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);
|
||||
|
Loading…
Reference in New Issue
Block a user