mirror of https://github.com/grafana/grafana
parent
0796b2c0e3
commit
94a7e9b185
@ -0,0 +1,21 @@ |
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import PanelMeta from './panel_meta2'; |
||||
|
||||
export class PanelCtrl { |
||||
panelMeta: any; |
||||
panel: any; |
||||
row: any; |
||||
dashboard: any; |
||||
|
||||
constructor(private $scope) { |
||||
this.panelMeta = new PanelMeta({ |
||||
panelName: 'Table', |
||||
editIcon: "fa fa-table", |
||||
fullscreen: true, |
||||
metricsEditor: true, |
||||
}); |
||||
} |
||||
} |
||||
|
||||
|
||||
@ -0,0 +1,4 @@ |
||||
<h2 class="text-center"> |
||||
Test panel! |
||||
panel.id: {{ctrl.panel.id}} |
||||
</h2> |
||||
@ -1,47 +1,22 @@ |
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import PanelMeta from 'app/features/panel/panel_meta2'; |
||||
|
||||
class PanelBaseCtrl { |
||||
panelMeta: any; |
||||
panel: any; |
||||
dashboard: any; |
||||
|
||||
constructor(private $scope) { |
||||
this.panelMeta = new PanelMeta({ |
||||
panelName: 'Table', |
||||
editIcon: "fa fa-table", |
||||
fullscreen: true, |
||||
metricsEditor: true, |
||||
}); |
||||
} |
||||
} |
||||
|
||||
class TestPanelCtrl extends PanelBaseCtrl { |
||||
import {PanelCtrl} from '../../../features/panel/panel_ctrl'; |
||||
|
||||
class TestPanelCtrl extends PanelCtrl { |
||||
constructor($scope) { |
||||
super($scope); |
||||
} |
||||
} |
||||
|
||||
var testPanelComponent = { |
||||
template: ` |
||||
<grafana-panel ctrl="ctrl"> |
||||
<div class="text-center" style="padding-top: 2rem"> |
||||
<h2>Test Panel</h2> |
||||
</div> |
||||
</grafana-panel> |
||||
`,
|
||||
var panel = { |
||||
templateUrl: `app/plugins/panel/test/module.html`, |
||||
controller: TestPanelCtrl, |
||||
controllerAs: 'ctrl', |
||||
bindings: { |
||||
dashboard: "=", |
||||
panel: "=", |
||||
link: function(scope, elem) { |
||||
console.log('panel link'); |
||||
} |
||||
}; |
||||
|
||||
export { |
||||
PanelBaseCtrl, |
||||
TestPanelCtrl, |
||||
testPanelComponent as component, |
||||
panel, |
||||
} |
||||
|
||||
Loading…
Reference in new issue