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
+10
-8
@@ -3,14 +3,12 @@ import "./pod-disruption-budgets-details.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { DrawerItem } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { PodDisruptionBudget, pdbApi } from "../../api/endpoints";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { KubeObjectStore } from "../../kube-object.store";
|
||||
import { PodDisruptionBudget } from "../../api/endpoints";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<PodDisruptionBudget> {
|
||||
}
|
||||
@@ -56,6 +54,10 @@ export class PodDisruptionBudgetDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(pdbApi, {
|
||||
Details: PodDisruptionBudgetDetails,
|
||||
});
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "PodDisruptionBudget",
|
||||
apiVersions: ["policy/v1beta1"],
|
||||
components: {
|
||||
Details: (props) => <PodDisruptionBudgetDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -64,20 +64,7 @@ export class PodDisruptionBudgets extends React.Component<Props> {
|
||||
pdb.getAge(),
|
||||
]
|
||||
}}
|
||||
renderItemMenu={(pdb: PodDisruptionBudget) => {
|
||||
return <PodDisruptionBudgetsMenu object={pdb}/>
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function PodDisruptionBudgetsMenu(props: KubeObjectMenuProps<PodDisruptionBudget>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(pdbApi, {
|
||||
Menu: PodDisruptionBudgetsMenu,
|
||||
})
|
||||
Reference in new issue
Block a user