-
Notifications
You must be signed in to change notification settings - Fork 46
/
renderer.tsx
44 lines (42 loc) · 1.32 KB
/
renderer.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { Renderer } from "@k8slens/extensions";
import { NodeMenu } from "./src/node-menu";
import { PodAttachMenu } from "./src/attach-menu";
import { PodShellMenu } from "./src/shell-menu";
import { PodLogsMenu } from "./src/logs-menu";
import React from "react";
export default class PodMenuRendererExtension extends Renderer.LensExtension {
kubeObjectMenuItems = [
{
kind: "Node",
apiVersions: ["v1"],
components: {
MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Node>) => <NodeMenu {...props} />,
},
},
{
kind: "Pod",
apiVersions: ["v1"],
components: {
MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Pod>) => <PodAttachMenu {...props} />,
},
},
{
kind: "Pod",
apiVersions: ["v1"],
components: {
MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Pod>) => <PodShellMenu {...props} />,
},
},
{
kind: "Pod",
apiVersions: ["v1"],
components: {
MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Pod>) => <PodLogsMenu {...props} />,
},
},
];
}