Remove lingui (#1874)

* remove lingui

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* babelless

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* tweak ts-loader options

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* tweak renderer webpack config

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-12-29 14:53:34 +02:00
1 parent 050603a7b3
commit a03da3c572
163 files changed
+1140 -12003

No files matched your search

@@ -3,7 +3,6 @@ import "./cluster-issues.scss";
import React from "react";
import { observer } from "mobx-react";
import { computed } from "mobx";
import { Trans } from "@lingui/macro";
import { Icon } from "../icon";
import { SubHeader } from "../layout/sub-header";
import { Table, TableCell, TableHead, TableRow } from "../table";
@@ -114,8 +113,8 @@ export class ClusterIssues extends React.Component<Props> {
return (
<div className="no-issues flex column box grow gaps align-center justify-center">
<div><Icon material="check" big sticker/></div>
<div className="ok-title"><Trans>No issues found</Trans></div>
<span><Trans>Everything is fine in the Cluster</Trans></span>
<div className="ok-title">No issues found</div>
<span>Everything is fine in the Cluster</span>
</div>
);
}
@@ -124,7 +123,7 @@ export class ClusterIssues extends React.Component<Props> {
<>
<SubHeader>
<Icon material="error_outline"/>{" "}
<Trans>Warnings: {warnings.length}</Trans>
<>Warnings: {warnings.length}</>
</SubHeader>
<Table
items={warnings}
@@ -137,9 +136,9 @@ export class ClusterIssues extends React.Component<Props> {
className={cssNames("box grow", themeStore.activeTheme.type)}
>
<TableHead nowrap>
<TableCell className="message"><Trans>Message</Trans></TableCell>
<TableCell className="object" sortBy={sortBy.object}><Trans>Object</Trans></TableCell>
<TableCell className="kind" sortBy={sortBy.type}><Trans>Type</Trans></TableCell>
<TableCell className="message">Message</TableCell>
<TableCell className="object" sortBy={sortBy.object}>Object</TableCell>
<TableCell className="kind" sortBy={sortBy.type}>Type</TableCell>
</TableHead>
</Table>
</>
@@ -1,7 +1,6 @@
import "./cluster-metric-switchers.scss";
import React from "react";
import { Trans } from "@lingui/macro";
import { observer } from "mobx-react";
import { nodesStore } from "../+nodes/nodes.store";
import { cssNames } from "../../utils";
@@ -24,8 +23,8 @@ export const ClusterMetricSwitchers = observer(() => {
value={metricNodeRole}
onChange={(metric: MetricNodeRole) => clusterOverviewStore.metricNodeRole = metric}
>
<Radio label={<Trans>Master</Trans>} value={MetricNodeRole.MASTER}/>
<Radio label={<Trans>Worker</Trans>} value={MetricNodeRole.WORKER}/>
<Radio label="Master" value={MetricNodeRole.MASTER}/>
<Radio label="Worker" value={MetricNodeRole.WORKER}/>
</RadioGroup>
</div>
<div className="box grow metric-switch">
@@ -35,10 +34,10 @@ export const ClusterMetricSwitchers = observer(() => {
value={metricType}
onChange={(value: MetricType) => clusterOverviewStore.metricType = value}
>
<Radio label={<Trans>CPU</Trans>} value={MetricType.CPU}/>
<Radio label={<Trans>Memory</Trans>} value={MetricType.MEMORY}/>
<Radio label="CPU" value={MetricType.CPU}/>
<Radio label="Memory" value={MetricType.MEMORY}/>
</RadioGroup>
</div>
</div>
);
});
});
@@ -1,6 +1,5 @@
import React from "react";
import { Icon } from "../icon";
import { Trans } from "@lingui/macro";
import { cssNames } from "../../utils";
interface Props {
@@ -11,8 +10,8 @@ export function ClusterNoMetrics({ className }: Props) {
return (
<div className={cssNames("ClusterNoMetrics flex column box grow justify-center align-center", className)}>
<Icon material="info"/>
<p><Trans>Metrics are not available due to missing or invalid Prometheus configuration.</Trans></p>
<p><Trans>Right click cluster icon to open cluster settings.</Trans></p>
<p>Metrics are not available due to missing or invalid Prometheus configuration.</p>
<p>Right click cluster icon to open cluster settings.</p>
</div>
);
}
@@ -2,8 +2,6 @@ import "./cluster-pie-charts.scss";
import React from "react";
import { observer } from "mobx-react";
import { t, Trans } from "@lingui/macro";
import { useLingui } from "@lingui/react";
import { clusterOverviewStore, MetricNodeRole } from "./cluster-overview.store";
import { Spinner } from "../spinner";
import { Icon } from "../icon";
@@ -15,13 +13,11 @@ import { themeStore } from "../../theme.store";
import { getMetricLastPoints } from "../../api/endpoints/metrics.api";
export const ClusterPieCharts = observer(() => {
const { i18n } = useLingui();
const renderLimitWarning = () => {
return (
<div className="node-warning flex gaps align-center">
<Icon material="info"/>
<p><Trans>Specified limits are higher than node capacity!</Trans></p>
<p>Specified limits are higher than node capacity!</p>
</div>
);
};
@@ -73,10 +69,10 @@ export const ClusterPieCharts = observer(() => {
},
],
labels: [
`${i18n._(t`Usage`)}: ${cpuUsage ? cpuUsage.toFixed(2) : "N/A"}`,
`${i18n._(t`Requests`)}: ${cpuRequests ? cpuRequests.toFixed(2) : "N/A"}`,
`${i18n._(t`Limits`)}: ${cpuLimits ? cpuLimits.toFixed(2) : "N/A"}`,
`${i18n._(t`Capacity`)}: ${cpuCapacity || "N/A"}`
`Usage: ${cpuUsage ? cpuUsage.toFixed(2) : "N/A"}`,
`Requests: ${cpuRequests ? cpuRequests.toFixed(2) : "N/A"}`,
`Limits: ${cpuLimits ? cpuLimits.toFixed(2) : "N/A"}`,
`Capacity: ${cpuCapacity || "N/A"}`
]
};
const memoryData: ChartData = {
@@ -116,10 +112,10 @@ export const ClusterPieCharts = observer(() => {
},
],
labels: [
`${i18n._(t`Usage`)}: ${bytesToUnits(memoryUsage)}`,
`${i18n._(t`Requests`)}: ${bytesToUnits(memoryRequests)}`,
`${i18n._(t`Limits`)}: ${bytesToUnits(memoryLimits)}`,
`${i18n._(t`Capacity`)}: ${bytesToUnits(memoryCapacity)}`,
`Usage: ${bytesToUnits(memoryUsage)}`,
`Requests: ${bytesToUnits(memoryRequests)}`,
`Limits: ${bytesToUnits(memoryLimits)}`,
`Capacity: ${bytesToUnits(memoryCapacity)}`,
]
};
const podsData: ChartData = {
@@ -137,8 +133,8 @@ export const ClusterPieCharts = observer(() => {
},
],
labels: [
`${i18n._(t`Usage`)}: ${podUsage || 0}`,
`${i18n._(t`Capacity`)}: ${podCapacity}`,
`Usage: ${podUsage || 0}`,
`Capacity: ${podCapacity}`,
]
};
@@ -147,7 +143,7 @@ export const ClusterPieCharts = observer(() => {
<div className="chart flex column align-center box grow">
<PieChart
data={cpuData}
title={i18n._(t`CPU`)}
title={`CPU`}
legendColors={["#c93dce", "#4caf50", "#3d90ce", defaultColor]}
/>
{cpuLimitsOverload && renderLimitWarning()}
@@ -155,7 +151,7 @@ export const ClusterPieCharts = observer(() => {
<div className="chart flex column align-center box grow">
<PieChart
data={memoryData}
title={i18n._(t`Memory`)}
title={`Memory`}
legendColors={["#c93dce", "#4caf50", "#3d90ce", defaultColor]}
/>
{memoryLimitsOverload && renderLimitWarning()}
@@ -163,7 +159,7 @@ export const ClusterPieCharts = observer(() => {
<div className="chart flex column align-center box grow">
<PieChart
data={podsData}
title={i18n._(t`Pods`)}
title={`Pods`}
legendColors={["#4caf50", defaultColor]}
/>
</div>
@@ -180,7 +176,7 @@ export const ClusterPieCharts = observer(() => {
return (
<div className="empty flex column box grow align-center justify-center">
<Icon material="info"/>
<Trans>No Nodes Available.</Trans>
No Nodes Available.
</div>
);
}
@@ -206,4 +202,4 @@ export const ClusterPieCharts = observer(() => {
{renderContent()}
</div>
);
});
});