@backstage/plugin-kubernetes-react 0.5.13-next.1 → 0.5.14-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/alpha.d.ts +77 -0
  3. package/dist/components/Cluster/Cluster.esm.js +6 -9
  4. package/dist/components/Cluster/Cluster.esm.js.map +1 -1
  5. package/dist/components/ConfigmapsAccordions/ConfigmapsDrawer.esm.js +10 -1
  6. package/dist/components/ConfigmapsAccordions/ConfigmapsDrawer.esm.js.map +1 -1
  7. package/dist/components/CronJobsAccordions/CronJobsDrawer.esm.js +10 -1
  8. package/dist/components/CronJobsAccordions/CronJobsDrawer.esm.js.map +1 -1
  9. package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js +15 -27
  10. package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js.map +1 -1
  11. package/dist/components/CustomResources/ArgoRollouts/RolloutDrawer.esm.js +10 -1
  12. package/dist/components/CustomResources/ArgoRollouts/RolloutDrawer.esm.js.map +1 -1
  13. package/dist/components/CustomResources/DefaultCustomResourceDrawer.esm.js +2 -0
  14. package/dist/components/CustomResources/DefaultCustomResourceDrawer.esm.js.map +1 -1
  15. package/dist/components/DaemonSetsAccordions/DaemonSetsAccordions.esm.js +5 -10
  16. package/dist/components/DaemonSetsAccordions/DaemonSetsAccordions.esm.js.map +1 -1
  17. package/dist/components/DaemonSetsAccordions/DaemonSetsDrawer.esm.js +10 -1
  18. package/dist/components/DaemonSetsAccordions/DaemonSetsDrawer.esm.js.map +1 -1
  19. package/dist/components/DeploymentsAccordions/DeploymentDrawer.esm.js +10 -1
  20. package/dist/components/DeploymentsAccordions/DeploymentDrawer.esm.js.map +1 -1
  21. package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js +15 -27
  22. package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js.map +1 -1
  23. package/dist/components/ErrorPanel/ErrorPanel.esm.js +37 -20
  24. package/dist/components/ErrorPanel/ErrorPanel.esm.js.map +1 -1
  25. package/dist/components/ErrorReporting/ErrorReporting.esm.js +41 -34
  26. package/dist/components/ErrorReporting/ErrorReporting.esm.js.map +1 -1
  27. package/dist/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.esm.js +2 -0
  28. package/dist/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.esm.js.map +1 -1
  29. package/dist/components/IngressesAccordions/IngressDrawer.esm.js +4 -1
  30. package/dist/components/IngressesAccordions/IngressDrawer.esm.js.map +1 -1
  31. package/dist/components/JobsAccordions/JobsAccordions.esm.js +2 -0
  32. package/dist/components/JobsAccordions/JobsAccordions.esm.js.map +1 -1
  33. package/dist/components/JobsAccordions/JobsDrawer.esm.js +2 -0
  34. package/dist/components/JobsAccordions/JobsDrawer.esm.js.map +1 -1
  35. package/dist/components/KubernetesDialog/KubernetesDialog.esm.js +4 -1
  36. package/dist/components/KubernetesDialog/KubernetesDialog.esm.js.map +1 -1
  37. package/dist/components/KubernetesDrawer/KubernetesDrawer.esm.js +6 -3
  38. package/dist/components/KubernetesDrawer/KubernetesDrawer.esm.js.map +1 -1
  39. package/dist/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.esm.js +25 -15
  40. package/dist/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.esm.js.map +1 -1
  41. package/dist/components/KubernetesDrawer/ManifestYaml.esm.js +5 -2
  42. package/dist/components/KubernetesDrawer/ManifestYaml.esm.js.map +1 -1
  43. package/dist/components/PodExecTerminal/PodExecTerminalDialog.esm.js +10 -3
  44. package/dist/components/PodExecTerminal/PodExecTerminalDialog.esm.js.map +1 -1
  45. package/dist/components/Pods/Events/Events.esm.js +4 -1
  46. package/dist/components/Pods/Events/Events.esm.js.map +1 -1
  47. package/dist/components/Pods/FixDialog/FixDialog.esm.js +26 -16
  48. package/dist/components/Pods/FixDialog/FixDialog.esm.js.map +1 -1
  49. package/dist/components/Pods/PodDrawer/ContainerCard.esm.js +8 -5
  50. package/dist/components/Pods/PodDrawer/ContainerCard.esm.js.map +1 -1
  51. package/dist/components/Pods/PodDrawer/PodDrawer.esm.js +8 -5
  52. package/dist/components/Pods/PodDrawer/PodDrawer.esm.js.map +1 -1
  53. package/dist/components/Pods/PodLogs/PodLogs.esm.js +5 -2
  54. package/dist/components/Pods/PodLogs/PodLogs.esm.js.map +1 -1
  55. package/dist/components/Pods/PodLogs/PodLogsDialog.esm.js +10 -3
  56. package/dist/components/Pods/PodLogs/PodLogsDialog.esm.js.map +1 -1
  57. package/dist/components/Pods/PodsTable.esm.js +30 -25
  58. package/dist/components/Pods/PodsTable.esm.js.map +1 -1
  59. package/dist/components/ServicesAccordions/ServiceDrawer.esm.js +4 -1
  60. package/dist/components/ServicesAccordions/ServiceDrawer.esm.js.map +1 -1
  61. package/dist/components/StatefulSetsAccordions/StatefulSetDrawer.esm.js +4 -1
  62. package/dist/components/StatefulSetsAccordions/StatefulSetDrawer.esm.js.map +1 -1
  63. package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js +14 -14
  64. package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js.map +1 -1
  65. package/dist/translation.esm.js +113 -0
  66. package/dist/translation.esm.js.map +1 -1
  67. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @backstage/plugin-kubernetes-react
2
2
 
3
+ ## 0.5.14-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - f15d5f1: add missing i18n support for kubernetes and kubernetes-react
8
+ - Updated dependencies
9
+ - @backstage/core-plugin-api@1.12.1-next.0
10
+ - @backstage/core-components@0.18.4-next.0
11
+ - @backstage/catalog-model@1.7.6
12
+ - @backstage/errors@1.2.7
13
+ - @backstage/types@1.2.2
14
+ - @backstage/plugin-kubernetes-common@0.9.8
15
+
16
+ ## 0.5.13
17
+
18
+ ### Patch Changes
19
+
20
+ - 1906d37: Updated dependency `@kubernetes/client-node` to `1.4.0`.
21
+ - 05f60e1: Refactored constructor parameter properties to explicit property declarations for compatibility with TypeScript's `erasableSyntaxOnly` setting. This internal refactoring maintains all existing functionality while ensuring TypeScript compilation compatibility.
22
+ - Updated dependencies
23
+ - @backstage/core-components@0.18.3
24
+ - @backstage/plugin-kubernetes-common@0.9.8
25
+ - @backstage/core-plugin-api@1.12.0
26
+ - @backstage/catalog-model@1.7.6
27
+
3
28
  ## 0.5.13-next.1
4
29
 
5
30
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -2,7 +2,84 @@ import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/al
2
2
 
3
3
  /** @alpha */
