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

+20 -22
View File
@@ -1,5 +1,4 @@
import React, { useContext } from "react";
import { t } from "@lingui/macro";
import { IClusterMetrics, Node } from "../../api/endpoints";
import { BarChart, cpuOptions, memoryOptions } from "../chart";
import { isMetricsEmpty, normalizeMetrics } from "../../api/endpoints/metrics.api";
@@ -8,7 +7,6 @@ import { IResourceMetricsValue, ResourceMetricsContext } from "../resource-metri
import { observer } from "mobx-react";
import { ChartOptions, ChartPoint } from "chart.js";
import { themeStore } from "../../theme.store";
import { _i18n } from "../../i18n";
type IContext = IResourceMetricsValue<Node, { metrics: IClusterMetrics }>;
@@ -43,22 +41,22 @@ export const NodeCharts = observer(() => {
[
{
id: `${id}-cpuUsage`,
label: _i18n._(t`Usage`),
tooltip: _i18n._(t`CPU cores usage`),
label: `Usage`,
tooltip: `CPU cores usage`,
borderColor: "#3D90CE",
data: cpuUsage.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-cpuRequests`,
label: _i18n._(t`Requests`),
tooltip: _i18n._(t`CPU requests`),
label: `Requests`,
tooltip: `CPU requests`,
borderColor: "#30b24d",
data: cpuRequests.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-cpuCapacity`,
label: _i18n._(t`Capacity`),
tooltip: _i18n._(t`CPU capacity`),
label: `Capacity`,
tooltip: `CPU capacity`,
borderColor: chartCapacityColor,
data: cpuCapacity.map(([x, y]) => ({ x, y }))
}
@@ -67,22 +65,22 @@ export const NodeCharts = observer(() => {
[
{
id: `${id}-memoryUsage`,
label: _i18n._(t`Usage`),
tooltip: _i18n._(t`Memory usage`),
label: `Usage`,
tooltip: `Memory usage`,
borderColor: "#c93dce",
data: memoryUsage.map(([x, y]) => ({ x, y }))
},
{
id: "memoryRequests",
label: _i18n._(t`Requests`),
tooltip: _i18n._(t`Memory requests`),
label: `Requests`,
tooltip: `Memory requests`,
borderColor: "#30b24d",
data: memoryRequests.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-memoryCapacity`,
label: _i18n._(t`Capacity`),
tooltip: _i18n._(t`Memory capacity`),
label: `Capacity`,
tooltip: `Memory capacity`,
borderColor: chartCapacityColor,
data: memoryCapacity.map(([x, y]) => ({ x, y }))
}
@@ -91,15 +89,15 @@ export const NodeCharts = observer(() => {
[
{
id: `${id}-fsUsage`,
label: _i18n._(t`Usage`),
tooltip: _i18n._(t`Node filesystem usage in bytes`),
label: `Usage`,
tooltip: `Node filesystem usage in bytes`,
borderColor: "#ffc63d",
data: fsUsage.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-fsSize`,
label: _i18n._(t`Size`),
tooltip: _i18n._(t`Node filesystem size in bytes`),
label: `Size`,
tooltip: `Node filesystem size in bytes`,
borderColor: chartCapacityColor,
data: fsSize.map(([x, y]) => ({ x, y }))
}
@@ -108,15 +106,15 @@ export const NodeCharts = observer(() => {
[
{
id: `${id}-podUsage`,
label: _i18n._(t`Usage`),
tooltip: _i18n._(t`Number of running Pods`),
label: `Usage`,
tooltip: `Number of running Pods`,
borderColor: "#30b24d",
data: podUsage.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-podCapacity`,
label: _i18n._(t`Capacity`),
tooltip: _i18n._(t`Node Pods capacity`),
label: `Capacity`,
tooltip: `Node Pods capacity`,
borderColor: chartCapacityColor,
data: podCapacity.map(([x, y]) => ({ x, y }))
}
+22 -23
View File
@@ -4,7 +4,6 @@ import React from "react";
import upperFirst from "lodash/upperFirst";
import kebabCase from "lodash/kebabCase";
import { disposeOnUnmount, observer } from "mobx-react";
import { Trans } from "@lingui/macro";
import { DrawerItem, DrawerItemLabels } from "../drawer";
import { Badge } from "../badge";
import { nodesStore } from "./nodes.store";
@@ -50,10 +49,10 @@ export class NodeDetails extends React.Component<Props> {
const childPods = podsStore.getPodsByNode(node.getName());
const metrics = nodesStore.nodeMetrics;
const metricTabs = [
<Trans key="cpu">CPU</Trans>,
<Trans key="memory">Memory</Trans>,
<Trans key="disk">Disk</Trans>,
<Trans key="pods">Pods</Trans>,
"CPU",
"Memory",
"Disk",
"Pods",
];
return (
@@ -67,18 +66,18 @@ export class NodeDetails extends React.Component<Props> {
</ResourceMetrics>
)}
<KubeObjectMeta object={node} hideFields={["labels", "annotations", "uid", "resourceVersion", "selfLink"]}/>
<DrawerItem name={<Trans>Capacity</Trans>}>
<Trans>CPU</Trans>: {capacity.cpu},{" "}
<Trans>Memory</Trans>: {Math.floor(parseInt(capacity.memory) / 1024)}Mi,{" "}
<Trans>Pods</Trans>: {capacity.pods}
<DrawerItem name="Capacity">
CPU: {capacity.cpu},{" "}
Memory: {Math.floor(parseInt(capacity.memory) / 1024)}Mi,{" "}
Pods: {capacity.pods}
</DrawerItem>
<DrawerItem name={<Trans>Allocatable</Trans>}>
<Trans>CPU</Trans>: {allocatable.cpu},{" "}
<Trans>Memory</Trans>: {Math.floor(parseInt(allocatable.memory) / 1024)}Mi,{" "}
<Trans>Pods</Trans>: {allocatable.pods}
<DrawerItem name="Allocatable">
CPU: {allocatable.cpu},{" "}
Memory: {Math.floor(parseInt(allocatable.memory) / 1024)}Mi,{" "}
Pods: {allocatable.pods}
</DrawerItem>
{addresses &&
<DrawerItem name={<Trans>Addresses</Trans>}>
<DrawerItem name="Addresses">
{
addresses.map(({ type, address }) => (
<p key={type}>{type}: {address}</p>
@@ -86,31 +85,31 @@ export class NodeDetails extends React.Component<Props> {
}
</DrawerItem>
}
<DrawerItem name={<Trans>OS</Trans>}>
<DrawerItem name="OS">
{nodeInfo.operatingSystem} ({nodeInfo.architecture})
</DrawerItem>
<DrawerItem name={<Trans>OS Image</Trans>}>
<DrawerItem name="OS Image">
{nodeInfo.osImage}
</DrawerItem>
<DrawerItem name={<Trans>Kernel version</Trans>}>
<DrawerItem name="Kernel version">
{nodeInfo.kernelVersion}
</DrawerItem>
<DrawerItem name={<Trans>Container runtime</Trans>}>
<DrawerItem name="Container runtime">
{nodeInfo.containerRuntimeVersion}
</DrawerItem>
<DrawerItem name={<Trans>Kubelet version</Trans>}>
<DrawerItem name="Kubelet version">
{nodeInfo.kubeletVersion}
</DrawerItem>
<DrawerItemLabels
name={<Trans>Labels</Trans>}
name="Labels"
labels={node.getLabels()}
/>
<DrawerItemLabels
name={<Trans>Annotations</Trans>}
name="Annotations"
labels={node.getAnnotations()}
/>
{taints.length > 0 && (
<DrawerItem name={<Trans>Taints</Trans>} labelsOnly>
<DrawerItem name="Taints" labelsOnly>
{
taints.map(({ key, effect, value }) => (
<Badge key={key} label={`${key}: ${effect}`} tooltip={value}/>
@@ -119,7 +118,7 @@ export class NodeDetails extends React.Component<Props> {
</DrawerItem>
)}
{conditions &&
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
<DrawerItem name="Conditions" className="conditions" labelsOnly>
{
conditions.map(condition => {
const { type } = condition;
+13 -15
View File
@@ -2,7 +2,6 @@ import "./nodes.scss";
import React from "react";
import { observer } from "mobx-react";
import { RouteComponentProps } from "react-router";
import { t, Trans } from "@lingui/macro";
import { cssNames, interval } from "../../utils";
import { TabLayout } from "../layout/tab-layout";
import { nodesStore } from "./nodes.store";
@@ -11,7 +10,6 @@ import { KubeObjectListLayout } from "../kube-object";
import { INodesRouteParams } from "./nodes.route";
import { Node } from "../../api/endpoints/nodes.api";
import { LineProgress } from "../line-progress";
import { _i18n } from "../../i18n";
import { bytesToUnits } from "../../utils/convertMemory";
import { Tooltip, TooltipPosition } from "../tooltip";
import kebabCase from "lodash/kebabCase";
@@ -60,7 +58,7 @@ export class Nodes extends React.Component<Props> {
value={usage}
tooltip={{
preferredPositions: TooltipPosition.BOTTOM,
children: `${_i18n._(t`CPU:`)} ${Math.ceil(usage * 100) / cores}\%, ${_i18n._(t`cores:`)} ${cores}`
children: `CPU: ${Math.ceil(usage * 100) / cores}\%, cores: ${cores}`
}}
/>
);
@@ -79,7 +77,7 @@ export class Nodes extends React.Component<Props> {
value={usage}
tooltip={{
preferredPositions: TooltipPosition.BOTTOM,
children: `${_i18n._(t`Memory:`)} ${Math.ceil(usage * 100 / capacity)}%, ${bytesToUnits(usage, 3)}`
children: `Memory: ${Math.ceil(usage * 100 / capacity)}%, ${bytesToUnits(usage, 3)}`
}}
/>
);
@@ -98,7 +96,7 @@ export class Nodes extends React.Component<Props> {
value={usage}
tooltip={{
preferredPositions: TooltipPosition.BOTTOM,
children: `${_i18n._(t`Disk:`)} ${Math.ceil(usage * 100 / capacity)}%, ${bytesToUnits(usage, 3)}`
children: `Disk: ${Math.ceil(usage * 100 / capacity)}%, ${bytesToUnits(usage, 3)}`
}}
/>
);
@@ -155,18 +153,18 @@ export class Nodes extends React.Component<Props> {
(node: Node) => node.getKubeletVersion(),
(node: Node) => node.getNodeConditionText(),
]}
renderHeaderTitle={<Trans>Nodes</Trans>}
renderHeaderTitle="Nodes"
renderTableHeader={[
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
{ title: "Name", className: "name", sortBy: sortBy.name },
{ className: "warning" },
{ title: <Trans>CPU</Trans>, className: "cpu", sortBy: sortBy.cpu },
{ title: <Trans>Memory</Trans>, className: "memory", sortBy: sortBy.memory },
{ title: <Trans>Disk</Trans>, className: "disk", sortBy: sortBy.disk },
{ title: <Trans>Taints</Trans>, className: "taints", sortBy: sortBy.taints },
{ title: <Trans>Roles</Trans>, className: "roles", sortBy: sortBy.roles },
{ title: <Trans>Version</Trans>, className: "version", sortBy: sortBy.version },
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
{ title: <Trans>Conditions</Trans>, className: "conditions", sortBy: sortBy.conditions },
{ title: "CPU", className: "cpu", sortBy: sortBy.cpu },
{ title: "Memory", className: "memory", sortBy: sortBy.memory },
{ title: "Disk", className: "disk", sortBy: sortBy.disk },
{ title: "Taints", className: "taints", sortBy: sortBy.taints },
{ title: "Roles", className: "roles", sortBy: sortBy.roles },
{ title: "Version", className: "version", sortBy: sortBy.version },
{ title: "Age", className: "age", sortBy: sortBy.age },
{ title: "Conditions", className: "conditions", sortBy: sortBy.conditions },
]}
renderTableContents={(node: Node) => {
const tooltipId = `node-taints-${node.getId()}`;