Minor refactoring around theme access

This commit is contained in:
Torkel Ödegaard
2019-02-08 15:38:45 +01:00
parent 7e03913d0d
commit 5436c28448
9 changed files with 13 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
import _ from 'lodash';
import { PanelPlugin } from 'app/types/plugins';
import { GrafanaTheme, getTheme, GrafanaThemeType } from '@grafana/ui';
export interface BuildInfo {
version: string;
@@ -36,8 +37,11 @@ export class Settings {
loginError: any;
viewersCanEdit: boolean;
disableSanitizeHtml: boolean;
theme: GrafanaTheme;
constructor(options: Settings) {
this.theme = options.bootData.user.lightTheme ? getTheme(GrafanaThemeType.Light) : getTheme(GrafanaThemeType.Dark);
const defaults = {
datasources: {},
windowTitlePrefix: 'Grafana - ',