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
@@ -6,11 +6,12 @@ import { Trans } from "@lingui/macro";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { cpuUnitsToNumber, cssNames, unitsToBytes, metricUnitsToNumber } from "../../utils";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { ResourceQuota, resourceQuotaApi } from "../../api/endpoints/resource-quota.api";
|
||||
import { ResourceQuota } from "../../api/endpoints/resource-quota.api";
|
||||
import { LineProgress } from "../line-progress";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
import { ReplicaSetDetails } from "../+workloads-replicasets";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<ResourceQuota> {
|
||||
}
|
||||
@@ -97,6 +98,10 @@ export class ResourceQuotaDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(resourceQuotaApi, {
|
||||
Details: ResourceQuotaDetails
|
||||
})
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "ResourceQuota",
|
||||
apiVersions: ["v1"],
|
||||
components: {
|
||||
Details: (props) => <ReplicaSetDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -48,9 +48,6 @@ export class ResourceQuotas extends React.Component<Props> {
|
||||
resourceQuota.getNs(),
|
||||
resourceQuota.getAge(),
|
||||
]}
|
||||
renderItemMenu={(item: ResourceQuota) => {
|
||||
return <ResourceQuotaMenu object={item}/>
|
||||
}}
|
||||
addRemoveButtons={{
|
||||
onAdd: () => AddQuotaDialog.open(),
|
||||
addTooltip: <Trans>Create new ResourceQuota</Trans>
|
||||
@@ -61,13 +58,3 @@ export class ResourceQuotas extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function ResourceQuotaMenu(props: KubeObjectMenuProps<ResourceQuota>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
);
|
||||
}
|
||||
|
||||
apiManager.registerViews(resourceQuotaApi, {
|
||||
Menu: ResourceQuotaMenu,
|
||||
})
|
||||
Reference in new issue
Block a user