Turn on noUnusedLocals, noImplicitReturns, importsNotUsedAsValues: error, and isolatedModules (#2777)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-05-19 12:11:54 -04:00
1 parent 489cef9595
commit 5ed4537979
287 files changed
+704 -628

No files matched your search

@@ -22,11 +22,11 @@
import "./helm-charts.scss";
import React, { Component } from "react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { observer } from "mobx-react";
import { helmChartsURL, IHelmChartsRouteParams } from "./helm-charts.route";
import { helmChartStore } from "./helm-chart.store";
import { HelmChart } from "../../api/endpoints/helm-charts.api";
import type { HelmChart } from "../../api/endpoints/helm-charts.api";
import { HelmChartDetails } from "./helm-chart-details";
import { navigation } from "../../navigation";
import { ItemListLayout } from "../item-object-list/item-list-layout";
@@ -20,7 +20,7 @@
*/
import React from "react";
import { HelmRelease } from "../../api/endpoints/helm-releases.api";
import type { HelmRelease } from "../../api/endpoints/helm-releases.api";
import { autobind, cssNames } from "../../utils";
import { releaseStore } from "./release.store";
import { MenuActions, MenuActionsProps } from "../menu/menu-actions";
@@ -56,7 +56,7 @@ export class HelmReleaseMenu extends React.Component<Props> {
renderContent() {
const { release, toolbar } = this.props;
if (!release) return;
if (!release) return null;
const hasRollback = release && release.getRevision() > 1;
return (
@@ -24,7 +24,7 @@ import { action, observable, reaction, when } from "mobx";
import { autobind } from "../../utils";
import { createRelease, deleteRelease, HelmRelease, IReleaseCreatePayload, IReleaseUpdatePayload, listReleases, rollbackRelease, updateRelease } from "../../api/endpoints/helm-releases.api";
import { ItemStore } from "../../item.store";
import { Secret } from "../../api/endpoints";
import type { Secret } from "../../api/endpoints";
import { secretsStore } from "../+config-secrets/secrets.store";
import { namespaceStore } from "../+namespaces/namespace.store";
import { Notifications } from "../notifications";
@@ -146,8 +146,6 @@ export class ReleaseStore extends ItemStore<HelmRelease> {
}
async removeSelectedItems() {
if (!this.selectedItems.length) return;
return Promise.all(this.selectedItems.map(this.remove));
}
}
@@ -24,10 +24,10 @@ import "./releases.scss";
import React, { Component } from "react";
import kebabCase from "lodash/kebabCase";
import { disposeOnUnmount, observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { releaseStore } from "./release.store";
import { IReleaseRouteParams, releaseURL } from "./release.route";
import { HelmRelease } from "../../api/endpoints/helm-releases.api";
import type { HelmRelease } from "../../api/endpoints/helm-releases.api";
import { ReleaseDetails } from "./release-details";
import { ReleaseRollbackDialog } from "./release-rollback-dialog";
import { navigation } from "../../navigation";
@@ -26,7 +26,7 @@ import { Icon } from "../icon";
import { disposeOnUnmount, observer } from "mobx-react";
import { observable, reaction } from "mobx";
import { autobind } from "../../../common/utils";
import { CatalogCategory, CatalogEntityAddMenuContext, CatalogEntityAddMenu } from "../../api/catalog-entity";
import type { CatalogCategory, CatalogEntityAddMenuContext, CatalogEntityAddMenu } from "../../api/catalog-entity";
import { EventEmitter } from "events";
import { navigate } from "../../navigation";
@@ -21,7 +21,7 @@
import { action, computed, IReactionDisposer, observable, reaction } from "mobx";
import { catalogEntityRegistry } from "../../api/catalog-entity-registry";
import { CatalogEntity, CatalogEntityActionContext } from "../../api/catalog-entity";
import type { CatalogEntity, CatalogEntityActionContext } from "../../api/catalog-entity";
import { ItemObject, ItemStore } from "../../item.store";
import { autobind } from "../../utils";
import { CatalogCategory } from "../../../common/catalog";
@@ -30,7 +30,7 @@ import { Table, TableCell, TableHead, TableRow } from "../table";
import { nodesStore } from "../+nodes/nodes.store";
import { eventStore } from "../+events/event.store";
import { autobind, cssNames, prevDefault } from "../../utils";
import { ItemObject } from "../../item.store";
import type { ItemObject } from "../../item.store";
import { Spinner } from "../spinner";
import { ThemeStore } from "../../theme.store";
import { lookupApiLink } from "../../api/kube-api";
@@ -23,7 +23,7 @@ import "./cluster-metrics.scss";
import React from "react";
import { observer } from "mobx-react";
import { ChartOptions, ChartPoint } from "chart.js";
import type { ChartOptions, ChartPoint } from "chart.js";
import { clusterOverviewStore, MetricType } from "./cluster-overview.store";
import { BarChart } from "../chart";
import { bytesToUnits } from "../../utils";
@@ -100,7 +100,7 @@ export class HpaDetails extends React.Component<Props> {
render() {
const { object: hpa } = this.props;
if (!hpa) return;
if (!hpa) return null;
const { scaleTargetRef } = hpa.spec;
return (
@@ -23,10 +23,10 @@ import "./hpa.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { KubeObjectListLayout } from "../kube-object";
import { IHpaRouteParams } from "./hpa.route";
import { HorizontalPodAutoscaler } from "../../api/endpoints/hpa.api";
import type { IHpaRouteParams } from "./hpa.route";
import type { HorizontalPodAutoscaler } from "../../api/endpoints/hpa.api";
import { hpaStore } from "./hpa.store";
import { Badge } from "../badge";
import { cssNames } from "../../utils";
@@ -23,7 +23,7 @@ import "./limit-range-details.scss";
import React from "react";
import { observer } from "mobx-react";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { LimitPart, LimitRange, LimitRangeItem, Resource } from "../../api/endpoints/limit-range.api";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
@@ -21,14 +21,14 @@
import "./limit-ranges.scss";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { observer } from "mobx-react";
import { KubeObjectListLayout } from "../kube-object/kube-object-list-layout";
import { limitRangeStore } from "./limit-ranges.store";
import { LimitRangeRouteParams } from "./limit-ranges.route";
import type { LimitRangeRouteParams } from "./limit-ranges.route";
import React from "react";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
import { LimitRange } from "../../api/endpoints/limit-range.api";
import type { LimitRange } from "../../api/endpoints/limit-range.api";
enum columnId {
name = "name",
@@ -30,8 +30,8 @@ import { Input } from "../input";
import { Button } from "../button";
import { KubeEventDetails } from "../+events/kube-event-details";
import { configMapsStore } from "./config-maps.store";
import { KubeObjectDetailsProps } from "../kube-object";
import { ConfigMap } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { ConfigMap } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -132,5 +132,3 @@ kubeObjectDetailRegistry.add({
Details: (props) => <KubeEventDetails {...props} />
}
});
@@ -23,11 +23,11 @@ import "./config-maps.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { configMapsStore } from "./config-maps.store";
import { ConfigMap } from "../../api/endpoints/configmap.api";
import type { ConfigMap } from "../../api/endpoints/configmap.api";
import { KubeObjectListLayout } from "../kube-object";
import { IConfigMapsRouteParams } from "./config-maps.route";
import type { IConfigMapsRouteParams } from "./config-maps.route";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
enum columnId {
@@ -25,8 +25,8 @@ import React from "react";
import { observer } from "mobx-react";
import { DrawerItem } from "../drawer";
import { Badge } from "../badge";
import { KubeObjectDetailsProps } from "../kube-object";
import { PodDisruptionBudget } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { PodDisruptionBudget } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -24,7 +24,7 @@ import "./pod-disruption-budgets.scss";
import * as React from "react";
import { observer } from "mobx-react";
import { podDisruptionBudgetsStore } from "./pod-disruption-budgets.store";
import { PodDisruptionBudget } from "../../api/endpoints/poddisruptionbudget.api";
import type { PodDisruptionBudget } from "../../api/endpoints/poddisruptionbudget.api";
import { KubeObjectDetailsProps, KubeObjectListLayout } from "../kube-object";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -25,8 +25,8 @@ import kebabCase from "lodash/kebabCase";
import { observer } from "mobx-react";
import { DrawerItem, DrawerTitle } from "../drawer";
import { cpuUnitsToNumber, cssNames, unitsToBytes, metricUnitsToNumber } from "../../utils";
import { KubeObjectDetailsProps } from "../kube-object";
import { ResourceQuota } from "../../api/endpoints/resource-quota.api";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { ResourceQuota } from "../../api/endpoints/resource-quota.api";
import { LineProgress } from "../line-progress";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
@@ -23,12 +23,12 @@ import "./resource-quotas.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { KubeObjectListLayout } from "../kube-object";
import { ResourceQuota } from "../../api/endpoints/resource-quota.api";
import type { ResourceQuota } from "../../api/endpoints/resource-quota.api";
import { AddQuotaDialog } from "./add-quota-dialog";
import { resourceQuotaStore } from "./resource-quotas.store";
import { IResourceQuotaRouteParams } from "./resource-quotas.route";
import type { IResourceQuotaRouteParams } from "./resource-quotas.route";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
enum columnId {
@@ -33,7 +33,7 @@ import { SubTitle } from "../layout/sub-title";
import { NamespaceSelect } from "../+namespaces/namespace-select";
import { Select, SelectOption } from "../select";
import { Icon } from "../icon";
import { IKubeObjectMetadata } from "../../api/kube-object";
import type { IKubeObjectMetadata } from "../../api/kube-object";
import { base64 } from "../../utils";
import { Notifications } from "../notifications";
import upperFirst from "lodash/upperFirst";
@@ -32,8 +32,8 @@ import { Notifications } from "../notifications";
import { base64 } from "../../utils";
import { Icon } from "../icon";
import { secretsStore } from "./secrets.store";
import { KubeObjectDetailsProps } from "../kube-object";
import { Secret } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { Secret } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -23,10 +23,10 @@ import "./secrets.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import { Secret } from "../../api/endpoints";
import type { RouteComponentProps } from "react-router";
import type { Secret } from "../../api/endpoints";
import { AddSecretDialog } from "./add-secret-dialog";
import { ISecretsRouteParams } from "./secrets.route";
import type { ISecretsRouteParams } from "./secrets.route";
import { KubeObjectListLayout } from "../kube-object";
import { Badge } from "../badge";
import { secretsStore } from "./secrets.store";
@@ -19,8 +19,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { RouteProps } from "react-router";
import { IURLParams } from "../../../common/utils/buildUrl";
import type { RouteProps } from "react-router";
import type { IURLParams } from "../../../common/utils/buildUrl";
import { configMapsRoute, configMapsURL } from "../+config-maps/config-maps.route";
import { hpaRoute } from "../+config-autoscalers";
import { limitRangesRoute } from "../+config-limit-ranges";
@@ -24,12 +24,12 @@ import "./crd-details.scss";
import React from "react";
import { Link } from "react-router-dom";
import { observer } from "mobx-react";
import { CustomResourceDefinition } from "../../api/endpoints/crd.api";
import type { CustomResourceDefinition } from "../../api/endpoints/crd.api";
import { cssNames } from "../../utils";
import { AceEditor } from "../ace-editor";
import { Badge } from "../badge";
import { DrawerItem, DrawerTitle } from "../drawer";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { Input } from "../input";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
@@ -28,7 +28,7 @@ import { Link } from "react-router-dom";
import { stopPropagation } from "../../utils";
import { KubeObjectListLayout } from "../kube-object";
import { crdStore } from "./crd.store";
import { CustomResourceDefinition } from "../../api/endpoints/crd.api";
import type { CustomResourceDefinition } from "../../api/endpoints/crd.api";
import { Select, SelectOption } from "../select";
import { createPageParam } from "../../navigation";
import { Icon } from "../icon";
@@ -28,11 +28,11 @@ import { computed } from "mobx";
import { cssNames } from "../../utils";
import { Badge } from "../badge";
import { DrawerItem } from "../drawer";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { crdStore } from "./crd.store";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { Input } from "../input";
import { AdditionalPrinterColumnsV1, CustomResourceDefinition } from "../../api/endpoints/crd.api";
import type { AdditionalPrinterColumnsV1, CustomResourceDefinition } from "../../api/endpoints/crd.api";
import { parseJsonPath } from "../../utils/jsonPath";
interface Props extends KubeObjectDetailsProps<CustomResourceDefinition> {
@@ -22,7 +22,7 @@
import { autobind } from "../../utils";
import { KubeApi } from "../../api/kube-api";
import { KubeObjectStore } from "../../kube-object.store";
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
@autobind()
export class CRDResourceStore<T extends KubeObject = any> extends KubeObjectStore<T> {
@@ -24,13 +24,13 @@ import "./crd-resources.scss";
import React from "react";
import jsonPath from "jsonpath";
import { disposeOnUnmount, observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { KubeObjectListLayout } from "../kube-object";
import { KubeObject } from "../../api/kube-object";
import { ICRDRouteParams } from "./crd.route";
import type { KubeObject } from "../../api/kube-object";
import type { ICRDRouteParams } from "./crd.route";
import { autorun, computed } from "mobx";
import { crdStore } from "./crd.store";
import { TableSortCallback } from "../table";
import type { TableSortCallback } from "../table";
import { apiManager } from "../../api/api-manager";
import { parseJsonPath } from "../../utils/jsonPath";
@@ -26,14 +26,14 @@ import { crdApi, CustomResourceDefinition } from "../../api/endpoints/crd.api";
import { apiManager } from "../../api/api-manager";
import { KubeApi } from "../../api/kube-api";
import { CRDResourceStore } from "./crd-resource.store";
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
function initStore(crd: CustomResourceDefinition) {
const apiBase = crd.getResourceApiBase();
const kind = crd.getResourceKind();
const isNamespaced = crd.isNamespaced();
const api = apiManager.getApi(apiBase) || new KubeApi({ apiBase, kind, isNamespaced });
if (!apiManager.getStore(api)) {
apiManager.registerStore(new CRDResourceStore(api));
}
@@ -81,7 +81,7 @@ export class CRDStore extends KubeObjectStore<CustomResourceDefinition> {
getByObject(obj: KubeObject) {
if (!obj) return null;
const { kind, apiVersion } = obj;
return this.items.find(crd => (
kind === crd.getResourceKind() && apiVersion === `${crd.getGroup()}/${crd.getVersion()}`
));
@@ -23,15 +23,15 @@ import "./entity-settings.scss";
import React from "react";
import { observable } from "mobx";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { observer } from "mobx-react";
import { PageLayout } from "../layout/page-layout";
import { navigation } from "../../navigation";
import { Tabs, Tab } from "../tabs";
import { CatalogEntity } from "../../api/catalog-entity";
import type { CatalogEntity } from "../../api/catalog-entity";
import { catalogEntityRegistry } from "../../api/catalog-entity-registry";
import { entitySettingRegistry } from "../../../extensions/registries";
import { EntitySettingsRouteParams } from "./entity-settings.route";
import type { EntitySettingsRouteParams } from "./entity-settings.route";
import { groupBy } from "lodash";
interface Props extends RouteComponentProps<EntitySettingsRouteParams> {
@@ -27,7 +27,7 @@ import { DrawerItem, DrawerTitle } from "../drawer";
import { Link } from "react-router-dom";
import { observer } from "mobx-react";
import { KubeObjectDetailsProps, getDetailsUrl } from "../kube-object";
import { KubeEvent } from "../../api/endpoints/events.api";
import type { KubeEvent } from "../../api/endpoints/events.api";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { lookupApiLink } from "../../api/kube-api";
@@ -42,7 +42,7 @@ export class EventDetails extends React.Component<Props> {
render() {
const { object: event } = this.props;
if (!event) return;
if (!event) return null;
const { message, reason, count, type, involvedObject } = event;
const { kind, name, namespace, fieldPath } = involvedObject;
@@ -24,7 +24,7 @@ import compact from "lodash/compact";
import { KubeObjectStore } from "../../kube-object.store";
import { autobind } from "../../utils";
import { eventApi, KubeEvent } from "../../api/endpoints/events.api";
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
import { Pod } from "../../api/endpoints/pods.api";
import { podsStore } from "../+workloads-pods/pods.store";
import { apiManager } from "../../api/api-manager";
@@ -65,7 +65,7 @@ export class EventStore extends KubeObjectStore<KubeEvent> {
if (kind == Pod.kind) { // Wipe out running pods
const pod = podsStore.items.find(pod => pod.getId() == uid);
if (!pod || (!pod.hasIssues() && pod.spec.priority < 500000)) return;
if (!pod || (!pod.hasIssues() && pod.spec.priority < 500000)) return undefined;
}
return recent;
+3 -3
View File
@@ -28,9 +28,9 @@ import { orderBy } from "lodash";
import { TabLayout } from "../layout/tab-layout";
import { EventStore, eventStore } from "./event.store";
import { getDetailsUrl, KubeObjectListLayout, KubeObjectListLayoutProps } from "../kube-object";
import { KubeEvent } from "../../api/endpoints/events.api";
import { TableSortCallbacks, TableSortParams, TableProps } from "../table";
import { IHeaderPlaceholders } from "../item-object-list";
import type { KubeEvent } from "../../api/endpoints/events.api";
import type { TableSortCallbacks, TableSortParams, TableProps } from "../table";
import type { IHeaderPlaceholders } from "../item-object-list";
import { Tooltip } from "../tooltip";
import { Link } from "react-router-dom";
import { cssNames, IClassName, stopPropagation } from "../../utils";
@@ -23,7 +23,7 @@ import "./kube-event-details.scss";
import React from "react";
import { observer } from "mobx-react";
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
import { DrawerItem, DrawerTitle } from "../drawer";
import { cssNames } from "../../utils";
import { eventStore } from "./event.store";
@@ -23,10 +23,10 @@ import "./kube-event-icon.scss";
import React from "react";
import { Icon } from "../icon";
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
import { eventStore } from "./event.store";
import { cssNames } from "../../utils";
import { KubeEvent } from "../../api/endpoints/events.api";
import type { KubeEvent } from "../../api/endpoints/events.api";
interface Props {
object: KubeObject;
@@ -21,7 +21,8 @@
import { action, computed, observable } from "mobx";
import logger from "../../../main/logger";
import { disposer, ExtendableDisposer } from "../../utils";
import { disposer } from "../../utils";
import type { ExtendableDisposer } from "../../utils";
import * as uuid from "uuid";
import { broadcastMessage } from "../../../common/ipc";
import { ipcRenderer } from "electron";
@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { RouteProps } from "react-router";
import type { RouteProps } from "react-router";
import { buildURL } from "../../../common/utils/buildUrl";
export const extensionsRoute: RouteProps = {
@@ -199,7 +199,7 @@ async function createTempFilesAndValidate({ fileName, dataP }: InstallRequest):
const data = await dataP;
if (!data) {
return;
return null;
}
await fse.writeFile(tempFile, data);
@@ -27,7 +27,7 @@ import { observer } from "mobx-react";
import { Dialog, DialogProps } from "../dialog";
import { Wizard, WizardStep } from "../wizard";
import { namespaceStore } from "./namespace.store";
import { Namespace } from "../../api/endpoints";
import type { Namespace } from "../../api/endpoints";
import { Input } from "../input";
import { systemName } from "../input/input_validators";
import { Notifications } from "../notifications";
@@ -26,7 +26,7 @@ import { computed } from "mobx";
import { observer } from "mobx-react";
import { DrawerItem } from "../drawer";
import { cssNames } from "../../utils";
import { Namespace } from "../../api/endpoints";
import type { Namespace } from "../../api/endpoints";
import { getDetailsUrl, KubeObjectDetailsProps } from "../kube-object";
import { Link } from "react-router-dom";
import { Spinner } from "../spinner";
@@ -60,7 +60,7 @@ export class NamespaceDetails extends React.Component<Props> {
render() {
const { object: namespace } = this.props;
if (!namespace) return;
if (!namespace) return null;
const status = namespace.getStatus();
return (
@@ -28,7 +28,7 @@ import { components, PlaceholderProps } from "react-select";
import { Icon } from "../icon";
import { FilterIcon } from "../item-object-list/filter-icon";
import { FilterType } from "../item-object-list/page-filters.store";
import { SelectOption } from "../select";
import type { SelectOption } from "../select";
import { NamespaceSelect } from "./namespace-select";
import { namespaceStore } from "./namespace.store";
@@ -26,9 +26,9 @@ import { Namespace, NamespaceStatus } from "../../api/endpoints";
import { AddNamespaceDialog } from "./add-namespace-dialog";
import { TabLayout } from "../layout/tab-layout";
import { Badge } from "../badge";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { KubeObjectListLayout } from "../kube-object";
import { INamespacesRouteParams } from "./namespaces.route";
import type { INamespacesRouteParams } from "./namespaces.route";
import { namespaceStore } from "./namespace.store";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -25,8 +25,8 @@ import React from "react";
import { observer } from "mobx-react";
import { DrawerTitle } from "../drawer";
import { KubeEventDetails } from "../+events/kube-event-details";
import { KubeObjectDetailsProps } from "../kube-object";
import { Endpoint } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { Endpoint } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { EndpointSubsetList } from "./endpoint-subset-list";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -39,7 +39,7 @@ export class EndpointDetails extends React.Component<Props> {
render() {
const { object: endpoint } = this.props;
if (!endpoint) return;
if (!endpoint) return null;
return (
<div className="EndpointDetails">
@@ -23,9 +23,9 @@ import "./endpoints.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router-dom";
import { EndpointRouteParams } from "./endpoints.route";
import { Endpoint } from "../../api/endpoints/endpoint.api";
import type { RouteComponentProps } from "react-router-dom";
import type { EndpointRouteParams } from "./endpoints.route";
import type { Endpoint } from "../../api/endpoints/endpoint.api";
import { endpointStore } from "./endpoints.store";
import { KubeObjectListLayout } from "../kube-object";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -21,8 +21,8 @@
import React, { useContext } from "react";
import { observer } from "mobx-react";
import { ChartOptions, ChartPoint } from "chart.js";
import { IIngressMetrics, Ingress } from "../../api/endpoints";
import type { ChartOptions, ChartPoint } from "chart.js";
import type { IIngressMetrics, Ingress } from "../../api/endpoints";
import { BarChart, memoryOptions } from "../chart";
import { normalizeMetrics, isMetricsEmpty } from "../../api/endpoints/metrics.api";
import { NoMetrics } from "../resource-metrics/no-metrics";
@@ -25,12 +25,12 @@ import React from "react";
import { disposeOnUnmount, observer } from "mobx-react";
import { reaction } from "mobx";
import { DrawerItem, DrawerTitle } from "../drawer";
import { ILoadBalancerIngress, Ingress } from "../../api/endpoints";
import type { ILoadBalancerIngress, Ingress } from "../../api/endpoints";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { KubeEventDetails } from "../+events/kube-event-details";
import { ingressStore } from "./ingress.store";
import { ResourceMetrics } from "../resource-metrics";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { IngressCharts } from "./ingress-charts";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -23,9 +23,9 @@ import "./ingresses.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router-dom";
import { IngressRouteParams } from "./ingresses.route";
import { Ingress } from "../../api/endpoints/ingress.api";
import type { RouteComponentProps } from "react-router-dom";
import type { IngressRouteParams } from "./ingresses.route";
import type { Ingress } from "../../api/endpoints/ingress.api";
import { ingressStore } from "./ingress.store";
import { KubeObjectListLayout } from "../kube-object";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -23,10 +23,10 @@ import "./network-policies.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router-dom";
import { NetworkPolicy } from "../../api/endpoints/network-policy.api";
import type { RouteComponentProps } from "react-router-dom";
import type { NetworkPolicy } from "../../api/endpoints/network-policy.api";
import { KubeObjectListLayout } from "../kube-object";
import { INetworkPoliciesRouteParams } from "./network-policies.route";
import type { INetworkPoliciesRouteParams } from "./network-policies.route";
import { networkPolicyStore } from "./network-policy.store";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -24,12 +24,12 @@ import "./network-policy-details.scss";
import get from "lodash/get";
import React, { Fragment } from "react";
import { DrawerItem, DrawerTitle } from "../drawer";
import { IPolicyEgress, IPolicyIngress, IPolicyIpBlock, IPolicySelector, NetworkPolicy } from "../../api/endpoints/network-policy.api";
import type { IPolicyEgress, IPolicyIngress, IPolicyIpBlock, IPolicySelector, NetworkPolicy } from "../../api/endpoints/network-policy.api";
import { Badge } from "../badge";
import { SubTitle } from "../layout/sub-title";
import { KubeEventDetails } from "../+events/kube-event-details";
import { observer } from "mobx-react";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -53,7 +53,7 @@ export class NetworkPolicyDetails extends React.Component<Props> {
if (key === "ipBlock") {
const { cidr, except } = data as IPolicyIpBlock;
if (!cidr) return;
if (!cidr) return null;
return (
<DrawerItem name={key} key={key}>
@@ -96,12 +96,9 @@ export class NetworkPolicyDetails extends React.Component<Props> {
<>
<SubTitle title="To"/>
{to.map(item => {
const { ipBlock } = item;
const { ipBlock: { cidr, except } = {} } = item;
if (!ipBlock) return;
const { cidr, except } = ipBlock;
if (!cidr) return;
if (!cidr) return null;
return (
<DrawerItem name="ipBlock" key={cidr}>
@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
import { observer } from "mobx-react";
import React from "react";
import { Table, TableHead, TableCell, TableRow } from "../table";
@@ -26,8 +26,8 @@ import { disposeOnUnmount, observer } from "mobx-react";
import { DrawerItem, DrawerTitle } from "../drawer";
import { Badge } from "../badge";
import { KubeEventDetails } from "../+events/kube-event-details";
import { KubeObjectDetailsProps } from "../kube-object";
import { Service } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { Service } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { ServicePortComponent } from "./service-port-component";
import { endpointStore } from "../+network-endpoints/endpoints.store";
@@ -51,7 +51,7 @@ export class ServiceDetails extends React.Component<Props> {
render() {
const { object: service } = this.props;
if (!service) return;
if (!service) return null;
const { spec } = service;
const endpoint = endpointStore.getByName(service.getName(), service.getNs());
@@ -23,7 +23,7 @@ import "./service-port-component.scss";
import React from "react";
import { observer } from "mobx-react";
import { Service, ServicePort } from "../../api/endpoints";
import type { Service, ServicePort } from "../../api/endpoints";
import { apiBase } from "../../api";
import { observable } from "mobx";
import { cssNames } from "../../utils";
@@ -23,9 +23,9 @@ import "./services.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import { IServicesRouteParams } from "./services.route";
import { Service } from "../../api/endpoints/service.api";
import type { RouteComponentProps } from "react-router";
import type { IServicesRouteParams } from "./services.route";
import type { Service } from "../../api/endpoints/service.api";
import { KubeObjectListLayout } from "../kube-object";
import { Badge } from "../badge";
import { serviceStore } from "./services.store";
@@ -19,12 +19,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { RouteProps } from "react-router";
import type { RouteProps } from "react-router";
import { endpointRoute } from "../+network-endpoints";
import { ingressRoute } from "../+network-ingresses";
import { networkPoliciesRoute } from "../+network-policies";
import { servicesRoute, servicesURL } from "../+network-services";
import { IURLParams } from "../../../common/utils/buildUrl";
import type { IURLParams } from "../../../common/utils/buildUrl";
export const networkRoute: RouteProps = {
path: [
@@ -20,13 +20,13 @@
*/
import React, { useContext } from "react";
import { IClusterMetrics, Node } from "../../api/endpoints";
import type { IClusterMetrics, Node } from "../../api/endpoints";
import { BarChart, cpuOptions, memoryOptions } from "../chart";
import { isMetricsEmpty, normalizeMetrics } from "../../api/endpoints/metrics.api";
import { NoMetrics } from "../resource-metrics/no-metrics";
import { IResourceMetricsValue, ResourceMetricsContext } from "../resource-metrics";
import { observer } from "mobx-react";
import { ChartOptions, ChartPoint } from "chart.js";
import type { ChartOptions, ChartPoint } from "chart.js";
import { ThemeStore } from "../../theme.store";
import { mapValues } from "lodash";
@@ -30,8 +30,8 @@ import { Badge } from "../badge";
import { nodesStore } from "./nodes.store";
import { ResourceMetrics } from "../resource-metrics";
import { podsStore } from "../+workloads-pods/pods.store";
import { KubeObjectDetailsProps } from "../kube-object";
import { Node } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { Node } from "../../api/endpoints";
import { NodeCharts } from "./node-charts";
import { reaction } from "mobx";
import { PodDetailsList } from "../+workloads-pods/pod-details-list";
@@ -62,7 +62,7 @@ export class NodeDetails extends React.Component<Props> {
render() {
const { object: node } = this.props;
if (!node) return;
if (!node) return null;
const { status } = node;
const { nodeInfo, addresses, capacity, allocatable } = status;
const conditions = node.getActiveConditions();
@@ -62,7 +62,7 @@ export class NodesStore extends KubeObjectStore<Node> {
getLastMetricValues(node: Node, metricNames: string[]): number[] {
if (!this.metricsLoaded) {
return;
return [];
}
const nodeName = node.getName();
+5 -5
View File
@@ -22,14 +22,14 @@
import "./nodes.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { cssNames, interval } from "../../utils";
import { TabLayout } from "../layout/tab-layout";
import { nodesStore } from "./nodes.store";
import { podsStore } from "../+workloads-pods/pods.store";
import { KubeObjectListLayout } from "../kube-object";
import { INodesRouteParams } from "./nodes.route";
import { Node } from "../../api/endpoints/nodes.api";
import type { INodesRouteParams } from "./nodes.route";
import type { Node } from "../../api/endpoints/nodes.api";
import { LineProgress } from "../line-progress";
import { bytesToUnits } from "../../utils/convertMemory";
import { Tooltip, TooltipPosition } from "../tooltip";
@@ -73,8 +73,8 @@ export class Nodes extends React.Component<Props> {
const usage = metrics[0];
const cores = metrics[1];
const cpuUsagePercent = Math.ceil(usage * 100) / cores;
const cpuUsagePercentLabel: String = cpuUsagePercent % 1 === 0
? cpuUsagePercent.toString()
const cpuUsagePercentLabel: String = cpuUsagePercent % 1 === 0
? cpuUsagePercent.toString()
: cpuUsagePercent.toFixed(2);
return (
@@ -25,7 +25,7 @@ import React from "react";
import { observer } from "mobx-react";
import { KubeObjectListLayout } from "../kube-object";
import { podSecurityPoliciesStore } from "./pod-security-policies.store";
import { PodSecurityPolicy } from "../../api/endpoints";
import type { PodSecurityPolicy } from "../../api/endpoints";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
enum columnId {
@@ -24,8 +24,8 @@ import "./pod-security-policy-details.scss";
import React from "react";
import { observer } from "mobx-react";
import { DrawerItem, DrawerTitle } from "../drawer";
import { KubeObjectDetailsProps } from "../kube-object";
import { PodSecurityPolicy } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { PodSecurityPolicy } from "../../api/endpoints";
import { Badge } from "../badge";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
@@ -42,7 +42,7 @@ export class PodSecurityPolicyDetails extends React.Component<Props> {
rule: string;
ranges?: { max: number; min: number }[];
}) {
if (!group) return;
if (!group) return null;
const { rule, ranges } = group;
return (
@@ -27,8 +27,8 @@ import { DrawerItem, DrawerTitle } from "../drawer";
import { Badge } from "../badge";
import { KubeEventDetails } from "../+events/kube-event-details";
import { observer } from "mobx-react";
import { KubeObjectDetailsProps } from "../kube-object";
import { StorageClass } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { StorageClass } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
import { storageClassStore } from "./storage-class.store";
@@ -22,11 +22,11 @@
import "./storage-classes.scss";
import React from "react";
import { RouteComponentProps } from "react-router-dom";
import type { RouteComponentProps } from "react-router-dom";
import { observer } from "mobx-react";
import { StorageClass } from "../../api/endpoints/storage-class.api";
import type { StorageClass } from "../../api/endpoints/storage-class.api";
import { KubeObjectListLayout } from "../kube-object";
import { IStorageClassesRouteParams } from "./storage-classes.route";
import type { IStorageClassesRouteParams } from "./storage-classes.route";
import { storageClassStore } from "./storage-class.store";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -33,7 +33,7 @@ import { volumeClaimStore } from "./volume-claim.store";
import { ResourceMetrics } from "../resource-metrics";
import { VolumeClaimDiskChart } from "./volume-claim-disk-chart";
import { getDetailsUrl, KubeObjectDetailsProps, KubeObjectMeta } from "../kube-object";
import { PersistentVolumeClaim } from "../../api/endpoints";
import type { PersistentVolumeClaim } from "../../api/endpoints";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
import { ResourceType } from "../cluster-settings/components/cluster-metrics-setting";
import { ClusterStore } from "../../../common/cluster-store";
@@ -21,7 +21,7 @@
import React, { useContext } from "react";
import { observer } from "mobx-react";
import { IPvcMetrics, PersistentVolumeClaim } from "../../api/endpoints";
import type { IPvcMetrics, PersistentVolumeClaim } from "../../api/endpoints";
import { BarChart, ChartDataSets, memoryOptions } from "../chart";
import { isMetricsEmpty, normalizeMetrics } from "../../api/endpoints/metrics.api";
import { NoMetrics } from "../resource-metrics/no-metrics";
@@ -25,10 +25,10 @@ import React from "react";
import { observer } from "mobx-react";
import { Link, RouteComponentProps } from "react-router-dom";
import { volumeClaimStore } from "./volume-claim.store";
import { PersistentVolumeClaim } from "../../api/endpoints/persistent-volume-claims.api";
import type { PersistentVolumeClaim } from "../../api/endpoints/persistent-volume-claims.api";
import { podsStore } from "../+workloads-pods/pods.store";
import { getDetailsUrl, KubeObjectListLayout } from "../kube-object";
import { IVolumeClaimsRouteParams } from "./volume-claims.route";
import type { IVolumeClaimsRouteParams } from "./volume-claims.route";
import { unitsToBytes } from "../../utils/convertMemory";
import { stopPropagation } from "../../utils";
import { storageClassApi } from "../../api/endpoints";
@@ -23,7 +23,7 @@ import "./volume-details-list.scss";
import React from "react";
import { observer } from "mobx-react";
import { PersistentVolume } from "../../api/endpoints/persistent-volume.api";
import type { PersistentVolume } from "../../api/endpoints/persistent-volume.api";
import { autobind } from "../../../common/utils/autobind";
import { TableRow } from "../table/table-row";
import { cssNames, prevDefault } from "../../utils";
@@ -23,7 +23,7 @@ import { KubeObjectStore } from "../../kube-object.store";
import { autobind } from "../../utils";
import { PersistentVolume, persistentVolumeApi } from "../../api/endpoints/persistent-volume.api";
import { apiManager } from "../../api/api-manager";
import { StorageClass } from "../../api/endpoints/storage-class.api";
import type { StorageClass } from "../../api/endpoints/storage-class.api";
@autobind()
export class PersistentVolumesStore extends KubeObjectStore<PersistentVolume> {
@@ -24,9 +24,9 @@ import "./volumes.scss";
import React from "react";
import { observer } from "mobx-react";
import { Link, RouteComponentProps } from "react-router-dom";
import { PersistentVolume } from "../../api/endpoints/persistent-volume.api";
import type { PersistentVolume } from "../../api/endpoints/persistent-volume.api";
import { getDetailsUrl, KubeObjectListLayout } from "../kube-object";
import { IVolumesRouteParams } from "./volumes.route";
import type { IVolumesRouteParams } from "./volumes.route";
import { stopPropagation } from "../../utils";
import { volumesStore } from "./volumes.store";
import { pvcApi, storageClassApi } from "../../api/endpoints";
@@ -19,11 +19,11 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { RouteProps } from "react-router";
import type { RouteProps } from "react-router";
import { storageClassesRoute } from "../+storage-classes";
import { volumeClaimsRoute, volumeClaimsURL } from "../+storage-volume-claims";
import { volumesRoute } from "../+storage-volumes";
import { IURLParams } from "../../../common/utils/buildUrl";
import type { IURLParams } from "../../../common/utils/buildUrl";
export const storageRoute: RouteProps = {
path: [
@@ -40,7 +40,7 @@ import { namespaceStore } from "../+namespaces/namespace.store";
import { serviceAccountsStore } from "../+user-management-service-accounts/service-accounts.store";
import { roleBindingsStore } from "./role-bindings.store";
import { showDetails } from "../kube-object";
import { KubeObjectStore } from "../../kube-object.store";
import type { KubeObjectStore } from "../../kube-object.store";
interface BindingSelectOption extends SelectOption {
value: string; // binding name
@@ -23,7 +23,7 @@ import "./role-binding-details.scss";
import React from "react";
import { AddRemoveButtons } from "../add-remove-buttons";
import { IRoleBindingSubject, RoleBinding } from "../../api/endpoints";
import type { IRoleBindingSubject, RoleBinding } from "../../api/endpoints";
import { autobind, prevDefault } from "../../utils";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { ConfirmDialog } from "../confirm-dialog";
@@ -33,7 +33,7 @@ import { disposeOnUnmount, observer } from "mobx-react";
import { observable, reaction } from "mobx";
import { roleBindingsStore } from "./role-bindings.store";
import { AddRoleBindingDialog } from "./add-role-binding-dialog";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -23,9 +23,9 @@ import "./role-bindings.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import { IRoleBindingsRouteParams } from "../+user-management/user-management.route";
import { RoleBinding } from "../../api/endpoints";
import type { RouteComponentProps } from "react-router";
import type { IRoleBindingsRouteParams } from "../+user-management/user-management.route";
import type { RoleBinding } from "../../api/endpoints";
import { roleBindingsStore } from "./role-bindings.store";
import { KubeObjectListLayout } from "../kube-object";
import { AddRoleBindingDialog } from "./add-role-binding-dialog";
@@ -25,8 +25,8 @@ import React from "react";
import { DrawerTitle } from "../drawer";
import { KubeEventDetails } from "../+events/kube-event-details";
import { observer } from "mobx-react";
import { KubeObjectDetailsProps } from "../kube-object";
import { Role } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { Role } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -38,7 +38,7 @@ export class RoleDetails extends React.Component<Props> {
render() {
const { object: role } = this.props;
if (!role) return;
if (!role) return null;
const rules = role.getRules();
return (
@@ -23,10 +23,10 @@ import "./roles.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import { IRolesRouteParams } from "../+user-management/user-management.route";
import type { RouteComponentProps } from "react-router";
import type { IRolesRouteParams } from "../+user-management/user-management.route";
import { rolesStore } from "./roles.store";
import { Role } from "../../api/endpoints";
import type { Role } from "../../api/endpoints";
import { KubeObjectListLayout } from "../kube-object";
import { AddRoleDialog } from "./add-role-dialog";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -24,7 +24,7 @@ import "./service-accounts-secret.scss";
import React from "react";
import moment from "moment";
import { Icon } from "../icon";
import { Secret } from "../../api/endpoints/secret.api";
import type { Secret } from "../../api/endpoints/secret.api";
import { prevDefault } from "../../utils";
interface Props {
@@ -23,14 +23,14 @@ import "./service-accounts.scss";
import React from "react";
import { observer } from "mobx-react";
import { ServiceAccount } from "../../api/endpoints/service-accounts.api";
import { RouteComponentProps } from "react-router";
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import type { ServiceAccount } from "../../api/endpoints/service-accounts.api";
import type { RouteComponentProps } from "react-router";
import type { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import { MenuItem } from "../menu";
import { openServiceAccountKubeConfig } from "../kubeconfig-dialog";
import { Icon } from "../icon";
import { KubeObjectListLayout } from "../kube-object";
import { IServiceAccountsRouteParams } from "../+user-management";
import type { IServiceAccountsRouteParams } from "../+user-management";
import { serviceAccountsStore } from "./service-accounts.store";
import { CreateServiceAccountDialog } from "./create-service-account-dialog";
import { kubeObjectMenuRegistry } from "../../../extensions/registries/kube-object-menu-registry";
@@ -31,7 +31,7 @@ import { Link } from "react-router-dom";
import { KubeEventDetails } from "../+events/kube-event-details";
import { cronJobStore } from "./cronjob.store";
import { getDetailsUrl, KubeObjectDetailsProps } from "../kube-object";
import { CronJob, Job } from "../../api/endpoints";
import type { CronJob, Job } from "../../api/endpoints";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
@@ -23,15 +23,15 @@ import "./cronjobs.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { CronJob, cronJobApi } from "../../api/endpoints/cron-job.api";
import { MenuItem } from "../menu";
import { Icon } from "../icon";
import { cronJobStore } from "./cronjob.store";
import { jobStore } from "../+workloads-jobs/job.store";
import { eventStore } from "../+events/event.store";
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import { ICronJobsRouteParams } from "../+workloads";
import type { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import type { ICronJobsRouteParams } from "../+workloads";
import { KubeObjectListLayout } from "../kube-object";
import { CronJobTriggerDialog } from "./cronjob-trigger-dialog";
import { kubeObjectMenuRegistry } from "../../../extensions/registries/kube-object-menu-registry";
@@ -31,8 +31,8 @@ import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities"
import { KubeEventDetails } from "../+events/kube-event-details";
import { daemonSetStore } from "./daemonsets.store";
import { podsStore } from "../+workloads-pods/pods.store";
import { KubeObjectDetailsProps } from "../kube-object";
import { DaemonSet } from "../../api/endpoints";
import type { KubeObjectDetailsProps } from "../kube-object";
import type { DaemonSet } from "../../api/endpoints";
import { ResourceMetrics, ResourceMetricsText } from "../resource-metrics";
import { PodCharts, podMetricTabs } from "../+workloads-pods/pod-charts";
import { reaction } from "mobx";
@@ -23,14 +23,14 @@ import "./daemonsets.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import { DaemonSet } from "../../api/endpoints";
import type { RouteComponentProps } from "react-router";
import type { DaemonSet } from "../../api/endpoints";
import { eventStore } from "../+events/event.store";
import { daemonSetStore } from "./daemonsets.store";
import { podsStore } from "../+workloads-pods/pods.store";
import { nodesStore } from "../+nodes/nodes.store";
import { KubeObjectListLayout } from "../kube-object";
import { IDaemonSetsRouteParams } from "../+workloads";
import type { IDaemonSetsRouteParams } from "../+workloads";
import { Badge } from "../badge";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -26,13 +26,13 @@ import kebabCase from "lodash/kebabCase";
import { disposeOnUnmount, observer } from "mobx-react";
import { DrawerItem } from "../drawer";
import { Badge } from "../badge";
import { Deployment } from "../../api/endpoints";
import type { Deployment } from "../../api/endpoints";
import { cssNames } from "../../utils";
import { PodDetailsTolerations } from "../+workloads-pods/pod-details-tolerations";
import { PodDetailsAffinities } from "../+workloads-pods/pod-details-affinities";
import { KubeEventDetails } from "../+events/kube-event-details";
import { podsStore } from "../+workloads-pods/pods.store";
import { KubeObjectDetailsProps } from "../kube-object";
import type { KubeObjectDetailsProps } from "../kube-object";
import { ResourceMetrics, ResourceMetricsText } from "../resource-metrics";
import { deploymentStore } from "./deployments.store";
import { PodCharts, podMetricTabs } from "../+workloads-pods/pod-charts";
@@ -23,7 +23,7 @@ import "./deployment-replicasets.scss";
import React from "react";
import { observer } from "mobx-react";
import { ReplicaSet } from "../../api/endpoints";
import type { ReplicaSet } from "../../api/endpoints";
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import { Spinner } from "../spinner";
import { prevDefault, stopPropagation } from "../../utils";
@@ -23,9 +23,9 @@ import "./deployments.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { Deployment, deploymentApi } from "../../api/endpoints";
import { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import type { KubeObjectMenuProps } from "../kube-object/kube-object-menu";
import { MenuItem } from "../menu";
import { Icon } from "../icon";
import { DeploymentScaleDialog } from "./deployment-scale-dialog";
@@ -36,7 +36,7 @@ import { podsStore } from "../+workloads-pods/pods.store";
import { nodesStore } from "../+nodes/nodes.store";
import { eventStore } from "../+events/event.store";
import { KubeObjectListLayout } from "../kube-object";
import { IDeploymentsRouteParams } from "../+workloads";
import type { IDeploymentsRouteParams } from "../+workloads";
import { cssNames } from "../../utils";
import kebabCase from "lodash/kebabCase";
import orderBy from "lodash/orderBy";
@@ -34,7 +34,7 @@ import { KubeEventDetails } from "../+events/kube-event-details";
import { podsStore } from "../+workloads-pods/pods.store";
import { jobStore } from "./job.store";
import { getDetailsUrl, KubeObjectDetailsProps } from "../kube-object";
import { Job } from "../../api/endpoints";
import type { Job } from "../../api/endpoints";
import { PodDetailsList } from "../+workloads-pods/pod-details-list";
import { lookupApiLink } from "../../api/kube-api";
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
@@ -23,13 +23,13 @@ import "./jobs.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { podsStore } from "../+workloads-pods/pods.store";
import { jobStore } from "./job.store";
import { eventStore } from "../+events/event.store";
import { Job } from "../../api/endpoints/job.api";
import type { Job } from "../../api/endpoints/job.api";
import { KubeObjectListLayout } from "../kube-object";
import { IJobsRouteParams } from "../+workloads";
import type { IJobsRouteParams } from "../+workloads";
import kebabCase from "lodash/kebabCase";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -28,7 +28,7 @@ import { observable } from "mobx";
import { observer } from "mobx-react";
import { PieChart } from "../chart";
import { cssVar } from "../../utils";
import { ChartData, ChartDataSets } from "chart.js";
import type { ChartData, ChartDataSets } from "chart.js";
import { ThemeStore } from "../../theme.store";
interface SimpleChartDataSets extends ChartDataSets {
@@ -24,8 +24,8 @@ import "./overview.scss";
import React from "react";
import { disposeOnUnmount, observer } from "mobx-react";
import { OverviewStatuses } from "./overview-statuses";
import { RouteComponentProps } from "react-router";
import { IWorkloadsOverviewRouteParams } from "../+workloads";
import type { RouteComponentProps } from "react-router";
import type { IWorkloadsOverviewRouteParams } from "../+workloads";
import { eventStore } from "../+events/event.store";
import { podsStore } from "../+workloads-pods/pods.store";
import { deploymentStore } from "../+workloads-deployments/deployments.store";
@@ -22,9 +22,15 @@
import React from "react";
import "@testing-library/jest-dom/extend-expect";
import { fireEvent, render } from "@testing-library/react";
import { IToleration } from "../../../api/workload-kube-object";
import type { IToleration } from "../../../api/workload-kube-object";
import { PodTolerations } from "../pod-tolerations";
jest.mock("electron", () => ({
app: {
getPath: () => "/foo",
},
}));
const tolerations: IToleration[] =[
{
key: "CriticalAddonsOnly",
@@ -21,7 +21,7 @@
import React, { useContext } from "react";
import { observer } from "mobx-react";
import { IPodMetrics } from "../../api/endpoints";
import type { IPodMetrics } from "../../api/endpoints";
import { BarChart, cpuOptions, memoryOptions } from "../chart";
import { isMetricsEmpty, normalizeMetrics } from "../../api/endpoints/metrics.api";
import { NoMetrics } from "../resource-metrics/no-metrics";
@@ -21,12 +21,12 @@
import React, { useContext } from "react";
import { observer } from "mobx-react";
import { IPodMetrics } from "../../api/endpoints";
import type { IPodMetrics } from "../../api/endpoints";
import { BarChart, cpuOptions, memoryOptions } from "../chart";
import { isMetricsEmpty, normalizeMetrics } from "../../api/endpoints/metrics.api";
import { NoMetrics } from "../resource-metrics/no-metrics";
import { IResourceMetricsValue, ResourceMetricsContext } from "../resource-metrics";
import { WorkloadKubeObject } from "../../api/workload-kube-object";
import type { WorkloadKubeObject } from "../../api/workload-kube-object";
import { ThemeStore } from "../../theme.store";
export const podMetricTabs = [
@@ -23,13 +23,13 @@ import "./pod-container-env.scss";
import React, { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { IPodContainer, Secret } from "../../api/endpoints";
import type { IPodContainer, Secret } from "../../api/endpoints";
import { DrawerItem } from "../drawer";
import { autorun } from "mobx";
import { secretsStore } from "../+config-secrets/secrets.store";
import { configMapsStore } from "../+config-maps/config-maps.store";
import { Icon } from "../icon";
import { base64, cssNames } from "../../utils";
import { base64, cssNames, iter } from "../../utils";
import _ from "lodash";
interface Props {
@@ -113,21 +113,23 @@ export const ContainerEnvironment = observer((props: Props) => {
};
const renderEnvFrom = () => {
const envVars = envFrom.map(vars => {
return Array.from(iter.filterFlatMap(envFrom, vars => {
if (vars.configMapRef?.name) {
return renderEnvFromConfigMap(vars.configMapRef.name);
} else if (vars.secretRef?.name ) {
}
if (vars.secretRef?.name) {
return renderEnvFromSecret(vars.secretRef.name);
}
});
return _.flatten(envVars);
return null;
}));
};
const renderEnvFromConfigMap = (configMapName: string) => {
const configMap = configMapsStore.getByName(configMapName, namespace);
if (!configMap) return;
if (!configMap) return null;
return Object.entries(configMap.data).map(([name, value]) => (
<div className="variable" key={name}>
@@ -139,7 +141,7 @@ export const ContainerEnvironment = observer((props: Props) => {
const renderEnvFromSecret = (secretName: string) => {
const secret = secretsStore.getByName(secretName, namespace);
if (!secret) return;
if (!secret) return null;
return Object.keys(secret.data).map(key => {
const secretKeyRef = {
@@ -23,7 +23,7 @@ import "./pod-container-port.scss";
import React from "react";
import { observer } from "mobx-react";
import { Pod } from "../../api/endpoints";
import type { Pod } from "../../api/endpoints";
import { apiBase } from "../../api";
import { observable } from "mobx";
import { cssNames } from "../../utils";
@@ -24,7 +24,7 @@ import React from "react";
import jsYaml from "js-yaml";
import { AceEditor } from "../ace-editor";
import { DrawerParamToggler, DrawerItem } from "../drawer";
import { Pod, Deployment, DaemonSet, StatefulSet, ReplicaSet, Job } from "../../api/endpoints";
import type { Pod, Deployment, DaemonSet, StatefulSet, ReplicaSet, Job } from "../../api/endpoints";
interface Props {
workload: Pod | Deployment | DaemonSet | StatefulSet | ReplicaSet | Job;
@@ -22,7 +22,7 @@
import "./pod-details-container.scss";
import React from "react";
import { IPodContainer, IPodContainerStatus, Pod } from "../../api/endpoints";
import type { IPodContainer, IPodContainerStatus, Pod } from "../../api/endpoints";
import { DrawerItem } from "../drawer";
import { cssNames } from "../../utils";
import { StatusBrick } from "../status-brick";
@@ -30,7 +30,7 @@ import { Badge } from "../badge";
import { ContainerEnvironment } from "./pod-container-env";
import { PodContainerPort } from "./pod-container-port";
import { ResourceMetrics } from "../resource-metrics";
import { IMetrics } from "../../api/endpoints/metrics.api";
import type { IMetrics } from "../../api/endpoints/metrics.api";
import { ContainerCharts } from "./container-charts";
import { ResourceType } from "../cluster-settings/components/cluster-metrics-setting";
import { LocaleDate } from "../locale-date";
@@ -66,6 +66,8 @@ export class PodDetailsContainer extends React.Component<Props> {
</span>
);
}
return null;
}
render() {
@@ -26,10 +26,10 @@ import kebabCase from "lodash/kebabCase";
import { reaction } from "mobx";
import { disposeOnUnmount, observer } from "mobx-react";
import { podsStore } from "./pods.store";
import { Pod } from "../../api/endpoints";
import type { Pod } from "../../api/endpoints";
import { autobind, bytesToUnits, cssNames, interval, prevDefault } from "../../utils";
import { LineProgress } from "../line-progress";
import { KubeObject } from "../../api/kube-object";
import type { KubeObject } from "../../api/kube-object";
import { Table, TableCell, TableHead, TableRow } from "../table";
import { Spinner } from "../spinner";
import { DrawerTitle } from "../drawer";
@@ -23,7 +23,7 @@ import "./pod-details-statuses.scss";
import React from "react";
import countBy from "lodash/countBy";
import kebabCase from "lodash/kebabCase";
import { Pod } from "../../api/endpoints";
import type { Pod } from "../../api/endpoints";
interface Props {
pods: Pod[];
@@ -22,7 +22,7 @@
import "./pod-details-tolerations.scss";
import React from "react";
import { DrawerParamToggler, DrawerItem } from "../drawer";
import { WorkloadKubeObject } from "../../api/workload-kube-object";
import type { WorkloadKubeObject } from "../../api/workload-kube-object";
import { PodTolerations } from "./pod-tolerations";
interface Props {
@@ -176,7 +176,7 @@ export class PodDetails extends React.Component<Props> {
key={name}
pod={pod}
container={container}
metrics={metrics}
metrics={metrics || null}
/>
);
})
@@ -23,7 +23,7 @@ import "./pod-tolerations.scss";
import React from "react";
import uniqueId from "lodash/uniqueId";
import { IToleration } from "../../api/workload-kube-object";
import type { IToleration } from "../../api/workload-kube-object";
import { Table, TableCell, TableHead, TableRow } from "../table";
interface Props {
@@ -25,7 +25,7 @@ import { KubeObjectStore } from "../../kube-object.store";
import { autobind, cpuUnitsToNumber, unitsToBytes } from "../../utils";
import { IPodMetrics, Pod, PodMetrics, podMetricsApi, podsApi } from "../../api/endpoints";
import { apiManager } from "../../api/api-manager";
import { WorkloadKubeObject } from "../../api/workload-kube-object";
import type { WorkloadKubeObject } from "../../api/workload-kube-object";
@autobind()
export class PodsStore extends KubeObjectStore<Pod> {
@@ -59,8 +59,6 @@ export class PodsStore extends KubeObjectStore<Pod> {
return this.items.filter(pod => {
const owners = pod.getOwnerRefs();
if (!owners.length) return;
return owners.find(owner => owner.uid === workload.getId());
});
}
@@ -25,9 +25,9 @@ import React, { Fragment } from "react";
import { observer } from "mobx-react";
import { Link } from "react-router-dom";
import { podsStore } from "./pods.store";
import { RouteComponentProps } from "react-router";
import type { RouteComponentProps } from "react-router";
import { volumeClaimStore } from "../+storage-volume-claims/volume-claim.store";
import { IPodsRouteParams } from "../+workloads";
import type { IPodsRouteParams } from "../+workloads";
import { eventStore } from "../+events/event.store";
import { getDetailsUrl, KubeObjectListLayout } from "../kube-object";
import { nodesApi, Pod } from "../../api/endpoints";
Loaded 100 of 287 files, more files were not shown because too many files have changed in this diff. Show more