mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into show-extension-preferences-in-separate-page
This commit is contained in:
commit
e3153d1eba
305 files changed
+25721
-3535
No files matched your search
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import appEventBusInjectable from "./app-event-bus.injectable";
|
||||
|
||||
const emitEventInjectable = getInjectable({
|
||||
id: "emit-event",
|
||||
instantiate: (di) => di.inject(appEventBusInjectable).emit,
|
||||
});
|
||||
|
||||
export default emitEventInjectable;
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
|
||||
export const allowedResourcesInjectionToken = getInjectionToken<
|
||||
IComputedValue<Set<string>>
|
||||
>({
|
||||
id: "allowed-resources",
|
||||
});
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { comparer, computed } from "mobx";
|
||||
import hostedClusterInjectable from "./hosted-cluster.injectable";
|
||||
|
||||
const allowedResourcesInjectable = getInjectable({
|
||||
id: "allowed-resources",
|
||||
|
||||
instantiate: (di) => {
|
||||
const cluster = di.inject(hostedClusterInjectable);
|
||||
|
||||
return computed(() => new Set(cluster?.allowedResources), {
|
||||
// This needs to be here so that during refresh changes are only propogated when necessary
|
||||
equals: (cur, prev) => comparer.structural(cur, prev),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export default allowedResourcesInjectable;
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getClusterIdFromHost } from "../utils";
|
||||
|
||||
const hostedClusterIdInjectable = getInjectable({
|
||||
id: "hosted-cluster-id",
|
||||
instantiate: () => getClusterIdFromHost(location.host),
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
export default hostedClusterIdInjectable;
|
||||
@@ -1,20 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import hostedClusterIdInjectable from "./hosted-cluster-id.injectable";
|
||||
import clusterStoreInjectable from "./cluster-store.injectable";
|
||||
|
||||
const hostedClusterInjectable = getInjectable({
|
||||
id: "hosted-cluster",
|
||||
|
||||
instantiate: (di) => {
|
||||
const hostedClusterId = di.inject(hostedClusterIdInjectable);
|
||||
const store = di.inject(clusterStoreInjectable);
|
||||
|
||||
return store.getById(hostedClusterId);
|
||||
},
|
||||
});
|
||||
|
||||
export default hostedClusterInjectable;
|
||||
+2
-2
@@ -6,8 +6,8 @@ import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import type { LensRendererExtension } from "../../extensions/lens-renderer-extension";
|
||||
|
||||
export const routeInjectionToken = getInjectionToken<Route<unknown>>({
|
||||
id: "route-injection-token",
|
||||
export const frontEndRouteInjectionToken = getInjectionToken<Route<unknown>>({
|
||||
id: "front-end-route-injection-token",
|
||||
});
|
||||
|
||||
export interface Route<TParameter = void> {
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { Route } from "./route-injection-token";
|
||||
import type { Route } from "./front-end-route-injection-token";
|
||||
|
||||
type InferParametersFrom<TRoute> = TRoute extends Route<infer TParameters>
|
||||
? TParameters
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
const addClusterRouteInjectable = getInjectable({
|
||||
id: "add-cluster-route",
|
||||
@@ -15,7 +15,7 @@ const addClusterRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default addClusterRouteInjectable;
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import type { Route } from "../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
export interface CatalogPathParameters {
|
||||
group?: string;
|
||||
@@ -21,7 +21,7 @@ const catalogRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default catalogRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
const clusterViewRouteInjectable = getInjectable({
|
||||
id: "cluster-view-route",
|
||||
@@ -15,7 +15,7 @@ const clusterViewRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterViewRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const configMapsRouteInjectable = getInjectable({
|
||||
id: "config-maps-route",
|
||||
@@ -19,7 +19,7 @@ const configMapsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default configMapsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const horizontalPodAutoscalersRouteInjectable = getInjectable({
|
||||
id: "horizontal-pod-autoscalers-route",
|
||||
@@ -19,7 +19,7 @@ const horizontalPodAutoscalersRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default horizontalPodAutoscalersRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const limitRangesRouteInjectable = getInjectable({
|
||||
id: "limit-ranges-route",
|
||||
@@ -22,7 +22,7 @@ const limitRangesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default limitRangesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const podDisruptionBudgetsRouteInjectable = getInjectable({
|
||||
id: "pod-disruption-budgets-route",
|
||||
@@ -19,7 +19,7 @@ const podDisruptionBudgetsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default podDisruptionBudgetsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const resourceQuotasRouteInjectable = getInjectable({
|
||||
id: "resource-quotas-route",
|
||||
@@ -19,7 +19,7 @@ const resourceQuotasRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default resourceQuotasRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const secretsRouteInjectable = getInjectable({
|
||||
id: "secrets-route",
|
||||
@@ -19,7 +19,7 @@ const secretsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default secretsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const crdListRouteInjectable = getInjectable({
|
||||
id: "crd-list-route",
|
||||
@@ -15,7 +15,7 @@ const crdListRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default crdListRouteInjectable;
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface CustomResourcesPathParameters {
|
||||
group?: string;
|
||||
@@ -21,7 +21,7 @@ const customResourcesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default customResourcesRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const eventsRouteInjectable = getInjectable({
|
||||
id: "events-route",
|
||||
@@ -19,7 +19,7 @@ const eventsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default eventsRouteInjectable;
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface HelmChartsPathParameters {
|
||||
repo?: string;
|
||||
@@ -21,7 +21,7 @@ const helmChartsRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default helmChartsRouteInjectable;
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface HelmReleasesPathParameters {
|
||||
namespace?: string;
|
||||
@@ -21,7 +21,7 @@ const helmReleasesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default helmReleasesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const namespacesRouteInjectable = getInjectable({
|
||||
id: "namespaces-route",
|
||||
@@ -19,7 +19,7 @@ const namespacesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default namespacesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const endpointsRouteInjectable = getInjectable({
|
||||
id: "endpoints-route",
|
||||
@@ -19,7 +19,7 @@ const endpointsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default endpointsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const ingressesRouteInjectable = getInjectable({
|
||||
id: "ingresses-route",
|
||||
@@ -19,7 +19,7 @@ const ingressesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default ingressesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const networkPoliciesRouteInjectable = getInjectable({
|
||||
id: "network-policies-route",
|
||||
@@ -19,7 +19,7 @@ const networkPoliciesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default networkPoliciesRouteInjectable;
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import type { Route } from "../../../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
export interface PortForwardsPathParameters {
|
||||
forwardport?: string;
|
||||
@@ -20,7 +20,7 @@ const portForwardsRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default portForwardsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const servicesRouteInjectable = getInjectable({
|
||||
id: "services-route",
|
||||
@@ -19,7 +19,7 @@ const servicesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default servicesRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const nodesRouteInjectable = getInjectable({
|
||||
id: "nodes-route",
|
||||
@@ -19,7 +19,7 @@ const nodesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default nodesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const clusterOverviewRouteInjectable = getInjectable({
|
||||
id: "cluster-overview-route",
|
||||
@@ -19,7 +19,7 @@ const clusterOverviewRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterOverviewRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const persistentVolumeClaimsRouteInjectable = getInjectable({
|
||||
id: "persistent-volume-claims-route",
|
||||
@@ -19,7 +19,7 @@ const persistentVolumeClaimsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default persistentVolumeClaimsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const persistentVolumesRouteInjectable = getInjectable({
|
||||
id: "persistent-volumes-route",
|
||||
@@ -19,7 +19,7 @@ const persistentVolumesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default persistentVolumesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const storageClassesRouteInjectable = getInjectable({
|
||||
id: "storage-classes-route",
|
||||
@@ -19,7 +19,7 @@ const storageClassesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default storageClassesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const clusterRoleBindingsRouteInjectable = getInjectable({
|
||||
id: "cluster-role-bindings-route",
|
||||
@@ -19,7 +19,7 @@ const clusterRoleBindingsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterRoleBindingsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const clusterRolesRouteInjectable = getInjectable({
|
||||
id: "cluster-roles-route",
|
||||
@@ -19,7 +19,7 @@ const clusterRolesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default clusterRolesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const podSecurityPoliciesRouteInjectable = getInjectable({
|
||||
id: "pod-security-policies-route",
|
||||
@@ -19,7 +19,7 @@ const podSecurityPoliciesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default podSecurityPoliciesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const roleBindingsRouteInjectable = getInjectable({
|
||||
id: "role-bindings-route",
|
||||
@@ -19,7 +19,7 @@ const roleBindingsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default roleBindingsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const rolesRouteInjectable = getInjectable({
|
||||
id: "roles-route",
|
||||
@@ -19,7 +19,7 @@ const rolesRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default rolesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const serviceAccountsRouteInjectable = getInjectable({
|
||||
id: "service-accounts-route",
|
||||
@@ -19,7 +19,7 @@ const serviceAccountsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default serviceAccountsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const cronJobsRouteInjectable = getInjectable({
|
||||
id: "cron-jobs-route",
|
||||
@@ -19,7 +19,7 @@ const cronJobsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default cronJobsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const daemonsetsRouteInjectable = getInjectable({
|
||||
id: "daemonsets-route",
|
||||
@@ -19,7 +19,7 @@ const daemonsetsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default daemonsetsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const deploymentsRouteInjectable = getInjectable({
|
||||
id: "deployments-route",
|
||||
@@ -19,7 +19,7 @@ const deploymentsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default deploymentsRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const jobsRouteInjectable = getInjectable({
|
||||
id: "jobs-route",
|
||||
@@ -19,7 +19,7 @@ const jobsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default jobsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const workloadsOverviewRouteInjectable = getInjectable({
|
||||
id: "workloads-overview-route",
|
||||
@@ -15,7 +15,7 @@ const workloadsOverviewRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default workloadsOverviewRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const podsRouteInjectable = getInjectable({
|
||||
id: "pods-route",
|
||||
@@ -19,7 +19,7 @@ const podsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default podsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const replicasetsRouteInjectable = getInjectable({
|
||||
id: "replicasets-route",
|
||||
@@ -19,7 +19,7 @@ const replicasetsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default replicasetsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import isAllowedResourceInjectable from "../../../../../utils/is-allowed-resource.injectable";
|
||||
import { routeInjectionToken } from "../../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
|
||||
|
||||
const statefulsetsRouteInjectable = getInjectable({
|
||||
id: "statefulsets-route",
|
||||
@@ -19,7 +19,7 @@ const statefulsetsRouteInjectable = getInjectable({
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default statefulsetsRouteInjectable;
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import type { Route } from "../../front-end-route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
export interface EntitySettingsPathParameters {
|
||||
entityId: string;
|
||||
@@ -20,7 +20,7 @@ const entitySettingsRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default entitySettingsRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
const extensionsRouteInjectable = getInjectable({
|
||||
id: "extensions-route",
|
||||
@@ -15,7 +15,7 @@ const extensionsRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default extensionsRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const appPreferencesRouteInjectable = getInjectable({
|
||||
id: "app-preferences-route",
|
||||
@@ -15,7 +15,7 @@ const appPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default appPreferencesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const editorPreferencesRouteInjectable = getInjectable({
|
||||
id: "editor-preferences-route",
|
||||
@@ -15,7 +15,7 @@ const editorPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default editorPreferencesRouteInjectable;
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import type { Route } from "../../../route-injection-token";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
import type { Route } from "../../../front-end-route-injection-token";
|
||||
|
||||
interface ExtensionPreferenceRouteParams {
|
||||
extensionId: string;
|
||||
@@ -21,7 +21,7 @@ const extensionPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default extensionPreferencesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const kubernetesPreferencesRouteInjectable = getInjectable({
|
||||
id: "kubernetes-preferences-route",
|
||||
@@ -15,7 +15,7 @@ const kubernetesPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default kubernetesPreferencesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const proxyPreferencesRouteInjectable = getInjectable({
|
||||
id: "proxy-preferences-route",
|
||||
@@ -15,7 +15,7 @@ const proxyPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default proxyPreferencesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const telemetryPreferencesRouteInjectable = getInjectable({
|
||||
id: "telemetry-preferences-route",
|
||||
@@ -15,7 +15,7 @@ const telemetryPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default telemetryPreferencesRouteInjectable;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
|
||||
|
||||
const terminalPreferencesRouteInjectable = getInjectable({
|
||||
id: "terminal-preferences-route",
|
||||
@@ -15,7 +15,7 @@ const terminalPreferencesRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default terminalPreferencesRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import { routeInjectionToken } from "../../route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
|
||||
|
||||
const welcomeRouteInjectable = getInjectable({
|
||||
id: "welcome-route",
|
||||
@@ -15,7 +15,7 @@ const welcomeRouteInjectable = getInjectable({
|
||||
isEnabled: computed(() => true),
|
||||
}),
|
||||
|
||||
injectionToken: routeInjectionToken,
|
||||
injectionToken: frontEndRouteInjectionToken,
|
||||
});
|
||||
|
||||
export default welcomeRouteInjectable;
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getDiForUnitTesting } from "../../renderer/getDiForUnitTesting";
|
||||
import { routeSpecificComponentInjectionToken } from "../../renderer/routes/route-specific-component-injection-token";
|
||||
import { routeInjectionToken } from "./route-injection-token";
|
||||
import { frontEndRouteInjectionToken } from "./front-end-route-injection-token";
|
||||
import { filter, map, matches } from "lodash/fp";
|
||||
import clusterStoreInjectable from "../cluster-store/cluster-store.injectable";
|
||||
import type { ClusterStore } from "../cluster-store/cluster-store";
|
||||
@@ -18,7 +18,7 @@ describe("verify-that-all-routes-have-component", () => {
|
||||
getById: () => null,
|
||||
} as unknown as ClusterStore));
|
||||
|
||||
const routes = rendererDi.injectMany(routeInjectionToken);
|
||||
const routes = rendererDi.injectMany(frontEndRouteInjectionToken);
|
||||
const routeComponents = rendererDi.injectMany(
|
||||
routeSpecificComponentInjectionToken,
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { execFile } from "child_process";
|
||||
import { promisify } from "util";
|
||||
|
||||
export type ExecFile = (filePath: string, args: string[]) => Promise<string>;
|
||||
|
||||
const execFileInjectable = getInjectable({
|
||||
id: "exec-file",
|
||||
|
||||
instantiate: (): ExecFile => async (filePath, args) => {
|
||||
const asyncExecFile = promisify(execFile);
|
||||
|
||||
const result = await asyncExecFile(filePath, args);
|
||||
|
||||
return result.stdout;
|
||||
},
|
||||
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
export default execFileInjectable;
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import readFileInjectable from "./read-file.injectable";
|
||||
import yaml from "js-yaml";
|
||||
|
||||
export type ReadYamlFile = (filePath: string) => Promise<unknown>;
|
||||
|
||||
const readYamlFileInjectable = getInjectable({
|
||||
id: "read-yaml-file",
|
||||
|
||||
instantiate: (di): ReadYamlFile => {
|
||||
const readFile = di.inject(readFileInjectable);
|
||||
|
||||
return async (filePath: string) => {
|
||||
const contents = await readFile(filePath);
|
||||
|
||||
return yaml.load(contents);
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default readYamlFileInjectable;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { HelmRepo } from "./helm-repo";
|
||||
import type { RequestChannel } from "../utils/channel/request-channel-injection-token";
|
||||
import { requestChannelInjectionToken } from "../utils/channel/request-channel-injection-token";
|
||||
import type { AsyncResult } from "../utils/async-result";
|
||||
|
||||
export type AddHelmRepositoryChannel = RequestChannel<HelmRepo, AsyncResult<string>>;
|
||||
|
||||
const addHelmRepositoryChannelInjectable = getInjectable({
|
||||
id: "add-helm-repository-channel",
|
||||
|
||||
instantiate: (): AddHelmRepositoryChannel => ({
|
||||
id: "add-helm-repository-channel",
|
||||
}),
|
||||
|
||||
injectionToken: requestChannelInjectionToken,
|
||||
});
|
||||
|
||||
export default addHelmRepositoryChannelInjectable;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { RequestChannel } from "../utils/channel/request-channel-injection-token";
|
||||
import type { HelmRepo } from "./helm-repo";
|
||||
import { requestChannelInjectionToken } from "../utils/channel/request-channel-injection-token";
|
||||
import type { AsyncResult } from "../utils/async-result";
|
||||
|
||||
export type GetHelmRepositoriesChannel = RequestChannel<void, AsyncResult<HelmRepo[]>>;
|
||||
|
||||
const getActiveHelmRepositoriesChannelInjectable = getInjectable({
|
||||
id: "get-active-helm-repositories-channel",
|
||||
|
||||
instantiate: (): GetHelmRepositoriesChannel => ({
|
||||
id: "get-helm-active-list-repositories",
|
||||
}),
|
||||
|
||||
injectionToken: requestChannelInjectionToken,
|
||||
});
|
||||
|
||||
export default getActiveHelmRepositoriesChannelInjectable;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
export type HelmRepo = {
|
||||
name: string;
|
||||
url: string;
|
||||
cacheFilePath?: string;
|
||||
caFile?: string;
|
||||
certFile?: string;
|
||||
insecureSkipTlsVerify?: boolean;
|
||||
keyFile?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { HelmRepo } from "./helm-repo";
|
||||
import type { RequestChannel } from "../utils/channel/request-channel-injection-token";
|
||||
import { requestChannelInjectionToken } from "../utils/channel/request-channel-injection-token";
|
||||
|
||||
export type RemoveHelmRepositoryChannel = RequestChannel<HelmRepo>;
|
||||
|
||||
const removeHelmRepositoryChannelInjectable = getInjectable({
|
||||
id: "remove-helm-repository-channel",
|
||||
|
||||
instantiate: (): RemoveHelmRepositoryChannel => ({
|
||||
id: "remove-helm-repository-channel",
|
||||
}),
|
||||
|
||||
injectionToken: requestChannelInjectionToken,
|
||||
});
|
||||
|
||||
export default removeHelmRepositoryChannelInjectable;
|
||||
@@ -449,7 +449,7 @@ describe("KubeApi", () => {
|
||||
expect(spy).toHaveBeenCalledWith("/api/v1/namespaces/kube-system/pods?watch=1&resourceVersion=", { query: { timeoutSeconds: 60 }}, expect.anything());
|
||||
});
|
||||
|
||||
it("aborts watch using abortController", async (done) => {
|
||||
it("aborts watch using abortController", (done) => {
|
||||
const spy = jest.spyOn(request, "getResponse");
|
||||
|
||||
mockFetch.mockResponse(async request => {
|
||||
@@ -472,10 +472,7 @@ describe("KubeApi", () => {
|
||||
});
|
||||
|
||||
expect(spy).toHaveBeenCalledWith("/api/v1/namespaces/kube-system/pods?watch=1&resourceVersion=", { query: { timeoutSeconds: 60 }}, expect.anything());
|
||||
|
||||
await delay(100);
|
||||
|
||||
abortController.abort();
|
||||
delay(100).then(() => abortController.abort());
|
||||
});
|
||||
|
||||
describe("retries", () => {
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { ClusterContext } from "./cluster-context";
|
||||
|
||||
import { action, computed, makeObservable, observable, reaction, when } from "mobx";
|
||||
import type { Disposer } from "../utils";
|
||||
import { autoBind, includes, isRequestError, noop, rejectPromiseBy } from "../utils";
|
||||
import { waitUntilDefined, autoBind, includes, isRequestError, noop, rejectPromiseBy } from "../utils";
|
||||
import type { KubeJsonApiDataFor, KubeObject } from "./kube-object";
|
||||
import { KubeStatus } from "./kube-object";
|
||||
import type { IKubeWatchEvent } from "./kube-watch-event";
|
||||
@@ -114,7 +114,7 @@ export abstract class KubeObjectStore<
|
||||
this.bindWatchEventsUpdater();
|
||||
}
|
||||
|
||||
get context(): ClusterContext {
|
||||
get context(): ClusterContext | undefined {
|
||||
return KubeObjectStore.defaultContext.get();
|
||||
}
|
||||
|
||||
@@ -259,8 +259,9 @@ export abstract class KubeObjectStore<
|
||||
|
||||
@action
|
||||
async loadAll({ namespaces, merge = true, reqInit, onLoadFailure }: KubeObjectStoreLoadAllParams = {}): Promise<undefined | K[]> {
|
||||
await this.contextReady;
|
||||
namespaces ??= this.context.contextNamespaces;
|
||||
const context = await waitUntilDefined(() => this.context);
|
||||
|
||||
namespaces ??= context.contextNamespaces;
|
||||
this.isLoading = true;
|
||||
|
||||
try {
|
||||
@@ -427,11 +428,17 @@ export abstract class KubeObjectStore<
|
||||
|
||||
subscribe({ onLoadFailure, abortController = new AbortController() }: KubeObjectStoreSubscribeParams = {}): Disposer {
|
||||
if (this.api.isNamespaced) {
|
||||
Promise.race([rejectPromiseBy(abortController.signal), Promise.all([this.contextReady, this.namespacesReady])])
|
||||
.then(() => {
|
||||
Promise.race([
|
||||
rejectPromiseBy(abortController.signal),
|
||||
Promise.all([
|
||||
waitUntilDefined(() => this.context),
|
||||
this.namespacesReady,
|
||||
] as const),
|
||||
])
|
||||
.then(([context]) => {
|
||||
assert(this.loadedNamespaces);
|
||||
|
||||
if (this.context.cluster?.isGlobalWatchEnabled && this.loadedNamespaces.length === 0) {
|
||||
if (context.cluster?.isGlobalWatchEnabled && this.loadedNamespaces.length === 0) {
|
||||
return this.watchNamespace("", abortController, { onLoadFailure });
|
||||
}
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ export function foldAttemptResults(mainAttempt: RouteAttempt, rendererAttempt: R
|
||||
}
|
||||
}
|
||||
|
||||
interface Dependencies {
|
||||
extensionLoader: ExtensionLoader;
|
||||
extensionsStore: ExtensionsStore;
|
||||
export interface LensProtocolRouterDependencies {
|
||||
readonly extensionLoader: ExtensionLoader;
|
||||
readonly extensionsStore: ExtensionsStore;
|
||||
}
|
||||
|
||||
export abstract class LensProtocolRouter {
|
||||
@@ -76,7 +76,7 @@ export abstract class LensProtocolRouter {
|
||||
|
||||
static readonly ExtensionUrlSchema = `/:${EXTENSION_PUBLISHER_MATCH}(@[A-Za-z0-9_]+)?/:${EXTENSION_NAME_MATCH}`;
|
||||
|
||||
constructor(protected dependencies: Dependencies) {}
|
||||
constructor(protected readonly dependencies: LensProtocolRouterDependencies) {}
|
||||
|
||||
/**
|
||||
* Attempts to route the given URL to all internal routes that have been registered
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { setImmediate } from "timers";
|
||||
|
||||
export const flushPromises = () => new Promise(setImmediate);
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
export type AsyncResult<Response, Error = string> =
|
||||
| { callWasSuccessful: true; response: Response }
|
||||
| { callWasSuccessful: false; error: Error };
|
||||
@@ -70,13 +70,13 @@ describe("channel", () => {
|
||||
closeAllWindows();
|
||||
});
|
||||
|
||||
describe("given window is shown", () => {
|
||||
describe("given window is started", () => {
|
||||
let someWindowFake: LensWindow;
|
||||
|
||||
beforeEach(async () => {
|
||||
someWindowFake = createTestWindow(mainDi, "some-window");
|
||||
|
||||
await someWindowFake.show();
|
||||
await someWindowFake.start();
|
||||
});
|
||||
|
||||
it("when sending message, triggers listener in window", () => {
|
||||
@@ -94,12 +94,12 @@ describe("channel", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("given multiple shown windows, when sending message, triggers listeners in all windows", async () => {
|
||||
it("given multiple started windows, when sending message, triggers listeners in all windows", async () => {
|
||||
const someWindowFake = createTestWindow(mainDi, "some-window");
|
||||
const someOtherWindowFake = createTestWindow(mainDi, "some-other-window");
|
||||
|
||||
await someWindowFake.show();
|
||||
await someOtherWindowFake.show();
|
||||
await someWindowFake.start();
|
||||
await someOtherWindowFake.start();
|
||||
|
||||
messageToChannel(testMessageChannel, "some-message");
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import moment from "moment";
|
||||
|
||||
export const getCurrentDateTime = () => moment().utc().format();
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
export const getErrorMessage = (error: unknown): string => {
|
||||
if (typeof error === "string") {
|
||||
return error;
|
||||
}
|
||||
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
|
||||
return JSON.stringify(error);
|
||||
};
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import allowedResourcesInjectable from "../cluster-store/allowed-resources.injectable";
|
||||
import type { KubeResource } from "../rbac";
|
||||
import { allowedResourcesInjectionToken } from "../cluster-store/allowed-resources-injection-token";
|
||||
|
||||
export type IsAllowedResource = (resource: KubeResource) => boolean;
|
||||
|
||||
@@ -13,7 +13,7 @@ const isAllowedResourceInjectable = getInjectable({
|
||||
id: "is-allowed-resource",
|
||||
|
||||
instantiate: (di, resourceName: string) => {
|
||||
const allowedResources = di.inject(allowedResourcesInjectable);
|
||||
const allowedResources = di.inject(allowedResourcesInjectionToken);
|
||||
|
||||
return computed(() => allowedResources.get().has(resourceName));
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import "abort-controller/polyfill";
|
||||
import type { AbortSignal } from "abort-controller";
|
||||
|
||||
/**
|
||||
* Creates a new promise that will be rejected when the signal rejects.
|
||||
@@ -11,7 +11,7 @@ import "abort-controller/polyfill";
|
||||
* Useful for `Promise.race()` applications.
|
||||
* @param signal The AbortController's signal to reject with
|
||||
*/
|
||||
export function rejectPromiseBy(signal: AbortSignal): Promise<void> {
|
||||
export function rejectPromiseBy(signal: AbortSignal): Promise<never> {
|
||||
return new Promise((_, reject) => {
|
||||
signal.addEventListener("abort", reject);
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { IObservableValue } from "mobx";
|
||||
import { computed } from "mobx";
|
||||
import syncBoxChannelInjectable from "./sync-box-channel.injectable";
|
||||
import { messageToChannelInjectionToken } from "../channel/message-to-channel-injection-token";
|
||||
@@ -17,8 +18,8 @@ const createSyncBoxInjectable = getInjectable({
|
||||
const messageToChannel = di.inject(messageToChannelInjectionToken);
|
||||
const getSyncBoxState = (id: string) => di.inject(syncBoxStateInjectable, id);
|
||||
|
||||
return <TData>(id: string, initialValue: TData): SyncBox<TData> => {
|
||||
const state = getSyncBoxState(id);
|
||||
return <Value>(id: string, initialValue: Value): SyncBox<Value> => {
|
||||
const state = getSyncBoxState(id) as IObservableValue<Value>;
|
||||
|
||||
state.set(initialValue);
|
||||
|
||||
|
||||
@@ -4,21 +4,10 @@
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { IComputedValue } from "mobx";
|
||||
|
||||
type AsJson<T> = T extends string | number | boolean | null
|
||||
? T
|
||||
: T extends Function
|
||||
? never
|
||||
: T extends Array<infer V>
|
||||
? AsJson<V>[]
|
||||
: T extends object
|
||||
? { [K in keyof T]: AsJson<T[K]> }
|
||||
: never;
|
||||
|
||||
export interface SyncBox<TValue> {
|
||||
export interface SyncBox<Value> {
|
||||
id: string;
|
||||
value: IComputedValue<AsJson<TValue>>;
|
||||
set: (value: AsJson<TValue>) => void;
|
||||
value: IComputedValue<Value>;
|
||||
set: (value: Value) => void;
|
||||
}
|
||||
|
||||
export const syncBoxInjectionToken = getInjectionToken<SyncBox<any>>({
|
||||
|
||||
@@ -137,6 +137,14 @@ export function hasDefiniteField<Field extends keyof T, T>(field: Field): (val:
|
||||
return (val): val is T & { [f in Field]-?: NonNullable<T[Field]> } => val[field] != null;
|
||||
}
|
||||
|
||||
export function isPromiseSettledRejected<T>(result: PromiseSettledResult<T>): result is PromiseRejectedResult {
|
||||
return result.status === "rejected";
|
||||
}
|
||||
|
||||
export function isPromiseSettledFulfilled<T>(result: PromiseSettledResult<T>): result is PromiseFulfilledResult<T> {
|
||||
return result.status === "fulfilled";
|
||||
}
|
||||
|
||||
export function isErrnoException(error: unknown): error is NodeJS.ErrnoException {
|
||||
return isObject(error)
|
||||
&& hasOptionalTypedProperty(error, "code", isString)
|
||||
|
||||
@@ -3,16 +3,22 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import path from "path";
|
||||
import bundledBinariesNormalizedArchInjectable from "./bundled-binaries-normalized-arch.injectable";
|
||||
import bundledResourcesDirectoryInjectable from "./bundled-resources-dir.injectable";
|
||||
import getAbsolutePathInjectable from "../path/get-absolute-path.injectable";
|
||||
import normalizedPlatformArchitectureInjectable from "./normalized-platform-architecture.injectable";
|
||||
|
||||
const baseBundeledBinariesDirectoryInjectable = getInjectable({
|
||||
id: "base-bundeled-binaries-directory",
|
||||
instantiate: (di) => path.join(
|
||||
di.inject(bundledResourcesDirectoryInjectable),
|
||||
di.inject(bundledBinariesNormalizedArchInjectable),
|
||||
),
|
||||
const baseBundledBinariesDirectoryInjectable = getInjectable({
|
||||
id: "base-bundled-binaries-directory",
|
||||
instantiate: (di) => {
|
||||
const bundledResourcesDirectory = di.inject(bundledResourcesDirectoryInjectable);
|
||||
const normalizedPlatformArchitecture = di.inject(normalizedPlatformArchitectureInjectable);
|
||||
const getAbsolutePath = di.inject(getAbsolutePathInjectable);
|
||||
|
||||
return getAbsolutePath(
|
||||
bundledResourcesDirectory,
|
||||
normalizedPlatformArchitecture,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
export default baseBundeledBinariesDirectoryInjectable;
|
||||
export default baseBundledBinariesDirectoryInjectable;
|
||||
@@ -3,19 +3,22 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import path from "path";
|
||||
import isProductionInjectable from "./is-production.injectable";
|
||||
import normalizedPlatformInjectable from "./normalized-platform.injectable";
|
||||
import getAbsolutePathInjectable from "../path/get-absolute-path.injectable";
|
||||
import lensResourcesDirInjectable from "./lens-resources-dir.injectable";
|
||||
|
||||
const bundledResourcesDirectoryInjectable = getInjectable({
|
||||
id: "bundled-resources-directory",
|
||||
instantiate: (di) => {
|
||||
const isProduction = di.inject(isProductionInjectable);
|
||||
const normalizedPlatform = di.inject(normalizedPlatformInjectable);
|
||||
const getAbsolutePath = di.inject(getAbsolutePathInjectable);
|
||||
const lensResourcesDir = di.inject(lensResourcesDirInjectable);
|
||||
|
||||
return isProduction
|
||||
? process.resourcesPath
|
||||
: path.join(process.cwd(), "binaries", "client", normalizedPlatform);
|
||||
? lensResourcesDir
|
||||
: getAbsolutePath(lensResourcesDir, "binaries", "client", normalizedPlatform);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
|
||||
const bundledBinariesNormalizedArchInjectable = getInjectable({
|
||||
id: "bundled-binaries-normalized-arch",
|
||||
const normalizedPlatformArchitectureInjectable = getInjectable({
|
||||
id: "normalized-platform-architecture",
|
||||
instantiate: () => {
|
||||
switch (process.arch) {
|
||||
case "arm64":
|
||||
@@ -24,4 +24,4 @@ const bundledBinariesNormalizedArchInjectable = getInjectable({
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
export default bundledBinariesNormalizedArchInjectable;
|
||||
export default normalizedPlatformArchitectureInjectable;
|
||||
@@ -3,11 +3,15 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import platformInjectable from "./platform.injectable";
|
||||
|
||||
const normalizedPlatformInjectable = getInjectable({
|
||||
id: "normalized-platform",
|
||||
instantiate: () => {
|
||||
switch (process.platform) {
|
||||
|
||||
instantiate: (di) => {
|
||||
const platform = di.inject(platformInjectable);
|
||||
|
||||
switch (platform) {
|
||||
case "darwin":
|
||||
return "darwin";
|
||||
case "linux":
|
||||
@@ -15,10 +19,9 @@ const normalizedPlatformInjectable = getInjectable({
|
||||
case "win32":
|
||||
return "windows";
|
||||
default:
|
||||
throw new Error(`platform=${process.platform} is unsupported`);
|
||||
throw new Error(`platform=${platform} is unsupported`);
|
||||
}
|
||||
},
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
export default normalizedPlatformInjectable;
|
||||
Reference in new issue
Block a user