4
4
  declare const kubernetesReactTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"kubernetes-react", {
5
+ readonly "namespace.label": "namespace:";
6
+ readonly "namespace.labelWithValue": "namespace: {{namespace}}";
7
+ readonly "events.noEventsFound": "No events found";
8
+ readonly "events.eventTooltip": "{{eventType}} event";
9
+ readonly "events.firstEvent": "First event {{timeAgo}} (count: {{count}})";
10
+ readonly "cluster.label": "Cluster";
11
+ readonly "cluster.pods": "pods";
12
+ readonly "cluster.pods_one": "{{count}} pod";
13
+ readonly "cluster.pods_other": "{{count}} pods";
14
+ readonly "cluster.podsWithErrors": "pods with errors";
15
+ readonly "cluster.podsWithErrors_one": "{{count}} pod with errors";
16
+ readonly "cluster.podsWithErrors_other": "{{count}} pods with errors";
17
+ readonly "cluster.noPodsWithErrors": "No pods with errors";
18
+ readonly "errorPanel.message": "There was a problem retrieving some Kubernetes resources for the entity: {{entityName}}. This could mean that the Error Reporting card is not completely accurate.";
19
+ readonly "errorPanel.title": "There was a problem retrieving Kubernetes objects";
20
+ readonly "errorPanel.errorsLabel": "Errors";
21
+ readonly "errorPanel.clusterLabel": "Cluster";
22
+ readonly "errorPanel.clusterLabelValue": "Cluster: {{cluster}}";
23
+ readonly "errorPanel.fetchError": "Error communicating with Kubernetes: {{errorType}}, message: {{message}}";
24
+ readonly "errorPanel.resourceError": "Error fetching Kubernetes resource: '{{resourcePath}}', error: {{errorType}}, status code: {{statusCode}}";
25
+ readonly "pods.pods_one": "{{count}} pod";
26
+ readonly "pods.pods_other": "{{count}} pods";
27
+ readonly "podsTable.columns.name": "name";
28
+ readonly "podsTable.columns.id": "ID";
29
+ readonly "podsTable.columns.status": "status";
30
+ readonly "podsTable.columns.phase": "phase";
31
+ readonly "podsTable.columns.containersReady": "containers ready";
32
+ readonly "podsTable.columns.totalRestarts": "total restarts";
33
+ readonly "podsTable.columns.cpuUsage": "CPU usage %";
34
+ readonly "podsTable.columns.memoryUsage": "Memory usage %";
35
+ readonly "podsTable.unknown": "unknown";
36
+ readonly "podsTable.status.running": "Running";
37
+ readonly "podsTable.status.ok": "OK";
38
+ readonly "fixDialog.title": "{{podName}} - {{errorType}}";
39
+ readonly "fixDialog.events": "Events:";
40
+ readonly "fixDialog.helpButton": "Help";
41
+ readonly "fixDialog.detectedError": "Detected error:";
42
+ readonly "fixDialog.causeExplanation": "Cause explanation:";
43
+ readonly "fixDialog.fix": "Fix:";
44
+ readonly "fixDialog.crashLogs": "Crash logs:";
45
+ readonly "fixDialog.openDocs": "Open docs";
46
+ readonly "fixDialog.ariaLabels.close": "close";
47
+ readonly "fixDialog.ariaLabels.fixIssue": "fix issue";
5
48
  readonly "podDrawer.buttons.delete": "Delete Pod";
49
+ readonly "podDrawer.cpuRequests": "CPU requests";
50
+ readonly "podDrawer.cpuLimits": "CPU limits";
51
+ readonly "podDrawer.memoryRequests": "Memory requests";
52
+ readonly "podDrawer.memoryLimits": "Memory limits";
53
+ readonly "podDrawer.resourceUtilization": "Resource utilization";
54
+ readonly "hpa.minReplicas": "min replicas";
55
+ readonly "hpa.maxReplicas": "max replicas";
56
+ readonly "hpa.replicasSummary": "min replicas {{min}} / max replicas {{max}}";
57
+ readonly "hpa.currentCpuUsage": "current CPU usage:";
58
+ readonly "hpa.currentCpuUsageLabel": "current CPU usage: {{value}}%";
59
+ readonly "hpa.targetCpuUsage": "target CPU usage:";
60
+ readonly "hpa.targetCpuUsageLabel": "target CPU usage: {{value}}%";
61
+ readonly "errorReporting.columns.name": "name";
62
+ readonly "errorReporting.columns.kind": "kind";
63
+ readonly "errorReporting.columns.namespace": "namespace";
64
+ readonly "errorReporting.columns.messages": "messages";
65
+ readonly "errorReporting.columns.cluster": "cluster";
66
+ readonly "errorReporting.title": "Error Reporting";
67
+ readonly "podLogs.title": "No logs emitted";
68
+ readonly "podLogs.description": "No logs were emitted by the container";
69
+ readonly "podLogs.buttonText": "Logs";
70
+ readonly "podLogs.titleTemplate": "{{podName}} - {{containerName}} logs on cluster {{clusterName}}";
71
+ readonly "podLogs.buttonAriaLabel": "get logs";
72
+ readonly "podExecTerminal.buttonText": "Terminal";
73
+ readonly "podExecTerminal.titleTemplate": "{{podName}} - {{containerName}} terminal shell on cluster {{clusterName}}";
74
+ readonly "podExecTerminal.buttonAriaLabel": "open terminal";
75
+ readonly "kubernetesDrawer.yaml": "YAML";
76
+ readonly "kubernetesDrawer.closeDrawer": "Close the drawer";
77
+ readonly "kubernetesDrawer.managedFields": "Managed Fields";
78
+ readonly "kubernetesDrawer.unknownName": "unknown name";
79
+ readonly "linkErrorPanel.message": "Could not format the link to the dashboard of your cluster named '{{clusterName}}'. Its dashboardApp property has been set to '{{dashboardApp}}.'";
80
+ readonly "linkErrorPanel.title": "There was a problem formatting the link to the Kubernetes dashboard";
81
+ readonly "linkErrorPanel.errorsLabel": "Errors:";
82
+ readonly "kubernetesDialog.closeAriaLabel": "close";
6
83
  }>;
7
84
 
8
85
  export { kubernetesReactTranslationRef };
@@ -28,12 +28,15 @@ import { ClusterContext } from '../../hooks/Cluster.esm.js';
28
28
  import { PodMetricsContext } from '../../hooks/usePodMetrics.esm.js';
29
29
  import '../../hooks/useMatchingErrors.esm.js';
30
30
  import { StatusOK, StatusError } from '@backstage/core-components';
31
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
32
+ import { kubernetesReactTranslationRef } from '../../translation.esm.js';
31
33
 
32
34
  const ClusterSummary = ({
33
35
  clusterName,
34
36
  totalNumberOfPods,
35
37
  numberOfPodsWithErrors
36
38
  }) => {
39
+ const { t } = useTranslationRef(kubernetesReactTranslationRef);
37
40
  return /* @__PURE__ */ jsxs(
38
41
  Grid,
39
42
  {
@@ -55,7 +58,7 @@ const ClusterSummary = ({
55
58
  spacing: 0,
56
59
  children: /* @__PURE__ */ jsxs(Grid, { item: true, xs: true, children: [
57
60
  /* @__PURE__ */ jsx(Typography, { variant: "body1", children: clusterName }),
58
- /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "subtitle1", children: "Cluster" })
61
+ /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "subtitle1", children: t("cluster.label") })
59
62
  ] })
60
63
  }
61
64
  ),
