@backstage/plugin-kubernetes-react 0.0.0-nightly-20260919022921 → 0.0.0-nightly-20260920023043

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 (95) hide show
  1. package/CHANGELOG.md +6 -6
  2. package/dist/alpha.esm.js.map +1 -1
  3. package/dist/api/KubernetesBackendClient.esm.js.map +1 -1
  4. package/dist/api/KubernetesClusterLinkFormatter.esm.js.map +1 -1
  5. package/dist/api/KubernetesProxyClient.esm.js.map +1 -1
  6. package/dist/api/formatters/AksClusterLinksFormatter.esm.js.map +1 -1
  7. package/dist/api/formatters/EksClusterLinksFormatter.esm.js.map +1 -1
  8. package/dist/api/formatters/GkeClusterLinksFormatter.esm.js.map +1 -1
  9. package/dist/api/formatters/HeadlampClusterLinksFormatter.esm.js.map +1 -1
  10. package/dist/api/formatters/OpenshiftClusterLinksFormatter.esm.js.map +1 -1
  11. package/dist/api/formatters/RancherClusterLinksFormatter.esm.js.map +1 -1
  12. package/dist/api/formatters/StandardClusterLinksFormatter.esm.js.map +1 -1
  13. package/dist/api/formatters/index.esm.js.map +1 -1
  14. package/dist/api/types.esm.js.map +1 -1
  15. package/dist/components/Cluster/Cluster.esm.js.map +1 -1
  16. package/dist/components/ConfigmapsAccordions/ConfigmapsAccordions.esm.js.map +1 -1
  17. package/dist/components/ConfigmapsAccordions/ConfigmapsDrawer.esm.js.map +1 -1
  18. package/dist/components/CronJobsAccordions/CronJobsAccordions.esm.js.map +1 -1
  19. package/dist/components/CronJobsAccordions/CronJobsDrawer.esm.js.map +1 -1
  20. package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js.map +1 -1
  21. package/dist/components/CustomResources/ArgoRollouts/RolloutDrawer.esm.js.map +1 -1
  22. package/dist/components/CustomResources/ArgoRollouts/StepsProgress.esm.js.map +1 -1
  23. package/dist/components/CustomResources/CustomResources.esm.js.map +1 -1
  24. package/dist/components/CustomResources/DefaultCustomResource.esm.js.map +1 -1
  25. package/dist/components/CustomResources/DefaultCustomResourceDrawer.esm.js.map +1 -1
  26. package/dist/components/DaemonSetsAccordions/DaemonSetsAccordions.esm.js.map +1 -1
  27. package/dist/components/DaemonSetsAccordions/DaemonSetsDrawer.esm.js.map +1 -1
  28. package/dist/components/DeploymentsAccordions/DeploymentDrawer.esm.js.map +1 -1
  29. package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js.map +1 -1
  30. package/dist/components/ErrorPanel/ErrorPanel.esm.js.map +1 -1
  31. package/dist/components/ErrorReporting/ErrorReporting.esm.js.map +1 -1
  32. package/dist/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.esm.js.map +1 -1
  33. package/dist/components/IngressesAccordions/IngressDrawer.esm.js.map +1 -1
  34. package/dist/components/IngressesAccordions/IngressesAccordions.esm.js.map +1 -1
  35. package/dist/components/JobsAccordions/JobsAccordions.esm.js.map +1 -1
  36. package/dist/components/JobsAccordions/JobsDrawer.esm.js.map +1 -1
  37. package/dist/components/KubernetesDialog/KubernetesDialog.esm.js.map +1 -1
  38. package/dist/components/KubernetesDrawer/KubernetesDrawer.esm.js.map +1 -1
  39. package/dist/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.esm.js.map +1 -1
  40. package/dist/components/KubernetesDrawer/ManifestYaml.esm.js.map +1 -1
  41. package/dist/components/PersistentVolumesAccordions/PersistentVolumesAccordions.esm.js.map +1 -1
  42. package/dist/components/PersistentVolumesAccordions/PersistentVolumesDrawer.esm.js.map +1 -1
  43. package/dist/components/PersistentVolumesAccordions/PersistentVolumesTable.esm.js.map +1 -1
  44. package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsAccordions.esm.js.map +1 -1
  45. package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsDrawer.esm.js.map +1 -1
  46. package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsTable.esm.js.map +1 -1
  47. package/dist/components/PodExecTerminal/PodExecTerminal.esm.js.map +1 -1
  48. package/dist/components/PodExecTerminal/PodExecTerminalAttachAddon.esm.js.map +1 -1
  49. package/dist/components/PodExecTerminal/PodExecTerminalContent.esm.js.map +1 -1
  50. package/dist/components/PodExecTerminal/PodExecTerminalDialog.esm.js.map +1 -1
  51. package/dist/components/Pods/ErrorList/ErrorList.esm.js.map +1 -1
  52. package/dist/components/Pods/Events/Events.esm.js.map +1 -1
  53. package/dist/components/Pods/Events/useEvents.esm.js.map +1 -1
  54. package/dist/components/Pods/FixDialog/FixDialog.esm.js.map +1 -1
  55. package/dist/components/Pods/PodDelete/PodDeleteButton.esm.js.map +1 -1
  56. package/dist/components/Pods/PodDelete/usePodDelete.esm.js.map +1 -1
  57. package/dist/components/Pods/PodDrawer/ContainerCard.esm.js.map +1 -1
  58. package/dist/components/Pods/PodDrawer/PendingPodContent.esm.js.map +1 -1
  59. package/dist/components/Pods/PodDrawer/PodDrawer.esm.js.map +1 -1
  60. package/dist/components/Pods/PodLogs/PodLogs.esm.js.map +1 -1
  61. package/dist/components/Pods/PodLogs/PodLogsDialog.esm.js.map +1 -1
  62. package/dist/components/Pods/PodLogs/usePodLogs.esm.js.map +1 -1
  63. package/dist/components/Pods/PodsTable.esm.js.map +1 -1
  64. package/dist/components/ResourceUtilization/ResourceUtilization.esm.js.map +1 -1
  65. package/dist/components/SecretsAccordions/SecretsAccordions.esm.js.map +1 -1
  66. package/dist/components/SecretsAccordions/SecretsDrawer.esm.js.map +1 -1
  67. package/dist/components/ServicesAccordions/ServiceDrawer.esm.js.map +1 -1
  68. package/dist/components/ServicesAccordions/ServicesAccordions.esm.js.map +1 -1
  69. package/dist/components/StatefulSetsAccordions/StatefulSetDrawer.esm.js.map +1 -1
  70. package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js.map +1 -1
  71. package/dist/hooks/Cluster.esm.js.map +1 -1
  72. package/dist/hooks/GroupedResponses.esm.js.map +1 -1
  73. package/dist/hooks/PodNamesWithErrors.esm.js.map +1 -1
  74. package/dist/hooks/PodNamesWithMetrics.esm.js.map +1 -1
  75. package/dist/hooks/auth.esm.js.map +1 -1
  76. package/dist/hooks/useCustomResources.esm.js.map +1 -1
  77. package/dist/hooks/useIsPodDeleteEnabled.esm.js.map +1 -1
  78. package/dist/hooks/useIsPodExecTerminalEnabled.esm.js.map +1 -1
  79. package/dist/hooks/useIsPodExecTerminalSupported.esm.js.map +1 -1
  80. package/dist/hooks/useKubernetesObjects.esm.js.map +1 -1
  81. package/dist/hooks/useMatchingErrors.esm.js.map +1 -1
  82. package/dist/hooks/usePodMetrics.esm.js.map +1 -1
  83. package/dist/kubernetes-auth-provider/AksKubernetesAuthProvider.esm.js.map +1 -1
  84. package/dist/kubernetes-auth-provider/GoogleKubernetesAuthProvider.esm.js.map +1 -1
  85. package/dist/kubernetes-auth-provider/KubernetesAuthProviders.esm.js.map +1 -1
  86. package/dist/kubernetes-auth-provider/OidcKubernetesAuthProvider.esm.js.map +1 -1
  87. package/dist/kubernetes-auth-provider/ServerSideAuthProvider.esm.js.map +1 -1
  88. package/dist/kubernetes-auth-provider/types.esm.js.map +1 -1
  89. package/dist/translation.esm.js.map +1 -1
  90. package/dist/utils/crons.esm.js.map +1 -1
  91. package/dist/utils/owner.esm.js.map +1 -1
  92. package/dist/utils/persistentVolumes.esm.js.map +1 -1
  93. package/dist/utils/pod.esm.js.map +1 -1
  94. package/dist/utils/resources.esm.js.map +1 -1
  95. package/package.json +9 -9
