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

more progress on some experimental stuff

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

+ 4 - 0
public/app/features/panel/query_editor.ts

@@ -30,6 +30,10 @@ function pluginDirectiveLoader($compile, datasourceSrv) {
       case "metrics-query-editor": {
         let datasource = scope.target.datasource || scope.ctrl.panel.datasource;
         return datasourceSrv.get(datasource).then(ds => {
+          if (!scope.target.refId) {
+            scope.target.refId = 'A';
+          }
+
           return System.import(ds.meta.module).then(dsModule => {
             return {
               name: 'metrics-query-editor-' + ds.meta.id,

+ 1 - 17
public/app/plugins/datasource/grafana/module.ts

@@ -3,24 +3,8 @@
 import angular from 'angular';
 import {GrafanaDatasource} from './datasource';
 
-var module = angular.module('grafana.directives');
-
-function grafanaMetricsQueryEditor() {
-  return {templateUrl: 'app/plugins/datasource/grafana/partials/query.editor.html'};
-}
-
-export class MetricsQueryEditor {
-  panelCtrl: any;
-  target: any;
-}
-
-class GrafanaMetricsQueryEditor extends MetricsQueryEditor {
+class GrafanaMetricsQueryEditor {
   static templateUrl = 'app/plugins/datasource/grafana/partials/query.editor.html';
-
-  constructor() {
-    super();
-    console.log('this is a metrics editor', this.panelCtrl, this.target);
-  }
 }
 
 export {

+ 1 - 1
public/app/plugins/datasource/grafana/partials/query.editor.html

@@ -41,7 +41,7 @@
 
 	<ul class="tight-form-list">
 		<li class="tight-form-item" style="min-width: 15px; text-align: center">
-			{{target.refId}}
+			{{ctrl.target.refId}}
 		</li>
 		<li>
 			<a class="tight-form-item" ng-click="target.hide = !target.hide; get_data();" role="menuitem">