-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrenderer.tsx
153 lines (146 loc) · 3.99 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import {Renderer} from "@k8slens/extensions";
import React from "react";
import {ActivityDetails, ActivityDetailsProps} from "./src/components/activity-details";
import {ActivityPage} from "./src/components/activity-page";
import {Activity} from "./src/activity"
import {ActivityMenu, ActivityMenuProps} from "./src/components/activity-menu";
import {PreviewPage} from "./src/components/preview-page";
import {PreviewMenu, PreviewMenuProps} from "./src/components/preview-menu";
import {Preview} from "./src/preview";
import {RepositoryPage} from "./src/components/repository-page";
import {Repository} from "./src/repository";
import {RepositoryMenu, RepositoryMenuProps} from "./src/components/repository-menu";
import {Environment} from "./src/environment";
import {EnvironmentMenu, EnvironmentMenuProps} from "./src/components/environment-menu";
import {EnvironmentPage} from "./src/components/environment-page";
import {BreakpointPage} from "./src/components/breakpoint-page";
export function JXIcon(props: Renderer.Component.IconProps) {
const JXLogo = require(`!!raw-loader!./jx.svg`).default;
return <Renderer.Component.Icon {...props} svg={JXLogo} tooltip="Jenkins X"/>
}
export default class JenkinsXExtension extends Renderer.LensExtension {
clusterPages = [
{
id: "breakpoints",
components: {
Page: () => <BreakpointPage extension={this}/>,
MenuIcon: JXIcon,
}
}, {
id: "environments",
components: {
Page: () => <EnvironmentPage extension={this}/>,
MenuIcon: JXIcon,
}
}, {
id: "pipelines",
components: {
Page: () => <ActivityPage extension={this}/>,
MenuIcon: JXIcon,
}
}, {
id: "previews",
components: {
Page: () => <PreviewPage extension={this}/>,
MenuIcon: JXIcon,
}
}, {
id: "repositories",
components: {
Page: () => <RepositoryPage extension={this}/>,
MenuIcon: JXIcon,
}
}
]
clusterPageMenus = [
{
id: "jenkins-x",
title: "Jenkins X",
components: {
Icon: JXIcon,
}
},
{
id: "jenkins-x/breakpoints",
parentId: "jenkins-x",
target: {pageId: "breakpoints"},
title: "Breakpoints",
components: {
Icon: JXIcon,
}
},
{
id: "jenkins-x/environments",
parentId: "jenkins-x",
target: {pageId: "environments"},
title: "Environments",
components: {
Icon: JXIcon,
}
},
{
id: "jenkins-x/pipelines",
parentId: "jenkins-x",
target: {pageId: "pipelines"},
title: "Pipelines",
components: {
Icon: JXIcon,
}
},
{
id: "jenkins-x/previews",
parentId: "jenkins-x",
target: {pageId: "previews"},
title: "Previews",
components: {
Icon: JXIcon,
}
},
{
id: "jenkins-x/repositories",
parentId: "jenkins-x",
target: {pageId: "repositories"},
title: "Repositories",
components: {
Icon: JXIcon,
}
},
];
kubeObjectMenuItems = [
{
kind: Environment.kind,
apiVersions: ["jenkins.io/v1"],
components: {
MenuItem: (props: EnvironmentMenuProps) => <EnvironmentMenu {...props} />
}
},
{
kind: Activity.kind,
apiVersions: ["jenkins.io/v1"],
components: {
MenuItem: (props: ActivityMenuProps) => <ActivityMenu {...props} />
}
},
{
kind: Preview.kind,
apiVersions: ["preview.jenkins.io/v1alpha1"],
components: {
MenuItem: (props: PreviewMenuProps) => <PreviewMenu {...props} />
}
},
{
kind: Repository.kind,
apiVersions: ["jenkins.io/v1"],
components: {
MenuItem: (props: RepositoryMenuProps) => <RepositoryMenu {...props} />
}
},
];
kubeObjectDetailItems = [{
kind: Activity.kind,
apiVersions: ["jenkins.io/v1"],
components: {
Details: (props: ActivityDetailsProps) => <ActivityDetails {...props} />
}
}]
}