@k8slens/extensions 5.3.1-git.93a60caf40.0 → 5.3.1-git.9ce91884c2.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.
Files changed (61) hide show
  1. package/dist/src/common/base-store.d.ts +5 -2
  2. package/dist/src/common/ipc/update-available.ipc.d.ts +2 -0
  3. package/dist/src/common/k8s-api/api-manager.d.ts +1 -1
  4. package/dist/src/common/k8s-api/cluster-context.d.ts +1 -0
  5. package/dist/src/common/k8s-api/endpoints/daemon-set.api.d.ts +2 -5
  6. package/dist/src/common/k8s-api/endpoints/deployment.api.d.ts +2 -5
  7. package/dist/src/common/k8s-api/endpoints/job.api.d.ts +2 -5
  8. package/dist/src/common/k8s-api/endpoints/metrics.api.d.ts +2 -0
  9. package/dist/src/common/k8s-api/endpoints/network-policy.api.d.ts +72 -32
  10. package/dist/src/common/k8s-api/endpoints/nodes.api.d.ts +6 -6
  11. package/dist/src/common/k8s-api/endpoints/persistent-volume-claims.api.d.ts +3 -16
  12. package/dist/src/common/k8s-api/endpoints/poddisruptionbudget.api.d.ts +2 -6
  13. package/dist/src/common/k8s-api/endpoints/pods.api.d.ts +2 -0
  14. package/dist/src/common/k8s-api/endpoints/replica-set.api.d.ts +2 -5
  15. package/dist/src/common/k8s-api/endpoints/stateful-set.api.d.ts +2 -5
  16. package/dist/src/common/k8s-api/kube-api.d.ts +26 -25
  17. package/dist/src/common/k8s-api/kube-object.d.ts +25 -2
  18. package/dist/src/common/k8s-api/kube-object.store.d.ts +11 -7
  19. package/dist/src/common/k8s-api/kube-watch-api.d.ts +7 -30
  20. package/dist/src/extensions/extension-api.js +686 -2126
  21. package/dist/src/main/cluster.d.ts +3 -7
  22. package/dist/src/main/context-handler.d.ts +8 -1
  23. package/dist/src/main/kube-auth-proxy.d.ts +5 -7
  24. package/dist/src/main/kubeconfig-manager.d.ts +16 -4
  25. package/dist/src/renderer/bootstrap.d.ts +2 -1
  26. package/dist/src/renderer/components/+events/kube-event-details.d.ts +1 -1
  27. package/dist/src/renderer/components/+namespaces/namespace-details.d.ts +0 -1
  28. package/dist/src/renderer/components/+namespaces/namespace-select.d.ts +0 -1
  29. package/dist/src/renderer/components/+namespaces/namespace.store.d.ts +5 -3
  30. package/dist/src/renderer/components/+network-ingresses/ingress-details.d.ts +1 -1
  31. package/dist/src/renderer/components/+network-policies/__tests__/network-policy-details.test.d.ts +21 -0
  32. package/dist/src/renderer/components/+network-policies/network-policy-details.d.ts +5 -4
  33. package/dist/src/renderer/components/+nodes/node-details.d.ts +1 -2
  34. package/dist/src/renderer/components/+nodes/nodes.d.ts +2 -1
  35. package/dist/src/renderer/components/+storage-classes/storage-class-details.d.ts +1 -1
  36. package/dist/src/renderer/components/+storage-volume-claims/volume-claim-details.d.ts +1 -1
  37. package/dist/src/renderer/components/+workloads-cronjobs/cronjob-details.d.ts +1 -1
  38. package/dist/src/renderer/components/+workloads-daemonsets/daemonset-details.d.ts +0 -1
  39. package/dist/src/renderer/components/+workloads-deployments/deployment-details.d.ts +0 -1
  40. package/dist/src/renderer/components/+workloads-jobs/job-details.d.ts +1 -1
  41. package/dist/src/renderer/components/+workloads-overview/overview-workload-status.d.ts +2 -7
  42. package/dist/src/renderer/components/+workloads-overview/overview.d.ts +2 -0
  43. package/dist/src/renderer/components/+workloads-replicasets/replicaset-details.d.ts +1 -2
  44. package/dist/src/renderer/components/+workloads-statefulsets/statefulset-details.d.ts +0 -1
  45. package/dist/src/renderer/components/avatar/__tests__/avatar.test.d.ts +21 -0
  46. package/dist/src/renderer/components/avatar/avatar.d.ts +7 -8
  47. package/dist/src/renderer/components/avatar/index.d.ts +21 -0
  48. package/dist/src/renderer/components/cluster-manager/cluster-status.d.ts +3 -2
  49. package/dist/src/renderer/components/context.d.ts +8 -1
  50. package/dist/src/renderer/components/dock/dock.store.d.ts +11 -4
  51. package/dist/src/renderer/components/drawer/drawer.d.ts +14 -3
  52. package/dist/src/renderer/components/getDi.d.ts +22 -0
  53. package/dist/src/renderer/components/getDiForUnitTesting.d.ts +22 -0
  54. package/dist/src/renderer/components/hotbar/hotbar-entity-icon.d.ts +3 -3
  55. package/dist/src/renderer/components/hotbar/hotbar-icon.d.ts +3 -10
  56. package/dist/src/renderer/components/hotbar/hotbar-menu.d.ts +3 -0
  57. package/dist/src/renderer/components/kube-object-list-layout/kube-object-list-layout.d.ts +2 -0
  58. package/dist/src/renderer/components/notifications/notifications.d.ts +3 -3
  59. package/dist/src/renderer/components/resizing-anchor/resizing-anchor.d.ts +3 -1
  60. package/dist/src/renderer/port-forward/port-forward.store.d.ts +1 -1
  61. package/package.json +1 -1
