mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Introduce competition for kubernetes preference tab
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
3c214c6635
commit
cd3210ac59
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { HelmCharts } from "./helm-charts";
|
||||||
|
import { preferenceItemInjectionToken } from "../../../../preferences/renderer/preference-items/preference-item-injection-token";
|
||||||
|
|
||||||
|
const helmChartsPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "helm-charts-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "item" as const,
|
||||||
|
id: "helm-charts",
|
||||||
|
parentId: "kubernetes-page",
|
||||||
|
orderNumber: 30,
|
||||||
|
Component: HelmCharts,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default helmChartsPreferenceItemInjectable;
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../../preference-item-injection-token";
|
||||||
|
import { KubeconfigSync } from "./kubeconfig-sync";
|
||||||
|
|
||||||
|
const kubeconfigSyncPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "kubeconfig-sync-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "item" as const,
|
||||||
|
id: "kubeconfig-sync",
|
||||||
|
parentId: "kubernetes-page",
|
||||||
|
orderNumber: 20,
|
||||||
|
Component: KubeconfigSync,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubeconfigSyncPreferenceItemInjectable;
|
||||||
@ -7,17 +7,17 @@ import fse from "fs-extra";
|
|||||||
import { computed, makeObservable, observable, reaction } from "mobx";
|
import { computed, makeObservable, observable, reaction } from "mobx";
|
||||||
import { disposeOnUnmount, observer } from "mobx-react";
|
import { disposeOnUnmount, observer } from "mobx-react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Notice } from "../+extensions/notice";
|
import { Notice } from "../../../../../../renderer/components/+extensions/notice";
|
||||||
import type { KubeconfigSyncEntry, KubeconfigSyncValue, UserStore } from "../../../common/user-store";
|
import type { KubeconfigSyncEntry, KubeconfigSyncValue, UserStore } from "../../../../../../common/user-store";
|
||||||
import { iter, tuple } from "../../utils";
|
import { iter, tuple } from "../../../../../../renderer/utils";
|
||||||
import { SubTitle } from "../layout/sub-title";
|
import { SubTitle } from "../../../../../../renderer/components/layout/sub-title";
|
||||||
import { PathPicker } from "../path-picker/path-picker";
|
import { PathPicker } from "../../../../../../renderer/components/path-picker/path-picker";
|
||||||
import { Spinner } from "../spinner";
|
import { Spinner } from "../../../../../../renderer/components/spinner";
|
||||||
import { RemovableItem } from "./removable-item";
|
import { RemovableItem } from "../../../../../../renderer/components/+preferences/removable-item";
|
||||||
import userStoreInjectable from "../../../common/user-store/user-store.injectable";
|
import userStoreInjectable from "../../../../../../common/user-store/user-store.injectable";
|
||||||
import isWindowsInjectable from "../../../common/vars/is-windows.injectable";
|
import isWindowsInjectable from "../../../../../../common/vars/is-windows.injectable";
|
||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../../../../common/logger.injectable";
|
||||||
import type { Logger } from "../../../common/logger";
|
import type { Logger } from "../../../../../../common/logger";
|
||||||
|
|
||||||
interface SyncInfo {
|
interface SyncInfo {
|
||||||
type: "file" | "folder" | "unknown";
|
type: "file" | "folder" | "unknown";
|
||||||
@ -66,7 +66,7 @@ interface Dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
class NonInjectedKubeconfigSyncs extends React.Component<Dependencies> {
|
class NonInjectedKubeconfigSync extends React.Component<Dependencies> {
|
||||||
syncs = observable.map<string, Value>();
|
syncs = observable.map<string, Value>();
|
||||||
@observable loaded = false;
|
@observable loaded = false;
|
||||||
|
|
||||||
@ -195,17 +195,19 @@ class NonInjectedKubeconfigSyncs extends React.Component<Dependencies> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<>
|
<section id="kube-sync">
|
||||||
|
<h2 data-testid="kubernetes-sync-header">Kubeconfig Syncs</h2>
|
||||||
|
|
||||||
{this.renderSyncButtons()}
|
{this.renderSyncButtons()}
|
||||||
<SubTitle title="Synced Items" className="pt-5"/>
|
<SubTitle title="Synced Items" className="pt-5"/>
|
||||||
{this.renderEntries()}
|
{this.renderEntries()}
|
||||||
</>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const KubeconfigSyncs = withInjectables<Dependencies>(
|
export const KubeconfigSync = withInjectables<Dependencies>(
|
||||||
NonInjectedKubeconfigSyncs,
|
NonInjectedKubeconfigSync,
|
||||||
|
|
||||||
{
|
{
|
||||||
getProps: (di) => ({
|
getProps: (di) => ({
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../../../preference-item-injection-token";
|
||||||
|
import { KubectlBinaryDownload } from "./kubectl-binary-download";
|
||||||
|
|
||||||
|
const kubectlBinaryDownloadPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "kubectl-binary-download-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "item" as const,
|
||||||
|
id: "kubectl-binary-download",
|
||||||
|
parentId: "kubectl",
|
||||||
|
orderNumber: 10,
|
||||||
|
Component: KubectlBinaryDownload,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubectlBinaryDownloadPreferenceItemInjectable;
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import React from "react";
|
||||||
|
import { SubTitle } from "../../../../../../../renderer/components/layout/sub-title";
|
||||||
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
|
import type { UserStore } from "../../../../../../../common/user-store";
|
||||||
|
import userStoreInjectable from "../../../../../../../common/user-store/user-store.injectable";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
import { Switch } from "../../../../../../../renderer/components/switch";
|
||||||
|
|
||||||
|
interface Dependencies {
|
||||||
|
userStore: UserStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NonInjectedKubectlBinaryDownload = observer(({ userStore }: Dependencies) => (
|
||||||
|
<section>
|
||||||
|
<SubTitle title="Kubectl binary download" />
|
||||||
|
<Switch
|
||||||
|
checked={userStore.downloadKubectlBinaries}
|
||||||
|
onChange={() => userStore.downloadKubectlBinaries = !userStore.downloadKubectlBinaries}
|
||||||
|
>
|
||||||
|
Download kubectl binaries matching the Kubernetes cluster version
|
||||||
|
</Switch>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
));
|
||||||
|
|
||||||
|
export const KubectlBinaryDownload = withInjectables<Dependencies>(
|
||||||
|
NonInjectedKubectlBinaryDownload,
|
||||||
|
|
||||||
|
{
|
||||||
|
getProps: (di) => ({
|
||||||
|
userStore: di.inject(userStoreInjectable),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../../../preference-item-injection-token";
|
||||||
|
import { KubectlDirectoryForBinaries } from "./kubectl-directory-for-binaries";
|
||||||
|
|
||||||
|
const kubectlDirectoryForBinariesPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "kubectl-directory-for-binaries-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "item" as const,
|
||||||
|
id: "kubectl-directory-for-binaries",
|
||||||
|
parentId: "kubectl",
|
||||||
|
orderNumber: 30,
|
||||||
|
Component: KubectlDirectoryForBinaries,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubectlDirectoryForBinariesPreferenceItemInjectable;
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { SubTitle } from "../../../../../../../renderer/components/layout/sub-title";
|
||||||
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
|
import type { UserStore } from "../../../../../../../common/user-store";
|
||||||
|
import userStoreInjectable from "../../../../../../../common/user-store/user-store.injectable";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
import { Input, InputValidators } from "../../../../../../../renderer/components/input";
|
||||||
|
import directoryForBinariesInjectable from "../../../../../../../common/app-paths/directory-for-binaries/directory-for-binaries.injectable";
|
||||||
|
|
||||||
|
interface Dependencies {
|
||||||
|
userStore: UserStore;
|
||||||
|
defaultPathForGeneralBinaries: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NonInjectedKubectlDirectoryForBinaries = observer(
|
||||||
|
({ userStore, defaultPathForGeneralBinaries }: Dependencies) => {
|
||||||
|
const [downloadPath, setDownloadPath] = useState(userStore.downloadBinariesPath || "");
|
||||||
|
const pathValidator = downloadPath ? InputValidators.isPath : undefined;
|
||||||
|
|
||||||
|
const save = () => {
|
||||||
|
userStore.downloadBinariesPath = downloadPath;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section>
|
||||||
|
<SubTitle title="Directory for binaries" />
|
||||||
|
<Input
|
||||||
|
theme="round-black"
|
||||||
|
value={downloadPath}
|
||||||
|
placeholder={defaultPathForGeneralBinaries}
|
||||||
|
validators={pathValidator}
|
||||||
|
onChange={setDownloadPath}
|
||||||
|
onBlur={save}
|
||||||
|
disabled={!userStore.downloadKubectlBinaries}
|
||||||
|
/>
|
||||||
|
<div className="hint">The directory to download binaries into.</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export const KubectlDirectoryForBinaries = withInjectables<Dependencies>(
|
||||||
|
NonInjectedKubectlDirectoryForBinaries,
|
||||||
|
|
||||||
|
{
|
||||||
|
getProps: (di) => ({
|
||||||
|
defaultPathForGeneralBinaries: di.inject(directoryForBinariesInjectable),
|
||||||
|
userStore: di.inject(userStoreInjectable),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../../../preference-item-injection-token";
|
||||||
|
import { KubectlDownloadMirror } from "./kubectl-download-mirror";
|
||||||
|
|
||||||
|
const kubectlDownloadMirrorPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "kubectl-download-mirror-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "item" as const,
|
||||||
|
id: "kubectl-download-mirror",
|
||||||
|
parentId: "kubectl",
|
||||||
|
orderNumber: 20,
|
||||||
|
Component: KubectlDownloadMirror,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubectlDownloadMirrorPreferenceItemInjectable;
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import React from "react";
|
||||||
|
import { SubTitle } from "../../../../../../../renderer/components/layout/sub-title";
|
||||||
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
|
import type { UserStore } from "../../../../../../../common/user-store";
|
||||||
|
import userStoreInjectable from "../../../../../../../common/user-store/user-store.injectable";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
import { Select } from "../../../../../../../renderer/components/select";
|
||||||
|
import { defaultPackageMirror, packageMirrors } from "../../../../../../../common/user-store/preferences-helpers";
|
||||||
|
|
||||||
|
interface Dependencies {
|
||||||
|
userStore: UserStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadMirrorOptions = Array.from(packageMirrors, ([name, mirror]) => ({
|
||||||
|
value: name,
|
||||||
|
label: mirror.label,
|
||||||
|
|
||||||
|
// TODO: Side-effect
|
||||||
|
isDisabled: !mirror.platforms.has(process.platform),
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
const NonInjectedKubectlDownloadMirror = observer(({ userStore }: Dependencies) => (
|
||||||
|
<section>
|
||||||
|
<SubTitle title="Download mirror" />
|
||||||
|
<Select
|
||||||
|
id="download-mirror-input"
|
||||||
|
placeholder="Download mirror for kubectl"
|
||||||
|
options={downloadMirrorOptions}
|
||||||
|
value={userStore.downloadMirror}
|
||||||
|
onChange={option => userStore.downloadMirror = option?.value ?? defaultPackageMirror}
|
||||||
|
isDisabled={!userStore.downloadKubectlBinaries}
|
||||||
|
themeName="lens"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
));
|
||||||
|
|
||||||
|
export const KubectlDownloadMirror = withInjectables<Dependencies>(
|
||||||
|
NonInjectedKubectlDownloadMirror,
|
||||||
|
|
||||||
|
{
|
||||||
|
getProps: (di) => ({
|
||||||
|
userStore: di.inject(userStoreInjectable),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../../preference-item-injection-token";
|
||||||
|
|
||||||
|
const kubectlGroupPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "kubectl-group-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "group" as const,
|
||||||
|
id: "kubectl",
|
||||||
|
parentId: "kubernetes-page",
|
||||||
|
orderNumber: 10,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubectlGroupPreferenceItemInjectable;
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../../../preference-item-injection-token";
|
||||||
|
import { KubectlPathToBinary } from "./kubectl-path-to-binary";
|
||||||
|
|
||||||
|
const kubectlPathToBinaryPreferenceItemInjectable = getInjectable({
|
||||||
|
id: "kubectl-path-to-binary-preference-item",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "item" as const,
|
||||||
|
id: "kubectl-path-to-binary",
|
||||||
|
parentId: "kubectl",
|
||||||
|
orderNumber: 40,
|
||||||
|
Component: KubectlPathToBinary,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubectlPathToBinaryPreferenceItemInjectable;
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { SubTitle } from "../../../../../../../renderer/components/layout/sub-title";
|
||||||
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
|
import type { UserStore } from "../../../../../../../common/user-store";
|
||||||
|
import userStoreInjectable from "../../../../../../../common/user-store/user-store.injectable";
|
||||||
|
import { observer } from "mobx-react";
|
||||||
|
import { Input, InputValidators } from "../../../../../../../renderer/components/input";
|
||||||
|
import directoryForKubectlBinariesInjectable from "../../../../../../../common/app-paths/directory-for-kubectl-binaries/directory-for-kubectl-binaries.injectable";
|
||||||
|
|
||||||
|
interface Dependencies {
|
||||||
|
userStore: UserStore;
|
||||||
|
defaultPathForKubectlBinaries: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NonInjectedKubectlPathToBinary = observer(
|
||||||
|
({ userStore, defaultPathForKubectlBinaries }: Dependencies) => {
|
||||||
|
const [binariesPath, setBinariesPath] = useState(userStore.kubectlBinariesPath || "");
|
||||||
|
const pathValidator = binariesPath ? InputValidators.isPath : undefined;
|
||||||
|
|
||||||
|
const save = () => {
|
||||||
|
userStore.kubectlBinariesPath = binariesPath;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section>
|
||||||
|
<SubTitle title="Path to kubectl binary" />
|
||||||
|
<Input
|
||||||
|
theme="round-black"
|
||||||
|
placeholder={defaultPathForKubectlBinaries}
|
||||||
|
value={binariesPath}
|
||||||
|
validators={pathValidator}
|
||||||
|
onChange={setBinariesPath}
|
||||||
|
onBlur={save}
|
||||||
|
disabled={userStore.downloadKubectlBinaries}
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export const KubectlPathToBinary = withInjectables<Dependencies>(
|
||||||
|
NonInjectedKubectlPathToBinary,
|
||||||
|
|
||||||
|
{
|
||||||
|
getProps: (di) => ({
|
||||||
|
defaultPathForKubectlBinaries: di.inject(directoryForKubectlBinariesInjectable),
|
||||||
|
userStore: di.inject(userStoreInjectable),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import React from "react";
|
||||||
|
import type { PreferenceItemComponent } from "../preference-item-injection-token";
|
||||||
|
|
||||||
|
export const KubernetesPage: PreferenceItemComponent = ({ children }) => (
|
||||||
|
<section id="kubernetes">
|
||||||
|
<h2 data-testid="kubernetes-header">Kubernetes</h2>
|
||||||
|
|
||||||
|
{children}
|
||||||
|
</section>
|
||||||
|
);
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../preference-item-injection-token";
|
||||||
|
import { KubernetesPage } from "./kubernetes-page";
|
||||||
|
import { HorizontalLine } from "../../../../../renderer/components/+preferences/horizontal-line/horizontal-line";
|
||||||
|
|
||||||
|
const kubernetesPreferencePageInjectable = getInjectable({
|
||||||
|
id: "kubernetes-preference-page",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "page" as const,
|
||||||
|
id: "kubernetes-page",
|
||||||
|
parentId: "kubernetes-tab",
|
||||||
|
orderNumber: 0,
|
||||||
|
Component: KubernetesPage,
|
||||||
|
childrenSeparator: HorizontalLine,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubernetesPreferencePageInjectable;
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { preferenceItemInjectionToken } from "../preference-item-injection-token";
|
||||||
|
|
||||||
|
const kubernetesPreferenceTabInjectable = getInjectable({
|
||||||
|
id: "kubernetes-preference-tab",
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
kind: "tab" as const,
|
||||||
|
id: "kubernetes-tab",
|
||||||
|
parentId: "preference-tabs" as const,
|
||||||
|
pathId: "kubernetes",
|
||||||
|
testId: "kubernetes-preferences-page",
|
||||||
|
label: "Kubernetes",
|
||||||
|
orderNumber: 10,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: preferenceItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default kubernetesPreferenceTabInjectable;
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { HelmCharts } from "../../../features/helm-charts/child-features/preferences/renderer/helm-charts";
|
import { HelmCharts } from "../../../features/helm-charts/child-features/preferences/renderer/helm-charts";
|
||||||
import { KubeconfigSyncs } from "./kubeconfig-syncs";
|
import { KubeconfigSync } from "../../../features/preferences/renderer/preference-items/kubernetes/kubeconfig-sync/kubeconfig-sync";
|
||||||
import { KubectlBinaries } from "./kubectl-binaries";
|
import { KubectlBinaries } from "./kubectl-binaries";
|
||||||
import { Preferences } from "./preferences";
|
import { Preferences } from "./preferences";
|
||||||
|
|
||||||
@ -17,10 +17,7 @@ export const Kubernetes = observer(() => (
|
|||||||
<KubectlBinaries />
|
<KubectlBinaries />
|
||||||
</section>
|
</section>
|
||||||
<hr />
|
<hr />
|
||||||
<section id="kube-sync">
|
<KubeconfigSync />
|
||||||
<h2 data-testid="kubernetes-sync-header">Kubeconfig Syncs</h2>
|
|
||||||
<KubeconfigSyncs />
|
|
||||||
</section>
|
|
||||||
<hr />
|
<hr />
|
||||||
<HelmCharts />
|
<HelmCharts />
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user