@@ -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';\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,E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AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,mBAAS,GAAA,CAAI,CAAC,SAAS,CAAA,qBACtB,GAAA,CAAC,QAAK,SAAA,EAAS,IAAA,EAAC,IAAA,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,MA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EAAS,IAAA,EAAC,IAAA,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 +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';\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,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,OAAO,EAAC,CAAA;AAAA,MAEtB,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;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;;;;"}
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';\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,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,OAAO,EAAC,CAAA;AAAA,MAEtB,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;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;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepsProgress.esm.js","sources":["../../../../src/components/CustomResources/ArgoRollouts/StepsProgress.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 Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ArgoRolloutCanaryStep,\n SetWeightStep,\n PauseStep,\n AnalysisStep,\n} from './types';\n\ninterface StepsProgressProps {\n currentStepIndex: number;\n aborted: boolean;\n steps: ArgoRolloutCanaryStep[];\n children?: ReactNode;\n}\n\nconst isSetWeightStep = (step: ArgoRolloutCanaryStep): step is SetWeightStep =>\n step.hasOwnProperty('setWeight');\n\nconst isPauseStep = (step: ArgoRolloutCanaryStep): step is PauseStep =>\n step.hasOwnProperty('pause');\n\nconst isAnalysisStep = (step: ArgoRolloutCanaryStep): step is AnalysisStep =>\n step.hasOwnProperty('analysis');\n\nconst createLabelForStep = (step: ArgoRolloutCanaryStep): ReactNode => {\n if (isSetWeightStep(step)) {\n return `setWeight ${step.setWeight}%`;\n } else if (isPauseStep(step)) {\n return step.pause.duration === undefined\n ? 'infinite pause'\n : `pause for ${step.pause.duration}`;\n } else if (isAnalysisStep(step)) {\n return (\n <div>\n <Typography paragraph>analysis templates:</Typography>\n {step.analysis.templates.map((t, i) => (\n <Typography paragraph key={i}>{`${t.templateName}${\n t.clusterScope ? ' (cluster scoped)' : ''\n }`}</Typography>\n ))}\n </div>\n );\n }\n return 'unknown step';\n};\n\nexport const StepsProgress = ({\n currentStepIndex,\n aborted,\n steps,\n}: StepsProgressProps) => {\n // If the activeStep is greater/equal to the number of steps\n // Then the canary is being promoted\n // Increase the step index to mark the 'canary promoted' step as done also\n const activeStepIndex =\n currentStepIndex >= steps.length ? currentStepIndex + 1 : currentStepIndex;\n\n /*\n * When the Rollout is aborted set the active step to -1\n * otherwise it appears to always be on the first step\n */\n return (\n <Stepper activeStep={aborted ? -1 : activeStepIndex} alternativeLabel>\n {steps\n .map((step, i) => (\n <Step key={i}>\n <StepLabel data-testid={`step-${i}`}>\n {createLabelForStep(step)}\n </StepLabel>\n </Step>\n ))\n .concat(\n <Step key=\"-1\">\n <StepLabel data-testid=\"step--1\">Canary promoted</StepLabel>\n </Step>,\n )}\n </Stepper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAmCA,MAAM,eAAA,GAAkB,CAAC,IAAA,KACvB,I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GAAI,gBAAA;AAM5D,EAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EAAQ,UAAA,EAAY,OAAA,GAAU,EAAA,GAAK,eAAA,EAAiB,gBAAA,EAAgB,IAAA,EAClE,QAAA,EAAA,KAAA,CACE,GAAA,CAAI,CAAC,IAAA,EAAM,CAAA,qBACV,GAAA,CAAC,IAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,aAAA,EAAa,CAAA,KAAA,EAAQ,CAAC,CAAA,CAAA,EAC9B,QAAA,EAAA,kBAAA,CAAmB,IAAI,CAAA,EAC1B,CAAA,EAAA,EAHS,CAIX,CACD,CAAA,CACA,MAAA;AAAA,oBACC,GAAA,CAAC,QACC,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,eAAY,SAAA,EAAU,QAAA,EAAA,iBAAA,EAAe,KADxC,IAEV;AAAA,GACF,EACJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"StepsProgress.esm.js","sources":["../../../../src/components/CustomResources/ArgoRollouts/StepsProgress.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 Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ArgoRolloutCanaryStep,\n SetWeightStep,\n PauseStep,\n AnalysisStep,\n} from './types';\n\ninterface StepsProgressProps {\n currentStepIndex: number;\n aborted: boolean;\n steps: ArgoRolloutCanaryStep[];\n children?: ReactNode;\n}\n\nconst isSetWeightStep = (step: ArgoRolloutCanaryStep): step is SetWeightStep =>\n step.hasOwnProperty('setWeight');\n\nconst isPauseStep = (step: ArgoRolloutCanaryStep): step is PauseStep =>\n step.hasOwnProperty('pause');\n\nconst isAnalysisStep = (step: ArgoRolloutCanaryStep): step is AnalysisStep =>\n step.hasOwnProperty('analysis');\n\nconst createLabelForStep = (step: ArgoRolloutCanaryStep): ReactNode => {\n if (isSetWeightStep(step)) {\n return `setWeight ${step.setWeight}%`;\n } else if (isPauseStep(step)) {\n return step.pause.duration === undefined\n ? 'infinite pause'\n : `pause for ${step.pause.duration}`;\n } else if (isAnalysisStep(step)) {\n return (\n <div>\n <Typography paragraph>analysis templates:</Typography>\n {step.analysis.templates.map((t, i) => (\n <Typography paragraph key={i}>{`${t.templateName}${\n t.clusterScope ? ' (cluster scoped)' : ''\n }`}</Typography>\n ))}\n </div>\n );\n }\n return 'unknown step';\n};\n\nexport const StepsProgress = ({\n currentStepIndex,\n aborted,\n steps,\n}: StepsProgressProps) => {\n // If the activeStep is greater/equal to the number of steps\n // Then the canary is being promoted\n // Increase the step index to mark the 'canary promoted' step as done also\n const activeStepIndex =\n currentStepIndex >= steps.length ? currentStepIndex + 1 : currentStepIndex;\n\n /*\n * When the Rollout is aborted set the active step to -1\n * otherwise it appears to always be on the first step\n */\n return (\n <Stepper activeStep={aborted ? -1 : activeStepIndex} alternativeLabel>\n {steps\n .map((step, i) => (\n <Step key={i}>\n <StepLabel data-testid={`step-${i}`}>\n {createLabelForStep(step)}\n </StepLabel>\n </Step>\n ))\n .concat(\n <Step key=\"-1\">\n <StepLabel data-testid=\"step--1\">Canary promoted</StepLabel>\n </Step>,\n )}\n </Stepper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAmCA,MAAM,eAAA,GAAkB,CAAC,IAAA,KACvB,IAAA,CAAK,eAAe,WAAW,CAAA;AAEjC,MAAM,WAAA,GAAc,CAAC,IAAA,KACnB,IAAA,CAAK,eAAe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AAA,GAAK,eAAA,EAAiB,gBAAA,EAAgB,IAAA,EAClE,QAAA,EAAA,KAAA,CACE,GAAA,CAAI,CAAC,IAAA,EAAM,CAAA,qBACV,GAAA,CAAC,IAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,aAAA,EAAa,CAAA,KAAA,EAAQ,CAAC,CAAA,CAAA,EAC9B,QAAA,EAAA,kBAAA,CAAmB,IAAI,CAAA,EAC1B,CAAA,EAAA,EAHS,CAIX,CACD,CAAA,CACA,MAAA;AAAA,oBACC,GAAA,CAAC,QACC,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,eAAY,SAAA,EAAU,QAAA,EAAA,iBAAA,EAAe,KADxC,IAEV;AAAA,GACF,EACJ,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomResources.esm.js","sources":["../../../src/components/CustomResources/CustomResources.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 lodash, { Dictionary } from 'lodash';\nimport { RolloutAccordions } from './ArgoRollouts';\nimport { DefaultCustomResourceAccordions } from './DefaultCustomResource';\nimport { GroupedResponsesContext } from '../../hooks';\n\n/**\n *\n *\n * @public\n */\nexport interface CustomResourcesProps {\n children?: ReactNode;\n}\n\nconst kindToResource = (customResources: any[]): Dictionary<any[]> => {\n return lodash.groupBy(customResources, value => {\n return value.kind;\n });\n};\n\n/**\n *\n *\n * @public\n */\nexport const CustomResources = ({}: CustomResourcesProps) => {\n const groupedResponses = useContext(GroupedResponsesContext);\n const kindToResourceMap = kindToResource(groupedResponses.customResources);\n\n return (\n <>\n {Object.entries(kindToResourceMap).map(([kind, resources], i) => {\n switch (kind) {\n case 'Rollout':\n return <RolloutAccordions key={i} rollouts={resources} />;\n default:\n return (\n <DefaultCustomResourceAccordions\n key={i}\n customResources={resources}\n customResourceName={kind}\n />\n );\n }\n })}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAA,GAAiB,CAAC,eAAA,KAA8C;AACpE,EAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,eAAA,EAAiB,CAAA,KAAA,KAAS;AAC9C,IAAA,OAAO,KAAA,CAAM,IAAA;AAAA,EACf,CAAC,CAAA;AACH,CAAA;AAOO,MAAM,eAAA,GAAkB,CAAC,EAAC,KAA4B;AAC3D,EAAA,MAAM,gBAAA,GAAmB,WAAW,uBAAuB,CAAA;AAC3D,EAAA,MAAM,iBAAA,GAAoB,cAAA,CAAe,gBAAA,CAAiB,eAAe,CAAA;AAEzE,EAAA,uBACE,GAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA,MAAA,CAAO,OAAA,CAAQ,iBAAiB,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,IAAA,EAAM,SAAS,CAAA,EAAG,CAAA,KAAM;AAC/D,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,SAAA;AACH,QAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAA0B,QAAA,EAAU,SAAA,EAAA,EAAb,CAAwB,CAAA;AAAA,MACzD;AACE,QAAA,uBACE,GAAA;AAAA,UAAC,+BAAA;AAAA,UAAA;AAAA,YAEC,eAAA,EAAiB,SAAA;AAAA,YACjB,kBAAA,EAAoB;AAAA,WAAA;AAAA,UAFf;AAAA,SAGP;AAAA;AAEN,EACF,CAAC,CAAA,EACH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"CustomResources.esm.js","sources":["../../../src/components/CustomResources/CustomResources.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 lodash, { Dictionary } from 'lodash';\nimport { RolloutAccordions } from './ArgoRollouts';\nimport { DefaultCustomResourceAccordions } from './DefaultCustomResource';\nimport { GroupedResponsesContext } from '../../hooks';\n\n/**\n *\n *\n * @public\n */\nexport interface CustomResourcesProps {\n children?: ReactNode;\n}\n\nconst kindToResource = (customResources: any[]): Dictionary<any[]> => {\n return lodash.groupBy(customResources, value => {\n return value.kind;\n });\n};\n\n/**\n *\n *\n * @public\n */\nexport const CustomResources = ({}: CustomResourcesProps) => {\n const groupedResponses = useContext(GroupedResponsesContext);\n const kindToResourceMap = kindToResource(groupedResponses.customResources);\n\n return (\n <>\n {Object.entries(kindToResourceMap).map(([kind, resources], i) => {\n switch (kind) {\n case 'Rollout':\n return <RolloutAccordions key={i} rollouts={resources} />;\n default:\n return (\n <DefaultCustomResourceAccordions\n key={i}\n customResources={resources}\n customResourceName={kind}\n />\n );\n }\n })}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAA,GAAiB,CAAC,eAAA,KAA8C;AACpE,EAAA,OAAO,MAAA,CAAO,OAAA,CAAQ,eAAA,EAAiB,CAAA,KAAA,KAAS;AAC9C,IAAA,OAAO,KAAA,CAAM,IAAA;AAAA,EACf,CAAC,CAAA;AACH,CAAA;AAOO,MAAM,eAAA,GAAkB,CAAC,EAAC,KAA4B;AAC3D,EAAA,MAAM,gBAAA,GAAmB,WAAW,uBAAuB,CAAA;AAC3D,EAAA,MAAM,iBAAA,GAAoB,cAAA,CAAe,gBAAA,CAAiB,eAAe,CAAA;AAEzE,EAAA,uBACE,GAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA,MAAA,CAAO,OAAA,CAAQ,iBAAiB,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,IAAA,EAAM,SAAS,CAAA,EAAG,CAAA,KAAM;AAC/D,IAAA,QAAQ,IAAA;AAAM,MACZ,KAAK,SAAA;AACH,QAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAA0B,QAAA,EAAU,SAAA,EAAA,EAAb,CAAwB,CAAA;AAAA,MACzD;AACE,QAAA,uBACE,GAAA;AAAA,UAAC,+BAAA;AAAA,UAAA;AAAA,YAEC,eAAA,EAAiB,SAAA;AAAA,YACjB,kBAAA,EAAoB;AAAA,WAAA;AAAA,UAFf;AAAA,SAGP;AAAA;AAEN,EACF,CAAC,CAAA,EACH,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultCustomResource.esm.js","sources":["../../../src/components/CustomResources/DefaultCustomResource.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 { 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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { DefaultCustomResourceDrawer } from './DefaultCustomResourceDrawer';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\ntype DefaultCustomResourceAccordionsProps = {\n customResources: any[];\n customResourceName: string;\n defaultExpanded?: boolean;\n children?: ReactNode;\n};\n\ntype DefaultCustomResourceAccordionProps = {\n customResource: any;\n customResourceName: string;\n defaultExpanded?: boolean;\n children?: ReactNode;\n};\n\ntype DefaultCustomResourceSummaryProps = {\n customResource: any;\n customResourceName: string;\n children?: ReactNode;\n};\n\nconst DefaultCustomResourceSummary = ({\n customResource,\n customResourceName,\n}: DefaultCustomResourceSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={12} item>\n <DefaultCustomResourceDrawer\n customResource={customResource}\n customResourceName={customResourceName}\n />\n </Grid>\n </Grid>\n );\n};\n\nconst DefaultCustomResourceAccordion = ({\n customResource,\n customResourceName,\n defaultExpanded,\n}: DefaultCustomResourceAccordionProps) => {\n return (\n <Accordion\n defaultExpanded={defaultExpanded}\n TransitionProps={{ unmountOnExit: true }}\n variant=\"outlined\"\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <DefaultCustomResourceSummary\n customResource={customResource}\n customResourceName={customResourceName}\n />\n </AccordionSummary>\n <AccordionDetails>\n {Object.prototype.hasOwnProperty.call(customResource, 'status') && (\n <StructuredMetadataTable\n metadata={customResource.status}\n options={{ nestedValuesAsYaml: true }}\n />\n )}\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const DefaultCustomResourceAccordions = ({\n customResources,\n customResourceName,\n defaultExpanded = false,\n}: DefaultCustomResourceAccordionsProps) => {\n return (\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n >\n {customResources.map((cr, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <DefaultCustomResourceAccordion\n defaultExpanded={defaultExpanded}\n customResource={cr}\n customResourceName={customResourceName}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":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AAK;AAAA,SACtC,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,MAAM,kCAAkC,CAAC;AAAA,EAC9C,eAAA;AAAA,EACA,kBAAA;AAAA,EACA,eAAA,GAAkB;AACpB,CAAA,KAA4C;AAC1C,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,QAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,0BAAgB,GAAA,CAAI,CAAC,IAAI,CAAA,qBACxB,GAAA,CAAC,QAAK,SAAA,EAAS,IAAA,EAAC,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,8BAAA;AAAA,QAAA;AAAA,UACC,eAAA;AAAA,UACA,cAAA,EAAgB,EAAA;AAAA,UAChB;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAPwB,CAQ1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultCustomResource.esm.js","sources":["../../../src/components/CustomResources/DefaultCustomResource.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 { 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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { DefaultCustomResourceDrawer } from './DefaultCustomResourceDrawer';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\ntype DefaultCustomResourceAccordionsProps = {\n customResources: any[];\n customResourceName: string;\n defaultExpanded?: boolean;\n children?: ReactNode;\n};\n\ntype DefaultCustomResourceAccordionProps = {\n customResource: any;\n customResourceName: string;\n defaultExpanded?: boolean;\n children?: ReactNode;\n};\n\ntype DefaultCustomResourceSummaryProps = {\n customResource: any;\n customResourceName: string;\n children?: ReactNode;\n};\n\nconst DefaultCustomResourceSummary = ({\n customResource,\n customResourceName,\n}: DefaultCustomResourceSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={12} item>\n <DefaultCustomResourceDrawer\n customResource={customResource}\n customResourceName={customResourceName}\n />\n </Grid>\n </Grid>\n );\n};\n\nconst DefaultCustomResourceAccordion = ({\n customResource,\n customResourceName,\n defaultExpanded,\n}: DefaultCustomResourceAccordionProps) => {\n return (\n <Accordion\n defaultExpanded={defaultExpanded}\n TransitionProps={{ unmountOnExit: true }}\n variant=\"outlined\"\n >\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <DefaultCustomResourceSummary\n customResource={customResource}\n customResourceName={customResourceName}\n />\n </AccordionSummary>\n <AccordionDetails>\n {Object.prototype.hasOwnProperty.call(customResource, 'status') && (\n <StructuredMetadataTable\n metadata={customResource.status}\n options={{ nestedValuesAsYaml: true }}\n />\n )}\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const DefaultCustomResourceAccordions = ({\n customResources,\n customResourceName,\n defaultExpanded = false,\n}: DefaultCustomResourceAccordionsProps) => {\n return (\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n >\n {customResources.map((cr, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <DefaultCustomResourceAccordion\n defaultExpanded={defaultExpanded}\n customResource={cr}\n customResourceName={customResourceName}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA6CA,MAAM,+BAA+B,CAAC;AAAA,EACpC,cAAA;AAAA,EACA;AACF,CAAA,KAAyC;AACvC,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,eAAA;AAAA,MACf,UAAA,EAAW,QAAA;AAAA,MACX,OAAA,EAAS,CAAA;AAAA,MAET,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAI,EAAA,EAAI,MAAI,IAAA,EAChB,QAAA,kBAAA,GAAA;AAAA,QAAC,2BAAA;AAAA,QAAA;AAAA,UACC,cAAA;AAAA,UACA;AAAA;AAAA,OACF,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEA,MAAM,iCAAiC,CAAC;AAAA,EACtC,cAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF,CAAA,KAA2C;AACzC,EAAA,uBACE,IAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,eAAA;AAAA,MACA,eAAA,EAAiB,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,MACvC,OAAA,EAAQ,UAAA;AAAA,MAER,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,UAAA,kBAAY,GAAA,CAAC,cAAA,EAAA,EAAe,CAAA,EAC5C,QAAA,kBAAA,GAAA;AAAA,UAAC,4BAAA;AAAA,UAAA;AAAA,YACC,cAAA;AAAA,YACA;AAAA;AAAA,SACF,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,oBACE,QAAA,EAAA,MAAA,CAAO,SAAA,CAAU,eAAe,IAAA,CAAK,cAAA,EAAgB,QAAQ,CAAA,oBAC5D,GAAA;AAAA,UAAC,uBAAA;AAAA,UAAA;AAAA,YACC,UAAU,cAAA,CAAe,MAAA;AAAA,YACzB,OAAA,EAAS,EAAE,kBAAA,EAAoB,IAAA;AAAK;AAAA,SACtC,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,MAAM,kCAAkC,CAAC;AAAA,EAC9C,eAAA;AAAA,EACA,kBAAA;AAAA,EACA,eAAA,GAAkB;AACpB,CAAA,KAA4C;AAC1C,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,QAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,0BAAgB,GAAA,CAAI,CAAC,IAAI,CAAA,qBACxB,GAAA,CAAC,QAAK,SAAA,EAAS,IAAA,EAAC,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,8BAAA;AAAA,QAAA;AAAA,UACC,eAAA;AAAA,UACA,cAAA,EAAgB,EAAA;AAAA,UAChB;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAPwB,CAQ1B,CACD;AAAA;AAAA,GACH;AAEJ;;"}
@@ -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) => str.charAt(0).toUpperCase() + 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,KAAgB,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,EAAY,GAAI,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA;AAEtE,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;;;;"}
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) => str.charAt(0).toUpperCase() + 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,KAAgB,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,EAAY,GAAI,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA;AAEtE,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;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DaemonSetsAccordions.esm.js","sources":["../../../src/components/DaemonSetsAccordions/DaemonSetsAccordions.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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Pod, V1DaemonSet } from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { DaemonSetDrawer } from './DaemonSetsDrawer';\nimport { getOwnedResources } from '../../utils/owner';\nimport {\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\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 DaemonSetsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype DaemonSetAccordionProps = {\n daemonset: V1DaemonSet;\n ownedPods: V1Pod[];\n children?: ReactNode;\n};\n\ntype DaemonSetSummaryProps = {\n daemonset: V1DaemonSet;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n children?: ReactNode;\n};\n\nconst DaemonSetSummary = ({\n daemonset,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n}: DaemonSetSummaryProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={4} item>\n <DaemonSetDrawer daemonset={daemonset} />\n </Grid>\n <Grid\n item\n container\n xs={4}\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 </Grid>\n );\n};\n\nconst DaemonSetAccordion = ({\n daemonset,\n ownedPods,\n}: DaemonSetAccordionProps) => {\n const podNamesWithErrors = useContext(PodNamesWithErrorsContext);\n\n const podsWithErrors = ownedPods.filter(p =>\n podNamesWithErrors.has(p.metadata?.name ?? ''),\n );\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <DaemonSetSummary\n daemonset={daemonset}\n numberOfCurrentPods={ownedPods.length}\n numberOfPodsWithErrors={podsWithErrors.length}\n />\n </AccordionSummary>\n <AccordionDetails>\n <PodsTable\n pods={ownedPods}\n extraColumns={[READY_COLUMNS, RESOURCE_COLUMNS]}\n />\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const DaemonSetsAccordions = ({}: DaemonSetsAccordionsProps) => {\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 {groupedResponses.daemonSets.map((daemonset, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <DaemonSetAccordion\n ownedPods={getOwnedResources(daemonset, groupedResponses.pods)}\n daemonset={daemonset}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,mBAAmB,CAAC;AAAA,EACxB,SAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAA,KAA6B;AAC3B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,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,QAAA;AAAA,MACX,OAAA,EAAS,CAAA;AAAA,MAET,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAI,CAAA,EAAG,IAAA,EAAI,MACf,QAAA,kBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,WAAsB,CAAA,EACzC,CAAA;AAAA,wBACA,IAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAI,IAAA;AAAA,YACJ,SAAA,EAAS,IAAA;AAAA,YACT,EAAA,EAAI,CAAA;AAAA,YACJ,SAAA,EAAU,QAAA;AAAA,YACV,cAAA,EAAe,YAAA;AAAA,YACf,UAAA,EAAW,UAAA;AAAA,YACX,OAAA,EAAS,CAAA;A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A,kBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,SAAA;AAAA,QACN,YAAA,EAAc,CAAC,aAAA,EAAe,gBAAgB;AAAA;AAAA,KAChD,EACF;AAAA,GAAA,EACF,CAAA;AAEJ,CAAA;AAEO,MAAM,oBAAA,GAAuB,CAAC,EAAC,KAAiC;AACrE,EAAA,MAAM,gBAAA,GAAmB,WAAW,uBAAuB,CAAA;AAE3D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,QAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,2BAAiB,UAAA,CAAW,GAAA,CAAI,CAAC,SAAA,EAAW,CAAA,yBAC1C,IAAA,EAAA,EAAK,SAAA,EAAS,MAAC,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,iBAAA,CAAkB,SAAA,EAAW,gBAAA,CAAiB,IAAI,CAAA;AAAA,UAC7D;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EANwB,CAO1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"DaemonSetsAccordions.esm.js","sources":["../../../src/components/DaemonSetsAccordions/DaemonSetsAccordions.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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Pod, V1DaemonSet } from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { DaemonSetDrawer } from './DaemonSetsDrawer';\nimport { getOwnedResources } from '../../utils/owner';\nimport {\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\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 DaemonSetsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype DaemonSetAccordionProps = {\n daemonset: V1DaemonSet;\n ownedPods: V1Pod[];\n children?: ReactNode;\n};\n\ntype DaemonSetSummaryProps = {\n daemonset: V1DaemonSet;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n children?: ReactNode;\n};\n\nconst DaemonSetSummary = ({\n daemonset,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n}: DaemonSetSummaryProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={4} item>\n <DaemonSetDrawer daemonset={daemonset} />\n </Grid>\n <Grid\n item\n container\n xs={4}\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 </Grid>\n );\n};\n\nconst DaemonSetAccordion = ({\n daemonset,\n ownedPods,\n}: DaemonSetAccordionProps) => {\n const podNamesWithErrors = useContext(PodNamesWithErrorsContext);\n\n const podsWithErrors = ownedPods.filter(p =>\n podNamesWithErrors.has(p.metadata?.name ?? ''),\n );\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <DaemonSetSummary\n daemonset={daemonset}\n numberOfCurrentPods={ownedPods.length}\n numberOfPodsWithErrors={podsWithErrors.length}\n />\n </AccordionSummary>\n <AccordionDetails>\n <PodsTable\n pods={ownedPods}\n extraColumns={[READY_COLUMNS, RESOURCE_COLUMNS]}\n />\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const DaemonSetsAccordions = ({}: DaemonSetsAccordionsProps) => {\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 {groupedResponses.daemonSets.map((daemonset, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <DaemonSetAccordion\n ownedPods={getOwnedResources(daemonset, groupedResponses.pods)}\n daemonset={daemonset}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,mBAAmB,CAAC;AAAA,EACxB,SAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAA,KAA6B;AAC3B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AA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AAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,iBAAA,CAAkB,SAAA,EAAW,gBAAA,CAAiB,IAAI,CAAA;AAAA,UAC7D;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EANwB,CAO1B,CACD;AAAA;AAAA,GACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DaemonSetsDrawer.esm.js","sources":["../../../src/components/DaemonSetsAccordions/DaemonSetsDrawer.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 type { V1DaemonSet } 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 DaemonSetDrawer = ({\n daemonset,\n expanded,\n}: {\n daemonset: V1DaemonSet;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = daemonset.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={daemonset}\n expanded={expanded}\n kind=\"DaemonSet\"\n renderObject={(daemonsetObj: V1DaemonSet) => {\n return {\n updateStrategyType: daemonsetObj.spec?.updateStrategy?.type ?? '???',\n minReadySeconds: daemonsetObj.spec?.minReadySeconds ?? '???',\n revisionHistoryLimit:\n daemonsetObj.spec?.revisionHistoryLimit ?? '???',\n currentNumberScheduled:\n daemonsetObj.status?.currentNumberScheduled ?? '???',\n desiredNumberScheduled:\n daemonsetObj.status?.desiredNumberScheduled ?? '???',\n numberAvailable: daemonsetObj.status?.numberAvailable ?? '???',\n numberMisscheduled: daemonsetObj.status?.numberMisscheduled ?? '???',\n numberReady: daemonsetObj.status?.numberReady ?? '???',\n };\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 {daemonset.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n DaemonSet\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":";;;;;;;;;;;;;;AAwBO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,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,YAAA,KAA8B;AAC3C,QAAA,OAAO;AAAA,UACL,kBAAA,EAAoB,YAAA,CAAa,IAAA,EAAM,cAAA,EAAgB,IAAA,IAAQ,KAAA;AAAA,UAC/D,eAAA,EAAiB,YAAA,CAAa,IAAA,EAAM,eAAA,IAAmB,KAAA;AAAA,UACvD,oBAAA,EACE,YAAA,CAAa,IAAA,EAAM,oBAAA,IAAwB,KA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E,WAAW;AAAA;AAAA,aACpD,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"DaemonSetsDrawer.esm.js","sources":["../../../src/components/DaemonSetsAccordions/DaemonSetsDrawer.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 type { V1DaemonSet } 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 DaemonSetDrawer = ({\n daemonset,\n expanded,\n}: {\n daemonset: V1DaemonSet;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = daemonset.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={daemonset}\n expanded={expanded}\n kind=\"DaemonSet\"\n renderObject={(daemonsetObj: V1DaemonSet) => {\n return {\n updateStrategyType: daemonsetObj.spec?.updateStrategy?.type ?? '???',\n minReadySeconds: daemonsetObj.spec?.minReadySeconds ?? '???',\n revisionHistoryLimit:\n daemonsetObj.spec?.revisionHistoryLimit ?? '???',\n currentNumberScheduled:\n daemonsetObj.status?.currentNumberScheduled ?? '???',\n desiredNumberScheduled:\n daemonsetObj.status?.desiredNumberScheduled ?? '???',\n numberAvailable: daemonsetObj.status?.numberAvailable ?? '???',\n numberMisscheduled: daemonsetObj.status?.numberMisscheduled ?? '???',\n numberReady: daemonsetObj.status?.numberReady ?? '???',\n };\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 {daemonset.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n DaemonSet\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":";;;;;;;;;;;;;;AAwBO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,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,YAAA,KAA8B;AAC3C,QAAA,OAAO;AAAA,UACL,kBAAA,EAAoB,YAAA,CAAa,IAAA,EAAM,cAAA,EAAgB,IAAA,IAAQ,KAAA;AAAA,UAC/D,eAAA,EAAiB,YAAA,CAAa,IAAA,EAAM,eAAA,IAAmB,KAAA;AAAA,UACvD,oBAAA,EACE,YAAA,CAAa,IAAA,EAAM,oBAAA,IAAwB,KAAA;AAAA,UAC7C,sBAAA,EACE,YAAA,CAAa,MAAA,EAAQ,sBAAA,IAA0B,KAAA;AAAA,UACjD,sBAAA,EACE,YAAA,CAAa,MAAA,EAAQ,sBAAA,IAA0B,KAAA;AAAA,UACjD,eAAA,EAAi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sx"],"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 type { V1Deployment } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport { renderCondition } from '../../utils/pod';\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 DeploymentDrawer = ({\n deployment,\n expanded,\n}: {\n deployment: V1Deployment;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = deployment.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={deployment}\n expanded={expanded}\n kind=\"Deployment\"\n renderObject={(deploymentObj: V1Deployment) => {\n const conditions = (deploymentObj.status?.conditions ?? [])\n .map(renderCondition)\n .reduce((accum, next) => {\n accum[next[0]] = next[1];\n return accum;\n }, {} as { [key: string]: ReactNode });\n\n return {\n strategy: deploymentObj.spec?.strategy ?? '???',\n minReadySeconds: deploymentObj.spec?.minReadySeconds ?? '???',\n progressDeadlineSeconds:\n deploymentObj.spec?.progressDeadlineSeconds ?? '???',\n ...conditions,\n };\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 {deployment.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Deployment\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":";;;;;;;;;;;;;;;AA0BO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,UAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,WAAW,QAAA,EAAU,SAAA;AACvC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,UAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,YAAA;AAAA,MACL,YAAA,EAAc,CAAC,aAAA,KAAgC;AAC7C,QAAA,MAAM,UAAA,GAAA,CAAc,aAAA,CAAc,MAAA,EAAQ,UAAA,IAAc,EAAC,EACtD,GAAA,CAAI,eAAe,CAAA,CACnB,MAAA,CAAO,CAAC,KAAA,EAAO,IAAA,KAAS;AACvB,UAAA,KAAA,CAAM,IAAA,CAAK,CAAC,CAAC,CAAA,GAAI,KAAK,CAAC,CAAA;AACvB,UAAA,OAAO,KAAA;AAAA,QACT,CAAA,EAAG,EAAkC,CAAA;AAEvC,QAAA,OAAO;AAAA,UACL,QAAA,EAAU,aAAA,CAAc,IAAA,EAAM,QAAA,IAAY,KAAA;AAAA,UAC1C,eAAA,EAAiB,aAAA,CAAc,IAAA,EAAM,eAAA,IAAmB,KAAA;AAAA,UACxD,uBAAA,EACE,aAAA,CAAc,IAAA,EAAM,uBAAA,IAA2B,KAAA;AAAA,UACjD,GAAG;AAAA,SACL;AAAA,MACF,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,UAAA,CAAW,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAChC,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,YAAA,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;;;;"}
1
+ {"version":3,"file":"DeploymentDrawer.esm.js","sources":["../../../src/components/DeploymentsAccordions/DeploymentDrawer.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 type { V1Deployment } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport { renderCondition } from '../../utils/pod';\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 DeploymentDrawer = ({\n deployment,\n expanded,\n}: {\n deployment: V1Deployment;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = deployment.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={deployment}\n expanded={expanded}\n kind=\"Deployment\"\n renderObject={(deploymentObj: V1Deployment) => {\n const conditions = (deploymentObj.status?.conditions ?? [])\n .map(renderCondition)\n .reduce((accum, next) => {\n accum[next[0]] = next[1];\n return accum;\n }, {} as { [key: string]: ReactNode });\n\n return {\n strategy: deploymentObj.spec?.strategy ?? '???',\n minReadySeconds: deploymentObj.spec?.minReadySeconds ?? '???',\n progressDeadlineSeconds:\n deploymentObj.spec?.progressDeadlineSeconds ?? '???',\n ...conditions,\n };\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 {deployment.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Deployment\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":";;;;;;;;;;;;;;;AA0BO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,UAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MA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CAAW,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAChC,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,YAAA,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;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeploymentsAccordions.esm.js","sources":["../../../src/components/DeploymentsAccordions/DeploymentsAccordions.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 {\n V1Deployment,\n V1Pod,\n V2HorizontalPodAutoscaler,\n} from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { DeploymentDrawer } from './DeploymentDrawer';\nimport { HorizontalPodAutoscalerDrawer } from '../HorizontalPodAutoscalers';\nimport {\n getOwnedPodsThroughReplicaSets,\n getMatchingHpa,\n} from '../../utils/owner';\nimport {\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\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 DeploymentsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype DeploymentAccordionProps = {\n deployment: V1Deployment;\n ownedPods: V1Pod[];\n matchingHpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\ntype DeploymentSummaryProps = {\n deployment: V1Deployment;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n hpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\nconst DeploymentSummary = ({\n deployment,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n hpa,\n}: DeploymentSummaryProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\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={4} item>\n <DeploymentDrawer deployment={deployment} />\n </Grid>\n {hpa && (\n <Grid item xs={4}>\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={4}\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 </Grid>\n );\n};\n\nconst DeploymentAccordion = ({\n deployment,\n ownedPods,\n matchingHpa,\n}: DeploymentAccordionProps) => {\n const podNamesWithErrors = useContext(PodNamesWithErrorsContext);\n\n const podsWithErrors = ownedPods.filter(p =>\n podNamesWithErrors.has(p.metadata?.name ?? ''),\n );\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <DeploymentSummary\n deployment={deployment}\n numberOfCurrentPods={ownedPods.length}\n numberOfPodsWithErrors={podsWithErrors.length}\n hpa={matchingHpa}\n />\n </AccordionSummary>\n <AccordionDetails>\n <PodsTable\n pods={ownedPods}\n extraColumns={[READY_COLUMNS, RESOURCE_COLUMNS]}\n />\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const DeploymentsAccordions = ({}: DeploymentsAccordionsProps) => {\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 {groupedResponses.deployments.map((deployment, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <DeploymentAccordion\n matchingHpa={getMatchingHpa(\n {\n name: deployment.metadata?.name,\n namespace: deployment.metadata?.namespace,\n kind: 'deployment',\n },\n groupedResponses.horizontalPodAutoscalers,\n )}\n ownedPods={getOwnedPodsThroughReplicaSets(\n deployment,\n groupedResponses.replicaSets,\n groupedResponses.pods,\n )}\n deployment={deployment}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,oBAAoB,CAAC;AAAA,EACzB,UAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA;AACF,CAAA,KAA8B;AAC5B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,WAAA,GAAc,GAAA,EAAK,IAAA,EAAM,OAAA,EAAS,IAAA;AAAA,IACtC,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,MAAA,CAAO,kBAAA;AAEpB,EAAA,MAAM,OAAA,GAAU,GAAA,EAAK,MAAA,EAAQ,cAAA,EAAgB,IAAA;AAAA,IAC3C,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,OAAA,CAAQ,kBAAA;AAErB,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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A;AAAA,UACC,WAAA,EAAa,cAAA;AAAA,YACX;AAAA,cACE,IAAA,EAAM,WAAW,QAAA,EAAU,IAAA;AAAA,cAC3B,SAAA,EAAW,WAAW,QAAA,EAAU,SAAA;AAAA,cAChC,IAAA,EAAM;AAAA,aACR;AAAA,YACA,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA,SAAA,EAAW,8BAAA;AAAA,YACT,UAAA;AAAA,YACA,gBAAA,CAAiB,WAAA;AAAA,YACjB,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAlBwB,CAmB1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"DeploymentsAccordions.esm.js","sources":["../../../src/components/DeploymentsAccordions/DeploymentsAccordions.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 {\n V1Deployment,\n V1Pod,\n V2HorizontalPodAutoscaler,\n} from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { DeploymentDrawer } from './DeploymentDrawer';\nimport { HorizontalPodAutoscalerDrawer } from '../HorizontalPodAutoscalers';\nimport {\n getOwnedPodsThroughReplicaSets,\n getMatchingHpa,\n} from '../../utils/owner';\nimport {\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\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 DeploymentsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype DeploymentAccordionProps = {\n deployment: V1Deployment;\n ownedPods: V1Pod[];\n matchingHpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\ntype DeploymentSummaryProps = {\n deployment: V1Deployment;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n hpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\nconst DeploymentSummary = ({\n deployment,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n hpa,\n}: DeploymentSummaryProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\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={4} item>\n <DeploymentDrawer deployment={deployment} />\n </Grid>\n {hpa && (\n <Grid item xs={4}>\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={4}\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 </Grid>\n );\n};\n\nconst DeploymentAccordion = ({\n deployment,\n ownedPods,\n matchingHpa,\n}: DeploymentAccordionProps) => {\n const podNamesWithErrors = useContext(PodNamesWithErrorsContext);\n\n const podsWithErrors = ownedPods.filter(p =>\n podNamesWithErrors.has(p.metadata?.name ?? ''),\n );\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <DeploymentSummary\n deployment={deployment}\n numberOfCurrentPods={ownedPods.length}\n numberOfPodsWithErrors={podsWithErrors.length}\n hpa={matchingHpa}\n />\n </AccordionSummary>\n <AccordionDetails>\n <PodsTable\n pods={ownedPods}\n extraColumns={[READY_COLUMNS, RESOURCE_COLUMNS]}\n />\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const DeploymentsAccordions = ({}: DeploymentsAccordionsProps) => {\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 {groupedResponses.deployments.map((deployment, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <DeploymentAccordion\n matchingHpa={getMatchingHpa(\n {\n name: deployment.metadata?.name,\n namespace: deployment.metadata?.namespace,\n kind: 'deployment',\n },\n groupedResponses.horizontalPodAutoscalers,\n )}\n ownedPods={getOwnedPodsThroughReplicaSets(\n deployment,\n groupedResponses.replicaSets,\n groupedResponses.pods,\n )}\n deployment={deployment}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,oBAAoB,CAAC;AAAA,EACzB,UAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA;AACF,CAAA,KAA8B;AAC5B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,WAAA,GAAc,GAAA,EAAK,IAAA,EAAM,OAAA,EAAS,IAAA;AAAA,IACtC,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,MAAA,CAAO,kBAAA;AAEpB,EAAA,MAAM,OAAA,GAAU,GAAA,EAAK,MAAA,EAAQ,cAAA,EAAgB,IAAA;AAAA,IAC3C,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,OAAA,CAAQ,kBAAA;AAErB,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,QAAA;AAAA,MACX,OAAA,EAAS,CAAA;AAAA,MAET,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAI,CAAA,EAAG,IAAA,E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AAA,cAChC,IAAA,EAAM;AAAA,aACR;AAAA,YACA,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA,SAAA,EAAW,8BAAA;AAAA,YACT,UAAA;AAAA,YACA,gBAAA,CAAiB,WAAA;AAAA,YACjB,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAlBwB,CAmB1B,CACD;AAAA;AAAA,GACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorPanel.esm.js","sources":["../../../src/components/ErrorPanel/ErrorPanel.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 Typography from '@material-ui/core/Typography';\nimport { ClusterObjects } from '@backstage/plugin-kubernetes-common';\nimport { WarningPanel } from '@backstage/core-components';\nimport {\n useTranslationRef,\n TranslationFunction,\n} from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\nconst clustersWithErrorsToErrorMessage = (\n clustersWithErrors: ClusterObjects[],\n t: TranslationFunction<typeof kubernetesReactTranslationRef.T>,\n): ReactNode => {\n return clustersWithErrors.map((c, i) => {\n return (\n <div key={i}>\n <Typography variant=\"body2\">\n {t('errorPanel.clusterLabelValue', {\n cluster: c.cluster.title || c.cluster.name,\n })}\n </Typography>\n {c.errors.map((e, j) => {\n return (\n <Typography variant=\"body2\" key={j}>\n {e.errorType === 'FETCH_ERROR'\n ? t('errorPanel.fetchError', {\n errorType: e.errorType,\n message: e.message,\n })\n : t('errorPanel.resourceError', {\n resourcePath: e.resourcePath ?? '',\n errorType: e.errorType,\n statusCode: String(e.statusCode ?? ''),\n })}\n </Typography>\n );\n })}\n <br />\n </div>\n );\n });\n};\n\n/**\n *\n *\n * @public\n */\nexport type ErrorPanelProps = {\n entityName: string;\n errorMessage?: string;\n clustersWithErrors?: ClusterObjects[];\n children?: ReactNode;\n};\n\n/**\n *\n *\n * @public\n */\nexport const ErrorPanel = ({\n entityName,\n errorMessage,\n clustersWithErrors,\n}: ErrorPanelProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <WarningPanel\n title={t('errorPanel.title')}\n message={t('errorPanel.message', { entityName })}\n >\n {clustersWithErrors && (\n <div>\n {t('errorPanel.errorsLabel')}:{' '}\n {clustersWithErrorsToErrorMessage(clustersWithErrors, t)}\n </div>\n )}\n {errorMessage && (\n <Typography variant=\"body2\">\n {t('errorPanel.errorsLabel')}: {errorMessage}\n </Typography>\n )}\n </WarningPanel>\n );\n};\n"],"names":[],"mappings":";;;;;;AA0BA,MAAM,gCAAA,GAAmC,CACvC,kBAAA,EACA,CAAA,KACc;AACd,EAAA,OAAO,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,KAAM;AACtC,IAAA,4BACG,KAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,CAAA,CAAE,8BAAA,EAAgC;AAAA,QACjC,OAAA,EAAS,CAAA,CAAE,OAAA,CAAQ,KAAA,IAAS,EAAE,OAAA,CAAQ;AAAA,OACvC,CAAA,EACH,CAAA;AAAA,MACC,CAAA,CAAE,MAAA,CAAO,GAAA,CAAI,CAAC,GAAG,CAAA,KAAM;AACtB,QAAA,uBACE,GAAA,CAAC,cAAW,OAAA,EAAQ,OAAA,EACjB,YAAE,SAAA,KAAc,aAAA,GACb,EAAE,uBAAA,EAAyB;AAAA,UACzB,WAAW,CAAA,CAAE,SAA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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 Typography from '@material-ui/core/Typography';\nimport { ClusterObjects } from '@backstage/plugin-kubernetes-common';\nimport { WarningPanel } from '@backstage/core-components';\nimport {\n useTranslationRef,\n TranslationFunction,\n} from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\nconst clustersWithErrorsToErrorMessage = (\n clustersWithErrors: ClusterObjects[],\n t: TranslationFunction<typeof kubernetesReactTranslationRef.T>,\n): ReactNode => {\n return clustersWithErrors.map((c, i) => {\n return (\n <div key={i}>\n <Typography variant=\"body2\">\n {t('errorPanel.clusterLabelValue', {\n cluster: c.cluster.title || c.cluster.name,\n })}\n </Typography>\n {c.errors.map((e, j) => {\n return (\n <Typography variant=\"body2\" key={j}>\n {e.errorType === 'FETCH_ERROR'\n ? t('errorPanel.fetchError', {\n errorType: e.errorType,\n message: e.message,\n })\n : t('errorPanel.resourceError', {\n resourcePath: e.resourcePath ?? '',\n errorType: e.errorType,\n statusCode: String(e.statusCode ?? ''),\n })}\n </Typography>\n );\n })}\n <br />\n </div>\n );\n });\n};\n\n/**\n *\n *\n * @public\n */\nexport type ErrorPanelProps = {\n entityName: string;\n errorMessage?: string;\n clustersWithErrors?: ClusterObjects[];\n children?: ReactNode;\n};\n\n/**\n *\n *\n * @public\n */\nexport const ErrorPanel = ({\n entityName,\n errorMessage,\n clustersWithErrors,\n}: ErrorPanelProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <WarningPanel\n title={t('errorPanel.title')}\n message={t('errorPanel.message', { entityName })}\n >\n {clustersWithErrors && (\n <div>\n {t('errorPanel.errorsLabel')}:{' '}\n {clustersWithErrorsToErrorMessage(clustersWithErrors, t)}\n </div>\n )}\n {errorMessage && (\n <Typography variant=\"body2\">\n {t('errorPanel.errorsLabel')}: {errorMessage}\n </Typography>\n )}\n </WarningPanel>\n );\n};\n"],"names":[],"mappings":";;;;;;AA0BA,MAAM,gCAAA,GAAmC,CACvC,kBAAA,EACA,CAAA,KACc;AACd,EAAA,OAAO,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,KAAM;AACtC,IAAA,4BACG,KAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,CAAA,CAAE,8BAAA,EAAgC;AAAA,QACjC,OAAA,EAAS,CAAA,CAAE,OAAA,CAAQ,KAAA,IAAS,EAAE,OAAA,CAAQ;AAAA,OACvC,CAAA,EACH,CAAA;AAAA,MACC,CAAA,CAAE,MAAA,CAAO,GAAA,CAAI,CAAC,GAAG,CAAA,KAAM;AACtB,QAAA,uBACE,GAAA,CAAC,cAAW,OAAA,EAAQ,OAAA,EACjB,YAAE,SAAA,KAAc,aAAA,GACb,EAAE,uBAAA,EAAyB;AAAA,UACzB,WAAW,CAAA,CAAE,SAAA;AAAA,UACb,SAAS,CAAA,CAAE;AAAA,SACZ,CAAA,GACD,CAAA,CAAE,0BAAA,EAA4B;AAAA,UAC5B,YAAA,EAAc,EAAE,YAAA,IAAgB,EAAA;AAAA,UAChC,WAAW,CAAA,CAAE,SAAA;AAAA,UACb,UAAA,EAAY,MAAA,CAAO,CAAA,CAAE,UAAA,IAAc,EAAE;AAAA,SACtC,KAV0B,CAWjC,CAAA;AAAA,MAEJ,CAAC,CAAA;AAAA,0BACA,IAAA,EAAA,EAAG;AAAA,KAAA,EAAA,EAtBI,CAuBV,CAAA;AAAA,EAEJ,CAAC,CAAA;AACH,CAAA;AAmBO,MAAM,aAAa,CAAC;AAAA,EACzB,UAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,KAAuB;AACrB,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,uBACE,IAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,MAC3B,OAAA,EAAS,CAAA,CAAE,oBAAA,EAAsB,EAAE,YAAY,CAAA;AAAA,MAE9C,QAAA,EAAA;AAAA,QAAA,kBAAA,yBACE,KAAA,EAAA,EACE,QAAA,EAAA;AAAA,UAAA,CAAA,CAAE,wBAAwB,CAAA;AAAA,UAAE,GAAA;AAAA,UAAE,GAAA;AAAA,UAC9B,gCAAA,CAAiC,oBAAoB,CAAC;AAAA,SAAA,EACzD,CAAA;AAAA,QAED,YAAA,oBACC,IAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA;AAAA,UAAA,CAAA,CAAE,wBAAwB,CAAA;AAAA,UAAE,IAAA;AAAA,UAAG;AAAA,SAAA,EAClC;AAAA;AAAA;AAAA,GAEJ;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorReporting.esm.js","sources":["../../../src/components/ErrorReporting/ErrorReporting.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 { useMemo } from 'react';\nimport {\n ClusterAttributes,\n DetectedError,\n DetectedErrorsByCluster,\n} from '@backstage/plugin-kubernetes-common';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\n/**\n *\n *\n * @public\n */\nexport type ErrorReportingProps = {\n detectedErrors: DetectedErrorsByCluster;\n clusters: ClusterAttributes[];\n};\n\ninterface Row {\n cluster: ClusterAttributes;\n error: DetectedError;\n}\n\nconst sortBySeverity = (a: Row, b: Row) => {\n if (a.error.severity < b.error.severity) {\n return 1;\n } else if (b.error.severity < a.error.severity) {\n return -1;\n }\n return 0;\n};\n\n/**\n *\n *\n * @public\n */\nexport const ErrorReporting = ({\n detectedErrors,\n clusters,\n}: ErrorReportingProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const errors = Array.from(detectedErrors.entries())\n .flatMap(([clusterName, resourceErrors]) => {\n return resourceErrors.map(e => ({\n cluster: clusters.find(c => c.name === clusterName)!,\n error: e,\n }));\n })\n .sort(sortBySeverity);\n\n const columns: TableColumn<Row>[] = useMemo(\n () => [\n {\n title: String(t('errorReporting.columns.cluster')),\n width: '10%',\n render: (row: Row) => row.cluster.title || row.cluster.name,\n },\n {\n title: String(t('errorReporting.columns.namespace')),\n width: '10%',\n render: (row: Row) => row.error.sourceRef.namespace,\n },\n {\n title: String(t('errorReporting.columns.kind')),\n width: '10%',\n render: (row: Row) => row.error.sourceRef.kind,\n },\n {\n title: String(t('errorReporting.columns.name')),\n width: '30%',\n render: (row: Row) => {\n return <>{row.error.sourceRef.name} </>;\n },\n },\n {\n title: String(t('errorReporting.columns.messages')),\n width: '40%',\n render: (row: Row) => row.error.message,\n },\n ],\n [t],\n );\n\n return (\n <>\n {errors.length !== 0 && (\n <Table\n title={t('errorReporting.title')}\n data={errors}\n columns={columns}\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAwCA,MAAM,cAAA,GAAiB,CAAC,CAA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yright 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 { useMemo } from 'react';\nimport {\n ClusterAttributes,\n DetectedError,\n DetectedErrorsByCluster,\n} from '@backstage/plugin-kubernetes-common';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\n/**\n *\n *\n * @public\n */\nexport type ErrorReportingProps = {\n detectedErrors: DetectedErrorsByCluster;\n clusters: ClusterAttributes[];\n};\n\ninterface Row {\n cluster: ClusterAttributes;\n error: DetectedError;\n}\n\nconst sortBySeverity = (a: Row, b: Row) => {\n if (a.error.severity < b.error.severity) {\n return 1;\n } else if (b.error.severity < a.error.severity) {\n return -1;\n }\n return 0;\n};\n\n/**\n *\n *\n * @public\n */\nexport const ErrorReporting = ({\n detectedErrors,\n clusters,\n}: ErrorReportingProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const errors = Array.from(detectedErrors.entries())\n .flatMap(([clusterName, resourceErrors]) => {\n return resourceErrors.map(e => ({\n cluster: clusters.find(c => c.name === clusterName)!,\n error: e,\n }));\n })\n .sort(sortBySeverity);\n\n const columns: TableColumn<Row>[] = useMemo(\n () => [\n {\n title: String(t('errorReporting.columns.cluster')),\n width: '10%',\n render: (row: Row) => row.cluster.title || row.cluster.name,\n },\n {\n title: String(t('errorReporting.columns.namespace')),\n width: '10%',\n render: (row: Row) => row.error.sourceRef.namespace,\n },\n {\n title: String(t('errorReporting.columns.kind')),\n width: '10%',\n render: (row: Row) => row.error.sourceRef.kind,\n },\n {\n title: String(t('errorReporting.columns.name')),\n width: '30%',\n render: (row: Row) => {\n return <>{row.error.sourceRef.name} </>;\n },\n },\n {\n title: String(t('errorReporting.columns.messages')),\n width: '40%',\n render: (row: Row) => row.error.message,\n },\n ],\n [t],\n );\n\n return (\n <>\n {errors.length !== 0 && (\n <Table\n title={t('errorReporting.title')}\n data={errors}\n columns={columns}\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAwCA,MAAM,cAAA,GAAiB,CAAC,CAAA,EAAQ,CAAA,KAAW;AACzC,EAAA,IAAI,CAAA,CAAE,KAAA,CAAM,QAAA,GAAW,CAAA,CAAE,MAAM,QAAA,EAAU;AACvC,IAAA,OAAO,CAAA;AAAA,EACT,WAAW,CAAA,CAAE,KAAA,CAAM,QAAA,GAAW,CAAA,CAAE,MAAM,QAAA,EAAU;AAC9C,IAAA,OAAO,EAAA;AAAA,EACT;AACA,EAAA,OAAO,CAAA;AACT,CAAA;AAOO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,cAAA;AAAA,EACA;AACF,CAAA,KAA2B;AACzB,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,MAAA,GAAS,KAAA,CAAM,IAAA,CAAK,cAAA,CAAe,OAAA,EAAS,CAAA,CAC/C,OAAA,CAAQ,CAAC,CAAC,WAAA,EAAa,cAAc,CAAA,KAAM;AAC1C,IAAA,OAAO,cAAA,CAAe,IAAI,CAAA,CAAA,MAAM;AAAA,MAC9B,SAAS,QAAA,CAAS,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,WAAW,CAAA;AAAA,MAClD,KAAA,EAAO;AAAA,KACT,CAAE,CAAA;AAAA,EACJ,CAAC,CAAA,CACA,IAAA,CAAK,cAAc,CAAA;AAEtB,EAAA,MAAM,OAAA,GAA8B,OAAA;AAAA,IAClC,MAAM;AAAA,MACJ;A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AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,sBAAsB,CAAA;AAAA,MAC/B,IAAA,EAAM,MAAA;AAAA,MACN,OAAA;AAAA,MACA,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAA,EAAQ,KAAA,EAAO,qBAAqB,KAAA;AAAM;AAAA,GACrE,EAEJ,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalPodAutoscalerDrawer.esm.js","sources":["../../../src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.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 type { V2HorizontalPodAutoscaler } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\n\n/** @public */\nexport const HorizontalPodAutoscalerDrawer = (props: {\n hpa: V2HorizontalPodAutoscaler;\n expanded?: boolean;\n children?: ReactNode;\n}) => {\n const { hpa, expanded, children } = props;\n\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 <KubernetesStructuredMetadataTableDrawer\n kind=\"HorizontalPodAutoscaler\"\n object={hpa}\n expanded={expanded}\n renderObject={(hpaObject: V2HorizontalPodAutoscaler) => {\n return {\n targetCPUUtilizationPercentage: specCpuUtil,\n currentCPUUtilizationPercentage: cpuUtil,\n minReplicas: hpaObject.spec?.minReplicas,\n maxReplicas: hpaObject.spec?.maxReplicas,\n currentReplicas: hpaObject.status?.currentReplicas,\n desiredReplicas: hpaObject.status?.desiredReplicas,\n lastScaleTime: hpa?.status?.lastScaleTime,\n };\n }}\n >\n {children}\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAqBO,MAAM,6BAAA,GAAgC,CAAC,KAAA,KAIxC;AACJ,EAAA,MAAM,EAAE,GAAA,EAAK,QAAA,EAAU,QAAA,EAAS,GAAI,KAAA;AAEpC,EAAA,MAAM,WAAA,GAAc,GAAA,EAAK,IAAA,EAAM,OAAA,EAAS,IAAA;AAAA,IACtC,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,MAAA,CAAO,kBAAA;AAEpB,EAAA,MAAM,OAAA,GAAU,GAAA,EAAK,MAAA,EAAQ,cAAA,EAAgB,IAAA;AAAA,IAC3C,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,OAAA,CAAQ,kBAAA;AAErB,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,yBAAA;AAAA,MACL,MAAA,EAAQ,GAAA;AAAA,MACR,QAAA;AAAA,MACA,YAAA,EAAc,CAAC,SAAA,KAAyC;AACtD,QAAA,OAAO;AAAA,UACL,8BAAA,EAAgC,WAAA;AAAA,UAChC,+BAAA,EAAiC,OAAA;AAAA,UACjC,WAAA,EAAa,UAAU,IAAA,EAAM,WAAA;AAAA,UAC7B,WAAA,EAAa,UAAU,IAAA,EAAM,WAAA;AAAA,UAC7B,eAAA,EAAiB,UAAU,MAAA,EAAQ,eAAA;AAAA,UACnC,eAAA,EAAiB,UAAU,MAAA,EAAQ,eAAA;AAAA,UACnC,aAAA,EAAe,KAAK,MAAA,EAAQ;AAAA,SAC9B;AAAA,MACF,CAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"HorizontalPodAutoscalerDrawer.esm.js","sources":["../../../src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.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 type { V2HorizontalPodAutoscaler } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\n\n/** @public */\nexport const HorizontalPodAutoscalerDrawer = (props: {\n hpa: V2HorizontalPodAutoscaler;\n expanded?: boolean;\n children?: ReactNode;\n}) => {\n const { hpa, expanded, children } = props;\n\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 <KubernetesStructuredMetadataTableDrawer\n kind=\"HorizontalPodAutoscaler\"\n object={hpa}\n expanded={expanded}\n renderObject={(hpaObject: V2HorizontalPodAutoscaler) => {\n return {\n targetCPUUtilizationPercentage: specCpuUtil,\n currentCPUUtilizationPercentage: cpuUtil,\n minReplicas: hpaObject.spec?.minReplicas,\n maxReplicas: hpaObject.spec?.maxReplicas,\n currentReplicas: hpaObject.status?.currentReplicas,\n desiredReplicas: hpaObject.status?.desiredReplicas,\n lastScaleTime: hpa?.status?.lastScaleTime,\n };\n }}\n >\n {children}\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAqBO,MAAM,6BAAA,GAAgC,CAAC,KAAA,KAIxC;AACJ,EAAA,MAAM,EAAE,GAAA,EAAK,QAAA,EAAU,QAAA,EAAS,GAAI,KAAA;AAEpC,EAAA,MAAM,WAAA,GAAc,GAAA,EAAK,IAAA,EAAM,OAAA,EAAS,IAAA;AAAA,IACtC,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,MAAA,CAAO,kBAAA;AAEpB,EAAA,MAAM,OAAA,GAAU,GAAA,EAAK,MAAA,EAAQ,cAAA,EAAgB,IAAA;AAAA,IAC3C,YAAU,MAAA,CAAO,IAAA,KAAS,UAAA,IAAc,MAAA,CAAO,UAAU,IAAA,KAAS;AAAA,GACpE,EAAG,UAAU,OAAA,CAAQ,kBAAA;AAErB,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,yBAAA;AAAA,MACL,MAAA,EAAQ,GAAA;AAAA,MACR,QAAA;AAAA,MACA,YAAA,EAAc,CAAC,SAAA,KAAyC;AACtD,QAAA,OAAO;AAAA,UACL,8BAAA,EAAgC,WAAA;AAAA,UAChC,+BAAA,EAAiC,OAAA;AAAA,UACjC,WAAA,EAAa,UAAU,IAAA,EAAM,WAAA;AAAA,UAC7B,WAAA,EAAa,UAAU,IAAA,EAAM,WAAA;AAAA,UAC7B,eAAA,EAAiB,UAAU,MAAA,EAAQ,eAAA;AAAA,UACnC,eAAA,EAAiB,UAAU,MAAA,EAAQ,eAAA;AAAA,UACnC,aAAA,EAAe,KAAK,MAAA,EAAQ;AAAA,SAC9B;AAAA,MACF,CAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IngressDrawer.esm.js","sources":["../../../src/components/IngressesAccordions/IngressDrawer.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 type { V1Ingress } 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 IngressDrawer = ({\n ingress,\n expanded,\n}: {\n ingress: V1Ingress;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = ingress.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={ingress}\n expanded={expanded}\n kind=\"Ingress\"\n renderObject={(ingressObject: V1Ingress) => {\n return ingressObject.spec || {};\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 {ingress.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Ingress\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`${t('namespace.label')} ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;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CAAA,CAAE,iBAAiB,CAAC,CAAA,CAAA,EAAI,SAAS,IAAI,CAAA,EACpE;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"IngressDrawer.esm.js","sources":["../../../src/components/IngressesAccordions/IngressDrawer.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 type { V1Ingress } 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 IngressDrawer = ({\n ingress,\n expanded,\n}: {\n ingress: V1Ingress;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = ingress.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={ingress}\n expanded={expanded}\n kind=\"Ingress\"\n renderObject={(ingressObject: V1Ingress) => {\n return ingressObject.spec || {};\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 {ingress.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Ingress\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`${t('namespace.label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K,IAAA,EAAI,IAAA,EACR,8BAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,KAAA,EAAO,GAAG,CAAA,CAAE,iBAAiB,CAAC,CAAA,CAAA,EAAI,SAAS,IAAI,CAAA,EACpE;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IngressesAccordions.esm.js","sources":["../../../src/components/IngressesAccordions/IngressesAccordions.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 { 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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Ingress } from '@kubernetes/client-node';\nimport { IngressDrawer } from './IngressDrawer';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\n/**\n *\n *\n * @public\n */\nexport type IngressesAccordionsProps = {};\n\ntype IngressAccordionProps = {\n ingress: V1Ingress;\n};\n\ntype IngressSummaryProps = {\n ingress: V1Ingress;\n};\n\nconst IngressSummary = ({ ingress }: IngressSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"flex-start\"\n alignItems=\"center\"\n >\n <Grid xs={12} item>\n <IngressDrawer ingress={ingress} />\n </Grid>\n </Grid>\n );\n};\n\ntype IngressCardProps = {\n ingress: V1Ingress;\n};\n\nconst IngressCard = ({ ingress }: IngressCardProps) => {\n return (\n <StructuredMetadataTable\n metadata={{\n ...ingress.spec,\n }}\n options={{\n nestedValuesAsYaml: true,\n }}\n />\n );\n};\n\nconst IngressAccordion = ({ ingress }: IngressAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <IngressSummary ingress={ingress} />\n </AccordionSummary>\n <AccordionDetails>\n <IngressCard ingress={ingress} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const IngressesAccordions = ({}: IngressesAccordionsProps) => {\n const groupedResponses = useContext(GroupedResponsesContext);\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n >\n {groupedResponses.ingresses.map((ingress, i) => (\n <Grid item key={i} xs>\n <IngressAccordion ingress={ingress} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,cAAA,GAAiB,CAAC,EAAE,OAAA,EAAQ,KAA2B;AAC3D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,QAAA;AAAA,MAEX,QAAA,kBAAA,GAAA,CAAC,QAAK,EAAA,EAAI,EAAA,EAAI,MAAI,IAAA,EAChB,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,OAAA,EAAkB,CAAA,EACnC;AAAA;AAAA,GACF;AAEJ,CAAA;AAMA,MAAM,WAAA,GAAc,CAAC,EAAE,OAAA,EAAQ,KAAwB;AACrD,EAAA,uBACE,GAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU;AAAA,QACR,GAAG,OAAA,CAAQ;AAAA,OACb;AAAA,MACA,OAAA,EAAS;AAAA,QACP,kBAAA,EAAoB;AAAA;AACtB;AAAA,GACF;AAEJ,CAAA;AAEA,MAAM,gBAAA,GAAmB,CAAC,EAAE,OAAA,EAAQ,KAA6B;AAC/D,EAAA,4BACG,SAAA,EAAA,EAAU,eAAA,EAAiB,EAAE,aAAA,EAAe,MAAK,EAChD,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,4BAAY,GAAA,CAAC,cAAA,EAAA,EAAe,GAC5C,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,SAAkB,CAAA,EACpC,CAAA;AAAA,oBACA,GAAA,CAAC,gBAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,SAAkB,CAAA,EACjC;AAAA,GAAA,EACF,CAAA;AAEJ,CAAA;AAOO,MAAM,mBAAA,GAAsB,CAAC,EAAC,KAAgC;AACnE,EAAA,MAAM,gBAAA,GAAmB,WAAW,uBAAuB,CAAA;AAC3D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,2BAAiB,SAAA,CAAU,GAAA,CAAI,CAAC,OAAA,EAAS,sBACxC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,oBAAiB,OAAA,EAAkB,CAAA,EAAA,EADtB,CAEhB,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"IngressesAccordions.esm.js","sources":["../../../src/components/IngressesAccordions/IngressesAccordions.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 { 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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Ingress } from '@kubernetes/client-node';\nimport { IngressDrawer } from './IngressDrawer';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\n/**\n *\n *\n * @public\n */\nexport type IngressesAccordionsProps = {};\n\ntype IngressAccordionProps = {\n ingress: V1Ingress;\n};\n\ntype IngressSummaryProps = {\n ingress: V1Ingress;\n};\n\nconst IngressSummary = ({ ingress }: IngressSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"flex-start\"\n alignItems=\"center\"\n >\n <Grid xs={12} item>\n <IngressDrawer ingress={ingress} />\n </Grid>\n </Grid>\n );\n};\n\ntype IngressCardProps = {\n ingress: V1Ingress;\n};\n\nconst IngressCard = ({ ingress }: IngressCardProps) => {\n return (\n <StructuredMetadataTable\n metadata={{\n ...ingress.spec,\n }}\n options={{\n nestedValuesAsYaml: true,\n }}\n />\n );\n};\n\nconst IngressAccordion = ({ ingress }: IngressAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <IngressSummary ingress={ingress} />\n </AccordionSummary>\n <AccordionDetails>\n <IngressCard ingress={ingress} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const IngressesAccordions = ({}: IngressesAccordionsProps) => {\n const groupedResponses = useContext(GroupedResponsesContext);\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n >\n {groupedResponses.ingresses.map((ingress, i) => (\n <Grid item key={i} xs>\n <IngressAccordion ingress={ingress} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,cAAA,GAAiB,CAAC,EAAE,OAAA,EAAQ,KAA2B;AAC3D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,QAAA;AAAA,MAEX,QAAA,kBAAA,GAAA,CAAC,QAAK,EAAA,EAAI,EAAA,EAAI,MAAI,IAAA,EAChB,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,OAAA,EAAkB,CAAA,EACnC;AAAA;AAAA,GACF;AAEJ,CAAA;AAMA,MAAM,WAAA,GAAc,CAAC,EAAE,OAAA,EAAQ,KAAwB;AACrD,EAAA,uBACE,GAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU;AAAA,QACR,GAAG,OAAA,CAAQ;AAAA,OACb;AAAA,MACA,OAAA,EAAS;AAAA,QACP,kBAAA,EAAoB;AAAA;AACtB;AAAA,GACF;AAEJ,CAAA;AAEA,MAAM,gBAAA,GAAmB,CAAC,EAAE,OAAA,EAAQ,KAA6B;AAC/D,EAAA,4BACG,SAAA,EAAA,EAAU,eAAA,EAAiB,EAAE,aAAA,EAAe,MAAK,EAChD,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,4BAAY,GAAA,CAAC,cAAA,EAAA,EAAe,GAC5C,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,SAAkB,CAAA,EACpC,CAAA;AAAA,oBACA,GAAA,CAAC,gBAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,SAAkB,CAAA,EACjC;AAAA,GAAA,EACF,CAAA;AAEJ,CAAA;AAOO,MAAM,mBAAA,GAAsB,CAAC,EAAC,KAAgC;AACnE,EAAA,MAAM,gBAAA,GAAmB,WAAW,uBAAuB,CAAA;AAC3D,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,2BAAiB,SAAA,CAAU,GAAA,CAAI,CAAC,OAAA,EAAS,sBACxC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,oBAAiB,OAAA,EAAkB,CAAA,EAAA,EADtB,CAEhB,CACD;AAAA;AAAA,GACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"JobsAccordions.esm.js","sources":["../../../src/components/JobsAccordions/JobsAccordions.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 { 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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Job, V1Pod } from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { JobDrawer } from './JobsDrawer';\nimport { getOwnedResources } from '../../utils/owner';\nimport { GroupedResponsesContext } from '../../hooks';\nimport {\n StatusError,\n StatusOK,\n StatusPending,\n} from '@backstage/core-components';\n\n/**\n *\n *\n * @public\n */\nexport type JobsAccordionsProps = {\n jobs: V1Job[];\n children?: ReactNode;\n};\n\ntype JobAccordionProps = {\n job: V1Job;\n ownedPods: V1Pod[];\n children?: ReactNode;\n};\n\ntype JobSummaryProps = {\n job: V1Job;\n children?: ReactNode;\n};\n\nconst JobSummary = ({ job }: JobSummaryProps) => {\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 <JobDrawer job={job} />\n </Grid>\n <Grid\n item\n container\n xs={6}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n {job.status?.succeeded && <StatusOK>Succeeded</StatusOK>}\n {job.status?.active && <StatusPending>Running</StatusPending>}\n {job.status?.failed && <StatusError>Failed</StatusError>}\n </Grid>\n <Grid item>Start time: {job.status?.startTime?.toString()}</Grid>\n {job.status?.completionTime && (\n <Grid item>\n Completion time: {job.status.completionTime.toString()}\n </Grid>\n )}\n </Grid>\n </Grid>\n );\n};\n\nconst JobAccordion = ({ job, ownedPods }: JobAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <JobSummary job={job} />\n </AccordionSummary>\n <AccordionDetails>\n <PodsTable pods={ownedPods} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const JobsAccordions = ({ jobs }: JobsAccordionsProps) => {\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 {jobs.map((job, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <JobAccordion\n ownedPods={getOwnedResources(job, groupedResponses.pods)}\n job={job}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,UAAA,GAAa,CAAC,EAAE,GAAA,EAAI,KAAuB;AAC/C,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,QAAA;AAAA,MACX,OAAA,EAAS,CAAA;AAAA,MAET,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAI,CAAA,EAAG,IAAA,EAAI,MACf,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,KAAU,CAAA,EACvB,CAAA;AAAA,wBACA,IAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAI,IAAA;AAAA,YACJ,SAAA,EAAS,IAAA;AAAA,YACT,EAAA,EAAI,CAAA;AAAA,YACJ,SAAA,EAAU,QAAA;AAAA,YACV,cAAA,EAAe,YAAA;AAAA,YACf,UAAA,EAAW,UAAA;AAAA,YACX,OAAA,EAAS,CAAA;AAAA,YAET,QAAA,EAAA;AAAA,8BAAA,IAAA,CAAC,IAAA,EAAA,EAAK,MAAI,IAAA,EACP,QAAA,EAAA;AAAA,gBAAA,GAAA,CAAI,MAAA,EAAQ,SAAA,oBAAa,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,EAAA,WAAA,EAAS,CAAA;AAAA,gBAC5C,GAAA,CAAI,MAAA,EAAQ,MAAA,oBAAU,GAAA,CAAC,iBAAc,QAAA,EAAA,SAAA,EAAO,CAAA;AAAA,gBAC5C,GAAA,CAAI,MAAA,EA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e,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,eAAK,GAAA,CAAI,CAAC,KAAK,CAAA,qBACd,GAAA,CAAC,QAAK,SAAA,EAAS,IAAA,EAAC,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EAC7B,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,iBAAA,CAAkB,GAAA,EAAK,gBAAA,CAAiB,IAAI,CAAA;AAAA,UACvD;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EANwB,CAO1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"JobsAccordions.esm.js","sources":["../../../src/components/JobsAccordions/JobsAccordions.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 { 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 ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Job, V1Pod } from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { JobDrawer } from './JobsDrawer';\nimport { getOwnedResources } from '../../utils/owner';\nimport { GroupedResponsesContext } from '../../hooks';\nimport {\n StatusError,\n StatusOK,\n StatusPending,\n} from '@backstage/core-components';\n\n/**\n *\n *\n * @public\n */\nexport type JobsAccordionsProps = {\n jobs: V1Job[];\n children?: ReactNode;\n};\n\ntype JobAccordionProps = {\n job: V1Job;\n ownedPods: V1Pod[];\n children?: ReactNode;\n};\n\ntype JobSummaryProps = {\n job: V1Job;\n children?: ReactNode;\n};\n\nconst JobSummary = ({ job }: JobSummaryProps) => {\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 <JobDrawer job={job} />\n </Grid>\n <Grid\n item\n container\n xs={6}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n {job.status?.succeeded && <StatusOK>Succeeded</StatusOK>}\n {job.status?.active && <StatusPending>Running</StatusPending>}\n {job.status?.failed && <StatusError>Failed</StatusError>}\n </Grid>\n <Grid item>Start time: {job.status?.startTime?.toString()}</Grid>\n {job.status?.completionTime && (\n <Grid item>\n Completion time: {job.status.completionTime.toString()}\n </Grid>\n )}\n </Grid>\n </Grid>\n );\n};\n\nconst JobAccordion = ({ job, ownedPods }: JobAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <JobSummary job={job} />\n </AccordionSummary>\n <AccordionDetails>\n <PodsTable pods={ownedPods} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const JobsAccordions = ({ jobs }: JobsAccordionsProps) => {\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 {jobs.map((job, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <JobAccordion\n ownedPods={getOwnedResources(job, groupedResponses.pods)}\n job={job}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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,kBAAA,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,iBAAA,CAAkB,GAAA,EAAK,gBAAA,CAAiB,IAAI,CAAA;AAAA,UACvD;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EANwB,CAO1B,CACD;AAAA;AAAA,GACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"JobsDrawer.esm.js","sources":["../../../src/components/JobsAccordions/JobsDrawer.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 { V1Job } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\n\nexport const JobDrawer = ({\n job,\n expanded,\n}: {\n job: V1Job;\n expanded?: boolean;\n}) => {\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={job}\n expanded={expanded}\n kind=\"Job\"\n renderObject={(jobObj: V1Job) => {\n return {\n parallelism: jobObj.spec?.parallelism ?? '???',\n completions: jobObj.spec?.completions ?? '???',\n backoffLimit: jobObj.spec?.backoffLimit ?? '???',\n startTime: jobObj.status?.startTime ?? '???',\n };\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 {job.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Job\n </Typography>\n </Grid>\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBO,MAAM,YAAY,CAAC;AAAA,EACxB,GAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,GAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,KAAA;AAAA,MACL,YAAA,EAAc,CAAC,MAAA,KAAkB;AAC/B,QAAA,OAAO;AAAA,UACL,WAAA,EAAa,MAAA,CAAO,IAAA,EAAM,WAAA,IAAe,KAAA;AAAA,UACzC,WAAA,EAAa,MAAA,CAAO,IAAA,EAAM,WAAA,IAAe,KAAA;AAAA,UACzC,YAAA,EAAc,MAAA,CAAO,IAAA,EAAM,YAAA,IAAgB,KAAA;AAAA,UAC3C,SAAA,EAAW,MAAA,CAAO,MAAA,EAAQ,SAAA,IAAa;AAAA,SACzC;AAAA,MACF,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,GAAA,CAAI,QAAA,EAAU,IAAA,IAAQ,gBAAA,EACzB,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,KAAA,EAEtD,CAAA,EACF;AAAA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"JobsDrawer.esm.js","sources":["../../../src/components/JobsAccordions/JobsDrawer.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 { V1Job } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\n\nexport const JobDrawer = ({\n job,\n expanded,\n}: {\n job: V1Job;\n expanded?: boolean;\n}) => {\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={job}\n expanded={expanded}\n kind=\"Job\"\n renderObject={(jobObj: V1Job) => {\n return {\n parallelism: jobObj.spec?.parallelism ?? '???',\n completions: jobObj.spec?.completions ?? '???',\n backoffLimit: jobObj.spec?.backoffLimit ?? '???',\n startTime: jobObj.status?.startTime ?? '???',\n };\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 {job.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Job\n </Typography>\n </Grid>\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBO,MAAM,Y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 @@
1
- {"version":3,"file":"KubernetesDialog.esm.js","sources":["../../../src/components/KubernetesDialog/KubernetesDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport IconButton from '@material-ui/core/IconButton';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport { ReactNode, useState } from 'react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n dialogPaper: { minHeight: 'calc(100% - 64px)' },\n dialogContent: { flexBasis: 0 },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n }),\n);\n\nexport interface KubernetesDialogProps {\n buttonAriaLabel: string;\n buttonIcon: ReactNode;\n buttonText: string;\n children?: ReactNode;\n disabled?: boolean;\n title: string;\n}\n\n/**\n * Dialog component for use in the Kubernetes plugin\n *\n * @public\n */\nexport const KubernetesDialog = ({\n buttonAriaLabel,\n buttonIcon,\n buttonText,\n children,\n disabled,\n title,\n}: KubernetesDialogProps) => {\n const classes = useStyles();\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n const [open, setOpen] = useState(false);\n const openDialog = () => {\n setOpen(true);\n };\n const closeDialog = () => {\n setOpen(false);\n };\n\n return (\n <>\n <Dialog\n maxWidth=\"xl\"\n fullWidth\n open={open}\n onClose={closeDialog}\n PaperProps={{ className: classes.dialogPaper }}\n >\n <DialogTitle id=\"dialog-title\">\n {title}\n <IconButton\n aria-label={t('kubernetesDialog.closeAriaLabel')}\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent className={classes.dialogContent}>\n {children}\n </DialogContent>\n </Dialog>\n <Button\n variant=\"outlined\"\n aria-label={buttonAriaLabel}\n component=\"label\"\n disabled={disabled}\n onClick={openDialog}\n startIcon={buttonIcon}\n >\n {buttonText}\n </Button>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,WAAA,EAAa,EAAE,SAAA,EAAW,mBAAA,EAAoB;AAAA,IAC9C,aAAA,EAAe,EAAE,SAAA,EAAW,CAAA,EAAE;AAAA,IAC9B,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG;AAAA;AAC/B,GACD;AACH,CAAA;AAgBO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,eAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,KAA6B;AAC3B,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAE7D,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MA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ubernetesDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport IconButton from '@material-ui/core/IconButton';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport { ReactNode, useState } from 'react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n dialogPaper: { minHeight: 'calc(100% - 64px)' },\n dialogContent: { flexBasis: 0 },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n }),\n);\n\nexport interface KubernetesDialogProps {\n buttonAriaLabel: string;\n buttonIcon: ReactNode;\n buttonText: string;\n children?: ReactNode;\n disabled?: boolean;\n title: string;\n}\n\n/**\n * Dialog component for use in the Kubernetes plugin\n *\n * @public\n */\nexport const KubernetesDialog = ({\n buttonAriaLabel,\n buttonIcon,\n buttonText,\n children,\n disabled,\n title,\n}: KubernetesDialogProps) => {\n const classes = useStyles();\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n const [open, setOpen] = useState(false);\n const openDialog = () => {\n setOpen(true);\n };\n const closeDialog = () => {\n setOpen(false);\n };\n\n return (\n <>\n <Dialog\n maxWidth=\"xl\"\n fullWidth\n open={open}\n onClose={closeDialog}\n PaperProps={{ className: classes.dialogPaper }}\n >\n <DialogTitle id=\"dialog-title\">\n {title}\n <IconButton\n aria-label={t('kubernetesDialog.closeAriaLabel')}\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent className={classes.dialogContent}>\n {children}\n </DialogContent>\n </Dialog>\n <Button\n variant=\"outlined\"\n aria-label={buttonAriaLabel}\n component=\"label\"\n disabled={disabled}\n onClick={openDialog}\n startIcon={buttonIcon}\n >\n {buttonText}\n </Button>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,WAAA,EAAa,EAAE,SAAA,EAAW,mBAAA,EAAoB;AAAA,IAC9C,aAAA,EAAe,EAAE,SAAA,EAAW,CAAA,EAAE;AAAA,IAC9B,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG;AAAA;AAC/B,GACD;AACH,CAAA;AAgBO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,eAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,KAA6B;AAC3B,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAE7D,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd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