@@ -70,14 +73,8 @@ const ClusterSummary = ({
70
73
  alignItems: "flex-end",
71
74
  spacing: 0,
72
75
  children: [
73
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(StatusOK, { children: [
74
- totalNumberOfPods,
75
- " pods"
76
- ] }) }),
77
- /* @__PURE__ */ jsx(Grid, { item: true, children: numberOfPodsWithErrors > 0 ? /* @__PURE__ */ jsxs(StatusError, { children: [
78
- numberOfPodsWithErrors,
79
- " pods with errors"
80
- ] }) : /* @__PURE__ */ jsx(StatusOK, { children: "No pods with errors" }) })
76
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(StatusOK, { children: t("cluster.pods", { count: totalNumberOfPods }) }) }),
77
+ /* @__PURE__ */ jsx(Grid, { item: true, children: numberOfPodsWithErrors > 0 ? /* @__PURE__ */ jsx(StatusError, { children: t("cluster.podsWithErrors", { count: numberOfPodsWithErrors }) }) : /* @__PURE__ */ jsx(StatusOK, { children: t("cluster.noPodsWithErrors") }) })
81
78
  ]
82
79
  }
83
80
  )
@@ -1 +1 @@
1
- {"version":3,"file":"Cluster.esm.js","sources":["../../../src/components/Cluster/Cluster.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ClientPodStatus,\n ClusterObjects,\n groupResponses,\n} from '@backstage/plugin-kubernetes-common';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { DeploymentsAccordions } from '../DeploymentsAccordions';\nimport { StatefulSetsAccordions } from '../StatefulSetsAccordions';\nimport { IngressesAccordions } from '../IngressesAccordions';\nimport { ServicesAccordions } from '../ServicesAccordions';\nimport { ConfigmapsAccordions } from '../ConfigmapsAccordions';\nimport { CronJobsAccordions } from '../CronJobsAccordions';\nimport { CustomResources } from '../CustomResources';\nimport { DaemonSetsAccordions } from '../DaemonSetsAccordions';\nimport {\n ClusterContext,\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\n\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { PodMetricsContext } from '../../hooks/usePodMetrics';\n\ntype ClusterSummaryProps = {\n clusterName: string;\n totalNumberOfPods: number;\n numberOfPodsWithErrors: number;\n children?: ReactNode;\n};\n\nconst ClusterSummary = ({\n clusterName,\n totalNumberOfPods,\n numberOfPodsWithErrors,\n}: ClusterSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid\n xs={6}\n item\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item xs>\n <Typography variant=\"body1\">{clusterName}</Typography>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Cluster\n </Typography>\n </Grid>\n </Grid>\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n <StatusOK>{totalNumberOfPods} pods</StatusOK>\n </Grid>\n <Grid item>\n {numberOfPodsWithErrors > 0 ? (\n <StatusError>{numberOfPodsWithErrors} pods with errors</StatusError>\n ) : (\n <StatusOK>No pods with errors</StatusOK>\n )}\n </Grid>\n </Grid>\n </Grid>\n );\n};\n\n/**\n * Props for Cluster\n *\n * @public\n */\nexport type ClusterProps = {\n clusterObjects: ClusterObjects;\n podsWithErrors: Set<string>;\n children?: ReactNode;\n};\n\n/**\n * Component for rendering Kubernetes resources in a cluster\n *\n * @public\n */\nexport const Cluster = ({ clusterObjects, podsWithErrors }: ClusterProps) => {\n const groupedResponses = groupResponses(clusterObjects.resources);\n\n const podMetricsMap = new Map<string, ClientPodStatus[]>();\n podMetricsMap.set(clusterObjects.cluster.name, clusterObjects.podMetrics);\n return (\n <ClusterContext.Provider value={clusterObjects.cluster}>\n <GroupedResponsesContext.Provider value={groupedResponses}>\n <PodMetricsContext.Provider value={podMetricsMap}>\n <PodNamesWithErrorsContext.Provider value={podsWithErrors}>\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <ClusterSummary\n clusterName={\n clusterObjects.cluster.title || clusterObjects.cluster.name\n }\n totalNumberOfPods={groupedResponses.pods.length}\n numberOfPodsWithErrors={podsWithErrors.size}\n />\n </AccordionSummary>\n <AccordionDetails>\n <Grid container direction=\"column\">\n {groupedResponses.customResources.length > 0 ? (\n <Grid item>\n <CustomResources />\n </Grid>\n ) : undefined}\n {groupedResponses.deployments.length > 0 ? (\n <Grid item>\n <DeploymentsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.daemonSets.length > 0 ? (\n <Grid item>\n <DaemonSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.statefulsets.length > 0 ? (\n <Grid item>\n <StatefulSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.ingresses.length > 0 ? (\n <Grid item>\n <IngressesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.services.length > 0 ? (\n <Grid item>\n <ServicesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.configMaps.length > 0 ? (\n <Grid item>\n <ConfigmapsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.cronJobs.length > 0 ? (\n <Grid item>\n <CronJobsAccordions />\n </Grid>\n ) : undefined}\n </Grid>\n </AccordionDetails>\n </Accordion>\n </PodNamesWithErrorsContext.Provider>\n </PodMetricsContext.Provider>\n </GroupedResponsesContext.Provider>\n </ClusterContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,iBAAiB,CAAC;AAAA,EACtB,WAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA,KAA2B;AACzB,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,eAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MACX,OAAA,EAAS,CAAA;AAAA,MAET,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,EAAA,EAAI,CAAA;AAAA,YACJ,IAAA,EAAI,IAAA;AAAA,YACJ,SAAA,EAAS,IAAA;AAAA,YACT,SAAA,EAAU,QAAA;AAAA,YACV,cAAA,EAAe,YAAA;AAAA,YACf,UAAA,EAAW,YAAA;AAA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,CAAA,mBAClC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB,CAAA,GACE;AAAA,KAAA,EACN,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Cluster.esm.js","sources":["../../../src/components/Cluster/Cluster.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ClientPodStatus,\n ClusterObjects,\n groupResponses,\n} from '@backstage/plugin-kubernetes-common';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { DeploymentsAccordions } from '../DeploymentsAccordions';\nimport { StatefulSetsAccordions } from '../StatefulSetsAccordions';\nimport { IngressesAccordions } from '../IngressesAccordions';\nimport { ServicesAccordions } from '../ServicesAccordions';\nimport { ConfigmapsAccordions } from '../ConfigmapsAccordions';\nimport { CronJobsAccordions } from '../CronJobsAccordions';\nimport { CustomResources } from '../CustomResources';\nimport { DaemonSetsAccordions } from '../DaemonSetsAccordions';\nimport {\n ClusterContext,\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\n\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { PodMetricsContext } from '../../hooks/usePodMetrics';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\ntype ClusterSummaryProps = {\n clusterName: string;\n totalNumberOfPods: number;\n numberOfPodsWithErrors: number;\n children?: ReactNode;\n};\n\nconst ClusterSummary = ({\n clusterName,\n totalNumberOfPods,\n numberOfPodsWithErrors,\n}: ClusterSummaryProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid\n xs={6}\n item\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item xs>\n <Typography variant=\"body1\">{clusterName}</Typography>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n {t('cluster.label')}\n </Typography>\n </Grid>\n </Grid>\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n <StatusOK>{t('cluster.pods', { count: totalNumberOfPods })}</StatusOK>\n </Grid>\n <Grid item>\n {numberOfPodsWithErrors > 0 ? (\n <StatusError>\n {t('cluster.podsWithErrors', { count: numberOfPodsWithErrors })}\n </StatusError>\n ) : (\n <StatusOK>{t('cluster.noPodsWithErrors')}</StatusOK>\n )}\n </Grid>\n </Grid>\n </Grid>\n );\n};\n\n/**\n * Props for Cluster\n *\n * @public\n */\nexport type ClusterProps = {\n clusterObjects: ClusterObjects;\n podsWithErrors: Set<string>;\n children?: ReactNode;\n};\n\n/**\n * Component for rendering Kubernetes resources in a cluster\n *\n * @public\n */\nexport const Cluster = ({ clusterObjects, podsWithErrors }: ClusterProps) => {\n const groupedResponses = groupResponses(clusterObjects.resources);\n\n const podMetricsMap = new Map<string, ClientPodStatus[]>();\n podMetricsMap.set(clusterObjects.cluster.name, clusterObjects.podMetrics);\n return (\n <ClusterContext.Provider value={clusterObjects.cluster}>\n <GroupedResponsesContext.Provider value={groupedResponses}>\n <PodMetricsContext.Provider value={podMetricsMap}>\n <PodNamesWithErrorsContext.Provider value={podsWithErrors}>\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <ClusterSummary\n clusterName={\n clusterObjects.cluster.title || clusterObjects.cluster.name\n }\n totalNumberOfPods={groupedResponses.pods.length}\n numberOfPodsWithErrors={podsWithErrors.size}\n />\n </AccordionSummary>\n <AccordionDetails>\n <Grid container direction=\"column\">\n {groupedResponses.customResources.length > 0 ? (\n <Grid item>\n <CustomResources />\n </Grid>\n ) : undefined}\n {groupedResponses.deployments.length > 0 ? (\n <Grid item>\n <DeploymentsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.daemonSets.length > 0 ? (\n <Grid item>\n <DaemonSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.statefulsets.length > 0 ? (\n <Grid item>\n <StatefulSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.ingresses.length > 0 ? (\n <Grid item>\n <IngressesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.services.length > 0 ? (\n <Grid item>\n <ServicesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.configMaps.length > 0 ? (\n <Grid item>\n <ConfigmapsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.cronJobs.length > 0 ? (\n <Grid item>\n <CronJobsAccordions />\n </Grid>\n ) : undefined}\n </Grid>\n </AccordionDetails>\n </Accordion>\n </PodNamesWithErrorsContext.Provider>\n </PodMetricsContext.Provider>\n </GroupedResponsesContext.Provider>\n </ClusterContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,iBAAiB,CAAC;AAAA,EACtB,WAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA,KAA2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AAA,mBACnC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,mBAAA,EAAA,EAAoB,CAAA,EACvB,CAAA,GACE,MAAA;AAAA,MACH,gBAAA,CAAiB,QAAA,CAAS,MAAA,GAAS,CAAA,mBAClC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB,CAAA,GACE,MAAA;AAAA,MACH,gBAAA,CAAiB,UAAA,CAAW,MAAA,GAAS,CAAA,mBACpC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,CAAA,EACxB,CAAA,GACE,MAAA;AAAA,MACH,gBAAA,CAAiB,QAAA,CAAS,MAAA,GAAS,CAAA,mBAClC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB,CAAA,GACE;AAAA,KAAA,EACN,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA;AAEJ;;;;"}
@@ -6,6 +6,8 @@ import '@material-ui/core/FormControlLabel';
6
6
  import '@material-ui/core/Switch';
7
7
  import 'js-yaml';
8
8
  import 'react';
9
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
10
+ import { kubernetesReactTranslationRef } from '../../translation.esm.js';
9
11
  import Typography from '@material-ui/core/Typography';
10
12
  import Grid from '@material-ui/core/Grid';
11
13
  import Chip from '@material-ui/core/Chip';
@@ -14,6 +16,7 @@ const ConfigmapsDrawer = ({
14
16
  configmap,
15
17
  expanded
16
18
  }) => {
19
+ const { t } = useTranslationRef(kubernetesReactTranslationRef);
17
20
  const namespace = configmap.metadata?.namespace;
18
21
  return /* @__PURE__ */ jsx(
19
22
  KubernetesStructuredMetadataTableDrawer,
@@ -35,7 +38,13 @@ const ConfigmapsDrawer = ({
35
38
  children: [
36
39
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "body1", children: configmap.metadata?.name ?? "unknown object" }) }),
37
40
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "subtitle1", children: "ConfigMap" }) }),
38
- namespace && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Chip, { size: "small", label: `namespace: ${namespace}` }) })
41
+ namespace && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
42
+ Chip,
43
+ {
44
+ size: "small",
45
+ label: t("namespace.labelWithValue", { namespace })
46
+ }
47
+ ) })
39
48
  ]
