-
Notifications
You must be signed in to change notification settings - Fork 25
/
renderer.tsx
105 lines (99 loc) · 2.79 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import React from "react"
import { Renderer } from "@k8slens/extensions";
import { KubeForceChart, KubeResourcePage } from "./components"
import { KubeControllerChart } from "./components/KubeControllerChart";
import { KubePodChart } from "./components/KubePodChart";
import { KubeIngressChart } from "./components/KubeIngressChart";
import { KubeServiceChart } from "./components/KubeServiceChart";
export default class KubeResorceMapRenderer extends Renderer.LensExtension {
kubeObjectDetailItems = [
{
kind: "Deployment",
apiVersions: ["apps/v1"],
priority: 10,
components: {
Details: (props: Renderer.Component.KubeObjectDetailsProps<Renderer.K8sApi.Deployment>) => <KubeControllerChart {...props} />
}
},
{
kind: "DaemonSet",
apiVersions: ["apps/v1"],
priority: 10,
components: {
Details: (props: Renderer.Component.KubeObjectDetailsProps<Renderer.K8sApi.DaemonSet>) => <KubeControllerChart {...props} />
}
},
{
kind: "StatefulSet",
apiVersions: ["apps/v1"],
priority: 10,
components: {
Details: (props: Renderer.Component.KubeObjectDetailsProps<Renderer.K8sApi.StatefulSet>) => <KubeControllerChart {...props} />
}
},
{
kind: "Pod",
apiVersions: ["v1"],
priority: 10,
components: {
Details: (props: Renderer.Component.KubeObjectDetailsProps<Renderer.K8sApi.Pod>) => <KubePodChart {...props} />
}
},
{
kind: "Service",
apiVersions: ["v1"],
priority: 10,
components: {
Details: (props: Renderer.Component.KubeObjectDetailsProps<Renderer.K8sApi.Pod>) => <KubeServiceChart {...props} />
}
},
{
kind: "Ingress",
apiVersions: ["networking.k8s.io/v1"],
priority: 10,
components: {
Details: (props: Renderer.Component.KubeObjectDetailsProps<Renderer.K8sApi.Pod>) => <KubeIngressChart {...props} />
}
}
];
clusterPages = [
{
components: {
Page: KubeResourcePage
}
},
]
clusterPageMenus = [
{
title: "Resource Map",
components: {
Icon: MenuIcon,
}
}
]
kubeWorkloadsOverviewItems = [
{
priority: 25,
components : {
Details: () => { return (
<div className="ResourceMapOverviewDetail">
<div className="header flex gaps align-center">
<h5 className="box grow">Resources</h5>
</div>
<div className="content">
<KubeForceChart height={480} />
</div>
</div>
)}
}
}
]
}
export function MenuIcon(props: Renderer.Component.IconProps): React.ReactElement {
return (
<Renderer.Component.Icon
material="bubble_chart"
onClick={() => this.navigate()}
/>
)
}