1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Extensions page and menu item

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-10-28 10:18:28 +03:00
parent 18ac92ebdc
commit 5abbf98905
6 changed files with 44 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import { preferencesURL } from "../renderer/components/+preferences/preferences.
import { whatsNewURL } from "../renderer/components/+whats-new/whats-new.route";
import { clusterSettingsURL } from "../renderer/components/+cluster-settings/cluster-settings.route";
import { menuRegistry } from "../extensions/registries/menu-registry";
import { extensionsURL } from "../renderer/components/+extensions";
import logger from "./logger";
export type MenuTopId = "mac" | "file" | "edit" | "view" | "help"
@ -73,6 +74,12 @@ export function buildMenu(windowManager: WindowManager) {
navigate(preferencesURL())
}
},
{
label: 'Extensions',
click() {
navigate(extensionsURL())
}
},
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },

View File

@ -0,0 +1,8 @@
import { RouteProps } from "react-router";
import { buildURL } from "../../navigation";
export const extensionsRoute: RouteProps = {
path: "/extensions"
}
export const extensionsURL = buildURL(extensionsRoute.path)

View File

@ -0,0 +1,3 @@
.Extensions {
}

View File

@ -0,0 +1,22 @@
import "./extensions.scss";
import React from "react";
import { Trans } from "@lingui/macro";
import { observer } from "mobx-react";
import { PageLayout } from "../layout/page-layout";
@observer
export class Extensions extends React.Component {
disable() {
}
render() {
const header = <h2><Trans>Extensions</Trans></h2>;
return (
<PageLayout showOnTop className="Extensions" header={header}>
<h2><Trans>List</Trans></h2>
</PageLayout>
);
}
}

View File

@ -0,0 +1 @@
export * from "./extensions.route"

View File

@ -15,6 +15,8 @@ import { clusterViewRoute, clusterViewURL, getMatchedCluster, getMatchedClusterI
import { clusterStore } from "../../../common/cluster-store";
import { hasLoadedView, initView, lensViews, refreshViews } from "./lens-views";
import { globalPageRegistry } from "../../../extensions/registries/page-registry";
import { extensionsRoute } from "../+extensions";
import { Extensions } from "../+extensions/extensions";
@observer
export class ClusterManager extends React.Component {
@ -59,6 +61,7 @@ export class ClusterManager extends React.Component {
<Switch>
<Route component={LandingPage} {...landingRoute} />
<Route component={Preferences} {...preferencesRoute} />
<Route component={Extensions} {...extensionsRoute} />
<Route component={Workspaces} {...workspacesRoute} />
<Route component={AddCluster} {...addClusterRoute} />
<Route component={ClusterView} {...clusterViewRoute} />