40
49
  }
41
50
  )
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigmapsDrawer.esm.js","sources":["../../../src/components/ConfigmapsAccordions/ConfigmapsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\nimport type { V1ConfigMap } from '@kubernetes/client-node';\n\nexport const ConfigmapsDrawer = ({\n configmap,\n expanded,\n}: {\n configmap: V1ConfigMap;\n expanded?: boolean;\n}) => {\n const namespace = configmap.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={configmap}\n expanded={expanded}\n kind=\"ConfigMap\"\n renderObject={(configmapObject: V1ConfigMap) => {\n return configmapObject || {};\n }}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {configmap.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n ConfigMap\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,SAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,SAAA,GAAY,UAAU,QAAA,EAAU,SAAA;AACtC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,SAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,WAAA;AAAA,MACL,YAAA,EAAc,CAAC,eAAA,KAAiC;AAC9C,QAAA,OAAO,mBAAmB,EAAC;AAAA,MAC7B,CAAA;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,SAAA,CAAU,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC/B,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,WAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,SAAA,oBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,KAAA,EAAO,CAAA,WAAA,EAAc,SAAS,IAAI,CAAA,EACvD;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ConfigmapsDrawer.esm.js","sources":["../../../src/components/ConfigmapsAccordions/ConfigmapsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\nimport type { V1ConfigMap } from '@kubernetes/client-node';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\nexport const ConfigmapsDrawer = ({\n configmap,\n expanded,\n}: {\n configmap: V1ConfigMap;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = configmap.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={configmap}\n expanded={expanded}\n kind=\"ConfigMap\"\n renderObject={(configmapObject: V1ConfigMap) => {\n return configmapObject || {};\n }}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {configmap.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n ConfigMap\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip\n size=\"small\"\n label={t('namespace.labelWithValue', { namespace })}\n />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,SAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,UAAU,QAAA,EAAU,SAAA;AACtC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,SAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,WAAA;AAAA,MACL,YAAA,EAAc,CAAC,eAAA,KAAiC;AAC9C,QAAA,OAAO,mBAAmB,EAAC;AAAA,MAC7B,CAAA;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,SAAA,CAAU,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC/B,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,WAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,SAAA,oBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EAAK,OAAA;AAAA,gBACL,KAAA,EAAO,CAAA,CAAE,0BAAA,EAA4B,EAAE,WAAW;AAAA;AAAA,aACpD,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
@@ -6,6 +6,8 @@ import '@material-ui/core/FormControlLabel';
6
6
  import '@material-ui/core/Switch';
7
7
  import 'js-yaml';
8
8
  import 'react';
9
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
10
+ import { kubernetesReactTranslationRef } from '../../translation.esm.js';
9
11
  import Typography from '@material-ui/core/Typography';
10
12
  import Grid from '@material-ui/core/Grid';
11
13
  import Chip from '@material-ui/core/Chip';
@@ -14,6 +16,7 @@ const CronJobDrawer = ({
14
16
  cronJob,
15
17
  expanded
16
18
  }) => {
19
+ const { t } = useTranslationRef(kubernetesReactTranslationRef);
17
20
  const namespace = cronJob.metadata?.namespace;
18
21
  return /* @__PURE__ */ jsx(
19
22
  KubernetesStructuredMetadataTableDrawer,
@@ -38,7 +41,13 @@ const CronJobDrawer = ({
38
41
  children: [
39
42
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "body1", children: cronJob.metadata?.name ?? "unknown object" }) }),
40
43
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "subtitle1", children: "CronJob" }) }),
41
- namespace && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Chip, { size: "small", label: `namespace: ${namespace}` }) })
44
+ namespace && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
45
+ Chip,
46
+ {
47
+ size: "small",
48
+ label: t("namespace.labelWithValue", { namespace })
49
+ }
50
+ ) })
42
51
  ]
