2016-01-22 19:59:36 +01:00
|
|
|
///<reference path="../../headers/common.d.ts" />
|
|
|
|
|
|
2016-01-24 17:30:29 -05:00
|
|
|
import config from 'app/core/config';
|
|
|
|
|
|
2016-01-24 18:44:21 -05:00
|
|
|
import {PanelCtrl} from './panel_ctrl';
|
|
|
|
|
import {MetricsPanelCtrl} from './metrics_panel_ctrl';
|
2016-01-22 19:59:36 +01:00
|
|
|
|
2016-01-24 18:44:21 -05:00
|
|
|
class PanelDirective {
|
2016-01-24 16:39:25 -05:00
|
|
|
template: string;
|
|
|
|
|
templateUrl: string;
|
|
|
|
|
bindToController: boolean;
|
|
|
|
|
scope: any;
|
|
|
|
|
controller: any;
|
|
|
|
|
controllerAs: string;
|
|
|
|
|
|
|
|
|
|
getDirective() {
|
2016-01-24 17:58:08 -05:00
|
|
|
if (!this.controller) {
|
|
|
|
|
this.controller = PanelCtrl;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-24 16:39:25 -05:00
|
|
|
return {
|
|
|
|
|
template: this.template,
|
|
|
|
|
templateUrl: this.templateUrl,
|
|
|
|
|
controller: this.controller,
|
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
|
bindToController: true,
|
|
|
|
|
scope: {dashboard: "=", panel: "=", row: "="},
|
2016-01-25 17:51:18 -05:00
|
|
|
link: (scope, elem, attrs, ctrl) => {
|
|
|
|
|
ctrl.init();
|
|
|
|
|
this.link(scope, elem, attrs, ctrl);
|
|
|
|
|
}
|
2016-01-24 16:39:25 -05:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-25 17:51:18 -05:00
|
|
|
link(scope, elem, attrs, ctrl) {
|
2016-01-24 16:39:25 -05:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-01-22 19:59:36 +01:00
|
|
|
|
2016-01-24 18:44:21 -05:00
|
|
|
export {
|
|
|
|
|
PanelCtrl,
|
|
|
|
|
MetricsPanelCtrl,
|
|
|
|
|
PanelDirective,
|
|
|
|
|
}
|