+
diff --git a/public/app/plugins/panel/dashlist/module.js b/public/app/plugins/panel/dashlist/module.js
deleted file mode 100644
index 8ffee99ab2c..00000000000
--- a/public/app/plugins/panel/dashlist/module.js
+++ /dev/null
@@ -1,82 +0,0 @@
-define([
- 'angular',
- 'app/app',
- 'lodash',
- 'app/core/config',
- 'app/features/panel/panel_meta',
-],
-function (angular, app, _, config, PanelMeta) {
- 'use strict';
-
- var module = angular.module('grafana.panels.dashlist', []);
- app.useModule(module);
-
- /** @ngInject */
- function DashListPanelCtrl($scope, panelSrv, backendSrv) {
-
- $scope.panelMeta = new PanelMeta({
- panelName: 'Dashboard list',
- editIcon: "fa fa-star",
- fullscreen: true,
- });
-
- $scope.panelMeta.addEditorTab('Options', 'app/plugins/panel/dashlist/editor.html');
-
- var defaults = {
- mode: 'starred',
- query: '',
- limit: 10,
- tags: []
- };
-
- $scope.modes = ['starred', 'search'];
-
- _.defaults($scope.panel, defaults);
-
- $scope.dashList = [];
-
- $scope.init = function() {
- panelSrv.init($scope);
-
- if ($scope.panel.tag) {
- $scope.panel.tags = [$scope.panel.tag];
- delete $scope.panel.tag;
- }
-
- if ($scope.isNewPanel()) {
- $scope.panel.title = "Starred Dashboards";
- }
- };
-
- $scope.refreshData = function() {
- var params = {
- limit: $scope.panel.limit
- };
-
- if ($scope.panel.mode === 'starred') {
- params.starred = "true";
- } else {
- params.query = $scope.panel.query;
- params.tag = $scope.panel.tags;
- }
-
- return backendSrv.search(params).then(function(result) {
- $scope.dashList = result;
- $scope.panelRenderingComplete();
- });
- };
-
- $scope.init();
- }
-
- function dashListPanelDirective() {
- return {
- controller: DashListPanelCtrl,
- templateUrl: 'app/plugins/panel/dashlist/module.html',
- };
- }
-
- return {
- panel: dashListPanelDirective
- };
-});
diff --git a/public/app/plugins/panel/dashlist/module.ts b/public/app/plugins/panel/dashlist/module.ts
new file mode 100644
index 00000000000..d64174d77ff
--- /dev/null
+++ b/public/app/plugins/panel/dashlist/module.ts
@@ -0,0 +1,63 @@
+///
+
+import _ from 'lodash';
+import config from 'app/core/config';
+import {PanelDirective, PanelCtrl} from '../../../features/panel/panel';
+
+ // Set and populate defaults
+var panelDefaults = {
+ mode: 'starred',
+ query: '',
+ limit: 10,
+ tags: []
+};
+
+class DashListCtrl extends PanelCtrl {
+ dashList: any[];
+ modes: any[];
+
+ /** @ngInject */
+ constructor($scope, $injector, private backendSrv) {
+ super($scope, $injector);
+ _.defaults(this.panel, panelDefaults);
+
+ if (this.panel.tag) {
+ this.panel.tags = [$scope.panel.tag];
+ delete this.panel.tag;
+ }
+ }
+
+ initEditMode() {
+ this.modes = ['starred', 'search'];
+ this.icon = "fa fa-star";
+ this.addEditorTab('Options', () => {
+ return {templateUrl: 'app/plugins/panel/dashlist/editor.html'};
+ });
+ }
+
+ refresh() {
+ var params: any = {limit: this.panel.limit};
+
+ if (this.panel.mode === 'starred') {
+ params.starred = "true";
+ } else {
+ params.query = this.panel.query;
+ params.tag = this.panel.tags;
+ }
+
+ return this.backendSrv.search(params).then(result => {
+ this.dashList = result;
+ this.renderingCompleted();
+ });
+ }
+}
+
+class DashListPanel extends PanelDirective {
+ controller = DashListCtrl;
+ templateUrl = 'public/app/plugins/panel/dashlist/module.html';
+}
+
+export {
+ DashListCtrl,
+ DashListPanel as Panel
+}
diff --git a/public/app/plugins/panel/text/module.ts b/public/app/plugins/panel/text/module.ts
index 351abb7be7c..f546f10c567 100644
--- a/public/app/plugins/panel/text/module.ts
+++ b/public/app/plugins/panel/text/module.ts
@@ -18,17 +18,19 @@ export class TextPanelCtrl extends PanelCtrl {
super($scope, $injector);
_.defaults(this.panel, panelDefaults);
- this.render();
-
}
- initEditorTabs() {
+ initEditMode() {
this.icon = 'fa fa-text-width';
this.addEditorTab('Options', () => {
return { templateUrl: 'public/app/plugins/panel/text/editor.html' };
});
}
+ refresh() {
+ this.render();
+ }
+
render() {
if (this.panel.mode === 'markdown') {
this.renderMarkdown(this.panel.content);
@@ -40,10 +42,6 @@ export class TextPanelCtrl extends PanelCtrl {
this.renderingCompleted();
}
- refresh() {
- this.render();
- }
-
renderText(content) {
content = content
.replace(/&/g, '&')