43
52
  }
44
53
  )
@@ -1 +1 @@
1
- {"version":3,"file":"CronJobsDrawer.esm.js","sources":["../../../src/components/CronJobsAccordions/CronJobsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { V1CronJob } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\n\nexport const CronJobDrawer = ({\n cronJob,\n expanded,\n}: {\n cronJob: V1CronJob;\n expanded?: boolean;\n}) => {\n const namespace = cronJob.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={cronJob}\n expanded={expanded}\n kind=\"CronJob\"\n renderObject={(cronJobObj: V1CronJob) => ({\n schedule: cronJobObj.spec?.schedule ?? '???',\n startingDeadlineSeconds:\n cronJobObj.spec?.startingDeadlineSeconds ?? '???',\n concurrencyPolicy: cronJobObj.spec?.concurrencyPolicy ?? '???',\n lastScheduleTime: cronJobObj.status?.lastScheduleTime ?? '???',\n })}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {cronJob.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n CronJob\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,SAAA,GAAY,QAAQ,QAAA,EAAU,SAAA;AACpC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,OAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAc,CAAC,UAAA,MAA2B;AAAA,QACxC,QAAA,EAAU,UAAA,CAAW,IAAA,EAAM,QAAA,IAAY,KAAA;AAAA,QACvC,uBAAA,EACE,UAAA,CAAW,IAAA,EAAM,uBAAA,IAA2B,KAAA;AAAA,QAC9C,iBAAA,EAAmB,UAAA,CAAW,IAAA,EAAM,iBAAA,IAAqB,KAAA;AAAA,QACzD,gBAAA,EAAkB,UAAA,CAAW,MAAA,EAAQ,gBAAA,IAAoB;AAAA,OAC3D,CAAA;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC7B,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,SAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,SAAA,oBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,KAAA,EAAO,CAAA,WAAA,EAAc,SAAS,IAAI,CAAA,EACvD;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"CronJobsDrawer.esm.js","sources":["../../../src/components/CronJobsAccordions/CronJobsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { V1CronJob } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\nexport const CronJobDrawer = ({\n cronJob,\n expanded,\n}: {\n cronJob: V1CronJob;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = cronJob.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={cronJob}\n expanded={expanded}\n kind=\"CronJob\"\n renderObject={(cronJobObj: V1CronJob) => ({\n schedule: cronJobObj.spec?.schedule ?? '???',\n startingDeadlineSeconds:\n cronJobObj.spec?.startingDeadlineSeconds ?? '???',\n concurrencyPolicy: cronJobObj.spec?.concurrencyPolicy ?? '???',\n lastScheduleTime: cronJobObj.status?.lastScheduleTime ?? '???',\n })}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {cronJob.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n CronJob\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip\n size=\"small\"\n label={t('namespace.labelWithValue', { namespace })}\n />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,QAAQ,QAAA,EAAU,SAAA;AACpC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,OAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAc,CAAC,UAAA,MAA2B;AAAA,QACxC,QAAA,EAAU,UAAA,C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chingErrors.esm.js';
28
28
  import '@material-ui/icons/OpenInBrowser';
29
29
  import '../../KubernetesDialog/KubernetesDialog.esm.js';
30
30
  import '../../PodExecTerminal/PodExecTerminal.esm.js';
31
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
32
+ import { kubernetesReactTranslationRef } from '../../../translation.esm.js';
31
33
  import '@material-ui/core/Paper';
32
34
  import '@material-ui/lab/Skeleton';
33
35
  import '@material-ui/icons/Subject';
@@ -73,6 +75,7 @@ const RolloutSummary = ({
73
75
  numberOfPodsWithErrors,
74
76
  hpa
75
77
  }) => {
78
+ const { t } = useTranslationRef(kubernetesReactTranslationRef);
76
79
  const pauseTime = rollout.status?.pauseConditions?.find(
77
80
  (p) => p.reason === "CanaryPauseStep"
78
81
  )?.startTime;
@@ -103,23 +106,16 @@ const RolloutSummary = ({
103
106
  alignItems: "flex-start",
104
107
  spacing: 0,
105
108
  children: [
106
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", children: [
107
- "min replicas ",
108
- hpa.spec?.minReplicas ?? "?",
109
- " / max replicas",
110
- " ",
111
- hpa.spec?.maxReplicas ?? "?"
112
- ] }) }),
113
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", children: [
114
- "current CPU usage: ",
115
- cpuUtil ?? "?",
116
- "%"
117
- ] }) }),
118
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", children: [
119
- "target CPU usage: ",
120
- specCpuUtil ?? "?",
121
- "%"
122
- ] }) })
109
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: t("hpa.replicasSummary", {
110
+ min: String(hpa.spec?.minReplicas ?? "?"),
111
+ max: String(hpa.spec?.maxReplicas ?? "?")
112
+ }) }) }),
113
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: t("hpa.currentCpuUsageLabel", {
114
+ value: String(cpuUtil ?? "?")
115
+ }) }) }),
116
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: t("hpa.targetCpuUsageLabel", {
117
+ value: String(specCpuUtil ?? "?")
118
+ }) }) })
123
119
  ]
124
120
  }
125
121
  ) }) }),
@@ -134,16 +130,8 @@ const RolloutSummary = ({
134
130
  alignItems: "flex-end",
135
131
  spacing: 0,
136
132
  children: [
137
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(StatusOK, { children: [
138
- numberOfCurrentPods,
139
- " pods"
140
- ] }) }),
141
- /* @__PURE__ */ jsx(Grid, { item: true, children: numberOfPodsWithErrors > 0 ? /* @__PURE__ */ jsxs(StatusError, { children: [
142
- numberOfPodsWithErrors,
143
- " pod",
144
- numberOfPodsWithErrors > 1 ? "s" : "",
145
- " with errors"
146
- ] }) : /* @__PURE__ */ jsx(StatusOK, { children: "No pods with errors" }) })
133
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(StatusOK, { children: t("pods.pods", { count: numberOfCurrentPods }) }) }),
134
+ /* @__PURE__ */ jsx(Grid, { item: true, children: numberOfPodsWithErrors > 0 ? /* @__PURE__ */ jsx(StatusError, { children: t("cluster.podsWithErrors", { count: numberOfPodsWithErrors }) }) : /* @__PURE__ */ jsx(StatusOK, { children: t("cluster.noPodsWithErrors") }) })
147
135
  ]
148
136
  }
