-
Notifications
You must be signed in to change notification settings - Fork 22
/
module.js
41 lines (32 loc) · 1.06 KB
/
module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { PanelCtrl } from 'grafana/app/plugins/sdk'; // will be resolved to app/plugins/sdk
import './css/panel.base.scss';
// Remove next imports if you don't need separate styles for light and dark themes
import './css/panel.dark.scss';
import './css/panel.light.scss';
// Remove up to here
class Ctrl extends PanelCtrl {
constructor($scope, $injector) {
super($scope, $injector);
}
link(scope, element) {
this.initStyles();
}
initStyles() {
window.System.import(this.panelPath + 'css/panel.base.css!');
// Remove next lines if you don't need separate styles for light and dark themes
if (grafanaBootData.user.lightTheme) {
window.System.import(this.panelPath + 'css/panel.light.css!');
} else {
window.System.import(this.panelPath + 'css/panel.dark.css!');
}
// Remove up to here
}
get panelPath() {
if (this._panelPath === undefined) {
this._panelPath = `/public/plugins/${this.pluginId}/`;
}
return this._panelPath;
}
}
Ctrl.templateUrl = 'partials/template.html';
export { Ctrl as PanelCtrl }