support-page extension fixes

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-11-12 14:49:17 +02:00
1 parent a489d9aabe
commit 1fc8ff0abc
7 files changed
+13 -20

No files matched your search

+3 -3
View File
@@ -6,9 +6,9 @@ import { WindowManager } from "../main/window-manager";
export class LensMainExtension extends LensExtension {
@observable.shallow appMenus: MenuRegistration[] = []
async navigate(location: string, frameId?: number) {
async navigate(location?: string, frameId?: number) {
const windowManager = WindowManager.getInstance<WindowManager>();
const url = this.getPageUrl(location);
await windowManager.navigate(url, frameId)
const url = this.getPageUrl(location); // get full path to extension's page
await windowManager.navigate(url, frameId);
}
}
+3 -3
View File
@@ -1,5 +1,4 @@
import type { AppPreferenceRegistration, ClusterFeatureRegistration, KubeObjectDetailRegistration, KubeObjectMenuRegistration, KubeObjectStatusRegistration, PageMenuRegistration, PageRegistration, StatusBarRegistration, } from "./registries"
import { ipcRenderer } from "electron"
import { observable } from "mobx";
import { LensExtension } from "./lens-extension"
@@ -15,7 +14,8 @@ export class LensRendererExtension extends LensExtension {
@observable.shallow kubeObjectDetailItems: KubeObjectDetailRegistration[] = []
@observable.shallow kubeObjectMenuItems: KubeObjectMenuRegistration[] = []
navigate(location: string) {
ipcRenderer.emit("renderer:navigate", this.getPageUrl(location))
async navigate(location?: string) {
const { navigate } = await import("../renderer/navigation");
navigate(this.getPageUrl(location));
}
}