@@ -40,8 +40,8 @@ export declare class Cluster implements ClusterModel, ClusterState {
40
40
  * @internal
41
41
  */
42
42
  contextHandler: ContextHandler;
43
- protected kubeconfigManager: KubeconfigManager;
44
- protected eventDisposers: Function[];
43
+ protected proxyKubeconfigManager: KubeconfigManager;
44
+ protected eventsDisposer: import("../common/utils").ExtendableDisposer;
45
45
  protected activated: boolean;
46
46
  private resourceAccessStatuses;
47
47
  get whenReady(): Promise<void> & {
@@ -198,11 +198,7 @@ export declare class Cluster implements ClusterModel, ClusterState {
198
198
  /**
199
199
  * @internal
200
200
  */
201
- recreateProxyKubeconfig(): Promise<void>;
202
- /**
203
- * internal
204
- */
205
- protected unbindEvents(): void;
201
+ protected recreateProxyKubeconfig(): Promise<void>;
206
202
  /**
207
203
  * @param force force activation
208
204
  * @internal
@@ -29,13 +29,19 @@ export interface PrometheusDetails {
29
29
  prometheusPath: string;
30
30
  provider: PrometheusProvider;
31
31
  }
32
+ interface PrometheusServicePreferences {
33
+ namespace: string;
34
+ service: string;
35
+ port: number;
36
+ prefix: string;
37
+ }
32
38
  export declare class ContextHandler {
33
39
  protected cluster: Cluster;
34
40
  clusterUrl: UrlWithStringQuery;
35
41
  protected kubeAuthProxy?: KubeAuthProxy;
36
42
  protected apiTarget?: httpProxy.ServerOptions;
37
43
  protected prometheusProvider?: string;
38
- protected prometheusPath: string | null;
44
+ protected prometheus?: PrometheusServicePreferences;
39
45
  constructor(cluster: Cluster);
40
46
  setupPrometheus(preferences?: ClusterPrometheusPreferences): void;
41
47
  getPrometheusDetails(): Promise<PrometheusDetails>;
@@ -49,3 +55,4 @@ export declare class ContextHandler {
49
55
  ensureServer(): Promise<void>;
50
56
  stopServer(): void;
51
57
  }
58
+ export {};
@@ -21,18 +21,16 @@
21
21
  /// <reference types="node" />
22
22
  import { ChildProcess } from "child_process";
23
23
  import type { Cluster } from "./cluster";
24
- import { Kubectl } from "./kubectl";
25
24
  export declare class KubeAuthProxy {
25
+ protected readonly cluster: Cluster;
26
+ protected readonly env: NodeJS.ProcessEnv;
26
27
  readonly apiPrefix: string;
27
28
  get port(): number;
28
- protected _port?: number;
29
- protected cluster: Cluster;
30
- protected env: NodeJS.ProcessEnv;
31
- protected proxyProcess: ChildProcess;
32
- protected kubectl: Kubectl;
29
+ protected _port: number;
30
+ protected proxyProcess?: ChildProcess;
31
+ protected readonly acceptHosts: string;
33
32
  protected ready: boolean;
34
33
  constructor(cluster: Cluster, env: NodeJS.ProcessEnv);
35
- get acceptHosts(): string;
36
34
  get whenReady(): Promise<void> & {
37
35
  cancel(): void;
38
36
  };
@@ -23,13 +23,25 @@ import type { ContextHandler } from "./context-handler";
23
23
  export declare class KubeconfigManager {
24
24
  protected cluster: Cluster;
25
25
  protected contextHandler: ContextHandler;
26
- protected configDir: string;
27
- protected tempFile: string;
26
+ /**
27
+ * The path to the temp config file
28
+ *
29
+ * - if `string` then path
30
+ * - if `null` then not yet created
31
+ * - if `undefined` then unlinked by calling `clear()`
32
+ */
33
+ protected tempFilePath: string | null | undefined;
28
34
  constructor(cluster: Cluster, contextHandler: ContextHandler);
35
+ /**
36
+ *
37
+ * @returns The path to the temporary kubeconfig
38
+ */
29
39
  getPath(): Promise<string>;
40
+ /**
41
+ * Deletes the temporary kubeconfig file
42
+ */
30
43
  clear(): Promise<void>;
31
- unlink(): Promise<void>;
32
- protected init(): Promise<void>;
44
+ protected ensureFile(): Promise<void>;
33
45
  get resolveProxyUrl(): string;
34
46
  /**
35
47
  * Creates new "temporary" kubeconfig that point to the kubectl-proxy.
@@ -26,10 +26,11 @@ import * as ReactRouter from "react-router";
26
26
  import * as ReactRouterDom from "react-router-dom";
27
27
  import * as LensExtensionsCommonApi from "../extensions/common-api";
28
28
  import * as LensExtensionsRendererApi from "../extensions/renderer-api";
29
+ import type { DependencyInjectionContainer } from "@ogre-tools/injectable";
29
30
  declare type AppComponent = React.ComponentType & {
30
31
  init(rootElem: HTMLElement): Promise<void>;
31
32
  };
32
- export declare function bootstrap(comp: () => Promise<AppComponent>): Promise<void>;
33
+ export declare function bootstrap(comp: () => Promise<AppComponent>, di: DependencyInjectionContainer): Promise<void>;
33
34
  /**
34
35
  * Exports for virtual package "@k8slens/extensions" for renderer-process.
35
36
  * All exporting names available in global runtime scope:
@@ -25,6 +25,6 @@ export interface KubeEventDetailsProps {
25
25
  object: KubeObject;
26
26
  }
27
27
  export declare class KubeEventDetails extends React.Component<KubeEventDetailsProps> {
28
- componentDidMount(): Promise<void>;
28
+ componentDidMount(): void;
29
29
  render(): JSX.Element;
30
30
  }
@@ -27,7 +27,6 @@ interface Props extends KubeObjectDetailsProps<Namespace> {
27
27
  export declare class NamespaceDetails extends React.Component<Props> {
28
28
  metrics: IPodMetrics;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
31
30
  componentDidMount(): void;
32
31
  get quotas(): import("../../../common/k8s-api/endpoints").ResourceQuota[];
33
32
  get limitranges(): import("../../../common/k8s-api/endpoints").LimitRange[];
@@ -30,7 +30,6 @@ interface Props extends SelectProps {
30
30
  export declare class NamespaceSelect extends React.Component<Props> {
31
31
  static defaultProps: object;
32
32
  constructor(props: Props);
33
- componentDidMount(): void;
34
33
  get options(): SelectOption[];
35
34
  formatOptionLabel: (option: SelectOption) => {};
36
35
  render(): JSX.Element;
@@ -18,7 +18,7 @@
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 { IReactionDisposer, IReactionOptions } from "mobx";
21
+ import { IReactionDisposer } from "mobx";
22
22
  import { noop } from "../../utils";
23
23
  import { KubeObjectStore, KubeObjectStoreLoadingParams } from "../../../common/k8s-api/kube-object.store";
24
24
  import { Namespace } from "../../../common/k8s-api/endpoints/namespaces.api";
@@ -27,7 +27,9 @@ export declare class NamespaceStore extends KubeObjectStore<Namespace> {
27
27
  private storage;
28
28
  constructor();
29
29
  private init;
30
- onContextChange(callback: (namespaces: string[]) => void, opts?: IReactionOptions): IReactionDisposer;
30
+ onContextChange(callback: (namespaces: string[]) => void, opts?: {
31
+ fireImmediately?: boolean;
32
+ }): IReactionDisposer;
31
33
  private autoLoadAllowedNamespaces;
32
34
  private get initialNamespaces();
33
35
  /**
@@ -52,7 +54,7 @@ export declare class NamespaceStore extends KubeObjectStore<Namespace> {
52
54
  */
53
55
  get areAllSelectedImplicitly(): boolean;
54
56
  subscribe(): typeof noop;
55
- protected loadItems(params: KubeObjectStoreLoadingParams<Namespace>): Promise<Namespace[]>;
57
+ protected loadItems(params: KubeObjectStoreLoadingParams): Promise<Namespace[]>;
56
58
  selectNamespaces(namespace: string | string[]): void;
57
59
  clearSelected(namespaces?: string | string[]): void;
58
60
  /**
@@ -28,7 +28,7 @@ interface Props extends KubeObjectDetailsProps<Ingress> {
28
28
  export declare class IngressDetails extends React.Component<Props> {
29
29
  metrics: IIngressMetrics;
30
30
  constructor(props: Props);
31
- clean: import("mobx").IReactionDisposer;
31
+ componentDidMount(): void;
32
32
  loadMetrics(): Promise<void>;
33
33
  renderPaths(ingress: Ingress): JSX.Element[];
34
34
  renderIngressPoints(ingressPoints: ILoadBalancerIngress[]): JSX.Element;
@@ -0,0 +1,21 @@
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 {};
@@ -18,15 +18,16 @@
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 "./network-policy-details.scss";
22
21
  import React from "react";
23
- import { IPolicyEgress, IPolicyIngress, NetworkPolicy } from "../../../common/k8s-api/endpoints/network-policy.api";
22
+ import { IPolicyIpBlock, IPolicySelector, NetworkPolicy, NetworkPolicyPeer, NetworkPolicyPort } from "../../../common/k8s-api/endpoints/network-policy.api";
24
23
  import type { KubeObjectDetailsProps } from "../kube-object-details";
25
24
  interface Props extends KubeObjectDetailsProps<NetworkPolicy> {
26
25
  }
27
26
  export declare class NetworkPolicyDetails extends React.Component<Props> {
28
- renderIngressFrom(ingress: IPolicyIngress): JSX.Element;
29
- renderEgressTo(egress: IPolicyEgress): JSX.Element;
27
+ renderIPolicyIpBlock(ipBlock: IPolicyIpBlock | undefined): JSX.Element;
28
+ renderIPolicySelector(name: string, selector: IPolicySelector | undefined): JSX.Element;
29
+ renderNetworkPolicyPeers(name: string, peers: NetworkPolicyPeer[] | undefined): JSX.Element;
30
+ renderNetworkPolicyPorts(ports: NetworkPolicyPort[] | undefined): JSX.Element;
30
31
  render(): JSX.Element;
31
32
  }
32
33
  export {};
@@ -27,8 +27,7 @@ interface Props extends KubeObjectDetailsProps<Node> {
27
27
  export declare class NodeDetails extends React.Component<Props> {
28
28
  metrics: Partial<IClusterMetrics>;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
31
- componentDidMount(): Promise<void>;
30
+ componentDidMount(): void;
32
31
  loadMetrics(): Promise<void>;
33
32
  render(): JSX.Element;
34
33
  }
@@ -32,9 +32,10 @@ export declare class Nodes extends React.Component<Props> {
32
32
  componentDidMount(): Promise<void>;
33
33
  componentWillUnmount(): void;
34
34
  getLastMetricValues(node: Node, metricNames: string[]): number[];
35
+ private renderUsage;
35
36
  renderCpuUsage(node: Node): JSX.Element;
36
37
  renderMemoryUsage(node: Node): JSX.Element;
37
- renderDiskUsage(node: Node): any;
38
+ renderDiskUsage(node: Node): JSX.Element;
38
39
  renderConditions(node: Node): JSX.Element[];
39
40
  render(): JSX.Element;
40
41
  }
@@ -25,7 +25,7 @@ import { StorageClass } from "../../../common/k8s-api/endpoints";
25
25
  interface Props extends KubeObjectDetailsProps<StorageClass> {
26
26
  }
27
27
  export declare class StorageClassDetails extends React.Component<Props> {
28
- componentDidMount(): Promise<void>;
28
+ componentDidMount(): void;
29
29
  render(): JSX.Element;
30
30
  }
31
31
  export {};
@@ -27,7 +27,7 @@ interface Props extends KubeObjectDetailsProps<PersistentVolumeClaim> {
27
27
  export declare class PersistentVolumeClaimDetails extends React.Component<Props> {
28
28
  metrics: IPvcMetrics;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
30
+ componentDidMount(): void;
31
31
  loadMetrics(): Promise<void>;
32
32
  render(): JSX.Element;
33
33
  }
@@ -25,7 +25,7 @@ import { CronJob } from "../../../common/k8s-api/endpoints";
25
25
  interface Props extends KubeObjectDetailsProps<CronJob> {
26
26
  }
27
27
  export declare class CronJobDetails extends React.Component<Props> {
28
- componentDidMount(): Promise<void>;
28
+ componentDidMount(): void;
29
29
  render(): JSX.Element;
30
30
  }
31
31
  export {};
@@ -27,7 +27,6 @@ interface Props extends KubeObjectDetailsProps<DaemonSet> {
27
27
  export declare class DaemonSetDetails extends React.Component<Props> {
28
28
  metrics: IPodMetrics;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
31
30
  componentDidMount(): void;
32
31
  loadMetrics(): Promise<void>;
33
32
  render(): JSX.Element;
@@ -27,7 +27,6 @@ interface Props extends KubeObjectDetailsProps<Deployment> {
27
27
  export declare class DeploymentDetails extends React.Component<Props> {
28
28
  metrics: IPodMetrics;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
31
30
  componentDidMount(): void;
32
31
  loadMetrics(): Promise<void>;
33
32
  render(): JSX.Element;
@@ -27,7 +27,7 @@ interface Props extends KubeObjectDetailsProps<Job> {
27
27
  export declare class JobDetails extends React.Component<Props> {
28
28
  metrics: IPodMetrics;
29
29
  constructor(props: Props);
30
- componentDidMount(): Promise<void>;
30
+ componentDidMount(): void;
31
31
  loadMetrics(): Promise<void>;
32
32
  render(): JSX.Element;
33
33
  }
@@ -21,15 +21,10 @@
21
21
  import "./overview-workload-status.scss";
22
22
  import React from "react";
23
23
  interface Props {
24
- status: {
25
- [key: string]: number;
26
- };
24
+ status: Record<string, number>;
27
25
  }
28
26
  export declare class OverviewWorkloadStatus extends React.Component<Props> {
29
- elem: HTMLElement;
30
- constructor(props: Props);
31
- componentDidMount(): void;
32
- getStatusColor(status: string): string;
27
+ elem?: HTMLElement;
33
28
  renderChart(): JSX.Element;
34
29
  render(): JSX.Element;
35
30
  }
@@ -22,9 +22,11 @@ import "./overview.scss";
22
22
  import React from "react";
23
23
  import type { RouteComponentProps } from "react-router";
24
24
  import type { WorkloadsOverviewRouteParams } from "../../../common/routes";
25
+ import type { ClusterContext } from "../../../common/k8s-api/cluster-context";
25
26
  interface Props extends RouteComponentProps<WorkloadsOverviewRouteParams> {
26
27
  }
27
28
  export declare class WorkloadsOverview extends React.Component<Props> {
29
+ static clusterContext: ClusterContext;
28
30
  loadErrors: string[];
29
31
  constructor(props: Props);
30
32
  componentDidMount(): void;
@@ -27,8 +27,7 @@ interface Props extends KubeObjectDetailsProps<ReplicaSet> {
27
27
  export declare class ReplicaSetDetails extends React.Component<Props> {
28
28
  metrics: IPodMetrics;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
31
- componentDidMount(): Promise<void>;
30
+ componentDidMount(): void;
32
31
  loadMetrics(): Promise<void>;
33
32
  render(): JSX.Element;
34
33
  }
@@ -27,7 +27,6 @@ interface Props extends KubeObjectDetailsProps<StatefulSet> {
27
27
  export declare class StatefulSetDetails extends React.Component<Props> {
28
28
  metrics: IPodMetrics;
29
29
  constructor(props: Props);
30
- clean: import("mobx").IReactionDisposer;
31
30
  componentDidMount(): void;
32
31
  loadMetrics(): Promise<void>;
33
32
  render(): JSX.Element;
@@ -0,0 +1,21 @@
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 "@testing-library/jest-dom/extend-expect";
@@ -18,16 +18,15 @@
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 { DOMAttributes } from "react";
22
- import { AvatarTypeMap } from "@material-ui/core";
23
- interface Props extends DOMAttributes<HTMLElement>, Partial<AvatarTypeMap> {
21
+ import { HTMLAttributes, ImgHTMLAttributes } from "react";
22
+ export interface AvatarProps extends HTMLAttributes<HTMLElement> {
24
23
  title: string;
25
24
  colorHash?: string;
26
- width?: number;
27
- height?: number;
25
+ size?: number;
28
26
  src?: string;
29
- className?: string;
30
27
  background?: string;
28
+ variant?: "circle" | "rounded" | "square";
29
+ imgProps?: ImgHTMLAttributes<HTMLImageElement>;
30
+ disabled?: boolean;
31
31
  }
32
- export declare function Avatar(props: Props): JSX.Element;
33
- export {};
32
+ export declare function Avatar(props: AvatarProps): JSX.Element;
@@ -0,0 +1,21 @@
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 "./avatar";
@@ -21,16 +21,17 @@
21
21
  import React from "react";
22
22
  import type { Cluster } from "../../../main/cluster";
23
23
  import { IClassName } from "../../utils";
24
- import type { ClusterId, KubeAuthUpdate } from "../../../common/cluster-types";
24
+ import type { KubeAuthUpdate } from "../../../common/cluster-types";
25
25
  interface Props {
26
26
  className?: IClassName;
27
- clusterId: ClusterId;
27
+ cluster: Cluster;
28
28
  }
29
29
  export declare class ClusterStatus extends React.Component<Props> {
30
30
  authOutput: KubeAuthUpdate[];
31
31
  isReconnecting: boolean;
32
32
  constructor(props: Props);
33
33
  get cluster(): Cluster;
34
+ get entity(): import("../../api/catalog-entity").CatalogEntity<import("../../../common/catalog").CatalogEntityMetadata, import("../../../common/catalog").CatalogEntityStatus, import("../../../common/catalog").CatalogEntitySpec>;
34
35
  get hasErrors(): boolean;
35
36
  componentDidMount(): void;
36
37
  reconnect: () => Promise<void>;
@@ -18,5 +18,12 @@
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 type { Cluster } from "../../main/cluster";
21
22
  import type { ClusterContext } from "../../common/k8s-api/cluster-context";
22
- export declare const clusterContext: ClusterContext;
23
+ export declare class FrameContext implements ClusterContext {
24
+ cluster: Cluster;
25
+ constructor(cluster: Cluster);
26
+ get allNamespaces(): string[];
27
+ get contextNamespaces(): string[];
28
+ get hasSelectedAll(): boolean;
29
+ }
@@ -18,7 +18,6 @@
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 { IReactionOptions } from "mobx";
22
21
  export declare type TabId = string;
23
22
  export declare enum TabKind {
24
23
  TERMINAL = "terminal",
@@ -78,7 +77,11 @@ export interface DockTabChangeEvent {
78
77
  tabId: TabId;
79
78
  prevTab?: DockTab;
80
79
  }
81
- export interface DockTabChangeEventOptions extends IReactionOptions {
80
+ export interface DockTabChangeEventOptions {
81
+ /**
82
+ * apply a callback right after initialization
83
+ */
84
+ fireImmediately?: boolean;
82
85
  /**
83
86
  * filter: by dockStore.selectedTab.kind == tabKind
84
87
  */
@@ -111,8 +114,12 @@ export declare class DockStore implements DockStorageState {
111
114
  private init;
112
115
  get maxHeight(): number;
113
116
  protected adjustHeight(): void;
114
- onResize(callback: () => void, options?: IReactionOptions): import("mobx").IReactionDisposer;
115
- onTabClose(callback: (evt: DockTabCloseEvent) => void, options?: IReactionOptions): import("mobx").IReactionDisposer;
117
+ onResize(callback: () => void, opts?: {
118
+ fireImmediately?: boolean;
119
+ }): import("mobx").IReactionDisposer;
120
+ onTabClose(callback: (evt: DockTabCloseEvent) => void, opts?: {
121
+ fireImmediately?: boolean;
122
+ }): import("mobx").IReactionDisposer;
116
123
  onTabChange(callback: (evt: DockTabChangeEvent) => void, options?: DockTabChangeEventOptions): import("mobx").IReactionDisposer;
117
124
  hasTabs(): boolean;
118
125
  open(fullSize?: boolean): void;
@@ -21,31 +21,42 @@
21
21
  import "./drawer.scss";
22
22
  import React from "react";
23
23
  import { AnimateName } from "../animate";
24
+ export declare type DrawerPosition = "top" | "left" | "right" | "bottom";
24
25
  export interface DrawerProps {
25
26
  open: boolean;
26
27
  title: React.ReactNode;
28
+ /**
29
+ * The width or heigh (depending on `position`) of the Drawer.
30
+ *
31
+ * If not set then the Drawer will be resizable.
32
+ */
27
33
  size?: string;
28
34
  usePortal?: boolean;
29
35
  className?: string | object;
30
36
  contentClass?: string | object;
31
- position?: "top" | "left" | "right" | "bottom";
37
+ position?: DrawerPosition;
32
38
  animation?: AnimateName;
33
39
  onClose?: () => void;
34
40
  toolbar?: React.ReactNode;
35
41
  }
36
42
  interface State {
37
43
  isCopied: boolean;
44
+ width: number;
38
45
  }
39
- export declare class Drawer extends React.Component<DrawerProps> {
46
+ export declare class Drawer extends React.Component<DrawerProps, State> {
40
47
  static defaultProps: object;
41
48
  private mouseDownTarget;
42
49
  private contentElem;
43
50
  private scrollElem;
44
51
  private scrollPos;
45
52
  private stopListenLocation;
46
- state: State;
53
+ state: {
54
+ isCopied: boolean;
55
+ width: number;
56
+ };
47
57
  componentDidMount(): void;
48
58
  componentWillUnmount(): void;
59
+ resizeWidth: (width: number) => void;
49
60
  fixUpTripleClick: (ev: MouseEvent) => void;
50
61
  saveScrollPos: () => void;
51
62
  restoreScrollPos: () => void;
@@ -0,0 +1,22 @@
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 { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
22
+ export declare const getDi: () => ConfigurableDependencyInjectionContainer;
@@ -0,0 +1,22 @@
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 { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
22
+ export declare const getDiForUnitTesting: () => ConfigurableDependencyInjectionContainer;
@@ -18,13 +18,12 @@
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 React, { DOMAttributes } from "react";
21
+ import React, { HTMLAttributes } from "react";
22
22
  import type { CatalogEntity } from "../../../common/catalog";
23
23
  import { IClassName } from "../../utils";
24
- interface Props extends DOMAttributes<HTMLElement> {
24
+ interface Props extends HTMLAttributes<HTMLElement> {
25
25
  entity: CatalogEntity;
26
26
  index: number;
27
- className?: IClassName;
28
27
  errorClass?: IClassName;
29
28
  add: (item: CatalogEntity, index: number) => void;
30
29
  remove: (uid: string) => void;
@@ -36,6 +35,7 @@ export declare class HotbarEntityIcon extends React.Component<Props> {
36
35
  get kindIcon(): JSX.Element;
37
36
  get ledIcon(): JSX.Element;
38
37
  isActive(item: CatalogEntity): boolean;
38
+ onMenuOpen(): Promise<void>;
39
39
  render(): JSX.Element;
40
40
  }
41
41
  export {};