mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 00:54:58 -05:00
feat(plugin): experimental work on plugin architecture
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import PanelMeta from 'app/features/panel/panel_meta2';
|
||||
|
||||
class PanelBaseCtrl {
|
||||
constructor(private $scope) {
|
||||
$scope.panelMeta = new PanelMeta({
|
||||
panelName: 'Table',
|
||||
editIcon: "fa fa-table",
|
||||
fullscreen: true,
|
||||
metricsEditor: true,
|
||||
});
|
||||
$scope.testProp = "hello";
|
||||
}
|
||||
}
|
||||
|
||||
class TestPanelCtrl extends PanelBaseCtrl {
|
||||
|
||||
constructor($scope) {
|
||||
super($scope);
|
||||
$scope.panelMeta.panelName = "Test";
|
||||
}
|
||||
}
|
||||
|
||||
function testPanelDirective() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: `
|
||||
<grafana-panel>
|
||||
<div class="text-center" style="padding-top: 2rem">
|
||||
<h2>Test Panel, {{testProp}}</h2>
|
||||
</div>
|
||||
</grafana-panel>
|
||||
`,
|
||||
controller: TestPanelCtrl
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
PanelBaseCtrl,
|
||||
TestPanelCtrl,
|
||||
testPanelDirective as panel
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "panel",
|
||||
"name": "Test",
|
||||
"id": "test"
|
||||
}
|
||||
Reference in New Issue
Block a user