mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* fix cluster settings page layout Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * cleanup Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * refactor cluster settings to pluggable entity settings Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * fix gh actions network timeout on yarn install Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * review changes Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
39 lines
1.6 KiB
TypeScript
39 lines
1.6 KiB
TypeScript
import type { AppPreferenceRegistration, ClusterPageMenuRegistration, KubeObjectDetailRegistration, KubeObjectMenuRegistration, KubeObjectStatusRegistration, PageMenuRegistration, PageRegistration, StatusBarRegistration, } from "./registries";
|
|
import type { Cluster } from "../main/cluster";
|
|
import { LensExtension } from "./lens-extension";
|
|
import { getExtensionPageUrl } from "./registries/page-registry";
|
|
import { CommandRegistration } from "./registries/command-registry";
|
|
import { EntitySettingRegistration } from "./registries/entity-setting-registry";
|
|
|
|
export class LensRendererExtension extends LensExtension {
|
|
globalPages: PageRegistration[] = [];
|
|
clusterPages: PageRegistration[] = [];
|
|
globalPageMenus: PageMenuRegistration[] = [];
|
|
clusterPageMenus: ClusterPageMenuRegistration[] = [];
|
|
kubeObjectStatusTexts: KubeObjectStatusRegistration[] = [];
|
|
appPreferences: AppPreferenceRegistration[] = [];
|
|
entitySettings: EntitySettingRegistration[] = [];
|
|
statusBarItems: StatusBarRegistration[] = [];
|
|
kubeObjectDetailItems: KubeObjectDetailRegistration[] = [];
|
|
kubeObjectMenuItems: KubeObjectMenuRegistration[] = [];
|
|
commands: CommandRegistration[] = [];
|
|
|
|
async navigate<P extends object>(pageId?: string, params?: P) {
|
|
const { navigate } = await import("../renderer/navigation");
|
|
const pageUrl = getExtensionPageUrl({
|
|
extensionId: this.name,
|
|
pageId,
|
|
params: params ?? {}, // compile to url with params
|
|
});
|
|
|
|
navigate(pageUrl);
|
|
}
|
|
|
|
/**
|
|
* Defines if extension is enabled for a given cluster. Defaults to `true`.
|
|
*/
|
|
async isEnabledForCluster(cluster: Cluster): Promise<Boolean> {
|
|
return (void cluster) || true;
|
|
}
|
|
}
|