Commit 03565a2f authored by René Dudfield's avatar René Dudfield
Browse files

docs: Update plugin API markdown with make docs

parent e01c4cca
main a11y-reporting action-button-improvements add-cluster-to-notification-area add-clusters-dynamically add-direct-c-o-c add-fullscreen-to-editor add-labs add-more-log-options add-msi-installer add-network-policy-api add-notification-area add-notification-page add-ports-to-pods add-proxy-endpoint add-router-to-pluginLib add_manual_trigger_docker_action allow-listing-per-namespace allow-popups-in-app allow-to-build-without-checking-for-updates app-menus apply-multiple-resources autoscalers_resource_quota backend-dependencies branding-change build-app-with-plugins bump-chocolatey-0.13.0 center-cluster-chooser change-logo chart-0.10.1 choco-bump-0.12.1 cluster_chooser codegen config_from_env custom-resource-fixing de-de dep-updates2 dependabot/npm_and_yarn/app/electron-13.6.6 dependabot/npm_and_yarn/app/electron-15.5.5 dependabot/npm_and_yarn/app/minimist-1.2.6 dependabot/npm_and_yarn/frontend/async-2.6.4 dependabot/npm_and_yarn/frontend/d3-color-and-recharts-3.1.0 dependabot/npm_and_yarn/frontend/deep-object-diff-1.1.9 dependabot/npm_and_yarn/frontend/loader-utils-1.4.2 dependabot/npm_and_yarn/frontend/minimist-1.2.6 dependabot/npm_and_yarn/frontend/terser-4.8.1 dependabot/npm_and_yarn/frontend/url-parse-1.5.10 dependabot/npm_and_yarn/plugins/examples/app-menus/terser-5.14.2 dependabot/npm_and_yarn/plugins/examples/change-logo/glob-parent-and-kinvolk/headlamp-plugin-5.1.2 dependabot/npm_and_yarn/plugins/examples/change-logo/terser-5.14.2 dependabot/npm_and_yarn/plugins/examples/cluster-chooser/glob-parent-and-kinvolk/headlamp-plugin-5.1.2 dependabot/npm_and_yarn/plugins/examples/cluster-chooser/terser-5.14.2 dependabot/npm_and_yarn/plugins/examples/dynamic-clusters/glob-parent-and-kinvolk/headlamp-plugin-5.1.2 dependabot/npm_and_yarn/plugins/examples/dynamic-clusters/terser-5.14.2 dependabot/npm_and_yarn/plugins/examples/sidebar/terser-5.14.2 dependabot/npm_and_yarn/plugins/headlamp-plugin/async-3.2.3 dependabot/npm_and_yarn/plugins/headlamp-plugin/minimist-1.2.6 dependabot/npm_and_yarn/plugins/headlamp-plugin/terser-5.14.2 docker_desktop_ext docs-allow-to-build-without-checking-for-updates dont-cache-plugin-requests-on-desktop dont-use-a-one-click-installer-on-windows dont-wrap-header-cells e2e-container e2e-login e2e-playwright endpoints errcb-fix event-sorting example-fixes export-charts export-resource-chart-and-lib export_all_k8s_modules fetch-pods-by-labels fix-applying-ingresses fix-cluster-chooser fix-crash-in-label-selector fix-default-page-rows fix-filter-when-items-are-numbers fix-front-start fix-issue-in-page-grid-children-type fix-kubeconfig fix-navigating-during-delete-op fix-plugin-imports-again fix-quitting-server-again fix-release-note-stuck-issue fix-simple-table fix-table-filter fix-unexpected-null-in-getOwnedPods fix_manual_trigger_gh_action fr-fr fullscreen_dialog gh_action_automate_pr go-back-through-location-stack golang-17 handle-custom-auth-desktop headlamp-plugin-0.5.1-b headlamp-plugin-0.5.2-b headlamp-plugin-upgrade headlamp-upgrade-audit headless-fix headless-ux helm-fixes helm-typo-docs-fix hide-appbar improve-app-menus improve-pod-matcher improve-pod-status inno-setup jrocha/wip/show-build-version localefix log-viewer-scroll-fix mui-v5-upgrade namespaces-filter new-chooser-style new-k8s-secret new-terminal-fixes no-cluster-no-auth-required no-objects-in-plugins-redux notification-clear-and-all-read oidc-fix oidc-state-len-fix optimize-use-get persist-rows-per-page persist-url-params plugin-docs plugin-error-handling plugin-fixes plugin-improvements plugin-source plugin-tests-in-js plugin/allow-cluster-chooser-overriding plugins-in-style port-forwarding push-asset rc-0.10.0 rc-0.10.1 rc-0.11.0 rc-0.11.1 rc-0.12.0 rc-0.12.1 rc-0.13.0 rc-0.8.0 rc-0.9.0 redux-extension refresh_token remove-plugin-video rename-server render-logs-using-xterm resource-class-issue resources-json role_bind_info scaling-ui search-involved-object-type-events-table set-default-namespace shorter-resource-age show-build-version show-dialog-if-release-fetch-failed show-external-ips sidebar-icons sidebarroutefilter simple-table-details-from-url simplify-testing terminal-fixes test-cleanup test-stuff typedoc-plugin-upgrade update-examples-052 update-i18n update-release-draft update-signing-email upgrade-new-things use-fixed-date-on-tests use-shipped-tsconfig-for-plugins wait-for-plugins width-cosmetic-fixes windows-testing xterm-windows-mode v0.13.0 v0.12.1 v0.12.0 v0.11.1 v0.11.0 v0.10.1 v0.10.0 v0.9.0 v0.8.0 headlamp-plugin-0.5.3 headlamp-plugin-0.5.2 headlamp-plugin-0.5.1 headlamp-plugin-0.5.0 headlamp-plugin-0.4.9 headlamp-plugin-0.4.8 headlamp-plugin-0.4.7 headlamp-helm-0.8.0 headlamp-helm-0.7.0 headlamp-helm-0.6.0 headlamp-helm-0.5.0 headlamp-helm-0.4.0 headlamp-helm-0.3.0 headlamp-helm-0.2.0
No related merge requests found
Showing with 162 additions and 59 deletions
+162 -59
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
\ No newline at end of file
...@@ -8,5 +8,5 @@ slug: "_index" ...@@ -8,5 +8,5 @@ slug: "_index"
- [lib/k8s](modules/lib_k8s.md) - [lib/k8s](modules/lib_k8s.md)
- [lib/util](modules/lib_util.md) - [lib/util](modules/lib_util.md)
- [plugin](modules/plugin.md) - [plugin/lib](modules/plugin_lib.md)
- [plugin/registry](modules/plugin_registry.md) - [plugin/registry](modules/plugin_registry.md)
---
title: "Class: Headlamp"
linkTitle: "Headlamp"
slug: "plugin_lib.Headlamp"
---
[plugin/lib](../modules/plugin_lib.md).Headlamp
This class is a more convenient way for plugins to call registerPlugin in order to register
themselves.
## Constructors
### constructor
**new Headlamp**()
## Methods
### registerPlugin
`Static` **registerPlugin**(`pluginId`, `pluginObj`): `void`
Got a new plugin to add? Well, registerPlugin is your friend.
**`example`**
```javascript
const myPlugin = {
initialize: (register) => {
// do some stuff with register
// use some libraries in window.pluginLib
return true;
}
}
Headlamp.registerPlugin("aPluginIdString", myPlugin)
```
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `pluginId` | `string` | a unique id string for your plugin. |
| `pluginObj` | [`Plugin`](plugin_lib.Plugin.md) | the plugin being added. |
#### Returns
`void`
#### Defined in
[plugin/lib.ts:134](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/lib.ts#L134)
--- ---
title: "Class: Plugin" title: "Class: Plugin"
linkTitle: "Plugin" linkTitle: "Plugin"
slug: "plugin.Plugin" slug: "plugin_lib.Plugin"
--- ---
[plugin](../modules/plugin.md).Plugin [plugin/lib](../modules/plugin_lib.md).Plugin
Plugins should call registerPlugin(pluginId: string, pluginObj: Plugin) to register themselves. Plugins should call Headlamp.registerPlugin(pluginId: string, pluginObj: Plugin) to register themselves.
They will have their initialize(register) method called at plugin initialization time. They will have their initialize(register) method called at plugin initialization time.
...@@ -38,4 +38,4 @@ initialize is called for each plugin with a Registry which gives the plugin meth ...@@ -38,4 +38,4 @@ initialize is called for each plugin with a Registry which gives the plugin meth
#### Defined in #### Defined in
plugin/index.tsx:86 [plugin/lib.ts:94](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/lib.ts#L94)
...@@ -39,7 +39,7 @@ register.registerAppBarAction('monitor', () => <MonitorLink /> ); ...@@ -39,7 +39,7 @@ register.registerAppBarAction('monitor', () => <MonitorLink /> );
#### Defined in #### Defined in
plugin/registry.tsx:101 [plugin/registry.tsx:110](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/registry.tsx#L110)
___ ___
...@@ -70,7 +70,36 @@ register.registerDetailsViewHeaderAction('traces', (props) => ...@@ -70,7 +70,36 @@ register.registerDetailsViewHeaderAction('traces', (props) =>
#### Defined in #### Defined in
plugin/registry.tsx:82 [plugin/registry.tsx:91](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/registry.tsx#L91)
___
### registerDetailsViewSection
**registerDetailsViewSection**(`sectionName`, `sectionFunc`): `void`
Append the specified title and component to the details view.
**`example`**
```JSX
register.registerDetailsViewSection("biolatency", (resource: KubeObject) => { title: 'Block I/O Latency', component: (props) => <BioLatency {...props} resource={resource}/>});
```
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `sectionName` | `string` | a unique name for it |
| `sectionFunc` | [`sectionFunc`](../modules/plugin_registry.md#sectionfunc) | a function that returns your detail view component with props passed into it and the section title |
#### Returns
`void`
#### Defined in
[plugin/registry.tsx:126](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/registry.tsx#L126)
___ ___
...@@ -106,7 +135,7 @@ register.registerRoute({ ...@@ -106,7 +135,7 @@ register.registerRoute({
#### Defined in #### Defined in
plugin/registry.tsx:63 [plugin/registry.tsx:72](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/registry.tsx#L72)
___ ___
...@@ -139,4 +168,4 @@ registerSidebarItem('cluster', 'traces', 'Traces', '/traces'); ...@@ -139,4 +168,4 @@ registerSidebarItem('cluster', 'traces', 'Traces', '/traces');
#### Defined in #### Defined in
plugin/registry.tsx:26 [plugin/registry.tsx:35](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/registry.tsx#L35)
...@@ -14,7 +14,7 @@ slug: "lib_util.FilterState" ...@@ -14,7 +14,7 @@ slug: "lib_util.FilterState"
#### Defined in #### Defined in
lib/util.ts:80 [lib/util.ts:81](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L81)
___ ___
...@@ -24,4 +24,4 @@ ___ ...@@ -24,4 +24,4 @@ ___
#### Defined in #### Defined in
lib/util.ts:81 [lib/util.ts:82](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L82)
...@@ -8,7 +8,7 @@ slug: "lib_k8s" ...@@ -8,7 +8,7 @@ slug: "lib_k8s"
### ResourceClasses ### ResourceClasses
`Const` **ResourceClasses**: `Object` **ResourceClasses**: `Object` = `resourceClassesDict`
#### Index signature #### Index signature
...@@ -16,7 +16,7 @@ slug: "lib_k8s" ...@@ -16,7 +16,7 @@ slug: "lib_k8s"
#### Defined in #### Defined in
lib/k8s/index.ts:71 [lib/k8s/index.ts:73](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/k8s/index.ts#L73)
## Functions ## Functions
...@@ -30,7 +30,7 @@ lib/k8s/index.ts:71 ...@@ -30,7 +30,7 @@ lib/k8s/index.ts:71
#### Defined in #### Defined in
lib/k8s/index.ts:143 [lib/k8s/index.ts:145](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/k8s/index.ts#L145)
___ ___
...@@ -44,7 +44,7 @@ ___ ...@@ -44,7 +44,7 @@ ___
#### Defined in #### Defined in
lib/k8s/index.ts:126 [lib/k8s/index.ts:128](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/k8s/index.ts#L128)
___ ___
...@@ -58,7 +58,7 @@ ___ ...@@ -58,7 +58,7 @@ ___
#### Defined in #### Defined in
lib/k8s/index.ts:78 [lib/k8s/index.ts:80](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/k8s/index.ts#L80)
___ ___
...@@ -78,4 +78,4 @@ ___ ...@@ -78,4 +78,4 @@ ___
#### Defined in #### Defined in
lib/k8s/index.ts:149 [lib/k8s/index.ts:151](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/k8s/index.ts#L151)
...@@ -12,17 +12,17 @@ slug: "lib_util" ...@@ -12,17 +12,17 @@ slug: "lib_util"
### CLUSTER\_ACTION\_GRACE\_PERIOD ### CLUSTER\_ACTION\_GRACE\_PERIOD
`Const` **CLUSTER\_ACTION\_GRACE\_PERIOD**: ``5000`` **CLUSTER\_ACTION\_GRACE\_PERIOD**: ``5000``
#### Defined in #### Defined in
lib/util.ts:17 [lib/util.ts:18](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L18)
## Functions ## Functions
### filterResource ### filterResource
**filterResource**(`item`, `filter`): `boolean` **filterResource**(`item`, `filter`, `matchCriteria?`): `boolean`
#### Parameters #### Parameters
...@@ -30,6 +30,7 @@ lib/util.ts:17 ...@@ -30,6 +30,7 @@ lib/util.ts:17
| :------ | :------ | | :------ | :------ |
| `item` | `KubeObjectInterface` | | `item` | `KubeObjectInterface` |
| `filter` | [`FilterState`](../interfaces/lib_util.FilterState.md) | | `filter` | [`FilterState`](../interfaces/lib_util.FilterState.md) |
| `matchCriteria?` | `string`[] |
#### Returns #### Returns
...@@ -37,7 +38,7 @@ lib/util.ts:17 ...@@ -37,7 +38,7 @@ lib/util.ts:17
#### Defined in #### Defined in
lib/util.ts:84 [lib/util.ts:85](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L85)
___ ___
...@@ -51,7 +52,7 @@ ___ ...@@ -51,7 +52,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:119 [lib/util.ts:153](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L153)
___ ___
...@@ -63,7 +64,7 @@ ___ ...@@ -63,7 +64,7 @@ ___
| Name | Type | | Name | Type |
| :------ | :------ | | :------ | :------ |
| `path?` | `string` \| ``null`` | | `path?` | ``null`` \| `string` |
#### Returns #### Returns
...@@ -71,7 +72,7 @@ ___ ...@@ -71,7 +72,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:111 [lib/util.ts:145](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L145)
___ ___
...@@ -92,7 +93,7 @@ ___ ...@@ -92,7 +93,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:33 [lib/util.ts:34](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L34)
___ ___
...@@ -112,7 +113,7 @@ ___ ...@@ -112,7 +113,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:42 [lib/util.ts:43](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L43)
___ ___
...@@ -134,7 +135,7 @@ ___ ...@@ -134,7 +135,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:60 [lib/util.ts:61](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L61)
___ ___
...@@ -155,7 +156,7 @@ ___ ...@@ -155,7 +156,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:50 [lib/util.ts:51](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L51)
___ ___
...@@ -175,7 +176,7 @@ ___ ...@@ -175,7 +176,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:46 [lib/util.ts:47](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L47)
___ ___
...@@ -195,7 +196,7 @@ ___ ...@@ -195,7 +196,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:25 [lib/util.ts:26](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L26)
___ ___
...@@ -215,7 +216,7 @@ ___ ...@@ -215,7 +216,7 @@ ___
#### Defined in #### Defined in
lib/util.ts:21 [lib/util.ts:22](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L22)
___ ___
...@@ -235,13 +236,19 @@ ___ ...@@ -235,13 +236,19 @@ ___
#### Defined in #### Defined in
lib/util.ts:131 [lib/util.ts:165](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L165)
___ ___
### useFilterFunc ### useFilterFunc
**useFilterFunc**(): (`item`: `KubeObjectInterface`) => `boolean` **useFilterFunc**(`matchCriteria?`): (`item`: `KubeObjectInterface`) => `boolean`
#### Parameters
| Name | Type |
| :------ | :------ |
| `matchCriteria?` | `string`[] |
#### Returns #### Returns
...@@ -261,4 +268,4 @@ ___ ...@@ -261,4 +268,4 @@ ___
#### Defined in #### Defined in
lib/util.ts:106 [lib/util.ts:140](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/lib/util.ts#L140)
---
title: "Module: plugin"
linkTitle: "plugin"
slug: "plugin"
---
## Classes
- [Plugin](../classes/plugin.Plugin.md)
## Functions
### initializePlugins
**initializePlugins**(): `Promise`<`unknown`\>
Load external, then local plugins. Then initialize() them in order with a Registry.
#### Returns
`Promise`<`unknown`\>
#### Defined in
plugin/index.tsx:211
---
title: "Module: plugin/lib"
linkTitle: "plugin/lib"
slug: "plugin_lib"
---
The lib.ts file should carry the bits to be used by plugins whereas
the index.ts should have the functions that Headlamp itself needs for
loading the plugins.
## Classes
- [Headlamp](../classes/plugin_lib.Headlamp.md)
- [Plugin](../classes/plugin_lib.Plugin.md)
...@@ -7,3 +7,27 @@ slug: "plugin_registry" ...@@ -7,3 +7,27 @@ slug: "plugin_registry"
## Classes ## Classes
- [default](../classes/plugin_registry.default.md) - [default](../classes/plugin_registry.default.md)
## Type aliases
### sectionFunc
Ƭ **sectionFunc**: (`resource`: `KubeObject`) => `SectionFuncProps` \| ``null`` \| `undefined`
#### Type declaration
▸ (`resource`): `SectionFuncProps` \| ``null`` \| `undefined`
##### Parameters
| Name | Type |
| :------ | :------ |
| `resource` | `KubeObject` |
##### Returns
`SectionFuncProps` \| ``null`` \| `undefined`
#### Defined in
[plugin/registry.tsx:17](https://github.com/kinvolk/headlamp/blob/ab45ff9/frontend/src/plugin/registry.tsx#L17)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment