mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix issues with crd plugins (#243)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
298636b8f1
commit
4cd616bf65
8 files changed
+14
-39
No files matched your search
@@ -39,24 +39,6 @@ export class Config extends React.Component {
|
||||
url: resourceQuotaURL({ query }),
|
||||
path: resourceQuotaRoute.path,
|
||||
},
|
||||
{
|
||||
title: <Trans>Certificates</Trans>,
|
||||
component: Certificates,
|
||||
url: certificatesURL({ query }),
|
||||
path: certificatesURL(),
|
||||
},
|
||||
{
|
||||
title: <Trans>Issuers</Trans>,
|
||||
component: Issuers,
|
||||
url: issuersURL({ query }),
|
||||
path: issuersURL(),
|
||||
},
|
||||
{
|
||||
title: <Trans>Cluster Issuers</Trans>,
|
||||
component: ClusterIssuers,
|
||||
url: clusterIssuersURL(),
|
||||
path: clusterIssuersURL(),
|
||||
},
|
||||
{
|
||||
title: <Trans>HPA</Trans>,
|
||||
component: HorizontalPodAutoscalers,
|
||||
@@ -77,4 +59,4 @@ export class Config extends React.Component {
|
||||
</MainLayout>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -139,4 +139,4 @@ export class CertificateDetails extends React.Component<Props> {
|
||||
|
||||
apiManager.registerViews(certificatesApi, {
|
||||
Details: CertificateDetails
|
||||
})
|
||||
})
|
||||
@@ -101,5 +101,5 @@ export function CertificateMenu(props: KubeObjectMenuProps<Certificate>) {
|
||||
|
||||
apiManager.registerViews(certificatesApi, {
|
||||
List: Certificates,
|
||||
Menu: CertificateMenu,
|
||||
})
|
||||
Menu: CertificateMenu
|
||||
})
|
||||
@@ -14,9 +14,6 @@ export class CRDStore extends KubeObjectStore<CustomResourceDefinition> {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// auto-load crd-s for building sub-menus
|
||||
this.loadAll();
|
||||
|
||||
// auto-init stores for crd-s
|
||||
reaction(() => this.items.toJS(), items => {
|
||||
items.forEach(this.initStore);
|
||||
|
||||
@@ -69,7 +69,7 @@ export class KubeObjectDetails extends React.Component {
|
||||
const { kind, getName, selfLink } = object;
|
||||
title = `${kind}: ${getName()}`;
|
||||
apiComponents = apiManager.getViews(selfLink);
|
||||
if (isCrdInstance) {
|
||||
if (isCrdInstance && !apiComponents.Details) {
|
||||
apiComponents.Details = CrdResourceDetails
|
||||
apiComponents.Menu = CrdResourceMenu
|
||||
}
|
||||
|
||||
@@ -4,20 +4,13 @@ import * as React from "react";
|
||||
import { observable, reaction } from "mobx";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { matchPath, RouteProps } from "react-router-dom";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { createStorage, cssNames, isElectron } from "../../utils";
|
||||
import { createStorage, cssNames } from "../../utils";
|
||||
import { Tab, Tabs } from "../tabs";
|
||||
import { Icon } from "../icon";
|
||||
import { openUserKubeConfig } from "../kubeconfig-dialog";
|
||||
import { Sidebar } from "./sidebar";
|
||||
import { configStore } from "../../config.store";
|
||||
import { ErrorBoundary } from "../error-boundary";
|
||||
import { Dock } from "../dock";
|
||||
import { MenuItem } from "../menu";
|
||||
import { MenuActions } from "../menu/menu-actions";
|
||||
import { navigate, navigation } from "../../navigation";
|
||||
import { i18nStore } from "../../i18n";
|
||||
import { Badge } from "../badge";
|
||||
import { themeStore } from "../../theme.store";
|
||||
|
||||
export interface TabRoute extends RouteProps {
|
||||
@@ -54,9 +47,8 @@ export class MainLayout extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { className, contentClass, headerClass, tabs, footer, footerClass, children } = this.props;
|
||||
const { clusterName, username, lensVersion, kubectlAccess } = configStore.config;
|
||||
const { clusterName } = configStore.config;
|
||||
const { pathname } = navigation.location;
|
||||
const { languages, setLocale, activeLang } = i18nStore;
|
||||
return (
|
||||
<div className={cssNames("MainLayout", className, themeStore.activeTheme.type)}>
|
||||
<header className={cssNames("flex gaps align-center", headerClass)}>
|
||||
|
||||
@@ -42,6 +42,10 @@ interface Props {
|
||||
|
||||
@observer
|
||||
export class Sidebar extends React.Component<Props> {
|
||||
async componentDidMount() {
|
||||
if (!crdStore.isLoaded) crdStore.loadAll()
|
||||
}
|
||||
|
||||
renderCustomResources() {
|
||||
return Object.entries(crdStore.groups).map(([group, crds]) => {
|
||||
const submenus = crds.map(crd => {
|
||||
|
||||
Reference in new issue
Block a user