1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Merge branch 'master' into feature/ingress_class_api_view

This commit is contained in:
Roman 2022-12-29 12:38:16 +02:00
commit 87c932f2e5
7 changed files with 191 additions and 40 deletions

BIN
.github/screenshot.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 KiB

After

Width:  |  Height:  |  Size: 984 KiB

View File

@ -1,26 +1,26 @@
# Lens Open Source Project (OpenLens)
# Lens Desktop Core ("OpenLens")
[![Build Status](https://github.com/lensapp/lens/actions/workflows/test.yml/badge.svg)](https://github.com/lensapp/lens/actions/workflows/test.yml)
[![Chat on Slack](https://img.shields.io/badge/chat-on%20slack-blue.svg?logo=slack&longCache=true&style=flat)](https://join.slack.com/t/k8slens/shared_invite/zt-198iepl92-EPJsCckkJ~f887vWqJcgGA)
## The Repository
This repository ("OpenLens") is where Team Lens develops the [Lens IDE](https://k8slens.dev) product together with the community. It is backed by a number of Kubernetes and cloud native ecosystem pioneers. This source code is available to everyone under the [MIT license](./LICENSE).
This repository is where Team Lens develops the core of the [Lens Desktop](https://k8slens.dev) product together with the community.
## Lens - The Kubernetes IDE
The core is a library, powered by [Electron](https://www.electronjs.org/) and [React](https://reactjs.org/). Unlike generic Electron + React frameworks / boilerplates, it is very opinionated for creating Lens Desktop-like applications and has support for Lens Extensions.
Lens - The Kubernetes IDE ("Lens IDE") is a distribution of the OpenLens repository with Team Lens specific customizations released under a traditional [EULA](https://k8slens.dev/licenses/eula).
In the future, this library will be streamlined to become more customizable and pluggable with easy to use tooling for Lens Extension developers.
Lens IDE provides the full situational awareness for everything that runs in Kubernetes. It's lowering the barrier of entry for people just getting started and radically improving productivity for people with more experience.
This source code is available to everyone under the [MIT license](./LICENSE).
Lens IDE a standalone application for MacOS, Windows and Linux operating systems. You can download it free of charge for Windows, MacOS, and Linux from [Lens IDE website](https://k8slens.dev).
## Lens Desktop
[Lens Desktop](https://k8slens.dev) is built on top of the Lens Desktop Core with Team Lens built extensions released under a traditional [Terms Of Service](https://k8slens.dev/licenses/tos).
Lens Desktop is a standalone application for MacOS, Windows and Linux operating systems. Get started by downloading it from [Lens website](https://k8slens.dev).
[![Screenshot](.github/screenshot.png)](https://www.youtube.com/watch?v=eeDwdVXattc)
## Installation
See [Getting Started](https://docs.k8slens.dev/getting-started/install-lens/) page.
## Development
See [Development](https://docs.k8slens.dev/contributing/development/) page.
@ -31,4 +31,4 @@ See [Contributing](https://docs.k8slens.dev/contributing/) page.
## License
See [License](LICENSE).
See [License](LICENSE).

View File

@ -372,7 +372,7 @@
"@types/webpack-env": "^1.18.0",
"@types/webpack-node-externals": "^2.5.3",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"@typescript-eslint/parser": "^5.47.1",
"adr": "^1.4.3",
"ansi_up": "^5.1.0",
"chalk": "^4.1.2",
@ -416,7 +416,7 @@
"node-gyp": "^8.3.0",
"node-loader": "^2.0.0",
"nodemon": "^2.0.20",
"playwright": "^1.29.0",
"playwright": "^1.29.1",
"postcss": "^8.4.20",
"postcss-loader": "^6.2.1",
"query-string": "^7.1.3",
@ -431,7 +431,7 @@
"react-window": "^1.8.8",
"sass": "^1.57.1",
"sass-loader": "^12.6.0",
"sharp": "^0.31.2",
"sharp": "^0.31.3",
"style-loader": "^3.3.1",
"tailwindcss": "^3.2.4",
"tar-stream": "^2.2.0",

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { withInjectables } from "@ogre-tools/injectable-react";
import { action, computed, makeObservable, observable, reaction } from "mobx";
import { computed, makeObservable, observable, reaction } from "mobx";
import { disposeOnUnmount, observer } from "mobx-react";
import React from "react";
import { Notice } from "../../../../../../renderer/components/+extensions/notice";
@ -59,11 +59,7 @@ class NonInjectedKubeconfigSync extends React.Component<Dependencies> {
reaction(
() => Array.from(this.syncs.entries(), ([filePath, kind]) => tuple.from(filePath, kind)),
syncs => {
action(() => {
for (const [path] of syncs) {
this.props.userStore.syncKubeconfigEntries.set(path, {});
}
});
this.props.userStore.syncKubeconfigEntries.replace(syncs);
},
),
]);

View File

@ -6,16 +6,22 @@ import { getInjectable } from "@ogre-tools/injectable";
import type { SendMessageToChannel } from "../../../common/utils/channel/message-to-channel-injection-token";
import { sendMessageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
import getVisibleWindowsInjectable from "../../start-main-application/lens-window/get-visible-windows.injectable";
import clusterFramesInjectable from "../../../common/cluster-frames.injectable";
const messageToChannelInjectable = getInjectable({
id: "message-to-channel",
instantiate: (di) => {
const getVisibleWindows = di.inject(getVisibleWindowsInjectable);
const clusterFrames = di.inject(clusterFramesInjectable);
return ((channel, data) => {
for (const window of getVisibleWindows()) {
window.send({ channel: channel.id, data });
clusterFrames.forEach(frameInfo => {
window.send({ channel: channel.id, data, frameInfo });
});
}
}) as SendMessageToChannel;
},

View File

@ -0,0 +1,115 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
import getVisibleWindowsInjectable from "../../start-main-application/lens-window/get-visible-windows.injectable";
import clusterFramesInjectable from "../../../common/cluster-frames.injectable";
import type { MessageChannel } from "../../../common/utils/channel/message-channel-listener-injection-token";
import { sendMessageToChannelInjectionToken } from "../../../common/utils/channel/message-to-channel-injection-token";
import type { DiContainer } from "@ogre-tools/injectable";
import type { ClusterFrameInfo } from "../../../common/cluster-frames";
describe("message-to-channel", () => {
let di: DiContainer;
let sendToWindowMock: jest.Mock;
beforeEach(() => {
di = getDiForUnitTesting({ doGeneralOverrides: true });
sendToWindowMock = jest.fn();
di.override(getVisibleWindowsInjectable, () => () => [
{
id: "some-window",
send: sendToWindowMock,
show: () => {},
reload: () => {},
isStarting: false,
start: async () => {},
close: () => {},
isVisible: true,
},
{
id: "some-other-window",
send: sendToWindowMock,
show: () => {},
reload: () => {},
isStarting: false,
start: async () => {},
close: () => {},
isVisible: true,
},
]);
di.override(
clusterFramesInjectable,
() =>
new Map<string, ClusterFrameInfo>([
[
"some-cluster-id",
{ frameId: 42, processId: 84 },
],
[
"some-other-cluster-id",
{ frameId: 126, processId: 168 },
],
]),
);
});
describe("when sending message", () => {
beforeEach(() => {
const sendMessageToChannel = di.inject(
sendMessageToChannelInjectionToken,
);
sendMessageToChannel(someChannel, 42);
});
it("sends to each window and cluster frames", () => {
expect(sendToWindowMock.mock.calls).toEqual([
[{ channel: "some-channel-id", data: 42 }],
[
{
channel: "some-channel-id",
data: 42,
frameInfo: { frameId: 42, processId: 84 },
},
],
[
{
channel: "some-channel-id",
data: 42,
frameInfo: { frameId: 126, processId: 168 },
},
],
[{ channel: "some-channel-id", data: 42 }],
[
{
channel: "some-channel-id",
data: 42,
frameInfo: { frameId: 42, processId: 84 },
},
],
[
{
channel: "some-channel-id",
data: 42,
frameInfo: { frameId: 126, processId: 168 },
},
],
]);
});
});
});
const someChannel: MessageChannel<number> = {
id: "some-channel-id",
};

View File

@ -2776,14 +2776,14 @@
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/parser@^5.46.1":
version "5.46.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.46.1.tgz#1fc8e7102c1141eb64276c3b89d70da8c0ba5699"
integrity sha512-RelQ5cGypPh4ySAtfIMBzBGyrNerQcmfA1oJvPj5f+H4jI59rl9xxpn4bonC0tQvUKOEN7eGBFWxFLK3Xepneg==
"@typescript-eslint/parser@^5.47.1":
version "5.47.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.47.1.tgz#c4bf16f8c3c7608ce4bf8ff804b677fc899f173f"
integrity sha512-9Vb+KIv29r6GPu4EboWOnQM7T+UjpjXvjCPhNORlgm40a9Ia9bvaPJswvtae1gip2QEeVeGh6YquqAzEgoRAlw==
dependencies:
"@typescript-eslint/scope-manager" "5.46.1"
"@typescript-eslint/types" "5.46.1"
"@typescript-eslint/typescript-estree" "5.46.1"
"@typescript-eslint/scope-manager" "5.47.1"
"@typescript-eslint/types" "5.47.1"
"@typescript-eslint/typescript-estree" "5.47.1"
debug "^4.3.4"
"@typescript-eslint/scope-manager@5.46.1":
@ -2794,6 +2794,14 @@
"@typescript-eslint/types" "5.46.1"
"@typescript-eslint/visitor-keys" "5.46.1"
"@typescript-eslint/scope-manager@5.47.1":
version "5.47.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.47.1.tgz#0d302b3c2f20ab24e4787bf3f5a0d8c449b823bd"
integrity sha512-9hsFDsgUwrdOoW1D97Ewog7DYSHaq4WKuNs0LHF9RiCmqB0Z+XRR4Pf7u7u9z/8CciHuJ6yxNws1XznI3ddjEw==
dependencies:
"@typescript-eslint/types" "5.47.1"
"@typescript-eslint/visitor-keys" "5.47.1"
"@typescript-eslint/type-utils@5.46.1":
version "5.46.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.46.1.tgz#195033e4b30b51b870dfcf2828e88d57b04a11cc"
@ -2809,6 +2817,11 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.46.1.tgz#4e9db2107b9a88441c4d5ecacde3bb7a5ebbd47e"
integrity sha512-Z5pvlCaZgU+93ryiYUwGwLl9AQVB/PQ1TsJ9NZ/gHzZjN7g9IAn6RSDkpCV8hqTwAiaj6fmCcKSQeBPlIpW28w==
"@typescript-eslint/types@5.47.1":
version "5.47.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.47.1.tgz#459f07428aec5a8c4113706293c2ae876741ac8e"
integrity sha512-CmALY9YWXEpwuu6377ybJBZdtSAnzXLSQcxLSqSQSbC7VfpMu/HLVdrnVJj7ycI138EHqocW02LPJErE35cE9A==
"@typescript-eslint/typescript-estree@5.46.1":
version "5.46.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.46.1.tgz#5358088f98a8f9939355e0996f9c8f41c25eced2"
@ -2822,6 +2835,19 @@
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/typescript-estree@5.47.1":
version "5.47.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.1.tgz#b9d8441308aca53df7f69b2c67a887b82c9ed418"
integrity sha512-4+ZhFSuISAvRi2xUszEj0xXbNTHceV9GbH9S8oAD2a/F9SW57aJNQVOCxG8GPfSWH/X4eOPdMEU2jYVuWKEpWA==
dependencies:
"@typescript-eslint/types" "5.47.1"
"@typescript-eslint/visitor-keys" "5.47.1"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/utils@5.46.1":
version "5.46.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.46.1.tgz#7da3c934d9fd0eb4002a6bb3429f33298b469b4a"
@ -2844,6 +2870,14 @@
"@typescript-eslint/types" "5.46.1"
eslint-visitor-keys "^3.3.0"
"@typescript-eslint/visitor-keys@5.47.1":
version "5.47.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.1.tgz#d35c2da544dbb685db9c5b5b85adac0a1d74d1f2"
integrity sha512-rF3pmut2JCCjh6BLRhNKdYjULMb1brvoaiWDlHfLNVgmnZ0sBVJrs3SyaKE1XoDDnJuAx/hDQryHYmPUuNq0ig==
dependencies:
"@typescript-eslint/types" "5.47.1"
eslint-visitor-keys "^3.3.0"
"@webassemblyjs/ast@1.11.1":
version "1.11.1"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7"
@ -10223,17 +10257,17 @@ pkg-up@^3.1.0:
dependencies:
find-up "^3.0.0"
playwright-core@1.29.0:
version "1.29.0"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.29.0.tgz#314653618395afef5031156d691c7aa0826e5d05"
integrity sha512-pboOm1m0RD6z1GtwAbEH60PYRfF87vKdzOSRw2RyO0Y0a7utrMyWN2Au1ojGvQr4umuBMODkKTv607YIRypDSQ==
playwright-core@1.29.1:
version "1.29.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.29.1.tgz#9ec15d61c4bd2f386ddf6ce010db53a030345a47"
integrity sha512-20Ai3d+lMkWpI9YZYlxk8gxatfgax5STW8GaMozAHwigLiyiKQrdkt7gaoT9UQR8FIVDg6qVXs9IoZUQrDjIIg==
playwright@^1.29.0:
version "1.29.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.29.0.tgz#14b70f373a7d433b9e304ee1666cb70e93336364"
integrity sha512-vtXgX3FPNcAJq1QoIVCvmiHHKOLVTZkSYEo60n+EnX5MrNznAJzGquxT8c2sv+BG3CDyLeKm351e491HnF7yjw==
playwright@^1.29.1:
version "1.29.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.29.1.tgz#fc04b34f42e3bfc0edadb1c45ef9bffd53c21f70"
integrity sha512-lasC+pMqsQ2uWhNurt3YK3xo0gWlMjslYUylKbHcqF/NTjwp9KStRGO7S6wwz2f52GcSnop8XUK/GymJjdzrxw==
dependencies:
playwright-core "1.29.0"
playwright-core "1.29.1"
plist@^3.0.1, plist@^3.0.4:
version "3.0.5"
@ -11478,10 +11512,10 @@ sharp@^0.30.4:
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"
sharp@^0.31.2:
version "0.31.2"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.31.2.tgz#a8411c80512027f5a452b76d599268760c4e5dfa"
integrity sha512-DUdNVEXgS5A97cTagSLIIp8dUZ/lZtk78iNVZgHdHbx1qnQR7JAHY0BnXnwwH39Iw+VKhO08CTYhIg0p98vQ5Q==
sharp@^0.31.3:
version "0.31.3"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.31.3.tgz#60227edc5c2be90e7378a210466c99aefcf32688"
integrity sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==
dependencies:
color "^4.2.3"
detect-libc "^2.0.1"