149
137
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"Rollout.esm.js","sources":["../../../../src/components/CustomResources/ArgoRollouts/Rollout.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode, useContext } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Pod, V2HorizontalPodAutoscaler } from '@kubernetes/client-node';\nimport { PodsTable } from '../../Pods';\nimport { HorizontalPodAutoscalerDrawer } from '../../HorizontalPodAutoscalers';\nimport { RolloutDrawer } from './RolloutDrawer';\nimport PauseIcon from '@material-ui/icons/Pause';\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\nimport { DateTime } from 'luxon';\nimport { StepsProgress } from './StepsProgress';\nimport {\n PodNamesWithErrorsContext,\n GroupedResponsesContext,\n} from '../../../hooks';\nimport {\n getMatchingHpa,\n getOwnedPodsThroughReplicaSets,\n} from '../../../utils/owner';\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { READY_COLUMNS, RESOURCE_COLUMNS } from '../../Pods/PodsTable';\n\ntype RolloutAccordionsProps = {\n rollouts: any[];\n defaultExpanded?: boolean;\n children?: ReactNode;\n};\n\ntype RolloutAccordionProps = {\n rollout: any;\n ownedPods: V1Pod[];\n defaultExpanded?: boolean;\n matchingHpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\ntype RolloutSummaryProps = {\n rollout: any;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n hpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\nconst AbortedTitle = (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n }}\n >\n <ErrorOutlineIcon />\n <Typography variant=\"subtitle1\">Aborted</Typography>\n </div>\n);\n\nconst findAbortedMessage = (rollout: any): string | undefined =>\n rollout.status?.conditions?.find(\n (c: any) =>\n c.type === 'Progressing' &&\n c.status === 'False' &&\n c.reason === 'RolloutAborted',\n )?.message;\n\nconst RolloutSummary = ({\n rollout,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n hpa,\n}: RolloutSummaryProps) => {\n const pauseTime: string | undefined = rollout.status?.pauseConditions?.find(\n (p: any) => p.reason === 'CanaryPauseStep',\n )?.startTime;\n const abortedMessage = findAbortedMessage(rollout);\n const specCpuUtil = hpa?.spec?.metrics?.find(\n metric => metric.type === 'Resource' && metric.resource?.name === 'cpu',\n )?.resource?.target.averageUtilization;\n\n const cpuUtil = hpa?.status?.currentMetrics?.find(\n metric => metric.type === 'Resource' && metric.resource?.name === 'cpu',\n )?.resource?.current.averageUtilization;\n\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={6} item>\n <RolloutDrawer rollout={rollout} />\n </Grid>\n {hpa && (\n <Grid item xs={3}>\n <HorizontalPodAutoscalerDrawer hpa={hpa}>\n <Grid\n item\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"subtitle2\">\n min replicas {hpa.spec?.minReplicas ?? '?'} / max replicas{' '}\n {hpa.spec?.maxReplicas ?? '?'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n current CPU usage: {cpuUtil ?? '?'}%\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n target CPU usage: {specCpuUtil ?? '?'}%\n </Typography>\n </Grid>\n </Grid>\n </HorizontalPodAutoscalerDrawer>\n </Grid>\n )}\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n <StatusOK>{numberOfCurrentPods} pods</StatusOK>\n </Grid>\n <Grid item>\n {numberOfPodsWithErrors > 0 ? (\n <StatusError>\n {numberOfPodsWithErrors} pod\n {numberOfPodsWithErrors > 1 ? 's' : ''} with errors\n </StatusError>\n ) : (\n <StatusOK>No pods with errors</StatusOK>\n )}\n </Grid>\n </Grid>\n {pauseTime && (\n <Grid item xs={3}>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n }}\n >\n <PauseIcon />\n <Typography variant=\"subtitle1\">\n Paused ({DateTime.fromISO(pauseTime).toRelative({ locale: 'en' })}\n )\n </Typography>\n </div>\n </Grid>\n )}\n {abortedMessage && (\n <Grid item xs={3}>\n {AbortedTitle}\n </Grid>\n )}\n </Grid>\n );\n};\n\nconst RolloutAccordion = ({\n rollout,\n ownedPods,\n matchingHpa,\n defaultExpanded,\n}: RolloutAccordionProps) => {\n const podNamesWithErrors = useContext(PodNamesWithErrorsContext);\n\n const podsWithErrors = ownedPods.filter(p =>\n podNamesWithErrors.has(p.metadata?.name ?? ''),\n );\n\n const currentStepIndex = rollout.status?.currentStepIndex ?? 0;\n const abortedMessage = findAbortedMessage(rollout);\n\n return (\n <Accordion\n defaultExpanded={defaultExpanded}\n TransitionProps={{ unmountOnExit: true }}\n variant=\"outlined\"\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <RolloutSummary\n rollout={rollout}\n numberOfCurrentPods={ownedPods.length}\n numberOfPodsWithErrors={podsWithErrors.length}\n hpa={matchingHpa}\n />\n </AccordionSummary>\n <AccordionDetails>\n <div style={{ width: '100%' }}>\n <div>\n <Typography variant=\"h6\">Rollout status</Typography>\n </div>\n <div style={{ margin: '1rem' }}>\n {abortedMessage && (\n <>\n {AbortedTitle}\n <Typography variant=\"subtitle2\">{abortedMessage}</Typography>\n </>\n )}\n <StepsProgress\n aborted={abortedMessage !== undefined}\n steps={rollout.spec?.strategy?.canary?.steps ?? []}\n currentStepIndex={currentStepIndex}\n />\n </div>\n <div>\n <PodsTable\n pods={ownedPods}\n extraColumns={[READY_COLUMNS, RESOURCE_COLUMNS]}\n />\n </div>\n </div>\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const RolloutAccordions = ({\n rollouts,\n defaultExpanded = false,\n}: RolloutAccordionsProps) => {\n const groupedResponses = useContext(GroupedResponsesContext);\n\n return (\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n >\n {rollouts.map((rollout, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <RolloutAccordion\n defaultExpanded={defaultExpanded}\n matchingHpa={getMatchingHpa(\n {\n name: rollout.metadata?.name,\n namespace: rollout.metadata?.namespace,\n kind: 'rollout',\n },\n groupedResponses.horizontalPodAutoscalers,\n )}\n ownedPods={getOwnedPodsThroughReplicaSets(\n rollout,\n groupedResponses.replicaSets,\n groupedResponses.pods,\n )}\n rollout={rollout}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,YAAA,mBACJ,IAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IAEA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,CAAA;AAAA,sBAClB,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,SAAA,EAAO;AAAA;AAAA;AACzC,CAAA;AAGF,MAAM,kBAAA,GAAqB,CAAC,OAAA,KAC1B,OAAA,CAAQ,QAAQ,UAAA,EAAY,IAAA;AAAA,EAC1B,CAAC,MACC,CAAA,CAAE,IAAA,KAAS,iBACX,CAAA,CAAE,MAAA,KAAW,OAAA,IACb,CAAA,CAAE,MAAA,K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,EAAI,IAAA,EAAS,IAAE,IAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,eAAA;AAAA,UACA,WAAA,EAAa,cAAA;AAAA,YACX;AAAA,cACE,IAAA,EAAM,QAAQ,QAAA,EAAU,IAAA;AAAA,cACxB,SAAA,EAAW,QAAQ,QAAA,EAAU,SAAA;AAAA,cAC7B,IAAA,EAAM;AAAA,aACR;AAAA,YACA,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA,SAAA,EAAW,8BAAA;AAAA,YACT,OAAA;AAAA,YACA,gBAAA,CAAiB,WAAA;AAAA,YACjB,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAnBwB,CAoB1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"Rollout.esm.js","sources":["../../../../src/components/CustomResources/ArgoRollouts/Rollout.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode, useContext } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Pod, V2HorizontalPodAutoscaler } from '@kubernetes/client-node';\nimport { PodsTable } from '../../Pods';\nimport { HorizontalPodAutoscalerDrawer } from '../../HorizontalPodAutoscalers';\nimport { RolloutDrawer } from './RolloutDrawer';\nimport PauseIcon from '@material-ui/icons/Pause';\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\nimport { DateTime } from 'luxon';\nimport { StepsProgress } from './StepsProgress';\nimport {\n PodNamesWithErrorsContext,\n GroupedResponsesContext,\n} from '../../../hooks';\nimport {\n getMatchingHpa,\n getOwnedPodsThroughReplicaSets,\n} from '../../../utils/owner';\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { READY_COLUMNS, RESOURCE_COLUMNS } from '../../Pods/PodsTable';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\ntype RolloutAccordionsProps = {\n rollouts: any[];\n defaultExpanded?: boolean;\n children?: ReactNode;\n};\n\ntype RolloutAccordionProps = {\n rollout: any;\n ownedPods: V1Pod[];\n defaultExpanded?: boolean;\n matchingHpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\ntype RolloutSummaryProps = {\n rollout: any;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n hpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\nconst AbortedTitle = (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n }}\n >\n <ErrorOutlineIcon />\n <Typography variant=\"subtitle1\">Aborted</Typography>\n </div>\n);\n\nconst findAbortedMessage = (rollout: any): string | undefined =>\n rollout.status?.conditions?.find(\n (c: any) =>\n c.type === 'Progressing' &&\n c.status === 'False' &&\n c.reason === 'RolloutAborted',\n )?.message;\n\nconst RolloutSummary = ({\n rollout,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n hpa,\n}: RolloutSummaryProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const pauseTime: string | undefined = rollout.status?.pauseConditions?.find(\n (p: any) => p.reason === 'CanaryPauseStep',\n )?.startTime;\n const abortedMessage = findAbortedMessage(rollout);\n const specCpuUtil = hpa?.spec?.metrics?.find(\n metric => metric.type === 'Resource' && metric.resource?.name === 'cpu',\n )?.resource?.target.averageUtilization;\n\n const cpuUtil = hpa?.status?.currentMetrics?.find(\n metric => metric.type === 'Resource' && metric.resource?.name === 'cpu',\n )?.resource?.current.averageUtilization;\n\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={6} item>\n <RolloutDrawer rollout={rollout} />\n </Grid>\n {hpa && (\n <Grid item xs={3}>\n <HorizontalPodAutoscalerDrawer hpa={hpa}>\n <Grid\n item\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.replicasSummary', {\n min: String(hpa.spec?.minReplicas ?? '?'),\n max: String(hpa.spec?.maxReplicas ?? '?'),\n })}\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.currentCpuUsageLabel', {\n value: String(cpuUtil ?? '?'),\n })}\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.targetCpuUsageLabel', {\n value: String(specCpuUtil ?? '?'),\n })}\n </Typography>\n </Grid>\n </Grid>\n </HorizontalPodAutoscalerDrawer>\n </Grid>\n )}\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n <StatusOK>{t('pods.pods', { count: numberOfCurrentPods })}</StatusOK>\n </Grid>\n <Grid item>\n {numberOfPodsWithErrors > 0 ? (\n <StatusError>\n {t('cluster.podsWithErrors', { count: numberOfPodsWithErrors })}\n </StatusError>\n ) : (\n <StatusOK>{t('cluster.noPodsWithErrors')}</StatusOK>\n )}\n </Grid>\n </Grid>\n {pauseTime && (\n <Grid item xs={3}>\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n }}\n >\n <PauseIcon />\n <Typography variant=\"subtitle1\">\n Paused ({DateTime.fromISO(pauseTime).toRelative({ locale: 'en' })}\n )\n </Typography>\n </div>\n </Grid>\n )}\n {abortedMessage && (\n <Grid item xs={3}>\n {AbortedTitle}\n </Grid>\n )}\n </Grid>\n );\n};\n\nconst RolloutAccordion = ({\n rollout,\n ownedPods,\n matchingHpa,\n defaultExpanded,\n}: RolloutAccordionProps) => {\n const podNamesWithErrors = useContext(PodNamesWithErrorsContext);\n\n const podsWithErrors = ownedPods.filter(p =>\n podNamesWithErrors.has(p.metadata?.name ?? ''),\n );\n\n const currentStepIndex = rollout.status?.currentStepIndex ?? 0;\n const abortedMessage = findAbortedMessage(rollout);\n\n return (\n <Accordion\n defaultExpanded={defaultExpanded}\n TransitionProps={{ unmountOnExit: true }}\n variant=\"outlined\"\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <RolloutSummary\n rollout={rollout}\n numberOfCurrentPods={ownedPods.length}\n numberOfPodsWithErrors={podsWithErrors.length}\n hpa={matchingHpa}\n />\n </AccordionSummary>\n <AccordionDetails>\n <div style={{ width: '100%' }}>\n <div>\n <Typography variant=\"h6\">Rollout status</Typography>\n </div>\n <div style={{ margin: '1rem' }}>\n {abortedMessage && (\n <>\n {AbortedTitle}\n <Typography variant=\"subtitle2\">{abortedMessage}</Typography>\n </>\n )}\n <StepsProgress\n aborted={abortedMessage !== undefined}\n steps={rollout.spec?.strategy?.canary?.steps ?? []}\n currentStepIndex={currentStepIndex}\n />\n </div>\n <div>\n <PodsTable\n pods={ownedPods}\n extraColumns={[READY_COLUMNS, RESOURCE_COLUMNS]}\n />\n </div>\n </div>\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const RolloutAccordions = ({\n rollouts,\n defaultExpanded = false,\n}: RolloutAccordionsProps) => {\n const groupedResponses = useContext(GroupedResponsesContext);\n\n return (\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n >\n {rollouts.map((rollout, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <RolloutAccordion\n defaultExpanded={defaultExpanded}\n matchingHpa={getMatchingHpa(\n {\n name: rollout.metadata?.name,\n namespace: rollout.metadata?.namespace,\n kind: 'rollout',\n },\n groupedResponses.horizontalPodAutoscalers,\n )}\n ownedPods={getOwnedPodsThroughReplicaSets(\n rollout,\n groupedResponses.replicaSets,\n groupedResponses.pods,\n )}\n rollout={rollout}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,YAAA,mBACJ,IAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IAEA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,CAAA;AAAA,sBAClB,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,SAAA,EAAO;AAAA;AAAA;AACzC,CAAA;AAGF,MAAM,kBAAA,GAAqB,CAAC,OAAA,KAC1B,OAAA,CAAQ,QAAQ,UAAA,EAAY,IAAA;AAAA,EAC1B,CAAC,MACC,CAAA,CAAE,IAAA,KAAS,iBACX,CAAA,CAAE,MAAA,KAAW,OAAA,IACb,CAAA,CAAE,MAAA,KAAW;AACjB,CAAA,EAAG,OAAA;AAEL,MAAM,iBAAiB,CAAC;AAAA,EACtB,OAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA;AACF,CAAA,KAA2B;AACzB,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BA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AC,gBAAA;AAAA,QAAA;AAAA,UACC,eAAA;AAAA,UACA,WAAA,EAAa,cAAA;AAAA,YACX;AAAA,cACE,IAAA,EAAM,QAAQ,QAAA,EAAU,IAAA;AAAA,cACxB,SAAA,EAAW,QAAQ,QAAA,EAAU,SAAA;AAAA,cAC7B,IAAA,EAAM;AAAA,aACR;AAAA,YACA,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA,SAAA,EAAW,8BAAA;AAAA,YACT,OAAA;AAAA,YACA,gBAAA,CAAiB,WAAA;AAAA,YACjB,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAnBwB,CAoB1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
@@ -6,6 +6,8 @@ import '@material-ui/core/FormControlLabel';
6
6
  import '@material-ui/core/Switch';
7
7
  import 'js-yaml';
8
8
  import 'react';
9
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
10
+ import { kubernetesReactTranslationRef } from '../../../translation.esm.js';
9
11
  import Typography from '@material-ui/core/Typography';
10
12
  import Grid from '@material-ui/core/Grid';
11
13
  import Chip from '@material-ui/core/Chip';
@@ -14,6 +16,7 @@ const RolloutDrawer = ({
14
16
  rollout,
15
17
  expanded
16
18
  }) => {
19
+ const { t } = useTranslationRef(kubernetesReactTranslationRef);
17
20
  const namespace = rollout.metadata?.namespace;
18
21
  return /* @__PURE__ */ jsx(
19
22
  KubernetesStructuredMetadataTableDrawer,
@@ -33,7 +36,13 @@ const RolloutDrawer = ({
33
36
  children: [
34
37
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "body1", children: rollout.metadata?.name ?? "unknown object" }) }),
35
38
  /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { color: "textSecondary", variant: "subtitle1", children: "Rollout" }) }),
