소스 검색

wip: react panels, query editor loading from react PanelEditor view

Torkel Ödegaard 7 년 전
부모
커밋
1099daec38
2개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 0
      public/app/features/dashboard/panel_model.ts
  2. 0 4
      public/app/features/panel/metrics_panel_ctrl.ts

+ 5 - 0
public/app/features/dashboard/panel_model.ts

@@ -31,6 +31,7 @@ export class PanelModel {
   collapsed?: boolean;
   panels?: any;
   soloMode?: boolean;
+  targets: any[];
 
   // non persisted
   fullscreen: boolean;
@@ -48,6 +49,10 @@ export class PanelModel {
     if (!this.gridPos) {
       this.gridPos = { x: 0, y: 0, h: 3, w: 6 };
     }
+
+    if (!this.targets) {
+      this.targets = [{}];
+    }
   }
 
   getSaveModel() {

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

@@ -45,10 +45,6 @@ class MetricsPanelCtrl extends PanelCtrl {
     this.scope = $scope;
     this.panel.datasource = this.panel.datasource || null;
 
-    if (!this.panel.targets) {
-      this.panel.targets = [{}];
-    }
-
     this.events.on('refresh', this.onMetricsPanelRefresh.bind(this));
     this.events.on('init-edit-mode', this.onInitMetricsPanelEditMode.bind(this));
     this.events.on('panel-teardown', this.onPanelTearDown.bind(this));