mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
1 parent
050603a7b3
commit
a03da3c572
163 files changed
+1140
-12003
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import React, { useContext } from "react";
|
||||
import { t } from "@lingui/macro";
|
||||
import { observer } from "mobx-react";
|
||||
import { ChartOptions, ChartPoint } from "chart.js";
|
||||
import { IIngressMetrics, Ingress } from "../../api/endpoints";
|
||||
@@ -7,7 +6,6 @@ import { BarChart, memoryOptions } from "../chart";
|
||||
import { normalizeMetrics, isMetricsEmpty } from "../../api/endpoints/metrics.api";
|
||||
import { NoMetrics } from "../resource-metrics/no-metrics";
|
||||
import { ResourceMetricsContext, IResourceMetricsValue } from "../resource-metrics";
|
||||
import { _i18n } from "../../i18n";
|
||||
|
||||
type IContext = IResourceMetricsValue<Ingress, { metrics: IIngressMetrics }>;
|
||||
|
||||
@@ -33,15 +31,15 @@ export const IngressCharts = observer(() => {
|
||||
[
|
||||
{
|
||||
id: `${id}-bytesSentSuccess`,
|
||||
label: _i18n._(t`Bytes sent, status 2xx`),
|
||||
tooltip: _i18n._(t`Bytes sent by Ingress controller with successful status`),
|
||||
label: `Bytes sent, status 2xx`,
|
||||
tooltip: `Bytes sent by Ingress controller with successful status`,
|
||||
borderColor: "#46cd9e",
|
||||
data: bytesSentSuccess.map(([x, y]) => ({ x, y }))
|
||||
},
|
||||
{
|
||||
id: `${id}-bytesSentFailure`,
|
||||
label: _i18n._(t`Bytes sent, status 5xx`),
|
||||
tooltip: _i18n._(t`Bytes sent by Ingress controller with error status`),
|
||||
label: `Bytes sent, status 5xx`,
|
||||
tooltip: `Bytes sent by Ingress controller with error status`,
|
||||
borderColor: "#cd465a",
|
||||
data: bytesSentFailure.map(([x, y]) => ({ x, y }))
|
||||
},
|
||||
@@ -50,15 +48,15 @@ export const IngressCharts = observer(() => {
|
||||
[
|
||||
{
|
||||
id: `${id}-requestDurationSeconds`,
|
||||
label: _i18n._(t`Request`),
|
||||
tooltip: _i18n._(t`Request duration in seconds`),
|
||||
label: `Request`,
|
||||
tooltip: `Request duration in seconds`,
|
||||
borderColor: "#48b18d",
|
||||
data: requestDurationSeconds.map(([x, y]) => ({ x, y }))
|
||||
},
|
||||
{
|
||||
id: `${id}-responseDurationSeconds`,
|
||||
label: _i18n._(t`Response`),
|
||||
tooltip: _i18n._(t`Response duration in seconds`),
|
||||
label: `Response`,
|
||||
tooltip: `Response duration in seconds`,
|
||||
borderColor: "#73ba3c",
|
||||
data: responseDurationSeconds.map(([x, y]) => ({ x, y }))
|
||||
},
|
||||
@@ -78,7 +76,7 @@ export const IngressCharts = observer(() => {
|
||||
label: ({ datasetIndex, index }, { datasets }) => {
|
||||
const { label, data } = datasets[datasetIndex];
|
||||
const value = data[index] as ChartPoint;
|
||||
const chartTooltipSec = _i18n._(t`sec`);
|
||||
const chartTooltipSec = `sec`;
|
||||
|
||||
return `${label}: ${parseFloat(value.y as string).toFixed(3)} ${chartTooltipSec}`;
|
||||
}
|
||||
@@ -95,4 +93,4 @@ export const IngressCharts = observer(() => {
|
||||
data={{ datasets: datasets[tabId] }}
|
||||
/>
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -3,7 +3,6 @@ import "./ingress-details.scss";
|
||||
import React from "react";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { reaction } from "mobx";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import { Ingress, ILoadBalancerIngress } from "../../api/endpoints";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
@@ -40,14 +39,14 @@ export class IngressDetails extends React.Component<Props> {
|
||||
<div className="rules" key={index}>
|
||||
{rule.host && (
|
||||
<div className="host-title">
|
||||
<Trans>Host: {rule.host}</Trans>
|
||||
<>Host: {rule.host}</>
|
||||
</div>
|
||||
)}
|
||||
{rule.http && (
|
||||
<Table className="paths">
|
||||
<TableHead>
|
||||
<TableCell className="path"><Trans>Path</Trans></TableCell>
|
||||
<TableCell className="backends"><Trans>Backends</Trans></TableCell>
|
||||
<TableCell className="path">Path</TableCell>
|
||||
<TableCell className="backends">Backends</TableCell>
|
||||
</TableHead>
|
||||
{
|
||||
rule.http.paths.map((path, index) => {
|
||||
@@ -78,8 +77,8 @@ export class IngressDetails extends React.Component<Props> {
|
||||
<div>
|
||||
<Table className="ingress-points">
|
||||
<TableHead>
|
||||
<TableCell className="name" ><Trans>Hostname</Trans></TableCell>
|
||||
<TableCell className="ingresspoints"><Trans>IP</Trans></TableCell>
|
||||
<TableCell className="name" >Hostname</TableCell>
|
||||
<TableCell className="ingresspoints">IP</TableCell>
|
||||
</TableHead>
|
||||
{ingressPoints.map(({hostname, ip}, index) => {
|
||||
return (
|
||||
@@ -104,8 +103,8 @@ export class IngressDetails extends React.Component<Props> {
|
||||
const ingressPoints = status?.loadBalancer?.ingress;
|
||||
const { metrics } = ingressStore;
|
||||
const metricTabs = [
|
||||
<Trans key="network">Network</Trans>,
|
||||
<Trans key="network">Duration</Trans>,
|
||||
"Network",
|
||||
"Duration",
|
||||
];
|
||||
|
||||
const { serviceName, servicePort } = ingress.getServiceNamePort();
|
||||
@@ -119,23 +118,23 @@ export class IngressDetails extends React.Component<Props> {
|
||||
<IngressCharts/>
|
||||
</ResourceMetrics>
|
||||
<KubeObjectMeta object={ingress}/>
|
||||
<DrawerItem name={<Trans>Ports</Trans>}>
|
||||
<DrawerItem name="Ports">
|
||||
{ingress.getPorts()}
|
||||
</DrawerItem>
|
||||
{spec.tls &&
|
||||
<DrawerItem name={<Trans>TLS</Trans>}>
|
||||
<DrawerItem name="TLS">
|
||||
{spec.tls.map((tls, index) => <p key={index}>{tls.secretName}</p>)}
|
||||
</DrawerItem>
|
||||
}
|
||||
{serviceName && servicePort &&
|
||||
<DrawerItem name={<Trans>Service</Trans>}>
|
||||
<DrawerItem name="Service">
|
||||
{serviceName}:{servicePort}
|
||||
</DrawerItem>
|
||||
}
|
||||
<DrawerTitle title={<Trans>Rules</Trans>}/>
|
||||
<DrawerTitle title="Rules"/>
|
||||
{this.renderPaths(ingress)}
|
||||
|
||||
<DrawerTitle title={<Trans>Load-Balancer Ingress Points</Trans>}/>
|
||||
<DrawerTitle title="Load-Balancer Ingress Points"/>
|
||||
{this.renderIngressPoints(ingressPoints)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -7,7 +7,6 @@ import { IngressRouteParams } from "./ingresses.route";
|
||||
import { Ingress } from "../../api/endpoints/ingress.api";
|
||||
import { ingressStore } from "./ingress.store";
|
||||
import { KubeObjectListLayout } from "../kube-object";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
|
||||
enum sortBy {
|
||||
@@ -34,14 +33,14 @@ export class Ingresses extends React.Component<Props> {
|
||||
(ingress: Ingress) => ingress.getSearchFields(),
|
||||
(ingress: Ingress) => ingress.getPorts(),
|
||||
]}
|
||||
renderHeaderTitle={<Trans>Ingresses</Trans>}
|
||||
renderHeaderTitle="Ingresses"
|
||||
renderTableHeader={[
|
||||
{ title: <Trans>Name</Trans>, className: "name", sortBy: sortBy.name },
|
||||
{ title: "Name", className: "name", sortBy: sortBy.name },
|
||||
{ className: "warning" },
|
||||
{ title: <Trans>Namespace</Trans>, className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: <Trans>LoadBalancers</Trans>, className: "loadbalancers" },
|
||||
{ title: <Trans>Rules</Trans>, className: "rules" },
|
||||
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
||||
{ title: "Namespace", className: "namespace", sortBy: sortBy.namespace },
|
||||
{ title: "LoadBalancers", className: "loadbalancers" },
|
||||
{ title: "Rules", className: "rules" },
|
||||
{ title: "Age", className: "age", sortBy: sortBy.age },
|
||||
]}
|
||||
renderTableContents={(ingress: Ingress) => [
|
||||
ingress.getName(),
|
||||
|
||||
Reference in new issue
Block a user