-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrenderer.tsx
38 lines (35 loc) · 1.21 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
import { Renderer } from "@k8slens/extensions"
import React from "react"
import { PodLogsMenuItem } from "./src/pod-logs-menu"
type Pod = Renderer.K8sApi.Pod
/**
*
* RendererExtension which extends LensRendererExtension runs in Lens' 'renderer' process (NOT 'main' process)
* main vs renderer <https://www.electronjs.org/docs/tutorial/quick-start#main-and-renderer-processes>
*
* LensRendererExtension is the interface to Lens' renderer process. Its api allows you to access, configure,
* and customize Lens data add custom Lens UI elements, and generally run custom code in Lens' renderer process.
*
* To see console statements in 'renderer' process, go to the console tab in DevTools in Lens
* View > Toggle Developer Tools > Console.
*
*/
export default class OciImageExtensionRenderer extends Renderer.LensExtension {
/**
* onActivate is called when your extension has been successfully enabled.
*/
onActivate() {
console.log("activated")
}
kubeObjectMenuItems = [
{
kind: "Pod",
apiVersions: ["v1"],
components: {
MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Pod>) => (
<PodLogsMenuItem {...props} />
),
},
},
]
}