@k8slens/extensions 5.3.0-git.913244b204.0 → 5.3.0-git.cdb57f4c97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/common/catalog/catalog-run-event.d.ts +30 -0
- package/dist/src/common/routes/index.d.ts +1 -0
- package/dist/src/common/routes/port-forwards.d.ts +25 -0
- package/dist/src/extensions/extension-api.js +5925 -5913
- package/dist/src/extensions/renderer-api/catalog.d.ts +6 -4
- package/dist/src/main/routes/port-forward-route.d.ts +3 -0
- package/dist/src/main/shell-session/node-shell-session.d.ts +2 -0
- package/dist/src/renderer/api/catalog-entity-registry.d.ts +7 -10
- package/dist/src/renderer/{keyboard-shortcuts → components/+network-port-forwards}/index.d.ts +1 -1
- package/dist/src/renderer/components/+network-port-forwards/port-forward-menu.d.ts +33 -0
- package/dist/src/renderer/components/+network-port-forwards/port-forwards.d.ts +28 -0
- package/dist/src/renderer/components/+network-services/service-port-component.d.ts +6 -0
- package/dist/src/renderer/components/+workloads-pods/pod-container-port.d.ts +6 -0
- package/dist/src/renderer/components/+workloads-pods/pod-details-container.d.ts +1 -0
- package/dist/src/renderer/components/switch/switcher.d.ts +1 -1
- package/dist/src/renderer/navigation/history.d.ts +2 -2
- package/dist/src/renderer/port-forward/index.d.ts +23 -0
- package/dist/src/renderer/port-forward/port-forward-dialog.d.ts +46 -0
- package/dist/src/renderer/port-forward/port-forward-item.d.ts +46 -0
- package/dist/src/renderer/port-forward/port-forward.store.d.ts +39 -0
- package/package.json +1 -1
|
@@ -32,11 +32,13 @@ export declare class CatalogEntityRegistry {
|
|
|
32
32
|
getItemsForApiKind<T extends CatalogEntity>(apiVersion: string, kind: string): T[];
|
|
33
33
|
getItemsForCategory<T extends CatalogEntity>(category: CatalogCategory): T[];
|
|
34
34
|
/**
|
|
35
|
-
* Add a onBeforeRun hook to a catalog
|
|
36
|
-
*
|
|
37
|
-
* @param onBeforeRun The function
|
|
35
|
+
* Add a onBeforeRun hook to a catalog entities. If `onBeforeRun` was previously
|
|
36
|
+
* added then it will not be added again.
|
|
37
|
+
* @param onBeforeRun The function to be called with a `CatalogRunEvent`
|
|
38
|
+
* event target will be the catalog entity. onBeforeRun hook can call event.preventDefault()
|
|
39
|
+
* to stop run sequence
|
|
38
40
|
* @returns A function to remove that hook
|
|
39
41
|
*/
|
|
40
|
-
addOnBeforeRun(
|
|
42
|
+
addOnBeforeRun(onBeforeRun: CatalogEntityOnBeforeRun): Disposer;
|
|
41
43
|
}
|
|
42
44
|
export declare const catalogEntities: CatalogEntityRegistry;
|
|
@@ -21,4 +21,7 @@
|
|
|
21
21
|
import type { LensApiRequest } from "../router";
|
|
22
22
|
export declare class PortForwardRoute {
|
|
23
23
|
static routePortForward(request: LensApiRequest): Promise<void>;
|
|
24
|
+
static routeCurrentPortForward(request: LensApiRequest): Promise<void>;
|
|
25
|
+
static routeAllPortForwards(request: LensApiRequest): Promise<void>;
|
|
26
|
+
static routeCurrentPortForwardStop(request: LensApiRequest): Promise<void>;
|
|
24
27
|
}
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
20
|
*/
|
|
21
21
|
/// <reference types="node" />
|
|
22
|
+
/// <reference types="node/http" />
|
|
23
|
+
/// <reference types="got/dist/source/core/utils/timed-out" />
|
|
22
24
|
import type * as WebSocket from "ws";
|
|
23
25
|
import * as k8s from "@kubernetes/client-node";
|
|
24
26
|
import type { KubeConfig } from "@kubernetes/client-node";
|
|
@@ -18,20 +18,19 @@
|
|
|
18
18
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
19
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
20
|
*/
|
|
21
|
-
import { ObservableSet } from "mobx";
|
|
22
21
|
import { CatalogCategory, CatalogEntity, CatalogEntityData, CatalogCategoryRegistry, CatalogEntityKindData } from "../../common/catalog";
|
|
23
22
|
import "../../common/catalog-entities";
|
|
24
23
|
import type { Cluster } from "../../main/cluster";
|
|
25
24
|
import { Disposer } from "../utils";
|
|
25
|
+
import { CatalogRunEvent } from "../../common/catalog/catalog-run-event";
|
|
26
26
|
export declare type EntityFilter = (entity: CatalogEntity) => any;
|
|
27
|
-
export declare type CatalogEntityOnBeforeRun = (
|
|
28
|
-
declare type CatalogEntityUid = CatalogEntity["metadata"]["uid"];
|
|
27
|
+
export declare type CatalogEntityOnBeforeRun = (event: CatalogRunEvent) => void | Promise<void>;
|
|
29
28
|
export declare class CatalogEntityRegistry {
|
|
30
29
|
private categoryRegistry;
|
|
31
30
|
protected activeEntityId: string | undefined;
|
|
32
31
|
protected _entities: import("mobx").ObservableMap<string, CatalogEntity<import("../../common/catalog").CatalogEntityMetadata, import("../../common/catalog").CatalogEntityStatus, import("../../common/catalog").CatalogEntitySpec>>;
|
|
33
|
-
protected filters: ObservableSet<EntityFilter>;
|
|
34
|
-
protected onBeforeRunHooks: import("mobx").
|
|
32
|
+
protected filters: import("mobx").ObservableSet<EntityFilter>;
|
|
33
|
+
protected onBeforeRunHooks: import("mobx").ObservableSet<CatalogEntityOnBeforeRun>;
|
|
35
34
|
/**
|
|
36
35
|
* Buffer for keeping entities that don't yet have CatalogCategory synced
|
|
37
36
|
*/
|
|
@@ -61,14 +60,13 @@ export declare class CatalogEntityRegistry {
|
|
|
61
60
|
*/
|
|
62
61
|
addCatalogFilter(fn: EntityFilter): Disposer;
|
|
63
62
|
/**
|
|
64
|
-
* Add a onBeforeRun hook
|
|
65
|
-
* @param catalogEntityUid The uid of the catalog entity
|
|
63
|
+
* Add a onBeforeRun hook. If `onBeforeRun` was previously added then it will not be added again
|
|
66
64
|
* @param onBeforeRun The function that should return a boolean if the onRun of catalog entity should be triggered.
|
|
67
65
|
* @returns A function to remove that hook
|
|
68
66
|
*/
|
|
69
|
-
addOnBeforeRun(
|
|
67
|
+
addOnBeforeRun(onBeforeRun: CatalogEntityOnBeforeRun): Disposer;
|
|
70
68
|
/**
|
|
71
|
-
* Runs all the registered `onBeforeRun` hooks, short circuiting on the first
|
|
69
|
+
* Runs all the registered `onBeforeRun` hooks, short circuiting on the first event that's preventDefaulted
|
|
72
70
|
* @param entity The entity to run the hooks on
|
|
73
71
|
* @returns Whether the entities `onRun` method should be executed
|
|
74
72
|
*/
|
|
@@ -81,4 +79,3 @@ export declare class CatalogEntityRegistry {
|
|
|
81
79
|
}
|
|
82
80
|
export declare const catalogEntityRegistry: CatalogEntityRegistry;
|
|
83
81
|
export declare function getActiveClusterEntity(): Cluster | undefined;
|
|
84
|
-
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import React from "react";
|
|
22
|
+
import { PortForwardItem } from "../../port-forward";
|
|
23
|
+
import { MenuActionsProps } from "../menu/menu-actions";
|
|
24
|
+
interface Props extends MenuActionsProps {
|
|
25
|
+
portForward: PortForwardItem;
|
|
26
|
+
hideDetails?(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class PortForwardMenu extends React.Component<Props> {
|
|
29
|
+
remove(): Promise<void>;
|
|
30
|
+
renderContent(): JSX.Element;
|
|
31
|
+
render(): JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import "./port-forwards.scss";
|
|
22
|
+
import React from "react";
|
|
23
|
+
import { PortForwardItem } from "../../port-forward";
|
|
24
|
+
export declare class PortForwards extends React.Component {
|
|
25
|
+
componentDidMount(): void;
|
|
26
|
+
renderRemoveDialogMessage(selectedItems: PortForwardItem[]): JSX.Element;
|
|
27
|
+
render(): JSX.Element;
|
|
28
|
+
}
|
|
@@ -27,8 +27,14 @@ interface Props {
|
|
|
27
27
|
}
|
|
28
28
|
export declare class ServicePortComponent extends React.Component<Props> {
|
|
29
29
|
waiting: boolean;
|
|
30
|
+
forwardPort: number;
|
|
31
|
+
isPortForwarded: boolean;
|
|
30
32
|
constructor(props: Props);
|
|
33
|
+
componentDidMount(): void;
|
|
34
|
+
init(): void;
|
|
35
|
+
checkExistingPortForwarding(): Promise<void>;
|
|
31
36
|
portForward(): Promise<void>;
|
|
37
|
+
stopPortForward(): Promise<void>;
|
|
32
38
|
render(): JSX.Element;
|
|
33
39
|
}
|
|
34
40
|
export {};
|
|
@@ -31,8 +31,14 @@ interface Props {
|
|
|
31
31
|
}
|
|
32
32
|
export declare class PodContainerPort extends React.Component<Props> {
|
|
33
33
|
waiting: boolean;
|
|
34
|
+
forwardPort: number;
|
|
35
|
+
isPortForwarded: boolean;
|
|
34
36
|
constructor(props: Props);
|
|
37
|
+
componentDidMount(): void;
|
|
38
|
+
init(): void;
|
|
39
|
+
checkExistingPortForwarding(): Promise<void>;
|
|
35
40
|
portForward(): Promise<void>;
|
|
41
|
+
stopPortForward(): Promise<void>;
|
|
36
42
|
render(): JSX.Element;
|
|
37
43
|
}
|
|
38
44
|
export {};
|
|
@@ -30,6 +30,7 @@ interface Props {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export declare class PodDetailsContainer extends React.Component<Props> {
|
|
33
|
+
componentDidMount(): void;
|
|
33
34
|
renderStatus(state: string, status: IPodContainerStatus): JSX.Element;
|
|
34
35
|
renderLastState(lastState: string, status: IPodContainerStatus): JSX.Element;
|
|
35
36
|
render(): JSX.Element;
|
|
@@ -26,5 +26,5 @@ interface Styles extends Partial<Record<SwitchClassKey, string>> {
|
|
|
26
26
|
interface Props extends SwitchProps {
|
|
27
27
|
classes: Styles;
|
|
28
28
|
}
|
|
29
|
-
export declare const Switcher: React.ComponentType<Pick<Props, "name" | "
|
|
29
|
+
export declare const Switcher: React.ComponentType<Pick<Props, "name" | "key" | "id" | "value" | "type" | "resource" | "style" | "dir" | "form" | "slot" | "title" | "color" | "className" | "prefix" | "defaultValue" | "hidden" | "ref" | "disabled" | "onDrag" | "onDoubleClick" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "autoFocus" | "icon" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "readOnly" | "required" | "inputProps" | "action" | "innerRef" | "checkedIcon" | "disableFocusRipple" | "edge" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | "inputRef"> & import("@material-ui/core/styles").StyledComponentProps<"track" | "checked" | "root" | "thumb" | "focusVisible" | "switchBase">>;
|
|
30
30
|
export {};
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { ObservableSearchParamsOptions } from "mobx-observable-history";
|
|
22
22
|
export declare const searchParamsOptions: ObservableSearchParamsOptions;
|
|
23
|
-
export declare const history: import("history").History<
|
|
24
|
-
export declare const navigation: import("mobx-observable-history").ObservableHistory<
|
|
23
|
+
export declare const history: import("history").History<unknown>;
|
|
24
|
+
export declare const navigation: import("mobx-observable-history").ObservableHistory<unknown>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
export * from "./port-forward.store";
|
|
22
|
+
export * from "./port-forward-item";
|
|
23
|
+
export * from "./port-forward-dialog";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import "./port-forward-dialog.scss";
|
|
22
|
+
import { Component } from "react";
|
|
23
|
+
import { DialogProps } from "../components/dialog";
|
|
24
|
+
import type { ForwardedPort } from "./port-forward-item";
|
|
25
|
+
interface Props extends Partial<DialogProps> {
|
|
26
|
+
}
|
|
27
|
+
interface PortForwardDialogOpenOptions {
|
|
28
|
+
openInBrowser: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare class PortForwardDialog extends Component<Props> {
|
|
31
|
+
ready: boolean;
|
|
32
|
+
currentPort: number;
|
|
33
|
+
desiredPort: number;
|
|
34
|
+
constructor(props: Props);
|
|
35
|
+
static open(portForward: ForwardedPort, options?: PortForwardDialogOpenOptions): void;
|
|
36
|
+
static close(): void;
|
|
37
|
+
get portForward(): ForwardedPort;
|
|
38
|
+
close: () => void;
|
|
39
|
+
onOpen: () => Promise<void>;
|
|
40
|
+
onClose: () => void;
|
|
41
|
+
changePort: (value: string) => void;
|
|
42
|
+
startPortForward: () => Promise<void>;
|
|
43
|
+
renderContents(): JSX.Element;
|
|
44
|
+
render(): JSX.Element;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import type { ItemObject } from "../../common/item.store";
|
|
22
|
+
export interface ForwardedPort {
|
|
23
|
+
clusterId?: string;
|
|
24
|
+
kind: string;
|
|
25
|
+
namespace: string;
|
|
26
|
+
name: string;
|
|
27
|
+
port: number;
|
|
28
|
+
forwardPort: number;
|
|
29
|
+
}
|
|
30
|
+
export declare class PortForwardItem implements ItemObject {
|
|
31
|
+
clusterId: string;
|
|
32
|
+
kind: string;
|
|
33
|
+
namespace: string;
|
|
34
|
+
name: string;
|
|
35
|
+
port: number;
|
|
36
|
+
forwardPort: number;
|
|
37
|
+
constructor(pf: ForwardedPort);
|
|
38
|
+
getName(): string;
|
|
39
|
+
getNs(): string;
|
|
40
|
+
get id(): number;
|
|
41
|
+
getId(): string;
|
|
42
|
+
getKind(): string;
|
|
43
|
+
getPort(): number;
|
|
44
|
+
getForwardPort(): number;
|
|
45
|
+
getSearchFields(): (string | number)[];
|
|
46
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 OpenLens Authors
|
|
3
|
+
*
|
|
4
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
* this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
* the Software without restriction, including without limitation the rights to
|
|
7
|
+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
8
|
+
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
* subject to the following conditions:
|
|
10
|
+
*
|
|
11
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
* copies or substantial portions of the Software.
|
|
13
|
+
*
|
|
14
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
16
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
17
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
18
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
19
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
import { ItemStore } from "../../common/item.store";
|
|
22
|
+
import { ForwardedPort, PortForwardItem } from "./port-forward-item";
|
|
23
|
+
export declare class PortForwardStore extends ItemStore<PortForwardItem> {
|
|
24
|
+
private storage;
|
|
25
|
+
portForwards: PortForwardItem[];
|
|
26
|
+
constructor();
|
|
27
|
+
private init;
|
|
28
|
+
watch(): import("../utils").ExtendableDisposer;
|
|
29
|
+
loadAll(): Promise<any>;
|
|
30
|
+
reset(): void;
|
|
31
|
+
removeSelectedItems(): Promise<void[]>;
|
|
32
|
+
}
|
|
33
|
+
export declare function addPortForward(portForward: ForwardedPort): Promise<number>;
|
|
34
|
+
export declare function getPortForward(portForward: ForwardedPort): Promise<number>;
|
|
35
|
+
export declare function modifyPortForward(portForward: ForwardedPort, desiredPort: number): Promise<number>;
|
|
36
|
+
export declare function removePortForward(portForward: ForwardedPort): Promise<void>;
|
|
37
|
+
export declare function getPortForwards(): Promise<ForwardedPort[]>;
|
|
38
|
+
export declare function openPortForward(portForward: ForwardedPort): void;
|
|
39
|
+
export declare const portForwardStore: PortForwardStore;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@k8slens/extensions",
|
|
3
3
|
"productName": "OpenLens extensions",
|
|
4
4
|
"description": "OpenLens - Open Source Kubernetes IDE: extensions",
|
|
5
|
-
"version": "5.3.0-git.
|
|
5
|
+
"version": "5.3.0-git.cdb57f4c97.0",
|
|
6
6
|
"copyright": "© 2021 OpenLens Authors",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/src/extensions/extension-api.js",
|