36
- namespace && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Chip, { size: "small", label: `namespace: ${namespace}` }) })
39
+ namespace && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
40
+ Chip,
41
+ {
42
+ size: "small",
43
+ label: t("namespace.labelWithValue", { namespace })
44
+ }
45
+ ) })
37
46
  ]
38
47
  }
39
48
  )
@@ -1 +1 @@
1
- {"version":3,"file":"RolloutDrawer.esm.js","sources":["../../../../src/components/CustomResources/ArgoRollouts/RolloutDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KubernetesStructuredMetadataTableDrawer } from '../../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\n\nexport const RolloutDrawer = ({\n rollout,\n expanded,\n}: {\n rollout: any;\n expanded?: boolean;\n}) => {\n const namespace = rollout.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={rollout}\n expanded={expanded}\n kind=\"Rollout\"\n renderObject={() => ({})}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {rollout.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Rollout\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],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file":"RolloutDrawer.esm.js","sources":["../../../../src/components/CustomResources/ArgoRollouts/RolloutDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KubernetesStructuredMetadataTableDrawer } from '../../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nexport const RolloutDrawer = ({\n rollout,\n expanded,\n}: {\n rollout: any;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = rollout.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={rollout}\n expanded={expanded}\n kind=\"Rollout\"\n renderObject={() => ({})}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {rollout.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Rollout\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip\n size=\"small\"\n label={t('namespace.labelWithValue', { namespace })}\n />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ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}
@@ -6,6 +6,8 @@ import '@material-ui/core/FormControlLabel';
6
6
  import '@material-ui/core/Switch';
7
7
  import 'js-yaml';
8
8
  import 'react';
9
+ import '@backstage/core-plugin-api/alpha';
10
+ import '../../translation.esm.js';
9
11
  import Typography from '@material-ui/core/Typography';
10
12
  import Grid from '@material-ui/core/Grid';
11
13
 
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCustomResourceDrawer.esm.js","sources":["../../../src/components/CustomResources/DefaultCustomResourceDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\n\nconst capitalize = (str: string) =>\n str.charAt(0).toLocaleUpperCase('en-US') + str.slice(1);\n\nexport const DefaultCustomResourceDrawer = ({\n customResource,\n customResourceName,\n expanded,\n}: {\n customResource: any;\n customResourceName: string;\n expanded?: boolean;\n}) => {\n const capitalizedName = capitalize(customResourceName);\n\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={customResource}\n expanded={expanded}\n kind={capitalizedName}\n renderObject={cr => cr}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {customResource.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n {capitalizedName}\n </Typography>\n </Grid>\n </Grid>\n </KubernetesStructuredMetadataT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er.esm.js","sources":["../../../src/components/CustomResources/DefaultCustomResourceDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\n\nconst capitalize = (str: string) =>\n str.charAt(0).toLocaleUpperCase('en-US') + str.slice(1);\n\nexport const DefaultCustomResourceDrawer = ({\n customResource,\n customResourceName,\n expanded,\n}: {\n customResource: any;\n customResourceName: string;\n expanded?: boolean;\n}) => {\n const capitalizedName = capitalize(customResourceName);\n\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={customResource}\n expanded={expanded}\n kind={capitalizedName}\n renderObject={cr => cr}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {customResource.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n {capitalizedName}\n </Typography>\n </Grid>\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBA,MAAM,UAAA,GAAa,CAAC,GAAA,KAClB,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,iBAAA,CAAkB,OAAO,CAAA,GAAI,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA;AAEjD,MAAM,8BAA8B,CAAC;AAAA,EAC1C,cAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF,CAAA,KAIM;AACJ,EAAA,MAAM,eAAA,GAAkB,WAAW,kBAAkB,CAAA;AAErD,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,cAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAM,eAAA;AAAA,MACN,cAAc,CAAA,EAAA,KAAM,EAAA;AAAA,MAEpB,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,cAAA,CAAe,QAAA,EAAU,IAAA,IAAQ,gBAAA,EACpC,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EACvC,QAAA,EAAA,eAAA,EACH,CAAA,EACF;AAAA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
@@ -28,6 +28,8 @@ import '../../hooks/useMatchingErrors.esm.js';
28
28
  import '@material-ui/icons/OpenInBrowser';
29
29
  import '../KubernetesDialog/KubernetesDialog.esm.js';
30
30
  import '../PodExecTerminal/PodExecTerminal.esm.js';
31
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
32
+ import { kubernetesReactTranslationRef } from '../../translation.esm.js';
31
33
  import '@material-ui/core/Paper';
32
34
  import '@material-ui/lab/Skeleton';
33
35
  import '@material-ui/icons/Subject';
@@ -51,6 +53,7 @@ const DaemonSetSummary = ({
51
53
  numberOfCurrentPods,
52
54
  numberOfPodsWithErrors
53
55
  }) => {
56
+ const { t } = useTranslationRef(kubernetesReactTranslationRef);
54
57
  return /* @__PURE__ */ jsxs(
55
58
  Grid,
56
59
  {
@@ -72,16 +75,8 @@ const DaemonSetSummary = ({
72
75
  alignItems: "flex-end",
73
76
  spacing: 0,
74
77
  children: [
75
- /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsxs(StatusOK, { children: [
76
- numberOfCurrentPods,
77
- " pods"
78
- ] }) }),
79
- /* @__PURE__ */ jsx(Grid, { item: true, children: numberOfPodsWithErrors > 0 ? /* @__PURE__ */ jsxs(StatusError, { children: [
80
- numberOfPodsWithErrors,
81
- " pod",
82
- numberOfPodsWithErrors > 1 ? "s" : "",
83
- " with errors"
84
- ] }) : /* @__PURE__ */ jsx(StatusOK, { children: "No pods with errors" }) })
78
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(StatusOK, { children: t("pods.pods", { count: numberOfCurrentPods }) }) }),
79
+ /* @__PURE__ */ jsx(Grid, { item: true, children: numberOfPodsWithErrors > 0 ? /* @__PURE__ */ jsx(StatusError, { children: t("cluster.podsWithErrors", { count: numberOfPodsWithErrors }) }) : /* @__PURE__ */ jsx(StatusOK, { children: t("cluster.noPodsWithErrors") }) })
85
80
  ]
86
81
  }
87
82
  )