@grafana/runtime: expose config and loadPluginCss (#17655)

* move config to grafana runtime

* set defaults

* defaults in constructor

* use @types/systemjs

* rename Settings to GrafanaBootConfig
This commit is contained in:
Ryan McKinley
2019-06-19 11:31:47 -07:00
committed by GitHub
parent c9ad411d8e
commit 428134482d
8 changed files with 105 additions and 88 deletions

View File

@@ -31,6 +31,7 @@ import * as d3 from 'd3';
import * as grafanaData from '@grafana/data';
import * as grafanaUI from '@grafana/ui';
import * as grafanaRuntime from '@grafana/runtime';
export { loadPluginCss } from '@grafana/runtime';
// rxjs
import { Observable, Subject } from 'rxjs';
@@ -230,11 +231,3 @@ export function importPanelPlugin(id: string): Promise<PanelPlugin> {
return getPanelPluginNotFound(id);
});
}
export function loadPluginCss(options) {
if (config.bootData.user.lightTheme) {
System.import(options.light + '!css');
} else {
System.import(options.dark + '!css');
}
}