mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Implement extensions API for workloads overview details (#2945)
* Implement extensions API for workloads overview details Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com> * Prefix workloadsOverviewDetailItems Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com> * More renaming Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com> * Add missing registry Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
deaf67b30b
commit
9852e5cfd8
5 files changed
+72
-3
No files matched your search
@@ -38,6 +38,7 @@ import { Events } from "../+events";
|
||||
import { isAllowedResource } from "../../../common/rbac";
|
||||
import { kubeWatchApi } from "../../api/kube-watch-api";
|
||||
import { clusterContext } from "../context";
|
||||
import { workloadsOverviewDetailRegistry } from "../../../extensions/registries";
|
||||
|
||||
interface Props extends RouteComponentProps<IWorkloadsOverviewRouteParams> {
|
||||
}
|
||||
@@ -57,11 +58,34 @@ export class WorkloadsOverview extends React.Component<Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const items = workloadsOverviewDetailRegistry.getItems().map((item, index) => {
|
||||
return (
|
||||
<item.components.Details key={`workload-overview-${index}`}/>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="WorkloadsOverview flex column gaps">
|
||||
<OverviewStatuses/>
|
||||
{isAllowedResource("events") && <Events compact hideFilters className="box grow"/>}
|
||||
{items}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
workloadsOverviewDetailRegistry.add([
|
||||
{
|
||||
components: {
|
||||
Details: (props: any) => <OverviewStatuses {...props} />,
|
||||
}
|
||||
},
|
||||
{
|
||||
priority: 5,
|
||||
components: {
|
||||
Details: () => {
|
||||
return (
|
||||
isAllowedResource("events") && <Events compact hideFilters className="box grow"/>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
||||
Reference in new issue
Block a user