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
@@ -7,13 +7,13 @@ import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Badge } from "../badge";
|
||||
import { KubeEventDetails } from "../+events/kube-event-details";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { Service, serviceApi, endpointApi } from "../../api/endpoints";
|
||||
import { Service, endpointApi } from "../../api/endpoints";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { ServicePortComponent } from "./service-port-component";
|
||||
import { endpointStore } from "../+network-endpoints/endpoints.store";
|
||||
import { ServiceDetailsEndpoint } from "./service-details-endpoint";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<Service> {
|
||||
}
|
||||
@@ -85,6 +85,10 @@ export class ServiceDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(serviceApi, {
|
||||
Details: ServiceDetails,
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "Service",
|
||||
apiVersions: ["v1"],
|
||||
components: {
|
||||
Details: (props) => <ServiceDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -70,20 +70,7 @@ export class Services extends React.Component<Props> {
|
||||
service.getAge(),
|
||||
{ title: service.getStatus(), className: service.getStatus().toLowerCase() },
|
||||
]}
|
||||
renderItemMenu={(item: Service) => {
|
||||
return <ServiceMenu object={item}/>
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function ServiceMenu(props: KubeObjectMenuProps<Service>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(serviceApi, {
|
||||
Menu: ServiceMenu
|
||||
})
|
||||
Reference in new issue
Block a user