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
@@ -9,10 +9,10 @@ import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
import { KubeEventDetails } from "../+events/kube-event-details";
|
||||
import { getDetailsUrl } from "../../navigation";
|
||||
import { PersistentVolume, persistentVolumeApi, pvcApi } from "../../api/endpoints";
|
||||
import { PersistentVolume, pvcApi } from "../../api/endpoints";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
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<PersistentVolume> {
|
||||
}
|
||||
@@ -103,6 +103,10 @@ export class PersistentVolumeDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(persistentVolumeApi, {
|
||||
Details: PersistentVolumeDetails
|
||||
})
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "PersistentVolume",
|
||||
apiVersions: ["v1"],
|
||||
components: {
|
||||
Details: (props) => <PersistentVolumeDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -72,20 +72,7 @@ export class PersistentVolumes extends React.Component<Props> {
|
||||
{ title: volume.getStatus(), className: volume.getStatus().toLowerCase() }
|
||||
]
|
||||
}}
|
||||
renderItemMenu={(item: PersistentVolume) => {
|
||||
return <PersistentVolumeMenu object={item}/>
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function PersistentVolumeMenu(props: KubeObjectMenuProps<PersistentVolume>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(persistentVolumeApi, {
|
||||
Menu: PersistentVolumeMenu,
|
||||
})
|
||||
Reference in new issue
Block a user