mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix doughnut graphs on workload overview sometimes not showing (#5727)
This commit is contained in:
1 parent
7767216167
commit
4b1c9fb5fd
36 files changed
+868
-184
No files matched your search
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import themeStoreInjectable from "./store.injectable";
|
||||
|
||||
const activeThemeInjectable = getInjectable({
|
||||
id: "active-theme",
|
||||
instantiate: (di) => {
|
||||
const store = di.inject(themeStoreInjectable);
|
||||
|
||||
return computed(() => store.activeTheme);
|
||||
},
|
||||
});
|
||||
|
||||
export default activeThemeInjectable;
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { Theme } from "./store";
|
||||
import type { LensTheme } from "./store";
|
||||
|
||||
const lensDarkTheme: Theme = {
|
||||
const lensDarkTheme: LensTheme = {
|
||||
"name": "Dark",
|
||||
"type": "dark",
|
||||
"description": "Original Lens dark theme",
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { Theme } from "./store";
|
||||
import type { LensTheme } from "./store";
|
||||
|
||||
const lensLightTheme: Theme = {
|
||||
const lensLightTheme: LensTheme = {
|
||||
"name": "Light",
|
||||
"type": "light",
|
||||
"description": "Original Lens light theme",
|
||||
|
||||
@@ -18,7 +18,7 @@ import assert from "assert";
|
||||
|
||||
export type ThemeId = string;
|
||||
|
||||
export interface Theme {
|
||||
export interface LensTheme {
|
||||
name: string;
|
||||
type: "dark" | "light";
|
||||
colors: Record<string, string>;
|
||||
@@ -39,7 +39,7 @@ interface Dependencies {
|
||||
export class ThemeStore {
|
||||
private terminalColorPrefix = "terminal";
|
||||
|
||||
#themes = observable.map<ThemeId, Theme>({
|
||||
#themes = observable.map<ThemeId, LensTheme>({
|
||||
"lens-dark": lensDarkTheme,
|
||||
"lens-light": lensLightTheme,
|
||||
});
|
||||
@@ -66,9 +66,9 @@ export class ThemeStore {
|
||||
return this.dependencies.userStore.terminalTheme;
|
||||
}
|
||||
|
||||
private readonly defaultTheme: Theme;
|
||||
private readonly defaultTheme: LensTheme;
|
||||
|
||||
@computed get activeTheme(): Theme {
|
||||
@computed get activeTheme(): LensTheme {
|
||||
return this.themes.get(this.activeThemeId) ?? this.defaultTheme;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export class ThemeStore {
|
||||
}
|
||||
|
||||
get themes() {
|
||||
return this.#themes as ReadonlyDeep<Map<string, Theme>>;
|
||||
return this.#themes as ReadonlyDeep<Map<string, LensTheme>>;
|
||||
}
|
||||
|
||||
constructor(protected readonly dependencies: Dependencies) {
|
||||
@@ -130,7 +130,7 @@ export class ThemeStore {
|
||||
});
|
||||
}
|
||||
|
||||
getThemeById(themeId: ThemeId): Theme | undefined {
|
||||
getThemeById(themeId: ThemeId): LensTheme | undefined {
|
||||
return this.themes.get(themeId);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user