module.ts 873 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import PanelMeta from 'app/features/panel/panel_meta2';
  3. class PanelBaseCtrl {
  4. constructor(private $scope) {
  5. $scope.panelMeta = new PanelMeta({
  6. panelName: 'Table',
  7. editIcon: "fa fa-table",
  8. fullscreen: true,
  9. metricsEditor: true,
  10. });
  11. $scope.testProp = "hello";
  12. }
  13. }
  14. class TestPanelCtrl extends PanelBaseCtrl {
  15. constructor($scope) {
  16. super($scope);
  17. $scope.panelMeta.panelName = "Test";
  18. }
  19. }
  20. function testPanelDirective() {
  21. return {
  22. restrict: 'E',
  23. template: `
  24. <grafana-panel>
  25. <div class="text-center" style="padding-top: 2rem">
  26. <h2>Test Panel, {{testProp}}</h2>
  27. </div>
  28. </grafana-panel>
  29. `,
  30. controller: TestPanelCtrl,
  31. controllerAs: 'ctrl',
  32. };
  33. }
  34. export {
  35. PanelBaseCtrl,
  36. TestPanelCtrl,
  37. testPanelDirective as panel
  38. }