1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-11-11 19:31:58 +02:00
parent 5393cf4ec9
commit 3bad5ddea6
6 changed files with 16 additions and 19 deletions

View File

@ -1,4 +1,4 @@
import { LensMainExtension, Navigation } from "@k8slens/extensions"; import { LensMainExtension } from "@k8slens/extensions";
import { supportPageURL } from "./src/support.route"; import { supportPageURL } from "./src/support.route";
export default class SupportPageMainExtension extends LensMainExtension { export default class SupportPageMainExtension extends LensMainExtension {
@ -6,8 +6,8 @@ export default class SupportPageMainExtension extends LensMainExtension {
{ {
parentId: "help", parentId: "help",
label: "Support", label: "Support",
click() { click: () => {
Navigation.navigate(supportPageURL()); this.navigate(supportPageURL());
} }
} }
] ]

View File

@ -26,6 +26,12 @@
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
"dev": true "dev": true
}, },
"@types/node": {
"version": "14.14.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==",
"dev": true
},
"@types/prop-types": { "@types/prop-types": {
"version": "15.7.3", "version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",

View File

@ -8,13 +8,11 @@ import * as EventBus from "./event-bus"
import * as Store from "./stores" import * as Store from "./stores"
import * as Util from "./utils" import * as Util from "./utils"
import * as ClusterFeature from "./cluster-feature" import * as ClusterFeature from "./cluster-feature"
import * as Navigation from "./navigation"
export { export {
App, App,
EventBus, EventBus,
ClusterFeature, ClusterFeature,
Navigation,
Store, Store,
Util, Util,
} }

View File

@ -1,14 +0,0 @@
import { ipcMain } from "electron";
import { WindowManager } from "../../main/window-manager";
import { navigate as navRenderer } from "../../renderer/navigation";
export { hideDetails, showDetails, getDetailsUrl } from "../../renderer/navigation"
export { RouteProps } from "react-router"
export { IURLParams } from "../../common/utils/buildUrl";
export async function navigate(location: string) {
if (ipcMain) {
await WindowManager.getInstance<WindowManager>().navigate(location)
} else {
navRenderer(location)
}
}

View File

@ -1,7 +1,12 @@
import type { MenuRegistration } from "./registries/menu-registry"; import type { MenuRegistration } from "./registries/menu-registry";
import { observable } from "mobx"; import { observable } from "mobx";
import { LensExtension } from "./lens-extension" import { LensExtension } from "./lens-extension"
import { WindowManager } from "../main/window-manager";
export class LensMainExtension extends LensExtension { export class LensMainExtension extends LensExtension {
@observable.shallow appMenus: MenuRegistration[] = [] @observable.shallow appMenus: MenuRegistration[] = []
async navigate(location: string, frameId?: number) {
await WindowManager.getInstance<WindowManager>().navigate(location, frameId)
}
} }

View File

@ -3,8 +3,10 @@
// APIs // APIs
import * as Component from "./components" import * as Component from "./components"
import * as K8sApi from "./k8s-api" import * as K8sApi from "./k8s-api"
import * as Navigation from "./navigation"
export { export {
Component, Component,
K8sApi, K8sApi,
Navigation
} }