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
@@ -11,9 +11,9 @@ import { Button } from "../button";
|
||||
import { KubeEventDetails } from "../+events/kube-event-details";
|
||||
import { configMapsStore } from "./config-maps.store";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { ConfigMap, configMapApi } from "../../api/endpoints";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { ConfigMap } from "../../api/endpoints";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<ConfigMap> {
|
||||
}
|
||||
@@ -94,6 +94,10 @@ export class ConfigMapDetails extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
apiManager.registerViews(configMapApi, {
|
||||
Details: ConfigMapDetails
|
||||
})
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "ConfigMap",
|
||||
apiVersions: ["v1"],
|
||||
components: {
|
||||
Details: (props) => <ConfigMapDetails {...props} />
|
||||
}
|
||||
})
|
||||
@@ -50,20 +50,8 @@ export class ConfigMaps extends React.Component<Props> {
|
||||
configMap.getKeys().join(", "),
|
||||
configMap.getAge(),
|
||||
]}
|
||||
renderItemMenu={(item: ConfigMap) => {
|
||||
return <ConfigMapMenu object={item}/>
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function ConfigMapMenu(props: KubeObjectMenuProps<ConfigMap>) {
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
apiManager.registerViews(configMapApi, {
|
||||
Menu: ConfigMapMenu,
|
||||
})
|
||||
Reference in new issue
Block a user