mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Update injectable library (#4842)
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
This commit is contained in:
1 parent
e8ca1ddf87
commit
b65f6e00ec
231 files changed
+630
-613
No files matched your search
@@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { catalogEntityRegistry } from "../catalog-entity-registry";
|
||||
|
||||
const catalogEntityRegistryInjectable = getInjectable({
|
||||
id: "catalog-entity-registry",
|
||||
instantiate: () => catalogEntityRegistry,
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default catalogEntityRegistryInjectable;
|
||||
@@ -2,15 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { AppPaths, appPathsInjectionToken, appPathsIpcChannel } from "../../common/app-paths/app-path-injection-token";
|
||||
import getValueFromRegisteredChannelInjectable from "./get-value-from-registered-channel/get-value-from-registered-channel.injectable";
|
||||
|
||||
let syncAppPaths: AppPaths;
|
||||
|
||||
const appPathsInjectable = getInjectable({
|
||||
id: "app-paths",
|
||||
|
||||
setup: async (di) => {
|
||||
const getValueFromRegisteredChannel = di.inject(
|
||||
const getValueFromRegisteredChannel = await di.inject(
|
||||
getValueFromRegisteredChannelInjectable,
|
||||
);
|
||||
|
||||
@@ -20,8 +22,6 @@ const appPathsInjectable = getInjectable({
|
||||
instantiate: () => syncAppPaths,
|
||||
|
||||
injectionToken: appPathsInjectionToken,
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default appPathsInjectable;
|
||||
+3
-3
@@ -2,15 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import ipcRendererInjectable from "./ipc-renderer/ipc-renderer.injectable";
|
||||
import { getValueFromRegisteredChannel } from "./get-value-from-registered-channel";
|
||||
|
||||
const getValueFromRegisteredChannelInjectable = getInjectable({
|
||||
id: "get-value-from-registered-channel",
|
||||
|
||||
instantiate: (di) =>
|
||||
getValueFromRegisteredChannel({ ipcRenderer: di.inject(ipcRendererInjectable) }),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getValueFromRegisteredChannelInjectable;
|
||||
+2
-2
@@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { ipcRenderer } from "electron";
|
||||
|
||||
const ipcRendererInjectable = getInjectable({
|
||||
id: "ipc-renderer",
|
||||
instantiate: () => ipcRenderer,
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import { SentryInit } from "../common/sentry";
|
||||
import { registerCustomThemes } from "./components/monaco-editor";
|
||||
import { getDi } from "./getDi";
|
||||
import { DiContextProvider } from "@ogre-tools/injectable-react";
|
||||
import type { DependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import extensionLoaderInjectable from "../extensions/extension-loader/extension-loader.injectable";
|
||||
import extensionDiscoveryInjectable from "../extensions/extension-discovery/extension-discovery.injectable";
|
||||
import extensionInstallationStateStoreInjectable from "../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
@@ -55,7 +55,7 @@ async function attachChromeDebugger() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function bootstrap(di: DependencyInjectionContainer) {
|
||||
export async function bootstrap(di: DiContainer) {
|
||||
await di.runSetups();
|
||||
|
||||
const rootElem = document.getElementById("app");
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { ClusterFrameContext } from "./cluster-frame-context";
|
||||
import namespaceStoreInjectable from "../components/+namespaces/namespace-store/namespace-store.injectable";
|
||||
import hostedClusterInjectable from "../../common/cluster-store/hosted-cluster.injectable";
|
||||
|
||||
const clusterFrameContextInjectable = getInjectable({
|
||||
id: "cluster-frame-context",
|
||||
|
||||
instantiate: (di) => {
|
||||
const cluster = di.inject(hostedClusterInjectable);
|
||||
|
||||
@@ -19,8 +21,6 @@ const clusterFrameContextInjectable = getInjectable({
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clusterFrameContextInjectable;
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { CatalogCategorySpec } from "../../../../common/catalog";
|
||||
import type { LensRendererExtension } from "../../../../extensions/lens-renderer-extension";
|
||||
@@ -35,7 +35,7 @@ class TestCategory extends CatalogCategory {
|
||||
}
|
||||
|
||||
describe("Custom Category Columns", () => {
|
||||
let di: ConfigurableDependencyInjectionContainer;
|
||||
let di: DiContainer;
|
||||
|
||||
beforeEach(() => {
|
||||
di = getDiForUnitTesting();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type React from "react";
|
||||
import type { LensRendererExtension } from "../../../../extensions/lens-renderer-extension";
|
||||
@@ -13,7 +13,7 @@ import type { CustomCategoryViewRegistration } from "../custom-views";
|
||||
import customCategoryViewsInjectable from "../custom-views.injectable";
|
||||
|
||||
describe("Custom Category Views", () => {
|
||||
let di: ConfigurableDependencyInjectionContainer;
|
||||
let di: DiContainer;
|
||||
|
||||
beforeEach(() => {
|
||||
di = getDiForUnitTesting();
|
||||
|
||||
+3
-3
@@ -2,16 +2,16 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { CatalogEntityStore } from "./catalog-entity.store";
|
||||
import catalogEntityRegistryInjectable from "../../../api/catalog-entity-registry/catalog-entity-registry.injectable";
|
||||
|
||||
const catalogEntityStoreInjectable = getInjectable({
|
||||
id: "catalog-entity-store",
|
||||
|
||||
instantiate: (di) => new CatalogEntityStore({
|
||||
registry: di.inject(catalogEntityRegistryInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default catalogEntityStoreInjectable;
|
||||
+3
-3
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { browseCatalogTab } from "../../../../common/routes";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const catalogPreviousActiveTabStorageInjectable = getInjectable({
|
||||
id: "catalog-previous-active-tab-storage",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createStorage = di.inject(createStorageInjectable);
|
||||
|
||||
@@ -15,8 +17,6 @@ const catalogPreviousActiveTabStorageInjectable = getInjectable({
|
||||
browseCatalogTab,
|
||||
);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default catalogPreviousActiveTabStorageInjectable;
|
||||
@@ -14,7 +14,7 @@ import { CatalogEntityRegistry } from "../../api/catalog-entity-registry";
|
||||
import { CatalogEntityDetailRegistry } from "../../../extensions/registries";
|
||||
import type { CatalogEntityStore } from "./catalog-entity-store/catalog-entity.store";
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import type { DependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import catalogEntityStoreInjectable from "./catalog-entity-store/catalog-entity-store.injectable";
|
||||
import catalogEntityRegistryInjectable
|
||||
from "../../api/catalog-entity-registry/catalog-entity-registry.injectable";
|
||||
@@ -95,7 +95,7 @@ describe("<Catalog />", () => {
|
||||
}, onRun);
|
||||
}
|
||||
|
||||
let di: DependencyInjectionContainer;
|
||||
let di: DiContainer;
|
||||
let catalogEntityStore: CatalogEntityStore;
|
||||
let catalogEntityRegistry: CatalogEntityRegistry;
|
||||
let render: DiRender;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed, IComputedValue } from "mobx";
|
||||
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
|
||||
import rendererExtensionsInjectable from "../../../extensions/renderer-extensions.injectable";
|
||||
@@ -45,10 +45,11 @@ function getAdditionCategoryColumns({ extensions }: Dependencies): IComputedValu
|
||||
}
|
||||
|
||||
const categoryColumnsInjectable = getInjectable({
|
||||
id: "category-columns",
|
||||
|
||||
instantiate: (di) => getAdditionCategoryColumns({
|
||||
extensions: di.inject(rendererExtensionsInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default categoryColumnsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { orderBy } from "lodash";
|
||||
import { computed, IComputedValue } from "mobx";
|
||||
import type { LensRendererExtension } from "../../../extensions/lens-renderer-extension";
|
||||
@@ -49,10 +49,11 @@ function getCustomCategoryViews({ extensions }: Dependencies): IComputedValue<Ma
|
||||
}
|
||||
|
||||
const customCategoryViewsInjectable = getInjectable({
|
||||
id: "custom-category-views",
|
||||
|
||||
instantiate: (di) => getCustomCategoryViews({
|
||||
extensions: di.inject(rendererExtensionsInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default customCategoryViewsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { orderBy } from "lodash";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import type { CatalogCategory, CatalogEntity } from "../../../common/catalog";
|
||||
@@ -85,11 +85,11 @@ const getCategoryColumns = ({ extensionColumns }: Dependencies) => ({ activeCate
|
||||
};
|
||||
|
||||
const getCategoryColumnsInjectable = getInjectable({
|
||||
id: "get-category-columns",
|
||||
|
||||
instantiate: (di) => getCategoryColumns({
|
||||
extensionColumns: di.inject(categoryColumnsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getCategoryColumnsInjectable;
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import {
|
||||
ClusterOverviewStorageState,
|
||||
ClusterOverviewStore,
|
||||
@@ -13,6 +13,8 @@ import createStorageInjectable from "../../../utils/create-storage/create-storag
|
||||
import apiManagerInjectable from "../../kube-object-menu/dependencies/api-manager.injectable";
|
||||
|
||||
const clusterOverviewStoreInjectable = getInjectable({
|
||||
id: "cluster-overview-store",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createStorage = di.inject(createStorageInjectable);
|
||||
|
||||
@@ -34,8 +36,6 @@ const clusterOverviewStoreInjectable = getInjectable({
|
||||
|
||||
return store;
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clusterOverviewStoreInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { HorizontalPodAutoscalers } from "../+config-autoscalers";
|
||||
import { LimitRanges } from "../+config-limit-ranges";
|
||||
@@ -81,10 +81,11 @@ function getRouteTabs({ isAllowedResource }: Dependencies) {
|
||||
}
|
||||
|
||||
const configRoutesInjectable = getInjectable({
|
||||
id: "config-routes",
|
||||
|
||||
instantiate: (di) => getRouteTabs({
|
||||
isAllowedResource: di.inject(isAllowedResourceInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default configRoutesInjectable;
|
||||
@@ -3,14 +3,14 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { crdStore } from "./crd.store";
|
||||
|
||||
const customResourceDefinitionsInjectable = getInjectable({
|
||||
instantiate: () => computed(() => [...crdStore.items]),
|
||||
id: "custom-resource-definitions",
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
instantiate: () => computed(() => [...crdStore.items]),
|
||||
});
|
||||
|
||||
export default customResourceDefinitionsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed, IComputedValue } from "mobx";
|
||||
import type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints";
|
||||
import { getOrInsert } from "../../utils";
|
||||
@@ -25,10 +25,11 @@ function getGroupedCustomResourceDefinitions({ definitions }: Dependencies) {
|
||||
}
|
||||
|
||||
const groupedCustomResourceDefinitionsInjectable = getInjectable({
|
||||
id: "grouped-custom-resource-definitions",
|
||||
|
||||
instantiate: (di) => getGroupedCustomResourceDefinitions({
|
||||
definitions: di.inject(customResourceDefinitionsInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default groupedCustomResourceDefinitionsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed, IComputedValue } from "mobx";
|
||||
import type { CustomResourceDefinition } from "../../../common/k8s-api/endpoints";
|
||||
import { crdURL, crdDefinitionsRoute } from "../../../common/routes";
|
||||
@@ -51,10 +51,11 @@ function getRouteTabs({ customResourcesDefinitions }: Dependencies) {
|
||||
}
|
||||
|
||||
const customResourcesRouteTabsInjectable = getInjectable({
|
||||
id: "custom-resources-route-tabs",
|
||||
|
||||
instantiate: (di) => getRouteTabs({
|
||||
customResourcesDefinitions: di.inject(groupedCustomResourceDefinitionsInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default customResourcesRouteTabsInjectable;
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { attemptInstallByInfo } from "./attempt-install-by-info";
|
||||
import attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
|
||||
import getBaseRegistryUrlInjectable from "../get-base-registry-url/get-base-registry-url.injectable";
|
||||
@@ -10,14 +10,14 @@ import extensionInstallationStateStoreInjectable
|
||||
from "../../../../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
|
||||
const attemptInstallByInfoInjectable = getInjectable({
|
||||
id: "attempt-install-by-info",
|
||||
|
||||
instantiate: (di) =>
|
||||
attemptInstallByInfo({
|
||||
attemptInstall: di.inject(attemptInstallInjectable),
|
||||
getBaseRegistryUrl: di.inject(getBaseRegistryUrlInjectable),
|
||||
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default attemptInstallByInfoInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable";
|
||||
import { attemptInstall } from "./attempt-install";
|
||||
@@ -14,6 +14,8 @@ import extensionInstallationStateStoreInjectable
|
||||
from "../../../../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
|
||||
const attemptInstallInjectable = getInjectable({
|
||||
id: "attempt-install",
|
||||
|
||||
instantiate: (di) =>
|
||||
attemptInstall({
|
||||
extensionLoader: di.inject(extensionLoaderInjectable),
|
||||
@@ -23,8 +25,6 @@ const attemptInstallInjectable = getInjectable({
|
||||
getExtensionDestFolder: di.inject(getExtensionDestFolderInjectable),
|
||||
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default attemptInstallInjectable;
|
||||
+3
-3
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { createTempFilesAndValidate } from "./create-temp-files-and-validate";
|
||||
import extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable";
|
||||
|
||||
const createTempFilesAndValidateInjectable = getInjectable({
|
||||
id: "create-temp-files-and-validate",
|
||||
|
||||
instantiate: (di) =>
|
||||
createTempFilesAndValidate({
|
||||
extensionDiscovery: di.inject(extensionDiscoveryInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createTempFilesAndValidateInjectable;
|
||||
+3
-3
@@ -2,19 +2,19 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
|
||||
import extensionDiscoveryInjectable from "../../../../../extensions/extension-discovery/extension-discovery.injectable";
|
||||
|
||||
import { getExtensionDestFolder } from "./get-extension-dest-folder";
|
||||
|
||||
const getExtensionDestFolderInjectable = getInjectable({
|
||||
id: "get-extension-dest-folder",
|
||||
|
||||
instantiate: (di) =>
|
||||
getExtensionDestFolder({
|
||||
extensionDiscovery: di.inject(extensionDiscoveryInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getExtensionDestFolderInjectable;
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { unpackExtension } from "./unpack-extension";
|
||||
import extensionLoaderInjectable from "../../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import getExtensionDestFolderInjectable
|
||||
@@ -11,14 +11,14 @@ import extensionInstallationStateStoreInjectable
|
||||
from "../../../../../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
|
||||
const unpackExtensionInjectable = getInjectable({
|
||||
id: "unpack-extension",
|
||||
|
||||
instantiate: (di) =>
|
||||
unpackExtension({
|
||||
extensionLoader: di.inject(extensionLoaderInjectable),
|
||||
getExtensionDestFolder: di.inject(getExtensionDestFolderInjectable),
|
||||
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default unpackExtensionInjectable;
|
||||
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { attemptInstalls } from "./attempt-installs";
|
||||
import attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
|
||||
|
||||
const attemptInstallsInjectable = getInjectable({
|
||||
id: "attempt-installs",
|
||||
|
||||
instantiate: (di) =>
|
||||
attemptInstalls({
|
||||
attemptInstall: di.inject(attemptInstallInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default attemptInstallsInjectable;
|
||||
+3
-3
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { confirmUninstallExtension } from "./confirm-uninstall-extension";
|
||||
import uninstallExtensionInjectable from "../uninstall-extension/uninstall-extension.injectable";
|
||||
|
||||
const confirmUninstallExtensionInjectable = getInjectable({
|
||||
id: "confirm-uninstall-extension",
|
||||
|
||||
instantiate: (di) =>
|
||||
confirmUninstallExtension({
|
||||
uninstallExtension: di.inject(uninstallExtensionInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default confirmUninstallExtensionInjectable;
|
||||
+3
-3
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import { disableExtension } from "./disable-extension";
|
||||
|
||||
const disableExtensionInjectable = getInjectable({
|
||||
id: "disable-extension",
|
||||
|
||||
instantiate: (di) =>
|
||||
disableExtension({
|
||||
extensionLoader: di.inject(extensionLoaderInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default disableExtensionInjectable;
|
||||
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import { enableExtension } from "./enable-extension";
|
||||
|
||||
const enableExtensionInjectable = getInjectable({
|
||||
id: "enable-extension",
|
||||
|
||||
instantiate: (di) =>
|
||||
enableExtension({
|
||||
extensionLoader: di.inject(extensionLoaderInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default enableExtensionInjectable;
|
||||
+2
-3
@@ -5,18 +5,17 @@
|
||||
|
||||
import {
|
||||
getInjectable,
|
||||
lifecycleEnum,
|
||||
} from "@ogre-tools/injectable";
|
||||
import { UserStore } from "../../../../common/user-store";
|
||||
import { getBaseRegistryUrl } from "./get-base-registry-url";
|
||||
|
||||
const getBaseRegistryUrlInjectable = getInjectable({
|
||||
id: "get-base-registry-url",
|
||||
|
||||
instantiate: () => getBaseRegistryUrl({
|
||||
// TODO: use injection
|
||||
getRegistryUrlPreference: () => UserStore.getInstance().extensionRegistryUrl,
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getBaseRegistryUrlInjectable;
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import attemptInstallInjectable from "../attempt-install/attempt-install.injectable";
|
||||
import { installFromInput } from "./install-from-input";
|
||||
import attemptInstallByInfoInjectable from "../attempt-install-by-info/attempt-install-by-info.injectable";
|
||||
@@ -10,14 +10,14 @@ import extensionInstallationStateStoreInjectable
|
||||
from "../../../../extensions/extension-installation-state-store/extension-installation-state-store.injectable";
|
||||
|
||||
const installFromInputInjectable = getInjectable({
|
||||
id: "install-from-input",
|
||||
|
||||
instantiate: (di) =>
|
||||
installFromInput({
|
||||
attemptInstall: di.inject(attemptInstallInjectable),
|
||||
attemptInstallByInfo: di.inject(attemptInstallByInfoInjectable),
|
||||
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default installFromInputInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { requestOpenFilePickingDialog } from "../../ipc";
|
||||
import { supportedExtensionFormats } from "./supported-extension-formats";
|
||||
import attemptInstallsInjectable from "./attempt-installs/attempt-installs.injectable";
|
||||
@@ -28,12 +28,12 @@ const installFromSelectFileDialog = ({ attemptInstalls, directoryForDownloads }:
|
||||
};
|
||||
|
||||
const installFromSelectFileDialogInjectable = getInjectable({
|
||||
id: "install-from-select-file-dialog",
|
||||
|
||||
instantiate: (di) => installFromSelectFileDialog({
|
||||
attemptInstalls: di.inject(attemptInstallsInjectable),
|
||||
directoryForDownloads: di.inject(directoryForDownloadsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default installFromSelectFileDialogInjectable;
|
||||
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { installOnDrop } from "./install-on-drop";
|
||||
import attemptInstallsInjectable from "../attempt-installs/attempt-installs.injectable";
|
||||
|
||||
const installOnDropInjectable = getInjectable({
|
||||
id: "install-on-drop",
|
||||
|
||||
instantiate: (di) =>
|
||||
installOnDrop({
|
||||
attemptInstalls: di.inject(attemptInstallsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default installOnDropInjectable;
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
import { uninstallExtension } from "./uninstall-extension";
|
||||
import extensionInstallationStateStoreInjectable
|
||||
@@ -11,14 +11,14 @@ import extensionDiscoveryInjectable
|
||||
from "../../../../extensions/extension-discovery/extension-discovery.injectable";
|
||||
|
||||
const uninstallExtensionInjectable = getInjectable({
|
||||
id: "uninstall-extension",
|
||||
|
||||
instantiate: (di) =>
|
||||
uninstallExtension({
|
||||
extensionLoader: di.inject(extensionLoaderInjectable),
|
||||
extensionDiscovery: di.inject(extensionDiscoveryInjectable),
|
||||
extensionInstallationStateStore: di.inject(extensionInstallationStateStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default uninstallExtensionInjectable;
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable";
|
||||
|
||||
const userExtensionsInjectable = getInjectable({
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
id: "user-extensions",
|
||||
|
||||
instantiate: (di) => {
|
||||
const extensionLoader = di.inject(extensionLoaderInjectable);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import {
|
||||
createRelease,
|
||||
IReleaseCreatePayload,
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
import releasesInjectable from "../releases.injectable";
|
||||
|
||||
const createReleaseInjectable = getInjectable({
|
||||
id: "create-release",
|
||||
|
||||
instantiate: (di) => {
|
||||
const releases = di.inject(releasesInjectable);
|
||||
|
||||
@@ -21,8 +23,6 @@ const createReleaseInjectable = getInjectable({
|
||||
return release;
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createReleaseInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import {
|
||||
deleteRelease,
|
||||
HelmRelease,
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
import releasesInjectable from "../releases.injectable";
|
||||
|
||||
const deleteReleaseInjectable = getInjectable({
|
||||
id: "delete-release",
|
||||
|
||||
instantiate: (di) => {
|
||||
const releases = di.inject(releasesInjectable);
|
||||
|
||||
@@ -19,8 +21,6 @@ const deleteReleaseInjectable = getInjectable({
|
||||
releases.invalidate();
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default deleteReleaseInjectable;
|
||||
+3
-3
@@ -2,20 +2,20 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getRelease } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { asyncComputed } from "@ogre-tools/injectable-react";
|
||||
import releaseInjectable from "./release.injectable";
|
||||
|
||||
const releaseDetailsInjectable = getInjectable({
|
||||
id: "release-details",
|
||||
|
||||
instantiate: (di) =>
|
||||
asyncComputed(async () => {
|
||||
const release = di.inject(releaseInjectable).get();
|
||||
|
||||
return await getRelease(release.name, release.namespace);
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default releaseDetailsInjectable;
|
||||
+3
-3
@@ -2,13 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { matchPath } from "react-router";
|
||||
import observableHistoryInjectable from "../../../navigation/observable-history.injectable";
|
||||
import { releaseRoute, ReleaseRouteParams } from "../../../../common/routes";
|
||||
|
||||
const releaseRouteParametersInjectable = getInjectable({
|
||||
id: "release-route-parameters",
|
||||
|
||||
instantiate: (di) => {
|
||||
const observableHistory = di.inject(observableHistoryInjectable);
|
||||
|
||||
@@ -24,8 +26,6 @@ const releaseRouteParametersInjectable = getInjectable({
|
||||
return releasePathParameters.params;
|
||||
});
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default releaseRouteParametersInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getReleaseValues } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { asyncComputed } from "@ogre-tools/injectable-react";
|
||||
import releaseInjectable from "./release.injectable";
|
||||
@@ -10,6 +10,8 @@ import { Notifications } from "../../notifications";
|
||||
import userSuppliedValuesAreShownInjectable from "./user-supplied-values-are-shown.injectable";
|
||||
|
||||
const releaseValuesInjectable = getInjectable({
|
||||
id: "release-values",
|
||||
|
||||
instantiate: (di) =>
|
||||
asyncComputed(async () => {
|
||||
const release = di.inject(releaseInjectable).get();
|
||||
@@ -29,8 +31,6 @@ const releaseValuesInjectable = getInjectable({
|
||||
return "";
|
||||
}
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default releaseValuesInjectable;
|
||||
@@ -2,13 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { matches } from "lodash/fp";
|
||||
import releasesInjectable from "../releases.injectable";
|
||||
import releaseRouteParametersInjectable from "./release-route-parameters.injectable";
|
||||
import { computed } from "mobx";
|
||||
|
||||
const releaseInjectable = getInjectable({
|
||||
id: "release",
|
||||
|
||||
instantiate: (di) => {
|
||||
const releases = di.inject(releasesInjectable);
|
||||
const releaseRouteParameters = di.inject(releaseRouteParametersInjectable);
|
||||
@@ -23,8 +25,6 @@ const releaseInjectable = getInjectable({
|
||||
return releases.value.get().find(matches({ name, namespace }));
|
||||
});
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default releaseInjectable;
|
||||
+3
-3
@@ -2,10 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { observable } from "mobx";
|
||||
|
||||
const userSuppliedValuesAreShownInjectable = getInjectable({
|
||||
id: "user-supplied-values-are-shown",
|
||||
|
||||
instantiate: () => {
|
||||
const state = observable.box(false);
|
||||
|
||||
@@ -19,8 +21,6 @@ const userSuppliedValuesAreShownInjectable = getInjectable({
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default userSuppliedValuesAreShownInjectable;
|
||||
|
||||
+2
-2
@@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { ReleaseRollbackDialogModel } from "./release-rollback-dialog-model";
|
||||
|
||||
const releaseRollbackDialogModelInjectable = getInjectable({
|
||||
id: "release-rollback-dialog-model",
|
||||
instantiate: () => new ReleaseRollbackDialogModel(),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default releaseRollbackDialogModelInjectable;
|
||||
@@ -2,12 +2,14 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { asyncComputed } from "@ogre-tools/injectable-react";
|
||||
import namespaceStoreInjectable from "../+namespaces/namespace-store/namespace-store.injectable";
|
||||
import { listReleases } from "../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
|
||||
const releasesInjectable = getInjectable({
|
||||
id: "releases",
|
||||
|
||||
instantiate: (di) => {
|
||||
const namespaceStore = di.inject(namespaceStoreInjectable);
|
||||
|
||||
@@ -33,8 +35,6 @@ const releasesInjectable = getInjectable({
|
||||
return releaseArrays.flat();
|
||||
}, []);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default releasesInjectable;
|
||||
@@ -2,21 +2,21 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { observable } from "mobx";
|
||||
import releasesInjectable from "./releases.injectable";
|
||||
import deleteReleaseInjectable from "./delete-release/delete-release.injectable";
|
||||
import { removableReleases } from "./removable-releases";
|
||||
|
||||
const removableReleasesInjectable = getInjectable({
|
||||
id: "removable-releases",
|
||||
|
||||
instantiate: (di) =>
|
||||
removableReleases({
|
||||
releases: di.inject(releasesInjectable),
|
||||
deleteRelease: di.inject(deleteReleaseInjectable),
|
||||
releaseSelectionStatus: observable.map<string, boolean>(),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default removableReleasesInjectable;
|
||||
+3
-2
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { rollbackRelease } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import releasesInjectable from "../releases.injectable";
|
||||
|
||||
const rollbackReleaseInjectable = getInjectable({
|
||||
id: "rollback-release",
|
||||
|
||||
instantiate: (di) => {
|
||||
const releases = di.inject(releasesInjectable);
|
||||
|
||||
@@ -16,7 +18,6 @@ const rollbackReleaseInjectable = getInjectable({
|
||||
releases.invalidate();
|
||||
};
|
||||
},
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default rollbackReleaseInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import {
|
||||
IReleaseUpdatePayload,
|
||||
updateRelease,
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
import releasesInjectable from "../releases.injectable";
|
||||
|
||||
const updateReleaseInjectable = getInjectable({
|
||||
id: "update-release",
|
||||
|
||||
instantiate: (di) => {
|
||||
const releases = di.inject(releasesInjectable);
|
||||
|
||||
@@ -25,8 +27,6 @@ const updateReleaseInjectable = getInjectable({
|
||||
return result;
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default updateReleaseInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { TabLayoutRoute } from "../layout/tab-layout";
|
||||
import { HelmCharts } from "../+helm-charts";
|
||||
@@ -27,8 +27,8 @@ function getRouteTabs() {
|
||||
}
|
||||
|
||||
const helmRoutesInjectable = getInjectable({
|
||||
id: "helm-routes",
|
||||
instantiate: () => getRouteTabs(),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default helmRoutesInjectable;
|
||||
+2
-2
@@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { AddNamespaceDialogModel } from "./add-namespace-dialog-model";
|
||||
|
||||
const addNamespaceDialogModelInjectable = getInjectable({
|
||||
id: "add-namespace-dialog-model",
|
||||
instantiate: () => new AddNamespaceDialogModel(),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default addNamespaceDialogModelInjectable;
|
||||
+5
-5
@@ -3,15 +3,15 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { NamespaceSelectFilterModel } from "./namespace-select-filter-model";
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import namespaceStoreInjectable from "../namespace-store/namespace-store.injectable";
|
||||
|
||||
const NamespaceSelectFilterModelInjectable = getInjectable({
|
||||
const namespaceSelectFilterModelInjectable = getInjectable({
|
||||
id: "namespace-select-filter-model",
|
||||
|
||||
instantiate: (di) => new NamespaceSelectFilterModel({
|
||||
namespaceStore: di.inject(namespaceStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default NamespaceSelectFilterModelInjectable;
|
||||
export default namespaceSelectFilterModelInjectable;
|
||||
@@ -2,12 +2,14 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { NamespaceStore } from "./namespace.store";
|
||||
import apiManagerInjectable from "../../kube-object-menu/dependencies/api-manager.injectable";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const namespaceStoreInjectable = getInjectable({
|
||||
id: "namespace-store",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createStorage = di.inject(createStorageInjectable);
|
||||
|
||||
@@ -26,8 +28,6 @@ const namespaceStoreInjectable = getInjectable({
|
||||
|
||||
return namespaceStore;
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default namespaceStoreInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { TabLayoutRoute } from "../layout/tab-layout";
|
||||
import { Services } from "../+network-services";
|
||||
@@ -70,10 +70,11 @@ function getRouteTabs({ isAllowedResource }: Dependencies) {
|
||||
}
|
||||
|
||||
const networkRouteTabsInjectable = getInjectable({
|
||||
id: "network-route-tabs",
|
||||
|
||||
instantiate: (di) => getRouteTabs({
|
||||
isAllowedResource: di.inject(isAllowedResourceInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default networkRouteTabsInjectable;
|
||||
@@ -3,17 +3,17 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import rendererExtensionsInjectable from "../../../../extensions/renderer-extensions.injectable";
|
||||
import { getAppPreferences } from "./get-app-preferences";
|
||||
|
||||
const appPreferencesInjectable = getInjectable({
|
||||
id: "app-preferences",
|
||||
|
||||
instantiate: (di) =>
|
||||
getAppPreferences({
|
||||
extensions: di.inject(rendererExtensionsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default appPreferencesInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { TabLayoutRoute } from "../layout/tab-layout";
|
||||
import { PersistentVolumes } from "../+storage-volumes";
|
||||
@@ -52,10 +52,11 @@ function getRouteTabs({ isAllowedResource }: Dependencies) {
|
||||
}
|
||||
|
||||
const storageRouteTabsInjectable = getInjectable({
|
||||
id: "storage-route-tabs",
|
||||
|
||||
instantiate: (di) => getRouteTabs({
|
||||
isAllowedResource: di.inject(isAllowedResourceInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default storageRouteTabsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { TabLayoutRoute } from "../layout/tab-layout";
|
||||
import type { IsAllowedResource } from "../../../common/utils/is-allowed-resource.injectable";
|
||||
@@ -82,10 +82,11 @@ function getRouteTabs({ isAllowedResource }: Dependencies) {
|
||||
}
|
||||
|
||||
const userManagementRouteTabsInjectable = getInjectable({
|
||||
id: "user-management-route-tabs",
|
||||
|
||||
instantiate: (di) => getRouteTabs({
|
||||
isAllowedResource: di.inject(isAllowedResourceInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default userManagementRouteTabsInjectable;
|
||||
@@ -11,7 +11,7 @@ import { computed } from "mobx";
|
||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||
import type { DiRender } from "../../test-utils/renderFor";
|
||||
import { renderFor } from "../../test-utils/renderFor";
|
||||
import type { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import rendererExtensionsInjectable from "../../../../extensions/renderer-extensions.injectable";
|
||||
import { LensRendererExtension } from "../../../../extensions/lens-renderer-extension";
|
||||
import type { WelcomeBannerRegistration } from "../welcome-banner-items/welcome-banner-registration";
|
||||
@@ -27,7 +27,7 @@ jest.mock("electron", () => ({
|
||||
|
||||
describe("<Welcome/>", () => {
|
||||
let render: DiRender;
|
||||
let di: ConfigurableDependencyInjectionContainer;
|
||||
let di: DiContainer;
|
||||
let welcomeBannersStub: WelcomeBannerRegistration[];
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
+3
-3
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import rendererExtensionsInjectable from "../../../../extensions/renderer-extensions.injectable";
|
||||
import { computed } from "mobx";
|
||||
|
||||
const welcomeBannerItemsInjectable = getInjectable({
|
||||
id: "welcome-banner-items",
|
||||
|
||||
instantiate: (di) => {
|
||||
const extensions = di.inject(rendererExtensionsInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const welcomeBannerItemsInjectable = getInjectable({
|
||||
...extensions.get().flatMap((extension) => extension.welcomeBanners),
|
||||
]);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default welcomeBannerItemsInjectable;
|
||||
+3
-3
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import rendererExtensionsInjectable from "../../../../extensions/renderer-extensions.injectable";
|
||||
import { getWelcomeMenuItems } from "./get-welcome-menu-items";
|
||||
|
||||
const welcomeMenuItemsInjectable = getInjectable({
|
||||
id: "welcome-menu-items",
|
||||
|
||||
instantiate: (di) =>
|
||||
getWelcomeMenuItems({
|
||||
extensions: di.inject(rendererExtensionsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default welcomeMenuItemsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { KubeResource } from "../../../common/rbac";
|
||||
import type { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
import type { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
@@ -18,6 +18,8 @@ import namespaceStoreInjectable from "../+namespaces/namespace-store/namespace-s
|
||||
import { workloads } from "./workloads";
|
||||
|
||||
const workloadsInjectable = getInjectable({
|
||||
id: "workloads",
|
||||
|
||||
instantiate: (di) =>
|
||||
workloads({
|
||||
isAllowedResource: di.inject(isAllowedResourceInjectable),
|
||||
@@ -33,8 +35,6 @@ const workloadsInjectable = getInjectable({
|
||||
["cronjobs", cronJobStore],
|
||||
]),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default workloadsInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { TabLayoutRoute } from "../layout/tab-layout";
|
||||
import { WorkloadsOverview } from "../+workloads-overview/overview";
|
||||
@@ -100,10 +100,11 @@ function getRouteTabs({ isAllowedResource }: Dependencies) {
|
||||
}
|
||||
|
||||
const workloadsRouteTabsInjectable = getInjectable({
|
||||
id: "workloads-route-tabs",
|
||||
|
||||
instantiate: (di) => getRouteTabs({
|
||||
isAllowedResource: di.inject(isAllowedResourceInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default workloadsRouteTabsInjectable;
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { observable } from "mobx";
|
||||
import React from "react";
|
||||
|
||||
@@ -32,8 +32,8 @@ export class CommandOverlay {
|
||||
}
|
||||
|
||||
const commandOverlayInjectable = getInjectable({
|
||||
id: "command-overlay",
|
||||
instantiate: () => new CommandOverlay(),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default commandOverlayInjectable;
|
||||
+3
-2
@@ -12,7 +12,7 @@ import { HotbarSwitchCommand } from "../../hotbar/hotbar-switch-command";
|
||||
import { HotbarRenameCommand } from "../../hotbar/hotbar-rename-command";
|
||||
import { ActivateEntityCommand } from "../../activate-entity-command";
|
||||
import type { CommandContext, CommandRegistration } from "./commands";
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import commandOverlayInjectable from "../command-overlay.injectable";
|
||||
import createTerminalTabInjectable from "../../dock/terminal/create-terminal-tab.injectable";
|
||||
import type { DockTabCreate } from "../../dock/dock/store";
|
||||
@@ -205,6 +205,8 @@ function getInternalCommands({ openCommandDialog, getEntitySettingItems, createT
|
||||
}
|
||||
|
||||
const internalCommandsInjectable = getInjectable({
|
||||
id: "internal-commands",
|
||||
|
||||
instantiate: (di) => getInternalCommands({
|
||||
openCommandDialog: di.inject(commandOverlayInjectable).open,
|
||||
getEntitySettingItems: EntitySettingRegistry
|
||||
@@ -212,7 +214,6 @@ const internalCommandsInjectable = getInjectable({
|
||||
.getItemsForKind,
|
||||
createTerminalTab: di.inject(createTerminalTabInjectable),
|
||||
}),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default internalCommandsInjectable;
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed, IComputedValue } from "mobx";
|
||||
import type { CustomResourceDefinition } from "../../../../common/k8s-api/endpoints";
|
||||
import customResourceDefinitionsInjectable from "../../+custom-resources/custom-resources.injectable";
|
||||
@@ -41,13 +41,13 @@ const instantiateRegisteredCommands = ({ extensions, customResourceDefinitions,
|
||||
});
|
||||
|
||||
const registeredCommandsInjectable = getInjectable({
|
||||
id: "registered-commands",
|
||||
|
||||
instantiate: (di) => instantiateRegisteredCommands({
|
||||
extensions: di.inject(rendererExtensionsInjectable),
|
||||
customResourceDefinitions: di.inject(customResourceDefinitionsInjectable),
|
||||
internalCommands: di.inject(internalCommandsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default registeredCommandsInjectable;
|
||||
+3
-3
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import createResourceTabStoreInjectable from "./store.injectable";
|
||||
|
||||
const clearCreateResourceTabDataInjectable = getInjectable({
|
||||
id: "clear-create-resource-tab-data",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createResourceTabStore = di.inject(createResourceTabStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const clearCreateResourceTabDataInjectable = getInjectable({
|
||||
createResourceTabStore.clearData(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clearCreateResourceTabDataInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import dockStoreInjectable from "../dock/store.injectable";
|
||||
import { DockTabCreateSpecific, TabKind } from "../dock/store";
|
||||
|
||||
const createResourceTabInjectable = getInjectable({
|
||||
id: "create-resource-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dockStore = di.inject(dockStoreInjectable);
|
||||
|
||||
@@ -17,8 +19,6 @@ const createResourceTabInjectable = getInjectable({
|
||||
kind: TabKind.CREATE_RESOURCE,
|
||||
});
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createResourceTabInjectable;
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { GroupSelectOption, SelectOption } from "../../select";
|
||||
import userCreateResourceTemplatesInjectable from "./user-templates.injectable";
|
||||
@@ -11,6 +11,8 @@ import lensCreateResourceTemplatesInjectable from "./lens-templates.injectable";
|
||||
export type RawTemplates = [group: string, items: [file: string, contents: string][]];
|
||||
|
||||
const createResourceTemplatesInjectable = getInjectable({
|
||||
id: "create-resource-templates",
|
||||
|
||||
instantiate: async (di) => {
|
||||
const lensResourceTemplates = await di.inject(lensCreateResourceTemplatesInjectable);
|
||||
const userResourceTemplates = di.inject(userCreateResourceTemplatesInjectable);
|
||||
@@ -27,8 +29,6 @@ const createResourceTemplatesInjectable = getInjectable({
|
||||
}) as GroupSelectOption<SelectOption<string>>);
|
||||
});
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createResourceTemplatesInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import path from "path";
|
||||
import { hasCorrectExtension } from "./has-correct-extension";
|
||||
import "../../../../common/vars";
|
||||
@@ -33,6 +33,8 @@ async function getTemplates({ readDir, readFile }: Dependencies) {
|
||||
}
|
||||
|
||||
const lensCreateResourceTemplatesInjectable = getInjectable({
|
||||
id: "lens-create-resource-templates",
|
||||
|
||||
instantiate: async (di): Promise<RawTemplates> => {
|
||||
const templates = await getTemplates({
|
||||
readFile: di.inject(readFileInjectable),
|
||||
@@ -41,8 +43,6 @@ const lensCreateResourceTemplatesInjectable = getInjectable({
|
||||
|
||||
return ["lens", templates];
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default lensCreateResourceTemplatesInjectable;
|
||||
@@ -2,16 +2,16 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { CreateResourceTabStore } from "./store";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const createResourceTabStoreInjectable = getInjectable({
|
||||
id: "create-resource-tab-store",
|
||||
|
||||
instantiate: (di) => new CreateResourceTabStore({
|
||||
createStorage: di.inject(createStorageInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createResourceTabStoreInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed, IComputedValue, observable } from "mobx";
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
@@ -95,8 +95,8 @@ function watchUserCreateResourceTemplates(): IComputedValue<RawTemplates[]> {
|
||||
}
|
||||
|
||||
const userCreateResourceTemplatesInjectable = getInjectable({
|
||||
id: "user-create-resource-templates",
|
||||
instantiate: () => watchUserCreateResourceTemplates(),
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default userCreateResourceTemplatesInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { DockTabStore, DockTabStoreOptions } from "./dock-tab.store";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const createDockTabStoreInjectable = getInjectable({
|
||||
id: "create-dock-tab-store",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dependencies = {
|
||||
createStorage: di.inject(createStorageInjectable),
|
||||
@@ -14,8 +16,6 @@ const createDockTabStoreInjectable = getInjectable({
|
||||
|
||||
return <T>(options: DockTabStoreOptions = {}) => new DockTabStore<T>(dependencies, options);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createDockTabStoreInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "./store";
|
||||
import dockStoreInjectable from "./store.injectable";
|
||||
|
||||
const closeDockTabInjectable = getInjectable({
|
||||
id: "close-dock-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dockStore = di.inject(dockStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const closeDockTabInjectable = getInjectable({
|
||||
dockStore.closeTab(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default closeDockTabInjectable;
|
||||
@@ -2,19 +2,19 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import dockStoreInjectable from "./store.injectable";
|
||||
import type { DockTab, DockTabCreate } from "./store";
|
||||
|
||||
const createDockTabInjectable = getInjectable({
|
||||
id: "create-dock-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dockStore = di.inject(dockStoreInjectable);
|
||||
|
||||
return (rawTabDesc: DockTabCreate, addNumber?: boolean): DockTab =>
|
||||
dockStore.createTab(rawTabDesc, addNumber);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createDockTabInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
import { DockStorageState, TabKind } from "./store";
|
||||
|
||||
const dockStorageInjectable = getInjectable({
|
||||
id: "dock-storage",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createStorage = di.inject(createStorageInjectable);
|
||||
|
||||
@@ -22,8 +24,6 @@ const dockStorageInjectable = getInjectable({
|
||||
],
|
||||
});
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default dockStorageInjectable;
|
||||
@@ -2,11 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import dockStoreInjectable from "./store.injectable";
|
||||
import type { TabId } from "./store";
|
||||
|
||||
const renameTabInjectable = getInjectable({
|
||||
id: "rename-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dockStore = di.inject(dockStoreInjectable);
|
||||
@@ -15,8 +16,6 @@ const renameTabInjectable = getInjectable({
|
||||
dockStore.renameTab(tabId, title);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default renameTabInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "./store";
|
||||
import dockStoreInjectable from "./store.injectable";
|
||||
|
||||
const selectDockTabInjectable = getInjectable({
|
||||
id: "select-dock-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const dockStore = di.inject(dockStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const selectDockTabInjectable = getInjectable({
|
||||
dockStore.selectTab(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default selectDockTabInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { DockStore, TabKind } from "./store";
|
||||
import dockStorageInjectable from "./dock-storage.injectable";
|
||||
import clearLogTabDataInjectable from "../logs/clear-log-tab-data.injectable";
|
||||
@@ -14,6 +14,8 @@ import clearInstallChartTabDataInjectable from "../install-chart/clear-install-c
|
||||
import isLogsTabDataValidInjectable from "../logs/is-logs-tab-data-valid.injectable";
|
||||
|
||||
const dockStoreInjectable = getInjectable({
|
||||
id: "dock-store",
|
||||
|
||||
instantiate: (di) => new DockStore({
|
||||
storage: di.inject(dockStorageInjectable),
|
||||
tabDataClearers: {
|
||||
@@ -28,8 +30,6 @@ const dockStoreInjectable = getInjectable({
|
||||
[TabKind.POD_LOGS]: di.inject(isLogsTabDataValidInjectable),
|
||||
},
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default dockStoreInjectable;
|
||||
+3
-3
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import editResourceTabStoreInjectable from "./store.injectable";
|
||||
|
||||
const clearEditResourceTabDataInjectable = getInjectable({
|
||||
id: "clear-edit-resource-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const editResourceTabStore = di.inject(editResourceTabStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const clearEditResourceTabDataInjectable = getInjectable({
|
||||
editResourceTabStore.clearData(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clearEditResourceTabDataInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import editResourceTabStoreInjectable from "./store.injectable";
|
||||
import dockStoreInjectable from "../dock/store.injectable";
|
||||
import type { KubeObject } from "../../../../common/k8s-api/kube-object";
|
||||
@@ -45,12 +45,12 @@ const createEditResourceTab = ({ dockStore, editResourceStore }: Dependencies) =
|
||||
};
|
||||
|
||||
const createEditResourceTabInjectable = getInjectable({
|
||||
id: "create-edit-resource-tab",
|
||||
|
||||
instantiate: (di) => createEditResourceTab({
|
||||
dockStore: di.inject(dockStoreInjectable),
|
||||
editResourceStore: di.inject(editResourceTabStoreInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createEditResourceTabInjectable;
|
||||
@@ -2,16 +2,16 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { EditResourceTabStore } from "./store";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const editResourceTabStoreInjectable = getInjectable({
|
||||
id: "edit-resource-tab-store",
|
||||
|
||||
instantiate: (di) => new EditResourceTabStore({
|
||||
createStorage: di.inject(createStorageInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default editResourceTabStoreInjectable;
|
||||
+3
-3
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import installChartTabStoreInjectable from "./store.injectable";
|
||||
|
||||
const clearInstallChartTabDataInjectable = getInjectable({
|
||||
id: "clear-install-chart-tab-data",
|
||||
|
||||
instantiate: (di) => {
|
||||
const installChartTabStore = di.inject(installChartTabStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const clearInstallChartTabDataInjectable = getInjectable({
|
||||
installChartTabStore.clearData(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clearInstallChartTabDataInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import installChartTabStoreInjectable from "./store.injectable";
|
||||
import type { HelmChart } from "../../../../common/k8s-api/endpoints/helm-charts.api";
|
||||
import {
|
||||
@@ -44,12 +44,12 @@ const createInstallChartTab = ({ createDockTab, installChartStore }: Dependencie
|
||||
};
|
||||
|
||||
const createInstallChartTabInjectable = getInjectable({
|
||||
id: "create-install-chart-tab",
|
||||
|
||||
instantiate: (di) => createInstallChartTab({
|
||||
installChartStore: di.inject(installChartTabStoreInjectable),
|
||||
createDockTab: di.inject(createDockTabInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createInstallChartTabInjectable;
|
||||
@@ -2,13 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { InstallChartTabStore } from "./store";
|
||||
import createDockTabStoreInjectable from "../dock-tab-store/create-dock-tab-store.injectable";
|
||||
import type { IReleaseUpdateDetails } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const installChartTabStoreInjectable = getInjectable({
|
||||
id: "install-chart-tab-store",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createDockTabStore = di.inject(createDockTabStoreInjectable);
|
||||
|
||||
@@ -18,7 +20,6 @@ const installChartTabStoreInjectable = getInjectable({
|
||||
detailsStore: createDockTabStore<IReleaseUpdateDetails>(),
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default installChartTabStoreInjectable;
|
||||
@@ -2,18 +2,18 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
|
||||
const areLogsPresentInjectable = getInjectable({
|
||||
id: "are-logs-present",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
return (tabId: TabId) => logStore.areLogsPresent(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default areLogsPresentInjectable;
|
||||
@@ -2,12 +2,12 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { podsApi } from "../../../../common/k8s-api/endpoints";
|
||||
|
||||
const callForLogsInjectable = getInjectable({
|
||||
id: "call-for-logs",
|
||||
instantiate: () => podsApi.getLogs,
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default callForLogsInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import logTabStoreInjectable from "./tab-store.injectable";
|
||||
|
||||
const clearLogTabDataInjectable = getInjectable({
|
||||
id: "clear-log-tab-data",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logTabStore = di.inject(logTabStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const clearLogTabDataInjectable = getInjectable({
|
||||
logTabStore.clearData(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clearLogTabDataInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { DockTabCreate, DockTab, TabKind, TabId } from "../dock/store";
|
||||
import type { LogTabData } from "./tab-store";
|
||||
import * as uuid from "uuid";
|
||||
@@ -37,12 +37,12 @@ const createLogsTab = ({ createDockTab, setLogTabData }: Dependencies) => (title
|
||||
};
|
||||
|
||||
const createLogsTabInjectable = getInjectable({
|
||||
id: "create-logs-tab",
|
||||
|
||||
instantiate: (di) => createLogsTab({
|
||||
createDockTab: di.inject(createDockTabInjectable),
|
||||
setLogTabData: di.inject(setLogTabDataInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createLogsTabInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IPodContainer, Pod } from "../../../../common/k8s-api/endpoints";
|
||||
import type { TabId } from "../dock/store";
|
||||
import createLogsTabInjectable from "./create-logs-tab.injectable";
|
||||
@@ -13,6 +13,8 @@ export interface PodLogsTabData {
|
||||
}
|
||||
|
||||
const createPodLogsTabInjectable = getInjectable({
|
||||
id: "create-pod-logs-tab",
|
||||
|
||||
instantiate: (di) => {
|
||||
const createLogsTab = di.inject(createLogsTabInjectable);
|
||||
|
||||
@@ -24,8 +26,6 @@ const createPodLogsTabInjectable = getInjectable({
|
||||
selectedPodId: selectedPod.getId(),
|
||||
});
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createPodLogsTabInjectable;
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { podsStore } from "../../+workloads-pods/pods.store";
|
||||
import type { WorkloadKubeObject } from "../../../../common/k8s-api/workload-kube-object";
|
||||
import type { TabId } from "../dock/store";
|
||||
@@ -38,11 +38,11 @@ const createWorkloadLogsTab = ({ createLogsTab }: Dependencies) => ({ workload }
|
||||
};
|
||||
|
||||
const createWorkloadLogsTabInjectable = getInjectable({
|
||||
id: "create-workload-logs-tab",
|
||||
|
||||
instantiate: (di) => createWorkloadLogsTab({
|
||||
createLogsTab: di.inject(createLogsTabInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default createWorkloadLogsTabInjectable;
|
||||
@@ -2,18 +2,18 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { LogTabData } from "./tab-store";
|
||||
import logTabStoreInjectable from "./tab-store.injectable";
|
||||
|
||||
const getLogTabDataInjectable = getInjectable({
|
||||
id: "get-log-tab-data",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logTabStore = di.inject(logTabStoreInjectable);
|
||||
|
||||
return (tabId: string): LogTabData => logTabStore.getData(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getLogTabDataInjectable;
|
||||
@@ -2,18 +2,18 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
|
||||
const getLogsWithoutTimestampsInjectable = getInjectable({
|
||||
id: "get-logs-without-timestamps",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
return (tabId: string): string[] =>
|
||||
logStore.getLogsWithoutTimestamps(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getLogsWithoutTimestampsInjectable;
|
||||
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
|
||||
const getLogsInjectable = getInjectable({
|
||||
id: "get-logs",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
return (tabId: string): string[] => logStore.getLogs(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getLogsInjectable;
|
||||
@@ -2,18 +2,18 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
|
||||
const getTimestampSplitLogsInjectable = getInjectable({
|
||||
id: "get-timestamp-split-logs",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
return (tabId: string): [string, string][] =>
|
||||
logStore.getTimestampSplitLogs(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default getTimestampSplitLogsInjectable;
|
||||
@@ -2,18 +2,18 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import logTabStoreInjectable from "./tab-store.injectable";
|
||||
|
||||
const isLogsTabDataValidInjectable = getInjectable({
|
||||
id: "is-logs-tab-data-valid",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logTabStore = di.inject(logTabStoreInjectable);
|
||||
|
||||
return (tabId: TabId) => logTabStore.isDataValid(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default isLogsTabDataValidInjectable;
|
||||
@@ -2,13 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import type { Pod } from "../../../../common/k8s-api/endpoints";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
import type { LogTabData } from "./tab-store";
|
||||
|
||||
const loadLogsInjectable = getInjectable({
|
||||
id: "load-logs",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
@@ -18,8 +20,6 @@ const loadLogsInjectable = getInjectable({
|
||||
logTabData: IComputedValue<LogTabData>,
|
||||
): Promise<void> => logStore.load(tabId, pod, logTabData);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default loadLogsInjectable;
|
||||
@@ -23,6 +23,8 @@ export interface InstantiateArgs {
|
||||
}
|
||||
|
||||
const logsViewModelInjectable = getInjectable({
|
||||
id: "logs-view-model",
|
||||
|
||||
instantiate: (di, { tabId }: InstantiateArgs) => new LogTabViewModel(tabId, {
|
||||
getLogs: di.inject(getLogsInjectable),
|
||||
getLogsWithoutTimestamps: di.inject(getLogsWithoutTimestampsInjectable),
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import type { Pod } from "../../../../common/k8s-api/endpoints";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
import type { LogTabData } from "./tab-store";
|
||||
|
||||
const reloadLogsInjectable = getInjectable({
|
||||
id: "reload-logs",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
@@ -18,8 +20,6 @@ const reloadLogsInjectable = getInjectable({
|
||||
logTabData: IComputedValue<LogTabData>,
|
||||
): Promise<void> => logStore.reload(tabId, pod, logTabData);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default reloadLogsInjectable;
|
||||
@@ -2,18 +2,18 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { LogTabData } from "./tab-store";
|
||||
import logTabStoreInjectable from "./tab-store.injectable";
|
||||
|
||||
const setLogTabDataInjectable = getInjectable({
|
||||
id: "set-log-tab-data",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logTabStore = di.inject(logTabStoreInjectable);
|
||||
|
||||
return (tabId: string, data: LogTabData): void => logTabStore.setData(tabId, data);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default setLogTabDataInjectable;
|
||||
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import logStoreInjectable from "./store.injectable";
|
||||
|
||||
const stopLoadingLogsInjectable = getInjectable({
|
||||
id: "stop-loading-logs",
|
||||
|
||||
instantiate: (di) => {
|
||||
const logStore = di.inject(logStoreInjectable);
|
||||
|
||||
return (tabId: string): void => logStore.stopLoadingLogs(tabId);
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default stopLoadingLogsInjectable;
|
||||
@@ -2,16 +2,16 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { LogStore } from "./store";
|
||||
import callForLogsInjectable from "./call-for-logs.injectable";
|
||||
|
||||
const logStoreInjectable = getInjectable({
|
||||
id: "log-store",
|
||||
|
||||
instantiate: (di) => new LogStore({
|
||||
callForLogs: di.inject(callForLogsInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default logStoreInjectable;
|
||||
@@ -2,16 +2,16 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { LogTabStore } from "./tab-store";
|
||||
import createStorageInjectable from "../../../utils/create-storage/create-storage.injectable";
|
||||
|
||||
const logTabStoreInjectable = getInjectable({
|
||||
id: "log-tab-store",
|
||||
|
||||
instantiate: (di) => new LogTabStore({
|
||||
createStorage: di.inject(createStorageInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default logTabStoreInjectable;
|
||||
@@ -2,11 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { TabId } from "../dock/store";
|
||||
import terminalStoreInjectable from "./store.injectable";
|
||||
|
||||
const clearTerminalTabDataInjectable = getInjectable({
|
||||
id: "clear-terminal-tab-data",
|
||||
|
||||
instantiate: (di) => {
|
||||
const terminalStore = di.inject(terminalStoreInjectable);
|
||||
|
||||
@@ -14,8 +16,6 @@ const clearTerminalTabDataInjectable = getInjectable({
|
||||
terminalStore.destroy(tabId);
|
||||
};
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default clearTerminalTabDataInjectable;
|
||||
Loaded 100 of 231 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user