mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Extensible welcome page (#2637)
* welcome/landing page Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix integration tests Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
1f854d0a0f
commit
b1274cbb33
22 files changed
+147
-820
No files matched your search
@@ -214,6 +214,7 @@ export class ExtensionLoader extends Singleton {
|
||||
registries.entitySettingRegistry.add(extension.entitySettings),
|
||||
registries.statusBarRegistry.add(extension.statusBarItems),
|
||||
registries.commandRegistry.add(extension.commands),
|
||||
registries.welcomeMenuRegistry.add(extension.welcomeMenus),
|
||||
];
|
||||
|
||||
this.events.on("remove", (removedExtension: LensRendererExtension) => {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { AppPreferenceRegistration, ClusterPageMenuRegistration, KubeObjectDetailRegistration, KubeObjectMenuRegistration, KubeObjectStatusRegistration, PageMenuRegistration, PageRegistration, StatusBarRegistration, } from "./registries";
|
||||
import type {
|
||||
AppPreferenceRegistration, ClusterPageMenuRegistration, KubeObjectDetailRegistration, KubeObjectMenuRegistration,
|
||||
KubeObjectStatusRegistration, PageMenuRegistration, PageRegistration, StatusBarRegistration, WelcomeMenuRegistration,
|
||||
} from "./registries";
|
||||
import type { Cluster } from "../main/cluster";
|
||||
import { LensExtension } from "./lens-extension";
|
||||
import { getExtensionPageUrl } from "./registries/page-registry";
|
||||
@@ -17,6 +20,7 @@ export class LensRendererExtension extends LensExtension {
|
||||
kubeObjectDetailItems: KubeObjectDetailRegistration[] = [];
|
||||
kubeObjectMenuItems: KubeObjectMenuRegistration[] = [];
|
||||
commands: CommandRegistration[] = [];
|
||||
welcomeMenus: WelcomeMenuRegistration[] = [];
|
||||
|
||||
async navigate<P extends object>(pageId?: string, params?: P) {
|
||||
const { navigate } = await import("../renderer/navigation");
|
||||
|
||||
@@ -10,3 +10,4 @@ export * from "./kube-object-menu-registry";
|
||||
export * from "./kube-object-status-registry";
|
||||
export * from "./command-registry";
|
||||
export * from "./entity-setting-registry";
|
||||
export * from "./welcome-menu-registry";
|
||||
@@ -0,0 +1,11 @@
|
||||
import { BaseRegistry } from "./base-registry";
|
||||
|
||||
export interface WelcomeMenuRegistration {
|
||||
title: string;
|
||||
icon: string;
|
||||
click: () => void | Promise<void>;
|
||||
}
|
||||
|
||||
export class WelcomeMenuRegistry extends BaseRegistry<WelcomeMenuRegistration> {}
|
||||
|
||||
export const welcomeMenuRegistry = new WelcomeMenuRegistry();
|
||||
Reference in new issue
Block a user