mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fixes
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
0d16f6132d
commit
182346095b
@ -7,7 +7,7 @@ export default class SupportPageMainExtension extends LensMainExtension {
|
||||
parentId: "help",
|
||||
label: "Support",
|
||||
click: () => {
|
||||
this.navigate(this.getPageUrl(pageUrl)); // todo: simplify
|
||||
this.navigate(pageUrl);
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { Component, Interface, LensRendererExtension, Navigation } from "@k8slens/extensions";
|
||||
import { Component, Interface, LensRendererExtension } from "@k8slens/extensions";
|
||||
import { Support } from "./src/support";
|
||||
import { pageRoute, pageUrl } from "./src/common-vars";
|
||||
|
||||
@ -16,10 +16,7 @@ export default class SupportPageRendererExtension extends LensRendererExtension
|
||||
statusBarItems = [
|
||||
{
|
||||
item: (
|
||||
<div
|
||||
className="flex align-center gaps hover-highlight"
|
||||
onClick={() => Navigation.navigate(this.getPageUrl(pageUrl))}
|
||||
>
|
||||
<div className="flex align-center gaps hover-highlight" onClick={() => this.navigate(pageUrl)}>
|
||||
<Component.Icon material="help" smallest/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -7,6 +7,8 @@ export class LensMainExtension extends LensExtension {
|
||||
@observable.shallow appMenus: MenuRegistration[] = []
|
||||
|
||||
async navigate(location: string, frameId?: number) {
|
||||
await WindowManager.getInstance<WindowManager>().navigate(location, frameId)
|
||||
const windowManager = WindowManager.getInstance<WindowManager>();
|
||||
const url = this.getPageUrl(location);
|
||||
await windowManager.navigate(url, frameId)
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,4 +17,9 @@ export class LensRendererExtension extends LensExtension {
|
||||
@observable.shallow statusBarItems: StatusBarRegistration[] = []
|
||||
@observable.shallow kubeObjectDetailItems: KubeObjectDetailRegistration[] = []
|
||||
@observable.shallow kubeObjectMenuItems: KubeObjectMenuRegistration[] = []
|
||||
|
||||
async navigate(location: string){
|
||||
const { navigate } = await import("../renderer/navigation");
|
||||
navigate(this.getPageUrl(location));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
export { RouteProps } from "react-router"
|
||||
export { navigate } from "../../renderer/navigation";
|
||||
export { hideDetails, showDetails, getDetailsUrl } from "../../renderer/navigation"
|
||||
export { IURLParams } from "../../common/utils/buildUrl";
|
||||
|
||||
@ -4,11 +4,11 @@ import { ipcRenderer } from "electron";
|
||||
import { matchPath, RouteProps } from "react-router";
|
||||
import { reaction } from "mobx";
|
||||
import { createObservableHistory } from "mobx-observable-history";
|
||||
import { createBrowserHistory, createMemoryHistory, LocationDescriptor } from "history";
|
||||
import { createBrowserHistory, LocationDescriptor } from "history";
|
||||
import logger from "../main/logger";
|
||||
import { clusterViewRoute, IClusterViewRouteParams } from "./components/cluster-manager/cluster-view.route";
|
||||
|
||||
export const history = typeof window !== "undefined" ? createBrowserHistory() : createMemoryHistory();
|
||||
export const history = createBrowserHistory();
|
||||
export const navigation = createObservableHistory(history);
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user