mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allow extensions to register kube-object menus + details (#1108)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
91bef77997
commit
99db7aca19
101 files changed
+7858
-1604
No files matched your search
@@ -5,15 +5,15 @@ import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { reaction } from "mobx";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Ingress, ILoadBalancerIngress, ingressApi } from "../../api/endpoints";
|
||||
import { Ingress, ILoadBalancerIngress } from "../../api/endpoints";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { KubeEventDetails } from "../+events/kube-event-details";
|
||||
import { ingressStore } from "./ingress.store";
|
||||
import { ResourceMetrics } from "../resource-metrics";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { IngressCharts } from "./ingress-charts";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<Ingress> {
|
||||
}
|
||||
@@ -134,6 +134,10 @@ export class IngressDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(ingressApi, {
|
||||
Details: IngressDetails,
|
||||
})
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "Ingress",
|
||||
apiVersions: ["extensions/v1beta1"],
|
||||
components: {
|
||||
Details: (props) => <IngressDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -48,9 +48,6 @@ export class Ingresses extends React.Component<Props> {
|
||||
ingress.getRoutes().map(route => <p key={route}>{route}</p>),
|
||||
ingress.getAge(),
|
||||
]}
|
||||
renderItemMenu={(item: Ingress) => {
|
||||
return <IngressMenu object={item}/>
|
||||
}}
|
||||
tableProps={{
|
||||
customRowHeights: (item: Ingress, lineHeight, paddings) => {
|
||||
const lines = item.getRoutes().length || 1;
|
||||
@@ -61,13 +58,3 @@ export class Ingresses extends React.Component<Props> {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function IngressMenu(props: KubeObjectMenuProps<Ingress>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(ingressApi, {
|
||||
Menu: IngressMenu
|
||||
})
|
||||
Reference in new issue
Block a user