Просмотр исходного кода

feat(plugins): more work on plugin directives and isolation

Torkel Ödegaard 10 лет назад
Родитель
Сommit
0583ec0f93

+ 0 - 1
public/app/core/directives/plugin_directive_loader.ts

@@ -56,7 +56,6 @@ function pluginDirectiveLoader($compile, datasourceSrv) {
   }
 
   function appendAndCompile(scope, elem, componentInfo) {
-    console.log('compile', elem, componentInfo);
     var child = angular.element(document.createElement(componentInfo.name));
     _.each(componentInfo.attrs, (value, key) => {
       child.attr(key, value);

+ 4 - 1
public/app/features/datasources/edit_ctrl.js

@@ -10,7 +10,10 @@ function (angular, _, config) {
   var datasourceTypes = [];
 
   module.directive('datasourceHttpSettings', function() {
-    return {templateUrl: 'public/app/features/datasources/partials/http_settings.html'};
+    return {
+      scope: {current: "="},
+      templateUrl: 'public/app/features/datasources/partials/http_settings.html'
+    };
   });
 
   module.controller('DataSourceEditCtrl', function($scope, $q, backendSrv, $routeParams, $location, datasourceSrv) {

+ 0 - 2
public/app/features/datasources/partials/edit.html

@@ -46,8 +46,6 @@
 				</plugin-directive-loader>
 			</div>
 
-			<!-- <ds&#45;config&#45;view ds&#45;meta="datasourceMeta" current="current"></ds&#45;config&#45;view> -->
-
 			<div ng-if="testing" style="margin-top: 25px">
 				<h5 ng-show="!testing.done">Testing.... <i class="fa fa-spiner fa-spin"></i></h5>
 				<h5 ng-show="testing.done">Test results</h5>

+ 2 - 1
public/app/plugins/datasource/graphite/partials/config.html

@@ -1,2 +1,3 @@
-<datasource-http-settings></datasource-http-settings>
+<datasource-http-settings current="ctrl.current">
+</datasource-http-settings>
 

+ 2 - 1
public/app/plugins/datasource/prometheus/partials/config.html

@@ -1,2 +1,3 @@
-<datasource-http-settings></datasource-http-settings>
+<datasource-http-settings current="ctrl.current">
+</datasource-http-settings>