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
@@ -15,11 +15,11 @@ import { podsStore } from "../+workloads-pods/pods.store";
|
||||
import { jobStore } from "./job.store";
|
||||
import { getDetailsUrl } from "../../navigation";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { Job, jobApi } from "../../api/endpoints";
|
||||
import { Job } from "../../api/endpoints";
|
||||
import { PodDetailsList } from "../+workloads-pods/pod-details-list";
|
||||
import { lookupApiLink } from "../../api/kube-api";
|
||||
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<Job> {
|
||||
}
|
||||
@@ -107,6 +107,10 @@ export class JobDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(jobApi, {
|
||||
Details: JobDetails
|
||||
});
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "Job",
|
||||
apiVersions: ["batch/v1"],
|
||||
components: {
|
||||
Details: (props: any) => <JobDetails {...props}/>
|
||||
}
|
||||
})
|
||||
@@ -64,20 +64,7 @@ export class Jobs extends React.Component<Props> {
|
||||
}
|
||||
]
|
||||
}}
|
||||
renderItemMenu={(item: Job) => {
|
||||
return <JobMenu object={item}/>
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function JobMenu(props: KubeObjectMenuProps<Job>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(jobApi, {
|
||||
Menu: JobMenu,
|
||||
})
|
||||
Reference in new issue
Block a user