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",
|
parentId: "help",
|
||||||
label: "Support",
|
label: "Support",
|
||||||
click: () => {
|
click: () => {
|
||||||
this.navigate(this.getPageUrl(pageUrl)); // todo: simplify
|
this.navigate(pageUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
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 { Support } from "./src/support";
|
||||||
import { pageRoute, pageUrl } from "./src/common-vars";
|
import { pageRoute, pageUrl } from "./src/common-vars";
|
||||||
|
|
||||||
@ -16,10 +16,7 @@ export default class SupportPageRendererExtension extends LensRendererExtension
|
|||||||
statusBarItems = [
|
statusBarItems = [
|
||||||
{
|
{
|
||||||
item: (
|
item: (
|
||||||
<div
|
<div className="flex align-center gaps hover-highlight" onClick={() => this.navigate(pageUrl)}>
|
||||||
className="flex align-center gaps hover-highlight"
|
|
||||||
onClick={() => Navigation.navigate(this.getPageUrl(pageUrl))}
|
|
||||||
>
|
|
||||||
<Component.Icon material="help" smallest/>
|
<Component.Icon material="help" smallest/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -7,6 +7,8 @@ export class LensMainExtension extends LensExtension {
|
|||||||
@observable.shallow appMenus: MenuRegistration[] = []
|
@observable.shallow appMenus: MenuRegistration[] = []
|
||||||
|
|
||||||
async navigate(location: string, frameId?: number) {
|
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 statusBarItems: StatusBarRegistration[] = []
|
||||||
@observable.shallow kubeObjectDetailItems: KubeObjectDetailRegistration[] = []
|
@observable.shallow kubeObjectDetailItems: KubeObjectDetailRegistration[] = []
|
||||||
@observable.shallow kubeObjectMenuItems: KubeObjectMenuRegistration[] = []
|
@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 { navigate } from "../../renderer/navigation";
|
||||||
export { hideDetails, showDetails, getDetailsUrl } from "../../renderer/navigation"
|
export { hideDetails, showDetails, getDetailsUrl } from "../../renderer/navigation"
|
||||||
export { IURLParams } from "../../common/utils/buildUrl";
|
export { IURLParams } from "../../common/utils/buildUrl";
|
||||||
|
|||||||
@ -4,11 +4,11 @@ import { ipcRenderer } from "electron";
|
|||||||
import { matchPath, RouteProps } from "react-router";
|
import { matchPath, RouteProps } from "react-router";
|
||||||
import { reaction } from "mobx";
|
import { reaction } from "mobx";
|
||||||
import { createObservableHistory } from "mobx-observable-history";
|
import { createObservableHistory } from "mobx-observable-history";
|
||||||
import { createBrowserHistory, createMemoryHistory, LocationDescriptor } from "history";
|
import { createBrowserHistory, LocationDescriptor } from "history";
|
||||||
import logger from "../main/logger";
|
import logger from "../main/logger";
|
||||||
import { clusterViewRoute, IClusterViewRouteParams } from "./components/cluster-manager/cluster-view.route";
|
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);
|
export const navigation = createObservableHistory(history);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user