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
@@ -14,10 +14,10 @@ import { getDetailsUrl } from "../../navigation";
|
||||
import { ResourceMetrics } from "../resource-metrics";
|
||||
import { VolumeClaimDiskChart } from "./volume-claim-disk-chart";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { PersistentVolumeClaim, pvcApi } from "../../api/endpoints";
|
||||
import { PersistentVolumeClaim } from "../../api/endpoints";
|
||||
import { _i18n } from "../../i18n";
|
||||
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<PersistentVolumeClaim> {
|
||||
}
|
||||
@@ -95,6 +95,10 @@ export class PersistentVolumeClaimDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(pvcApi, {
|
||||
Details: PersistentVolumeClaimDetails,
|
||||
})
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "PersistentVolumeClaim",
|
||||
apiVersions: ["v1"],
|
||||
components: {
|
||||
Details: (props) => <PersistentVolumeClaimDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -82,20 +82,7 @@ export class PersistentVolumeClaims extends React.Component<Props> {
|
||||
{ title: pvc.getStatus(), className: pvc.getStatus().toLowerCase() },
|
||||
]
|
||||
}}
|
||||
renderItemMenu={(item: PersistentVolumeClaim) => {
|
||||
return <PersistentVolumeClaimMenu object={item}/>
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function PersistentVolumeClaimMenu(props: KubeObjectMenuProps<PersistentVolumeClaim>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(pvcApi, {
|
||||
Menu: PersistentVolumeClaimMenu,
|
||||
})
|
||||
Reference in new issue
Block a user