@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.
- package/CHANGELOG.md +6 -6
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api/KubernetesBackendClient.esm.js.map +1 -1
- package/dist/api/KubernetesClusterLinkFormatter.esm.js.map +1 -1
- package/dist/api/KubernetesProxyClient.esm.js.map +1 -1
- package/dist/api/formatters/AksClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/EksClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/GkeClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/HeadlampClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/OpenshiftClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/RancherClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/StandardClusterLinksFormatter.esm.js.map +1 -1
- package/dist/api/formatters/index.esm.js.map +1 -1
- package/dist/api/types.esm.js.map +1 -1
- package/dist/components/Cluster/Cluster.esm.js.map +1 -1
- package/dist/components/ConfigmapsAccordions/ConfigmapsAccordions.esm.js.map +1 -1
- package/dist/components/ConfigmapsAccordions/ConfigmapsDrawer.esm.js.map +1 -1
- package/dist/components/CronJobsAccordions/CronJobsAccordions.esm.js.map +1 -1
- package/dist/components/CronJobsAccordions/CronJobsDrawer.esm.js.map +1 -1
- package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js.map +1 -1
- package/dist/components/CustomResources/ArgoRollouts/RolloutDrawer.esm.js.map +1 -1
- package/dist/components/CustomResources/ArgoRollouts/StepsProgress.esm.js.map +1 -1
- package/dist/components/CustomResources/CustomResources.esm.js.map +1 -1
- package/dist/components/CustomResources/DefaultCustomResource.esm.js.map +1 -1
- package/dist/components/CustomResources/DefaultCustomResourceDrawer.esm.js.map +1 -1
- package/dist/components/DaemonSetsAccordions/DaemonSetsAccordions.esm.js.map +1 -1
- package/dist/components/DaemonSetsAccordions/DaemonSetsDrawer.esm.js.map +1 -1
- package/dist/components/DeploymentsAccordions/DeploymentDrawer.esm.js.map +1 -1
- package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js.map +1 -1
- package/dist/components/ErrorPanel/ErrorPanel.esm.js.map +1 -1
- package/dist/components/ErrorReporting/ErrorReporting.esm.js.map +1 -1
- package/dist/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.esm.js.map +1 -1
- package/dist/components/IngressesAccordions/IngressDrawer.esm.js.map +1 -1
- package/dist/components/IngressesAccordions/IngressesAccordions.esm.js.map +1 -1
- package/dist/components/JobsAccordions/JobsAccordions.esm.js.map +1 -1
- package/dist/components/JobsAccordions/JobsDrawer.esm.js.map +1 -1
- package/dist/components/KubernetesDialog/KubernetesDialog.esm.js.map +1 -1
- package/dist/components/KubernetesDrawer/KubernetesDrawer.esm.js.map +1 -1
- package/dist/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.esm.js.map +1 -1
- package/dist/components/KubernetesDrawer/ManifestYaml.esm.js.map +1 -1
- package/dist/components/PersistentVolumesAccordions/PersistentVolumesAccordions.esm.js.map +1 -1
- package/dist/components/PersistentVolumesAccordions/PersistentVolumesDrawer.esm.js.map +1 -1
- package/dist/components/PersistentVolumesAccordions/PersistentVolumesTable.esm.js.map +1 -1
- package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsAccordions.esm.js.map +1 -1
- package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsDrawer.esm.js.map +1 -1
- package/dist/components/PersistentVolumesClaimsAccordions/PersistentVolumeClaimsTable.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminal.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminalAttachAddon.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminalContent.esm.js.map +1 -1
- package/dist/components/PodExecTerminal/PodExecTerminalDialog.esm.js.map +1 -1
- package/dist/components/Pods/ErrorList/ErrorList.esm.js.map +1 -1
- package/dist/components/Pods/Events/Events.esm.js.map +1 -1
- package/dist/components/Pods/Events/useEvents.esm.js.map +1 -1
- package/dist/components/Pods/FixDialog/FixDialog.esm.js.map +1 -1
- package/dist/components/Pods/PodDelete/PodDeleteButton.esm.js.map +1 -1
- package/dist/components/Pods/PodDelete/usePodDelete.esm.js.map +1 -1
- package/dist/components/Pods/PodDrawer/ContainerCard.esm.js.map +1 -1
- package/dist/components/Pods/PodDrawer/PendingPodContent.esm.js.map +1 -1
- package/dist/components/Pods/PodDrawer/PodDrawer.esm.js.map +1 -1
- package/dist/components/Pods/PodLogs/PodLogs.esm.js.map +1 -1
- package/dist/components/Pods/PodLogs/PodLogsDialog.esm.js.map +1 -1
- package/dist/components/Pods/PodLogs/usePodLogs.esm.js.map +1 -1
- package/dist/components/Pods/PodsTable.esm.js.map +1 -1
- package/dist/components/ResourceUtilization/ResourceUtilization.esm.js.map +1 -1
- package/dist/components/SecretsAccordions/SecretsAccordions.esm.js.map +1 -1
- package/dist/components/SecretsAccordions/SecretsDrawer.esm.js.map +1 -1
- package/dist/components/ServicesAccordions/ServiceDrawer.esm.js.map +1 -1
- package/dist/components/ServicesAccordions/ServicesAccordions.esm.js.map +1 -1
- package/dist/components/StatefulSetsAccordions/StatefulSetDrawer.esm.js.map +1 -1
- package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js.map +1 -1
- package/dist/hooks/Cluster.esm.js.map +1 -1
- package/dist/hooks/GroupedResponses.esm.js.map +1 -1
- package/dist/hooks/PodNamesWithErrors.esm.js.map +1 -1
- package/dist/hooks/PodNamesWithMetrics.esm.js.map +1 -1
- package/dist/hooks/auth.esm.js.map +1 -1
- package/dist/hooks/useCustomResources.esm.js.map +1 -1
- package/dist/hooks/useIsPodDeleteEnabled.esm.js.map +1 -1
- package/dist/hooks/useIsPodExecTerminalEnabled.esm.js.map +1 -1
- package/dist/hooks/useIsPodExecTerminalSupported.esm.js.map +1 -1
- package/dist/hooks/useKubernetesObjects.esm.js.map +1 -1
- package/dist/hooks/useMatchingErrors.esm.js.map +1 -1
- package/dist/hooks/usePodMetrics.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/AksKubernetesAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/GoogleKubernetesAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/KubernetesAuthProviders.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/OidcKubernetesAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/ServerSideAuthProvider.esm.js.map +1 -1
- package/dist/kubernetes-auth-provider/types.esm.js.map +1 -1
- package/dist/translation.esm.js.map +1 -1
- package/dist/utils/crons.esm.js.map +1 -1
- package/dist/utils/owner.esm.js.map +1 -1
- package/dist/utils/persistentVolumes.esm.js.map +1 -1
- package/dist/utils/pod.esm.js.map +1 -1
- package/dist/utils/resources.esm.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodDeleteButton.esm.js","sources":["../../../../src/components/Pods/PodDelete/PodDeleteButton.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 */\nimport { useState } from 'react';\n\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport CardActions from '@material-ui/core/CardActions';\nimport Button from '@material-ui/core/Button';\nimport DeleteIcon from '@material-ui/icons/Close';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nimport { usePodDelete } from './usePodDelete';\nimport { PodScope } from './types';\n\n/**\n * Props for PodDeleteButton\n *\n * @public\n */\nexport interface PodDeleteButtonProps {\n podScope: PodScope;\n}\n\n/**\n * a Delete button to delete a given pod\n *\n * @public\n */\nexport const PodDeleteButton = ({ podScope }: PodDeleteButtonProps) => {\n const [isLoading, setIsLoading] = useState(false);\n const [hasError, setHasError] = useState(false);\n const deletePod = usePodDelete();\n\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const buttonText = t('podDrawer.buttons.delete');\n\n const handleDeleteClick = async () => {\n setIsLoading(true);\n try {\n await deletePod(podScope);\n } catch (error) {\n setHasError(true);\n // eslint-disable-next-line no-console\n console.error(error);\n }\n };\n\n return (\n <Grid container item xs={12}>\n <Grid item xs={12}>\n <CardActions>\n <Button\n variant=\"outlined\"\n aria-label={buttonText}\n component=\"label\"\n onClick={handleDeleteClick}\n startIcon={\n isLoading ? <CircularProgress size={18} /> : <DeleteIcon />\n }\n disabled={isLoading}\n >\n {buttonText}\n </Button>\n </CardActions>\n {hasError && (\n <Typography\n variant=\"body1\"\n color=\"error\"\n style={{ textAlign: 'right' }}\n >\n Could not delete the pod. Please check the console for the full\n report.\n </Typography>\n )}\n </Grid>\n </Grid>\n );\n};\n"],"names":["DeleteIcon"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,eAAA,GAAkB,CAAC,EAAE,QAAA,EAAS,KAA4B;AACrE,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,YAAY,YAAA,EAAa;AAE/B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,UAAA,GAAa,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odDeleteButton.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 */\nimport { useState } from 'react';\n\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport CardActions from '@material-ui/core/CardActions';\nimport Button from '@material-ui/core/Button';\nimport DeleteIcon from '@material-ui/icons/Close';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nimport { usePodDelete } from './usePodDelete';\nimport { PodScope } from './types';\n\n/**\n * Props for PodDeleteButton\n *\n * @public\n */\nexport interface PodDeleteButtonProps {\n podScope: PodScope;\n}\n\n/**\n * a Delete button to delete a given pod\n *\n * @public\n */\nexport const PodDeleteButton = ({ podScope }: PodDeleteButtonProps) => {\n const [isLoading, setIsLoading] = useState(false);\n const [hasError, setHasError] = useState(false);\n const deletePod = usePodDelete();\n\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const buttonText = t('podDrawer.buttons.delete');\n\n const handleDeleteClick = async () => {\n setIsLoading(true);\n try {\n await deletePod(podScope);\n } catch (error) {\n setHasError(true);\n // eslint-disable-next-line no-console\n console.error(error);\n }\n };\n\n return (\n <Grid container item xs={12}>\n <Grid item xs={12}>\n <CardActions>\n <Button\n variant=\"outlined\"\n aria-label={buttonText}\n component=\"label\"\n onClick={handleDeleteClick}\n startIcon={\n isLoading ? <CircularProgress size={18} /> : <DeleteIcon />\n }\n disabled={isLoading}\n >\n {buttonText}\n </Button>\n </CardActions>\n {hasError && (\n <Typography\n variant=\"body1\"\n color=\"error\"\n style={{ textAlign: 'right' }}\n >\n Could not delete the pod. Please check the console for the full\n report.\n </Typography>\n )}\n </Grid>\n </Grid>\n );\n};\n"],"names":["DeleteIcon"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,eAAA,GAAkB,CAAC,EAAE,QAAA,EAAS,KAA4B;AACrE,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,YAAY,YAAA,EAAa;AAE/B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,UAAA,GAAa,EAAE,0BAA0B,CAAA;AAE/C,EAAA,MAAM,oBAAoB,YAAY;AACpC,IAAA,YAAA,CAAa,IAAI,CAAA;AACjB,IAAA,IAAI;AACF,MAAA,MAAM,UAAU,QAAQ,CAAA;AAAA,IAC1B,SAAS,KAAA,EAAO;AACd,MAAA,WAAA,CAAY,IAAI,CAAA;AAEhB,MAAA,OAAA,CAAQ,MAAM,KAAK,CAAA;AAAA,IACrB;AAAA,EACF,CAAA;AAEA,EAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACvB,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,IAAI,EAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,UAAA;AAAA,QACR,YAAA,EAAY,UAAA;AAAA,QACZ,SAAA,EAAU,OAAA;AAAA,QACV,OAAA,EAAS,iBAAA;AAAA,QACT,SAAA,EACE,4BAAY,GAAA,CAAC,gBAAA,EAAA,EAAiB,MAAM,EAAA,EAAI,CAAA,uBAAMA,SAAA,EAAA,EAAW,CAAA;AAAA,QAE3D,QAAA,EAAU,SAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA,KACH,EACF,CAAA;AAAA,IACC,QAAA,oBACC,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,OAAA;AAAA,QACR,KAAA,EAAM,OAAA;AAAA,QACN,KAAA,EAAO,EAAE,SAAA,EAAW,OAAA,EAAQ;AAAA,QAC7B,QAAA,EAAA;AAAA;AAAA;AAGD,GAAA,EAEJ,CAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePodDelete.esm.js","sources":["../../../../src/components/Pods/PodDelete/usePodDelete.ts"],"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 */\nimport { useCallback } from 'react';\n\nimport { PodScope } from './types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesProxyApiRef } from '../../../api/types';\n\n/**\n * Arguments for usePodDelete\n *\n * @public\n */\nexport interface PodDeleteOptions {\n podScope: PodScope;\n}\n\n/**\n * Delete a given pod\n *\n * @public\n */\nexport const usePodDelete = () => {\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n\n const deletePod = useCallback(\n async (podScope: PodScope) => {\n return await kubernetesProxyApi.deletePod({\n podName: podScope.podName,\n namespace: podScope.podNamespace,\n clusterName: podScope.cluster.name,\n });\n },\n [kubernetesProxyApi],\n );\n\n return deletePod;\n};\n"],"names":[],"mappings":";;;;AAmCO,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AAEvD,EAAA,MAAM,SAAA,GAAY,WAAA;AAAA,IAChB,OAAO,QAAA,KAAuB;AAC5B,MAAA,OAAO,MAAM,mBAAmB,SAAA,CAAU;AAAA,QACxC,SAAS,QAAA,CAAS,OAAA;AAAA,QAClB,WAAW,QAAA,CAAS,YAAA;AAAA,QACpB,WAAA,EAAa,SAAS,OAAA,CAAQ;AAAA,OAC/B,CAAA;AAAA,IACH,CAAA;AAAA,IACA,CAAC,kBAAkB;AAAA,GACrB;AAEA,EAAA,OAAO,SAAA;AACT
|
|
1
|
+
{"version":3,"file":"usePodDelete.esm.js","sources":["../../../../src/components/Pods/PodDelete/usePodDelete.ts"],"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 */\nimport { useCallback } from 'react';\n\nimport { PodScope } from './types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesProxyApiRef } from '../../../api/types';\n\n/**\n * Arguments for usePodDelete\n *\n * @public\n */\nexport interface PodDeleteOptions {\n podScope: PodScope;\n}\n\n/**\n * Delete a given pod\n *\n * @public\n */\nexport const usePodDelete = () => {\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n\n const deletePod = useCallback(\n async (podScope: PodScope) => {\n return await kubernetesProxyApi.deletePod({\n podName: podScope.podName,\n namespace: podScope.podNamespace,\n clusterName: podScope.cluster.name,\n });\n },\n [kubernetesProxyApi],\n );\n\n return deletePod;\n};\n"],"names":[],"mappings":";;;;AAmCO,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AAEvD,EAAA,MAAM,SAAA,GAAY,WAAA;AAAA,IAChB,OAAO,QAAA,KAAuB;AAC5B,MAAA,OAAO,MAAM,mBAAmB,SAAA,CAAU;AAAA,QACxC,SAAS,QAAA,CAAS,OAAA;AAAA,QAClB,WAAW,QAAA,CAAS,YAAA;AAAA,QACpB,WAAA,EAAa,SAAS,OAAA,CAAQ;AAAA,OAC/B,CAAA;AAAA,IACH,CAAA;AAAA,IACA,CAAC,kBAAkB;AAAA,GACrB;AAEA,EAAA,OAAO,SAAA;AACT;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContainerCard.esm.js","sources":["../../../../src/components/Pods/PodDrawer/ContainerCard.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { StructuredMetadataTable } from '@backstage/core-components';\nimport { ClientContainerStatus } from '@backstage/plugin-kubernetes-common';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { IContainer, IContainerStatus } from 'kubernetes-models/v1';\nimport { DateTime } from 'luxon';\n\nimport { useIsPodExecTerminalEnabled } from '../../../hooks';\nimport { bytesToMiB, formatMillicores } from '../../../utils/resources';\nimport { PodExecTerminalDialog } from '../../PodExecTerminal/PodExecTerminalDialog';\nimport { ResourceUtilization } from '../../ResourceUtilization';\nimport { PodLogsDialog, PodScope } from '../PodLogs';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nconst getContainerHealthChecks = (\n containerSpec: IContainer,\n containerStatus: IContainerStatus,\n): { [key: string]: boolean } => {\n const healthCheck = {\n 'not waiting to start': containerStatus.state?.waiting === undefined,\n 'no restarts': containerStatus.restartCount === 0,\n };\n if (containerStatus.state?.terminated?.reason === 'Completed') {\n return healthCheck;\n }\n Object.assign(\n healthCheck,\n { started: !!containerStatus.started },\n { ready: containerStatus.ready },\n { 'readiness probe set': containerSpec?.readinessProbe !== undefined },\n );\n if (containerSpec && containerSpec?.livenessProbe !== undefined) {\n Object.assign(healthCheck, {\n 'liveness probe set': containerSpec.livenessProbe,\n });\n }\n return healthCheck;\n};\n\nconst getCurrentState = (containerStatus: IContainerStatus): string => {\n return (\n containerStatus.state?.waiting?.reason ||\n containerStatus.state?.terminated?.reason ||\n (containerStatus.state?.running !== undefined ? 'Running' : 'Unknown')\n );\n};\n\nconst getStartedAtTime = (\n containerStatus: IContainerStatus,\n): string | undefined => {\n return (\n containerStatus.state?.running?.startedAt ||\n containerStatus.state?.terminated?.startedAt\n );\n};\n\ninterface ContainerDatetimeProps {\n prefix: string;\n dateTime: string;\n}\n\nconst ContainerDatetime = ({ prefix, dateTime }: ContainerDatetimeProps) => {\n return (\n <Typography variant=\"subtitle2\">\n {prefix}:{' '}\n {DateTime.fromISO(dateTime).toRelative({\n locale: 'en',\n })}\n </Typography>\n );\n};\n\n/**\n * Props for ContainerCard\n *\n * @public\n */\nexport interface ContainerCardProps {\n podScope: PodScope;\n containerSpec?: IContainer;\n containerStatus: IContainerStatus;\n containerMetrics?: ClientContainerStatus;\n}\n\n/**\n * Shows details about a container within a pod\n *\n * @public\n */\nexport function ContainerCard({\n podScope,\n containerSpec,\n containerStatus,\n containerMetrics,\n}: ContainerCardProps) {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const isPodExecTerminalEnabled = useIsPodExecTerminalEnabled();\n\n // This should never be undefined\n if (containerSpec === undefined) {\n return <Typography>error reading pod from cluster</Typography>;\n }\n const containerStartedTime = getStartedAtTime(containerStatus);\n const containerFinishedTime = containerStatus.state?.terminated?.finishedAt;\n\n return (\n <Card>\n <CardHeader\n title={containerStatus.name}\n subheader={containerStatus.image}\n />\n <CardContent>\n <Grid container>\n <Grid item xs={12}>\n {containerStartedTime && (\n <ContainerDatetime\n prefix=\"Started\"\n dateTime={containerStartedTime}\n />\n )}\n {containerFinishedTime && (\n <ContainerDatetime\n prefix=\"Completed\"\n dateTime={containerFinishedTime}\n />\n )}\n {containerStartedTime && containerFinishedTime && (\n <Typography variant=\"subtitle2\">\n Execution time:{' '}\n {DateTime.fromISO(containerFinishedTime)\n .diff(DateTime.fromISO(containerStartedTime), [\n 'hours',\n 'minutes',\n 'seconds',\n ])\n .toHuman()}\n </Typography>\n )}\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">\n Status: {getCurrentState(containerStatus)}\n </Typography>\n </Grid>\n {containerStatus.restartCount > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">\n Restarts: {containerStatus.restartCount}\n </Typography>\n </Grid>\n )}\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">Container health</Typography>\n </Grid>\n <Grid item xs={12}>\n <StructuredMetadataTable\n metadata={getContainerHealthChecks(\n containerSpec,\n containerStatus,\n )}\n options={{ nestedValuesAsYaml: true }}\n />\n </Grid>\n {containerMetrics && (\n <Grid container item xs={12} spacing={0}>\n <Grid item xs={12}>\n <Typography variant=\"subtitle1\">\n {t('podDrawer.resourceUtilization')}\n </Typography>\n </Grid>\n <Grid item xs={12} style={{ minHeight: '5rem' }}>\n <ResourceUtilization\n compressed\n title={t('podDrawer.cpuRequests')}\n usage={containerMetrics.cpuUsage.currentUsage}\n total={containerMetrics.cpuUsage.requestTotal}\n totalFormatted={formatMillicores(\n containerMetrics.cpuUsage.requestTotal,\n )}\n />\n <ResourceUtilization\n compressed\n title={t('podDrawer.cpuLimits')}\n usage={containerMetrics.cpuUsage.currentUsage}\n total={containerMetrics.cpuUsage.limitTotal}\n totalFormatted={formatMillicores(\n containerMetrics.cpuUsage.limitTotal,\n )}\n />\n <ResourceUtilization\n compressed\n title={t('podDrawer.memoryRequests')}\n usage={containerMetrics.memoryUsage.currentUsage}\n total={containerMetrics.memoryUsage.requestTotal}\n totalFormatted={bytesToMiB(\n containerMetrics.memoryUsage.requestTotal,\n )}\n />\n <ResourceUtilization\n compressed\n title={t('podDrawer.memoryLimits')}\n usage={containerMetrics.memoryUsage.currentUsage}\n total={containerMetrics.memoryUsage.limitTotal}\n totalFormatted={bytesToMiB(\n containerMetrics.memoryUsage.limitTotal,\n )}\n />\n </Grid>\n </Grid>\n )}\n </Grid>\n </CardContent>\n <CardActions>\n <PodLogsDialog\n containerScope={{\n containerName: containerStatus.name,\n ...podScope,\n }}\n />\n {isPodExecTerminalEnabled && (\n <PodExecTerminalDialog\n cluster={podScope.cluster}\n containerName={containerStatus.name}\n podName={podScope.podName}\n podNamespace={podScope.podNamespace}\n />\n )}\n </CardActions>\n </Card>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,wBAAA,GAA2B,CAC/B,aAAA,EACA,eAAA,KAC+B;AAC/B,EAAA,MAAM,WAAA,GAAc;AAAA,IAClB,sBAAA,EAAwB,eAAA,CAAgB,KAAA,EAAO,OAAA,KAAY,MAAA;AAAA,IAC3D,aAAA,EAAe,gBAAgB,YAAA,KAAiB;AAAA,GAClD;AACA,EAAA,IAAI,eAAA,CAAgB,KAAA,EAAO,UAAA,EAAY,MAAA,KAAW,WAAA,EAAa;AAC7D,IAAA,OAAO,WAAA;AAAA,EACT;AACA,EAAA,MAAA,CAAO,MAAA;AAAA,IACL,WAAA;AAAA,IACA,EAAE,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A,CAAY,YAAA;AAAA,cACpC,KAAA,EAAO,iBAAiB,WAAA,CAAY,YAAA;AAAA,cACpC,cAAA,EAAgB,UAAA;AAAA,gBACd,iBAAiB,WAAA,CAAY;AAAA;AAC/B;AAAA,WACF;AAAA,0BACA,GAAA;AAAA,YAAC,mBAAA;AAAA,YAAA;AAAA,cACC,UAAA,EAAU,IAAA;AAAA,cACV,KAAA,EAAO,EAAE,wBAAwB,CAAA;AAAA,cACjC,KAAA,EAAO,iBAAiB,WAAA,CAAY,YAAA;AAAA,cACpC,KAAA,EAAO,iBAAiB,WAAA,CAAY,UAAA;AAAA,cACpC,cAAA,EAAgB,UAAA;AAAA,gBACd,iBAAiB,WAAA,CAAY;AAAA;AAC/B;AAAA;AACF,SAAA,EACF;AAAA,OAAA,EACF;AAAA,KAAA,EAEJ,CAAA,EACF,CAAA;AAAA,yBACC,WAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,aAAA;AAAA,QAAA;AAAA,UACC,cAAA,EAAgB;AAAA,YACd,eAAe,eAAA,CAAgB,IAAA;AAAA,YAC/B,GAAG;AAAA;AACL;AAAA,OACF;AAAA,MACC,wBAAA,oBACC,GAAA;AAAA,QAAC,qBAAA;AAAA,QAAA;AAAA,UACC,SAAS,QAAA,CAAS,OAAA;AAAA,UAClB,eAAe,eAAA,CAAgB,IAAA;AAAA,UAC/B,SAAS,QAAA,CAAS,OAAA;AAAA,UAClB,cAAc,QAAA,CAAS;AAAA;AAAA;AACzB,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"ContainerCard.esm.js","sources":["../../../../src/components/Pods/PodDrawer/ContainerCard.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { StructuredMetadataTable } from '@backstage/core-components';\nimport { ClientContainerStatus } from '@backstage/plugin-kubernetes-common';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { IContainer, IContainerStatus } from 'kubernetes-models/v1';\nimport { DateTime } from 'luxon';\n\nimport { useIsPodExecTerminalEnabled } from '../../../hooks';\nimport { bytesToMiB, formatMillicores } from '../../../utils/resources';\nimport { PodExecTerminalDialog } from '../../PodExecTerminal/PodExecTerminalDialog';\nimport { ResourceUtilization } from '../../ResourceUtilization';\nimport { PodLogsDialog, PodScope } from '../PodLogs';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nconst getContainerHealthChecks = (\n containerSpec: IContainer,\n containerStatus: IContainerStatus,\n): { [key: string]: boolean } => {\n const healthCheck = {\n 'not waiting to start': containerStatus.state?.waiting === undefined,\n 'no restarts': containerStatus.restartCount === 0,\n };\n if (containerStatus.state?.terminated?.reason === 'Completed') {\n return healthCheck;\n }\n Object.assign(\n healthCheck,\n { started: !!containerStatus.started },\n { ready: containerStatus.ready },\n { 'readiness probe set': containerSpec?.readinessProbe !== undefined },\n );\n if (containerSpec && containerSpec?.livenessProbe !== undefined) {\n Object.assign(healthCheck, {\n 'liveness probe set': containerSpec.livenessProbe,\n });\n }\n return healthCheck;\n};\n\nconst getCurrentState = (containerStatus: IContainerStatus): string => {\n return (\n containerStatus.state?.waiting?.reason ||\n containerStatus.state?.terminated?.reason ||\n (containerStatus.state?.running !== undefined ? 'Running' : 'Unknown')\n );\n};\n\nconst getStartedAtTime = (\n containerStatus: IContainerStatus,\n): string | undefined => {\n return (\n containerStatus.state?.running?.startedAt ||\n containerStatus.state?.terminated?.startedAt\n );\n};\n\ninterface ContainerDatetimeProps {\n prefix: string;\n dateTime: string;\n}\n\nconst ContainerDatetime = ({ prefix, dateTime }: ContainerDatetimeProps) => {\n return (\n <Typography variant=\"subtitle2\">\n {prefix}:{' '}\n {DateTime.fromISO(dateTime).toRelative({\n locale: 'en',\n })}\n </Typography>\n );\n};\n\n/**\n * Props for ContainerCard\n *\n * @public\n */\nexport interface ContainerCardProps {\n podScope: PodScope;\n containerSpec?: IContainer;\n containerStatus: IContainerStatus;\n containerMetrics?: ClientContainerStatus;\n}\n\n/**\n * Shows details about a container within a pod\n *\n * @public\n */\nexport function ContainerCard({\n podScope,\n containerSpec,\n containerStatus,\n containerMetrics,\n}: ContainerCardProps) {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const isPodExecTerminalEnabled = useIsPodExecTerminalEnabled();\n\n // This should never be undefined\n if (containerSpec === undefined) {\n return <Typography>error reading pod from cluster</Typography>;\n }\n const containerStartedTime = getStartedAtTime(containerStatus);\n const containerFinishedTime = containerStatus.state?.terminated?.finishedAt;\n\n return (\n <Card>\n <CardHeader\n title={containerStatus.name}\n subheader={containerStatus.image}\n />\n <CardContent>\n <Grid container>\n <Grid item xs={12}>\n {containerStartedTime && (\n <ContainerDatetime\n prefix=\"Started\"\n dateTime={containerStartedTime}\n />\n )}\n {containerFinishedTime && (\n <ContainerDatetime\n prefix=\"Completed\"\n dateTime={containerFinishedTime}\n />\n )}\n {containerStartedTime && containerFinishedTime && (\n <Typography variant=\"subtitle2\">\n Execution time:{' '}\n {DateTime.fromISO(containerFinishedTime)\n .diff(DateTime.fromISO(containerStartedTime), [\n 'hours',\n 'minutes',\n 'seconds',\n ])\n .toHuman()}\n </Typography>\n )}\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">\n Status: {getCurrentState(containerStatus)}\n </Typography>\n </Grid>\n {containerStatus.restartCount > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">\n Restarts: {containerStatus.restartCount}\n </Typography>\n </Grid>\n )}\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">Container health</Typography>\n </Grid>\n <Grid item xs={12}>\n <StructuredMetadataTable\n metadata={getContainerHealthChecks(\n containerSpec,\n containerStatus,\n )}\n options={{ nestedValuesAsYaml: true }}\n />\n </Grid>\n {containerMetrics && (\n <Grid container item xs={12} spacing={0}>\n <Grid item xs={12}>\n <Typography variant=\"subtitle1\">\n {t('podDrawer.resourceUtilization')}\n </Typography>\n </Grid>\n <Grid item xs={12} style={{ minHeight: '5rem' }}>\n <ResourceUtilization\n compressed\n title={t('podDrawer.cpuRequests')}\n usage={containerMetrics.cpuUsage.currentUsage}\n total={containerMetrics.cpuUsage.requestTotal}\n totalFormatted={formatMillicores(\n containerMetrics.cpuUsage.requestTotal,\n )}\n />\n <ResourceUtilization\n compressed\n title={t('podDrawer.cpuLimits')}\n usage={containerMetrics.cpuUsage.currentUsage}\n total={containerMetrics.cpuUsage.limitTotal}\n totalFormatted={formatMillicores(\n containerMetrics.cpuUsage.limitTotal,\n )}\n />\n <ResourceUtilization\n compressed\n title={t('podDrawer.memoryRequests')}\n usage={containerMetrics.memoryUsage.currentUsage}\n total={containerMetrics.memoryUsage.requestTotal}\n totalFormatted={bytesToMiB(\n containerMetrics.memoryUsage.requestTotal,\n )}\n />\n <ResourceUtilization\n compressed\n title={t('podDrawer.memoryLimits')}\n usage={containerMetrics.memoryUsage.currentUsage}\n total={containerMetrics.memoryUsage.limitTotal}\n totalFormatted={bytesToMiB(\n containerMetrics.memoryUsage.limitTotal,\n )}\n />\n </Grid>\n </Grid>\n )}\n </Grid>\n </CardContent>\n <CardActions>\n <PodLogsDialog\n containerScope={{\n containerName: containerStatus.name,\n ...podScope,\n }}\n />\n {isPodExecTerminalEnabled && (\n <PodExecTerminalDialog\n cluster={podScope.cluster}\n containerName={containerSt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;AAAA,OACF;AAAA,MACC,wBAAA,oBACC,GAAA;AAAA,QAAC,qBAAA;AAAA,QAAA;AAAA,UACC,SAAS,QAAA,CAAS,OAAA;AAAA,UAClB,eAAe,eAAA,CAAgB,IAAA;AAAA,UAC/B,SAAS,QAAA,CAAS,OAAA;AAAA,UAClB,cAAc,QAAA,CAAS;AAAA;AAAA;AACzB,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingPodContent.esm.js","sources":["../../../../src/components/Pods/PodDrawer/PendingPodContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 Grid from '@material-ui/core/Grid';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport Typography from '@material-ui/core/Typography';\nimport { IPodCondition, Pod } from 'kubernetes-models/v1';\nimport {\n StatusError,\n StatusOK,\n StatusWarning,\n} from '@backstage/core-components';\nimport { DateTime } from 'luxon';\n\ninterface PodConditionProps {\n condition: IPodCondition;\n}\n\nconst PodCondition = ({ condition }: PodConditionProps) => {\n return (\n <>\n {condition.status === 'False' && (\n <StatusError>\n {condition.type} - ({condition.reason}{' '}\n {condition.lastTransitionTime &&\n DateTime.fromISO(condition.lastTransitionTime).toRelative({\n locale: 'en',\n })}\n ) - {condition.message}{' '}\n </StatusError>\n )}\n {condition.status === 'True' && (\n <StatusOK>\n {condition.type} - (\n {condition.lastTransitionTime &&\n DateTime.fromISO(condition.lastTransitionTime).toRelative({\n locale: 'en',\n })}\n )\n </StatusOK>\n )}\n {condition.status === 'Unknown' && (\n <StatusWarning>\n {condition.type} - (\n {condition.lastTransitionTime &&\n DateTime.fromISO(condition.lastTransitionTime).toRelative({\n locale: 'en',\n })}\n ) {condition.message}\n </StatusWarning>\n )}\n </>\n );\n};\n\n/**\n * Props for PendingPodContent\n *\n * @public\n */\nexport interface PendingPodContentProps {\n pod: Pod;\n}\n\n/**\n * Shows details about pod's conditions as it starts\n *\n * @public\n */\nexport const PendingPodContent = ({ pod }: PendingPodContentProps) => {\n // TODO add PodHasNetwork when it's out of alpha\n // https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions\n const startupConditions = [\n pod.status?.conditions?.find(c => c.type === 'PodScheduled'),\n pod.status?.conditions?.find(c => c.type === 'Initialized'),\n pod.status?.conditions?.find(c => c.type === 'ContainersReady'),\n pod.status?.conditions?.find(c => c.type === 'Ready'),\n ].filter((c): c is IPodCondition => !!c); // filter out undefined\n return (\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Pod is Pending. Conditions:</Typography>\n <List>\n {startupConditions.map(c => (\n <ListItem key={c.type}>\n <PodCondition condition={c} />\n </ListItem>\n ))}\n </List>\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA+BA,MAAM,YAAA,GAAe,CAAC,EAAE,SAAA,EAAU,KAAyB;AACzD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,SAAA,CAAU,MAAA,KAAW,OAAA,oBACpB,IAAA,CAAC,WAAA,EAAA,EACE,QAAA,EAAA;AAAA,MAAA,SAAA,CAAU,IAAA;AAAA,MAAK,MAAA;AAAA,MAAK,SAAA,CAAU,MAAA;AAAA,MAAQ,GAAA;AAAA,MACtC,UAAU,kBAAA,IACT,QAAA,CAAS,QAAQ,SAAA,CAAU,kBAAkB,EAAE,UAAA,CAAW;AAAA,QACxD,MAAA,EAAQ;AAAA,OACT,CAAA;A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AA,IACpD,MAAA,CAAO,CAAC,CAAA,KAA0B,CAAC,CAAC,CAAC,CAAA;AACvC,EAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,OAAA,EAAS,CAAA,EACvB,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,QAAA,EAAA,6BAAA,EAA2B,CAAA;AAAA,oBACpD,GAAA,CAAC,IAAA,EAAA,EACE,QAAA,EAAA,iBAAA,CAAkB,GAAA,CAAI,uBACrB,GAAA,CAAC,QAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,WAAW,CAAA,EAAG,CAAA,EAAA,EADf,CAAA,CAAE,IAEjB,CACD,CAAA,EACH;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"PendingPodContent.esm.js","sources":["../../../../src/components/Pods/PodDrawer/PendingPodContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 Grid from '@material-ui/core/Grid';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport Typography from '@material-ui/core/Typography';\nimport { IPodCondition, Pod } from 'kubernetes-models/v1';\nimport {\n StatusError,\n StatusOK,\n StatusWarning,\n} from '@backstage/core-components';\nimport { DateTime } from 'luxon';\n\ninterface PodConditionProps {\n condition: IPodCondition;\n}\n\nconst PodCondition = ({ condition }: PodConditionProps) => {\n return (\n <>\n {condition.status === 'False' && (\n <StatusError>\n {condition.type} - ({condition.reason}{' '}\n {condition.lastTransitionTime &&\n DateTime.fromISO(condition.lastTransitionTime).toRelative({\n locale: 'en',\n })}\n ) - {condition.message}{' '}\n </StatusError>\n )}\n {condition.status === 'True' && (\n <StatusOK>\n {condition.type} - (\n {condition.lastTransitionTime &&\n DateTime.fromISO(condition.lastTransitionTime).toRelative({\n locale: 'en',\n })}\n )\n </StatusOK>\n )}\n {condition.status === 'Unknown' && (\n <StatusWarning>\n {condition.type} - (\n {condition.lastTransitionTime &&\n DateTime.fromISO(condition.lastTransitionTime).toRelative({\n locale: 'en',\n })}\n ) {condition.message}\n </StatusWarning>\n )}\n </>\n );\n};\n\n/**\n * Props for PendingPodContent\n *\n * @public\n */\nexport interface PendingPodContentProps {\n pod: Pod;\n}\n\n/**\n * Shows details about pod's conditions as it starts\n *\n * @public\n */\nexport const PendingPodContent = ({ pod }: PendingPodContentProps) => {\n // TODO add PodHasNetwork when it's out of alpha\n // https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions\n const startupConditions = [\n pod.status?.conditions?.find(c => c.type === 'PodScheduled'),\n pod.status?.conditions?.find(c => c.type === 'Initialized'),\n pod.status?.conditions?.find(c => c.type === 'ContainersReady'),\n pod.status?.conditions?.find(c => c.type === 'Ready'),\n ].filter((c): c is IPodCondition => !!c); // filter out undefined\n return (\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Pod is Pending. Conditions:</Typography>\n <List>\n {startupConditions.map(c => (\n <ListItem key={c.type}>\n <PodCondition condition={c} />\n </ListItem>\n ))}\n </List>\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA+BA,MAAM,YAAA,GAAe,CAAC,EAAE,SAAA,EAAU,KAAyB;AACzD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,E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AA,KAAK,CAAA,CAAE,SAAS,cAAc,CAAA;AAAA,IAC3D,IAAI,MAAA,EAAQ,UAAA,EAAY,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,aAAa,CAAA;AAAA,IAC1D,IAAI,MAAA,EAAQ,UAAA,EAAY,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,iBAAiB,CAAA;AAAA,IAC9D,IAAI,MAAA,EAAQ,UAAA,EAAY,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,OAAO;AAAA,IACpD,MAAA,CAAO,CAAC,CAAA,KAA0B,CAAC,CAAC,CAAC,CAAA;AACvC,EAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,OAAA,EAAS,CAAA,EACvB,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,QAAA,EAAA,6BAAA,EAA2B,CAAA;AAAA,oBACpD,GAAA,CAAC,IAAA,EAAA,EACE,QAAA,EAAA,iBAAA,CAAkB,GAAA,CAAI,uBACrB,GAAA,CAAC,QAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,WAAW,CAAA,EAAG,CAAA,EAAA,EADf,CAAA,CAAE,IAEjB,CACD,CAAA,EACH;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodDrawer.esm.js","sources":["../../../../src/components/Pods/PodDrawer/PodDrawer.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 { ItemCardGrid } from '@backstage/core-components';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\n\nimport { Pod } from 'kubernetes-models/v1';\n\nimport { ContainerCard } from './ContainerCard';\n\nimport { PodAndErrors } from '../types';\nimport { KubernetesDrawer } from '../../KubernetesDrawer';\nimport { PodDeleteButton } from '../PodDelete/PodDeleteButton';\nimport { PendingPodContent } from './PendingPodContent';\nimport { ErrorList } from '../ErrorList';\nimport { usePodMetrics } from '../../../hooks/usePodMetrics';\nimport { ResourceUtilization } from '../../ResourceUtilization';\nimport { bytesToMiB, formatMillicores } from '../../../utils/resources';\nimport { useIsPodDeleteEnabled } from '../../../hooks';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nconst useDrawerContentStyles = makeStyles((_theme: Theme) =>\n createStyles({\n header: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n content: {\n height: '80%',\n },\n icon: {\n fontSize: 20,\n },\n podoklist: {\n width: '100%',\n maxWidth: 360,\n maxHeight: 360,\n },\n }),\n);\n\nfunction getContainerSpecByName(pod: Pod, containerName: string) {\n return pod.spec?.containers.find(c => c.name === containerName);\n}\n\n/**\n * Props for PodDrawer\n *\n * @public\n */\nexport interface PodDrawerProps {\n open?: boolean;\n podAndErrors: PodAndErrors;\n}\n\n/**\n * A Drawer for Kubernetes Pods\n *\n * @public\n */\nexport const PodDrawer = ({ podAndErrors, open }: PodDrawerProps) => {\n const classes = useDrawerContentStyles();\n const podMetrics = usePodMetrics(podAndErrors.cluster.name, podAndErrors.pod);\n const isPodDeleteEnabled = useIsPodDeleteEnabled();\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n return (\n <KubernetesDrawer\n open={open}\n drawerContentsHeader={\n <Typography variant=\"subtitle1\">\n Pod{' '}\n {podAndErrors.pod.status?.podIP &&\n `(${podAndErrors.pod.status?.podIP})`}\n </Typography>\n }\n kubernetesObject={podAndErrors.pod}\n label={\n <Typography variant=\"subtitle1\">\n {podAndErrors.pod.metadata?.name ?? 'unknown'}\n </Typography>\n }\n >\n <div className={classes.content}>\n {isPodDeleteEnabled && (\n <PodDeleteButton\n podScope={{\n podName: podAndErrors.pod.metadata?.name ?? 'unknown',\n podNamespace: podAndErrors.pod.metadata?.namespace ?? 'default',\n cluster: podAndErrors.cluster,\n }}\n />\n )}\n {podMetrics && (\n <Grid container item xs={12}>\n <Grid item xs={12}>\n <Typography variant=\"h5\">\n {t('podDrawer.resourceUtilization')}\n </Typography>\n </Grid>\n <Grid item xs={6}>\n <ResourceUtilization\n title={t('podDrawer.cpuRequests')}\n usage={podMetrics.cpu.currentUsage}\n total={podMetrics.cpu.requestTotal}\n totalFormatted={formatMillicores(podMetrics.cpu.requestTotal)}\n />\n <ResourceUtilization\n title={t('podDrawer.cpuLimits')}\n usage={podMetrics.cpu.currentUsage}\n total={podMetrics.cpu.limitTotal}\n totalFormatted={formatMillicores(podMetrics.cpu.limitTotal)}\n />\n </Grid>\n <Grid item xs={6}>\n <ResourceUtilization\n title={t('podDrawer.memoryRequests')}\n usage={podMetrics.memory.currentUsage}\n total={podMetrics.memory.requestTotal}\n totalFormatted={bytesToMiB(podMetrics.memory.requestTotal)}\n />\n <ResourceUtilization\n title={t('podDrawer.memoryLimits')}\n usage={podMetrics.memory.currentUsage}\n total={podMetrics.memory.limitTotal}\n totalFormatted={bytesToMiB(podMetrics.memory.limitTotal)}\n />\n </Grid>\n </Grid>\n )}\n {podAndErrors.pod.status?.phase === 'Pending' && (\n <PendingPodContent pod={podAndErrors.pod} />\n )}\n {podAndErrors.pod.status?.containerStatuses?.length && (\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Containers</Typography>\n </Grid>\n <Grid item xs={12}>\n <ItemCardGrid>\n {podAndErrors.pod.status?.containerStatuses?.map(\n (containerStatus, i) => {\n const containerSpec = getContainerSpecByName(\n podAndErrors.pod,\n containerStatus.name,\n );\n const containerMetrics = (\n podMetrics?.containers ?? []\n ).find(c => c.container === containerStatus.name);\n return (\n <ContainerCard\n key={`container-card-${podAndErrors.pod.metadata?.name}-${i}`}\n containerMetrics={containerMetrics}\n podScope={{\n podName: podAndErrors.pod.metadata?.name ?? 'unknown',\n podNamespace:\n podAndErrors.pod.metadata?.namespace ?? 'unknown',\n cluster: podAndErrors.cluster,\n }}\n containerSpec={containerSpec}\n containerStatus={containerStatus}\n />\n );\n },\n )}\n </ItemCardGrid>\n </Grid>\n {podAndErrors.errors.length > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"h5\">Errors</Typography>\n </Grid>\n )}\n {podAndErrors.errors.length > 0 && (\n <Grid item xs={12}>\n <ErrorList podAndErrors={[podAndErrors]} />\n </Grid>\n )}\n </Grid>\n )}\n </div>\n </KubernetesDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,sBAAA,GAAyB,UAAA;AAAA,EAAW,CAAC,WACzC,YAAA,CAAa;AAAA,IACX,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,MAAA;AAAA,MACT,aAAA,EAAe,KAAA;AAAA,MACf,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU,GAAA;AAAA,MACV,SAAA,EAAW;AAAA;AACb,GACD;AACH,CAAA;AAEA,SAAS,sBAAA,CAAuB,KAAU,aAA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OAAA,EAEJ;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"PodDrawer.esm.js","sources":["../../../../src/components/Pods/PodDrawer/PodDrawer.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 { ItemCardGrid } from '@backstage/core-components';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\n\nimport { Pod } from 'kubernetes-models/v1';\n\nimport { ContainerCard } from './ContainerCard';\n\nimport { PodAndErrors } from '../types';\nimport { KubernetesDrawer } from '../../KubernetesDrawer';\nimport { PodDeleteButton } from '../PodDelete/PodDeleteButton';\nimport { PendingPodContent } from './PendingPodContent';\nimport { ErrorList } from '../ErrorList';\nimport { usePodMetrics } from '../../../hooks/usePodMetrics';\nimport { ResourceUtilization } from '../../ResourceUtilization';\nimport { bytesToMiB, formatMillicores } from '../../../utils/resources';\nimport { useIsPodDeleteEnabled } from '../../../hooks';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\nconst useDrawerContentStyles = makeStyles((_theme: Theme) =>\n createStyles({\n header: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n content: {\n height: '80%',\n },\n icon: {\n fontSize: 20,\n },\n podoklist: {\n width: '100%',\n maxWidth: 360,\n maxHeight: 360,\n },\n }),\n);\n\nfunction getContainerSpecByName(pod: Pod, containerName: string) {\n return pod.spec?.containers.find(c => c.name === containerName);\n}\n\n/**\n * Props for PodDrawer\n *\n * @public\n */\nexport interface PodDrawerProps {\n open?: boolean;\n podAndErrors: PodAndErrors;\n}\n\n/**\n * A Drawer for Kubernetes Pods\n *\n * @public\n */\nexport const PodDrawer = ({ podAndErrors, open }: PodDrawerProps) => {\n const classes = useDrawerContentStyles();\n const podMetrics = usePodMetrics(podAndErrors.cluster.name, podAndErrors.pod);\n const isPodDeleteEnabled = useIsPodDeleteEnabled();\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n return (\n <KubernetesDrawer\n open={open}\n drawerContentsHeader={\n <Typography variant=\"subtitle1\">\n Pod{' '}\n {podAndErrors.pod.status?.podIP &&\n `(${podAndErrors.pod.status?.podIP})`}\n </Typography>\n }\n kubernetesObject={podAndErrors.pod}\n label={\n <Typography variant=\"subtitle1\">\n {podAndErrors.pod.metadata?.name ?? 'unknown'}\n </Typography>\n }\n >\n <div className={classes.content}>\n {isPodDeleteEnabled && (\n <PodDeleteButton\n podScope={{\n podName: podAndErrors.pod.metadata?.name ?? 'unknown',\n podNamespace: podAndErrors.pod.metadata?.namespace ?? 'default',\n cluster: podAndErrors.cluster,\n }}\n />\n )}\n {podMetrics && (\n <Grid container item xs={12}>\n <Grid item xs={12}>\n <Typography variant=\"h5\">\n {t('podDrawer.resourceUtilization')}\n </Typography>\n </Grid>\n <Grid item xs={6}>\n <ResourceUtilization\n title={t('podDrawer.cpuRequests')}\n usage={podMetrics.cpu.currentUsage}\n total={podMetrics.cpu.requestTotal}\n totalFormatted={formatMillicores(podMetrics.cpu.requestTotal)}\n />\n <ResourceUtilization\n title={t('podDrawer.cpuLimits')}\n usage={podMetrics.cpu.currentUsage}\n total={podMetrics.cpu.limitTotal}\n totalFormatted={formatMillicores(podMetrics.cpu.limitTotal)}\n />\n </Grid>\n <Grid item xs={6}>\n <ResourceUtilization\n title={t('podDrawer.memoryRequests')}\n usage={podMetrics.memory.currentUsage}\n total={podMetrics.memory.requestTotal}\n totalFormatted={bytesToMiB(podMetrics.memory.requestTotal)}\n />\n <ResourceUtilization\n title={t('podDrawer.memoryLimits')}\n usage={podMetrics.memory.currentUsage}\n total={podMetrics.memory.limitTotal}\n totalFormatted={bytesToMiB(podMetrics.memory.limitTotal)}\n />\n </Grid>\n </Grid>\n )}\n {podAndErrors.pod.status?.phase === 'Pending' && (\n <PendingPodContent pod={podAndErrors.pod} />\n )}\n {podAndErrors.pod.status?.containerStatuses?.length && (\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Containers</Typography>\n </Grid>\n <Grid item xs={12}>\n <ItemCardGrid>\n {podAndErrors.pod.status?.containerStatuses?.map(\n (containerStatus, i) => {\n const containerSpec = getContainerSpecByName(\n podAndErrors.pod,\n containerStatus.name,\n );\n const containerMetrics = (\n podMetrics?.containers ?? []\n ).find(c => c.container === containerStatus.name);\n return (\n <ContainerCard\n key={`container-card-${podAndErrors.pod.metadata?.name}-${i}`}\n containerMetrics={containerMetrics}\n podScope={{\n podName: podAndErrors.pod.metadata?.name ?? 'unknown',\n podNamespace:\n podAndErrors.pod.metadata?.namespace ?? 'unknown',\n cluster: podAndErrors.cluster,\n }}\n containerSpec={containerSpec}\n containerStatus={containerStatus}\n />\n );\n },\n )}\n </ItemCardGrid>\n </Grid>\n {podAndErrors.errors.length > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"h5\">Errors</Typography>\n </Grid>\n )}\n {podAndErrors.errors.length > 0 && (\n <Grid item xs={12}>\n <ErrorList podAndErrors={[podAndErrors]} />\n </Grid>\n )}\n </Grid>\n )}\n </div>\n </KubernetesDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,sBAAA,GAAyB,UAAA;AAAA,EAAW,CAAC,WACzC,YAAA,CAAa;AAAA,IACX,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,MAAA;AAAA,MACT,aAAA,EAAe,KAAA;AAAA,MACf,cAAA,EAAgB;AAAA,KAClB;AA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AA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,oBAAM,CAAA,EACjC,CAAA;AAAA,UAED,aAAa,MAAA,CAAO,MAAA,GAAS,CAAA,oBAC5B,GAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACb,8BAAC,SAAA,EAAA,EAAU,YAAA,EAAc,CAAC,YAAY,GAAG,CAAA,EAC3C;AAAA,SAAA,EAEJ;AAAA,OAAA,EAEJ;AAAA;AAAA,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodLogs.esm.js","sources":["../../../../src/components/Pods/PodLogs/PodLogs.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {\n DismissableBanner,\n EmptyState,\n LogViewer,\n} from '@backstage/core-components';\nimport Paper from '@material-ui/core/Paper';\nimport Skeleton from '@material-ui/lab/Skeleton';\n\nimport { ContainerScope } from './types';\nimport { usePodLogs } from './usePodLogs';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\n/**\n * Props for PodLogs\n *\n * @public\n */\nexport interface PodLogsProps {\n containerScope: ContainerScope;\n previous?: boolean;\n}\n\n/**\n * Shows the logs for the given pod\n *\n * @public\n */\nexport function PodLogs({ containerScope, previous }: PodLogsProps) {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const { value, error, loading } = usePodLogs({\n containerScope,\n previous,\n });\n\n return (\n <>\n {error && (\n <DismissableBanner\n {...{\n message: error.message,\n variant: 'error',\n fixed: false,\n }}\n id=\"pod-logs\"\n />\n )}\n <Paper\n elevation={1}\n style={{ height: '100%', width: '100%', minHeight: '55rem' }}\n >\n {loading && <Skeleton variant=\"rect\" width=\"100%\" height=\"100%\" />}\n {!loading &&\n value !== undefined &&\n (value.text === '' ? (\n <EmptyState\n missing=\"data\"\n title={t('podLogs.title')}\n description={t('podLogs.description')}\n />\n ) : (\n <LogViewer text={value.text} />\n ))}\n </Paper>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4CO,SAAS,OAAA,CAAQ,EAAE,cAAA,EAAgB,QAAA,EAAS,EAAiB;AAClE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,OAAA,KAAY,UAAA,CAAW;AAAA,IAC3C,cAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,KAAA,oBACC,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,UACF,SAAS,KAAA,CAAM,OAAA;AAAA,UACf,OAAA,EAAS,OAAA;AAAA,UACT,KAAA,EAAO;AAAA,SACT;AAAA,QACA,EAAA,EAAG;AAAA;AAAA,KACL;AAAA,oBAEF,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,CAAA;AAAA,QACX,OAAO,EAAE,MAAA,EAAQ,QAAQ,KAAA,EAAO,MAAA,EAAQ,WAAW,OAAA,EAAQ;AAAA,QAE1D,QAAA,EAAA;AAAA,UAAA,OAAA,wBAAY,QAAA,EAAA,EAAS,OAAA,EAAQ,QAAO,KAAA,EAAM,MAAA,EAAO,QAAO,MAAA,EAAO,CAAA;AAAA,UAC/D,CAAC,OAAA,IACA,KAAA,KAAU,MAAA,KACT,KAAA,CAAM,SAAS,EAAA,mBACd,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,MAAA;AAAA,cACR,KAAA,EAAO,EAAE,eAAe,CAAA;AAAA,cACxB,WAAA,EAAa,EAAE,qBAAqB;AAAA;AAAA,WACtC,mBAEA,GAAA,CAAC,SAAA,EAAA,EAAU,IAAA,EAAM,MAAM,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA;AAEnC,GAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"PodLogs.esm.js","sources":["../../../../src/components/Pods/PodLogs/PodLogs.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {\n DismissableBanner,\n EmptyState,\n LogViewer,\n} from '@backstage/core-components';\nimport Paper from '@material-ui/core/Paper';\nimport Skeleton from '@material-ui/lab/Skeleton';\n\nimport { ContainerScope } from './types';\nimport { usePodLogs } from './usePodLogs';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\n/**\n * Props for PodLogs\n *\n * @public\n */\nexport interface PodLogsProps {\n containerScope: ContainerScope;\n previous?: boolean;\n}\n\n/**\n * Shows the logs for the given pod\n *\n * @public\n */\nexport function PodLogs({ containerScope, previous }: PodLogsProps) {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const { value, error, loading } = usePodLogs({\n containerScope,\n previous,\n });\n\n return (\n <>\n {error && (\n <DismissableBanner\n {...{\n message: error.message,\n variant: 'error',\n fixed: false,\n }}\n id=\"pod-logs\"\n />\n )}\n <Paper\n elevation={1}\n style={{ height: '100%', width: '100%', minHeight: '55rem' }}\n >\n {loading && <Skeleton variant=\"rect\" width=\"100%\" height=\"100%\" />}\n {!loading &&\n value !== undefined &&\n (value.text === '' ? (\n <EmptyState\n missing=\"data\"\n title={t('podLogs.title')}\n description={t('podLogs.description')}\n />\n ) : (\n <LogViewer text={value.text} />\n ))}\n </Paper>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4CO,SAAS,OAAA,CAAQ,EAAE,cAAA,EAAgB,QAAA,EAAS,EAAiB;AAClE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,OAAA,KAAY,UAAA,CAAW;AAAA,IAC3C,cAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,KAAA,oBACC,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,UACF,SAAS,KAAA,CAAM,OAAA;AAAA,UACf,OAAA,EAAS,OAAA;AAAA,UACT,KAAA,EAAO;AAAA,SACT;AAAA,QACA,EAAA,EAAG;AAAA;AAAA,KACL;AAAA,oBAEF,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,CAAA;AAAA,QACX,OAAO,EAAE,MAAA,EAAQ,QAAQ,KAAA,EAAO,MAAA,EAAQ,WAAW,OAAA,EAAQ;AAAA,QAE1D,QAAA,EAAA;AAAA,UAAA,OAAA,wBAAY,QAAA,EAAA,EAAS,OAAA,EAAQ,QAAO,KAAA,EAAM,MAAA,EAAO,QAAO,MAAA,EAAO,CAAA;AAAA,UAC/D,CAAC,OAAA,IACA,KAAA,KAAU,MAAA,KACT,KAAA,CAAM,SAAS,EAAA,mBACd,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,MAAA;AAAA,cACR,KAAA,EAAO,EAAE,eAAe,CAAA;AAAA,cACxB,WAAA,EAAa,EAAE,qBAAqB;AAAA;AAAA,WACtC,mBAEA,GAAA,CAAC,SAAA,EAAA,EAAU,IAAA,EAAM,MAAM,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA;AAEnC,GAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodLogsDialog.esm.js","sources":["../../../../src/components/Pods/PodLogs/PodLogsDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 SubjectIcon from '@material-ui/icons/Subject';\n\nimport { KubernetesDialog } from '../../KubernetesDialog';\nimport { PodLogs } from './PodLogs';\nimport { ContainerScope } from './types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\n/**\n * Props for PodLogsDialog\n *\n * @public\n */\nexport interface PodLogsDialogProps {\n containerScope: ContainerScope;\n}\n\n/**\n * Shows the logs for the given pod in a Dialog\n *\n * @public\n */\nexport const PodLogsDialog = ({ containerScope }: PodLogsDialogProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <KubernetesDialog\n buttonAriaLabel={t('podLogs.buttonAriaLabel')}\n buttonIcon={<SubjectIcon />}\n buttonText={t('podLogs.buttonText')}\n disabled={false}\n title={t('podLogs.titleTemplate', {\n podName: containerScope.podName,\n containerName: containerScope.containerName,\n clusterName:\n containerScope.cluster.title || containerScope.cluster.name,\n })}\n >\n <PodLogs containerScope={containerScope} />\n </KubernetesDialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,aAAA,GAAgB,CAAC,EAAE,cAAA,EAAe,KAA0B;AACvE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,uBACE,GAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,eAAA,EAAiB,EAAE,yBAAyB,CAAA;AAAA,MAC5C,UAAA,sBAAa,WAAA,EAAA,EAAY,CAAA;AAAA,MACzB,UAAA,EAAY,EAAE,oBAAoB,CAAA;AAAA,MAClC,QAAA,EAAU,KAAA;AAAA,MACV,KAAA,EAAO,EAAE,uBAAA,EAAyB;AAAA,QAChC,SAAS,cAAA,CAAe,OAAA;AAAA,QACxB,eAAe,cAAA,CAAe,aAAA;AAAA,QAC9B,WAAA,EACE,cAAA,CAAe,OAAA,CAAQ,KAAA,IAAS,eAAe,OAAA,CAAQ;AAAA,OAC1D,CAAA;AAAA,MAED,QAAA,kBAAA,GAAA,CAAC,WAAQ,cAAA,EAAgC;AAAA;AAAA,GAC3C;AAEJ
|
|
1
|
+
{"version":3,"file":"PodLogsDialog.esm.js","sources":["../../../../src/components/Pods/PodLogs/PodLogsDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 SubjectIcon from '@material-ui/icons/Subject';\n\nimport { KubernetesDialog } from '../../KubernetesDialog';\nimport { PodLogs } from './PodLogs';\nimport { ContainerScope } from './types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../../translation';\n\n/**\n * Props for PodLogsDialog\n *\n * @public\n */\nexport interface PodLogsDialogProps {\n containerScope: ContainerScope;\n}\n\n/**\n * Shows the logs for the given pod in a Dialog\n *\n * @public\n */\nexport const PodLogsDialog = ({ containerScope }: PodLogsDialogProps) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n return (\n <KubernetesDialog\n buttonAriaLabel={t('podLogs.buttonAriaLabel')}\n buttonIcon={<SubjectIcon />}\n buttonText={t('podLogs.buttonText')}\n disabled={false}\n title={t('podLogs.titleTemplate', {\n podName: containerScope.podName,\n containerName: containerScope.containerName,\n clusterName:\n containerScope.cluster.title || containerScope.cluster.name,\n })}\n >\n <PodLogs containerScope={containerScope} />\n </KubernetesDialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,aAAA,GAAgB,CAAC,EAAE,cAAA,EAAe,KAA0B;AACvE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,uBACE,GAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,eAAA,EAAiB,EAAE,yBAAyB,CAAA;AAAA,MAC5C,UAAA,sBAAa,WAAA,EAAA,EAAY,CAAA;AAAA,MACzB,UAAA,EAAY,EAAE,oBAAoB,CAAA;AAAA,MAClC,QAAA,EAAU,KAAA;AAAA,MACV,KAAA,EAAO,EAAE,uBAAA,EAAyB;AAAA,QAChC,SAAS,cAAA,CAAe,OAAA;AAAA,QACxB,eAAe,cAAA,CAAe,aAAA;AAAA,QAC9B,WAAA,EACE,cAAA,CAAe,OAAA,CAAQ,KAAA,IAAS,eAAe,OAAA,CAAQ;AAAA,OAC1D,CAAA;AAAA,MAED,QAAA,kBAAA,GAAA,CAAC,WAAQ,cAAA,EAAgC;AAAA;AAAA,GAC3C;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePodLogs.esm.js","sources":["../../../../src/components/Pods/PodLogs/usePodLogs.ts"],"sourcesContent":["/*\n * Copyright 2023 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 useAsync from 'react-use/esm/useAsync';\n\nimport { ContainerScope } from './types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesProxyApiRef } from '../../../api/types';\n\n/**\n * Arguments for usePodLogs\n *\n * @public\n */\nexport interface PodLogsOptions {\n containerScope: ContainerScope;\n previous?: boolean;\n}\n\n/**\n * Retrieves the logs for the given pod\n *\n * @public\n */\nexport const usePodLogs = ({ containerScope, previous }: PodLogsOptions) => {\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n return useAsync(async () => {\n return await kubernetesProxyApi.getPodLogs({\n podName: containerScope.podName,\n namespace: containerScope.podNamespace,\n containerName: containerScope.containerName,\n clusterName: containerScope.cluster.name,\n previous,\n });\n }, [JSON.stringify(containerScope)]);\n};\n"],"names":[],"mappings":";;;;AAoCO,MAAM,UAAA,GAAa,CAAC,EAAE,cAAA,EAAgB,UAAS,KAAsB;AAC1E,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AACvD,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAA,OAAO,MAAM,mBAAmB,UAAA,CAAW;AAAA,MACzC,SAAS,cAAA,CAAe,OAAA;AAAA,MACxB,WAAW,cAAA,CAAe,YAAA;AAAA,MAC1B,eAAe,cAAA,CAAe,aAAA;AAAA,MAC9B,WAAA,EAAa,eAAe,OAAA,CAAQ,IAAA;AAAA,MACpC;AAAA,KACD,CAAA;AAAA,EACH,GAAG,CAAC,IAAA,CAAK,SAAA,CAAU,cAAc,CAAC,CAAC,CAAA;AACrC
|
|
1
|
+
{"version":3,"file":"usePodLogs.esm.js","sources":["../../../../src/components/Pods/PodLogs/usePodLogs.ts"],"sourcesContent":["/*\n * Copyright 2023 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 useAsync from 'react-use/esm/useAsync';\n\nimport { ContainerScope } from './types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesProxyApiRef } from '../../../api/types';\n\n/**\n * Arguments for usePodLogs\n *\n * @public\n */\nexport interface PodLogsOptions {\n containerScope: ContainerScope;\n previous?: boolean;\n}\n\n/**\n * Retrieves the logs for the given pod\n *\n * @public\n */\nexport const usePodLogs = ({ containerScope, previous }: PodLogsOptions) => {\n const kubernetesProxyApi = useApi(kubernetesProxyApiRef);\n return useAsync(async () => {\n return await kubernetesProxyApi.getPodLogs({\n podName: containerScope.podName,\n namespace: containerScope.podNamespace,\n containerName: containerScope.containerName,\n clusterName: containerScope.cluster.name,\n previous,\n });\n }, [JSON.stringify(containerScope)]);\n};\n"],"names":[],"mappings":";;;;AAoCO,MAAM,UAAA,GAAa,CAAC,EAAE,cAAA,EAAgB,UAAS,KAAsB;AAC1E,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AACvD,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAA,OAAO,MAAM,mBAAmB,UAAA,CAAW;AAAA,MACzC,SAAS,cAAA,CAAe,OAAA;AAAA,MACxB,WAAW,cAAA,CAAe,YAAA;AAAA,MAC1B,eAAe,cAAA,CAAe,aAAA;AAAA,MAC9B,WAAA,EAAa,eAAe,OAAA,CAAQ,IAAA;AAAA,MACpC;AAAA,KACD,CAAA;AAAA,EACH,GAAG,CAAC,IAAA,CAAK,SAAA,CAAU,cAAc,CAAC,CAAC,CAAA;AACrC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodsTable.esm.js","sources":["../../../src/components/Pods/PodsTable.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 { PodDrawer } from './PodDrawer';\nimport {\n containersReady,\n containerStatuses,\n podStatusToCpuUtil,\n podStatusToMemoryUtil,\n totalRestarts,\n} from '../../utils/pod';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { ClusterContext } from '../../hooks/Cluster';\nimport { useMatchingErrors } from '../../hooks/useMatchingErrors';\nimport { Pod } from 'kubernetes-models/v1/Pod';\nimport type { V1Pod } from '@kubernetes/client-node';\nimport { usePodMetrics } from '../../hooks/usePodMetrics';\nimport Typography from '@material-ui/core/Typography';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\n/**\n *\n *\n * @public\n */\nexport const READY_COLUMNS: PodColumns = 'READY';\n\n/**\n *\n *\n * @public\n */\nexport const RESOURCE_COLUMNS: PodColumns = 'RESOURCE';\n\n/**\n *\n *\n * @public\n */\nexport type PodColumns = 'READY' | 'RESOURCE';\n\n/**\n *\n *\n * @public\n */\nexport type PodsTablesProps = {\n pods: Pod | V1Pod[];\n extraColumns?: PodColumns[];\n children?: ReactNode;\n};\n\nconst PodDrawerTrigger = ({ pod }: { pod: Pod }) => {\n const errors = useMatchingErrors({\n kind: 'Pod',\n apiVersion: 'v1',\n metadata: pod.metadata,\n });\n return (\n <PodDrawer\n podAndErrors={{\n pod: pod as any,\n cluster: useContext(ClusterContext),\n errors: errors,\n }}\n />\n );\n};\n\nconst Cpu = ({ clusterName, pod }: { clusterName: string; pod: Pod }) => {\n const metrics = usePodMetrics(clusterName, pod);\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n if (!metrics) {\n return <Typography>{t('podsTable.unknown')}</Typography>;\n }\n\n return <>{podStatusToCpuUtil(metrics)}</>;\n};\n\nconst Memory = ({ clusterName, pod }: { clusterName: string; pod: Pod }) => {\n const metrics = usePodMetrics(clusterName, pod);\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n if (!metrics) {\n return <Typography>{t('podsTable.unknown')}</Typography>;\n }\n\n return <>{podStatusToMemoryUtil(metrics)}</>;\n};\n\n/**\n *\n *\n * @public\n */\nexport const PodsTable = ({ pods, extraColumns = [] }: PodsTablesProps) => {\n const cluster = useContext(ClusterContext);\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n const READY: TableColumn<Pod>[] = [\n {\n title: t('podsTable.columns.containersReady'),\n align: 'center',\n render: containersReady,\n width: 'auto',\n },\n {\n title: t('podsTable.columns.totalRestarts'),\n align: 'center',\n render: totalRestarts,\n type: 'numeric',\n width: 'auto',\n },\n ];\n\n const defaultColumns: TableColumn<Pod>[] = [\n {\n title: t('podsTable.columns.id'),\n field: 'metadata.uid',\n hidden: true,\n },\n {\n title: t('podsTable.columns.name'),\n highlight: true,\n render: (pod: Pod) => {\n return <PodDrawerTrigger pod={pod} />;\n },\n },\n {\n title: t('podsTable.columns.phase'),\n render: (pod: Pod) => pod.status?.phase ?? t('podsTable.unknown'),\n width: 'auto',\n },\n {\n title: t('podsTable.columns.status'),\n render: containerStatuses,\n },\n ];\n const columns: TableColumn<Pod>[] = [...defaultColumns];\n\n if (extraColumns.includes(READY_COLUMNS)) {\n columns.push(...READY);\n }\n if (extraColumns.includes(RESOURCE_COLUMNS)) {\n const resourceColumns: TableColumn<Pod>[] = [\n {\n title: t('podsTable.columns.cpuUsage'),\n render: (pod: Pod) => {\n return <Cpu clusterName={cluster.name} pod={pod} />;\n },\n width: 'auto',\n },\n {\n title: t('podsTable.columns.memoryUsage'),\n render: (pod: Pod) => {\n return <Memory clusterName={cluster.name} pod={pod} />;\n },\n width: 'auto',\n },\n ];\n columns.push(...resourceColumns);\n }\n\n const tableStyle = {\n minWidth: '0',\n width: '100%',\n };\n\n return (\n <div style={tableStyle}>\n <Table\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n // It was observed that in some instances the pod drawer closes when new data (like CPU usage) is available and the table reloads.\n // Mapping the metadata UID to the tables ID fixes this problem.\n data={\n (pods as Pod[]).map((pod: Pod) => ({\n ...pod,\n id: pod?.metadata?.uid,\n })) as any as Pod[]\n }\n columns={columns}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCO,MAAM,aAAA,GAA4B;AAOlC,MAAM,gBAAA,GAA+B;AAoB5C,MAAM,gBAAA,GAAmB,CAAC,EAAE,GAAA,EAAI,KAAoB;AAClD,EAAA,MAAM,SAAS,iBAAA,CAAkB;AAAA,IAC/B,IAAA,EAAM,KAAA;AAAA,IACN,UAAA,EAAY,IAAA;AAAA,IACZ,UAAU,GAAA,CAAI;AAAA,GACf,CAAA;AACD,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAc;AAAA,QACZ,GAAA;AAAA,QACA,OAAA,EAAS,WAAW,cAAc,CAAA;AAAA,QAClC;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEA,MAAM,GAAA,GAAM,CAAC,EAAE,WAAA,EAAa,KAAI,KAAyC;AACvE,EAAA,MAAM,OAAA,GA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AQ,MAAM,GAAA,EAAU,CAAA;AAAA,QACnD,CAAA;AAAA,QACA,KAAA,EAAO;AAAA,OACT;AAAA,MACA;AAAA,QACE,KAAA,EAAO,EAAE,+BAA+B,CAAA;AAAA,QACxC,MAAA,EAAQ,CAAC,GAAA,KAAa;AACpB,UAAA,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAO,WAAA,EAAa,OAAA,CAAQ,MAAM,GAAA,EAAU,CAAA;AAAA,QACtD,CAAA;AAAA,QACA,KAAA,EAAO;AAAA;AACT,KACF;AACA,IAAA,OAAA,CAAQ,IAAA,CAAK,GAAG,eAAe,CAAA;AAAA,EACjC;AAEA,EAAA,MAAM,UAAA,GAAa;AAAA,IACjB,QAAA,EAAU,GAAA;AAAA,IACV,KAAA,EAAO;AAAA,GACT;AAEA,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAO,UAAA,EACV,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAA,EAAQ,KAAA,EAAO,qBAAqB,KAAA,EAAM;AAAA,MAGnE,IAAA,EACG,IAAA,CAAe,GAAA,CAAI,CAAC,GAAA,MAAc;AAAA,QACjC,GAAG,GAAA;AAAA,QACH,EAAA,EAAI,KAAK,QAAA,EAAU;AAAA,OACrB,CAAE,CAAA;AAAA,MAEJ;AAAA;AAAA,GACF,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"PodsTable.esm.js","sources":["../../../src/components/Pods/PodsTable.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 { PodDrawer } from './PodDrawer';\nimport {\n containersReady,\n containerStatuses,\n podStatusToCpuUtil,\n podStatusToMemoryUtil,\n totalRestarts,\n} from '../../utils/pod';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { ClusterContext } from '../../hooks/Cluster';\nimport { useMatchingErrors } from '../../hooks/useMatchingErrors';\nimport { Pod } from 'kubernetes-models/v1/Pod';\nimport type { V1Pod } from '@kubernetes/client-node';\nimport { usePodMetrics } from '../../hooks/usePodMetrics';\nimport Typography from '@material-ui/core/Typography';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesReactTranslationRef } from '../../translation';\n\n/**\n *\n *\n * @public\n */\nexport const READY_COLUMNS: PodColumns = 'READY';\n\n/**\n *\n *\n * @public\n */\nexport const RESOURCE_COLUMNS: PodColumns = 'RESOURCE';\n\n/**\n *\n *\n * @public\n */\nexport type PodColumns = 'READY' | 'RESOURCE';\n\n/**\n *\n *\n * @public\n */\nexport type PodsTablesProps = {\n pods: Pod | V1Pod[];\n extraColumns?: PodColumns[];\n children?: ReactNode;\n};\n\nconst PodDrawerTrigger = ({ pod }: { pod: Pod }) => {\n const errors = useMatchingErrors({\n kind: 'Pod',\n apiVersion: 'v1',\n metadata: pod.metadata,\n });\n return (\n <PodDrawer\n podAndErrors={{\n pod: pod as any,\n cluster: useContext(ClusterContext),\n errors: errors,\n }}\n />\n );\n};\n\nconst Cpu = ({ clusterName, pod }: { clusterName: string; pod: Pod }) => {\n const metrics = usePodMetrics(clusterName, pod);\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n if (!metrics) {\n return <Typography>{t('podsTable.unknown')}</Typography>;\n }\n\n return <>{podStatusToCpuUtil(metrics)}</>;\n};\n\nconst Memory = ({ clusterName, pod }: { clusterName: string; pod: Pod }) => {\n const metrics = usePodMetrics(clusterName, pod);\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n if (!metrics) {\n return <Typography>{t('podsTable.unknown')}</Typography>;\n }\n\n return <>{podStatusToMemoryUtil(metrics)}</>;\n};\n\n/**\n *\n *\n * @public\n */\nexport const PodsTable = ({ pods, extraColumns = [] }: PodsTablesProps) => {\n const cluster = useContext(ClusterContext);\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n\n const READY: TableColumn<Pod>[] = [\n {\n title: t('podsTable.columns.containersReady'),\n align: 'center',\n render: containersReady,\n width: 'auto',\n },\n {\n title: t('podsTable.columns.totalRestarts'),\n align: 'center',\n render: totalRestarts,\n type: 'numeric',\n width: 'auto',\n },\n ];\n\n const defaultColumns: TableColumn<Pod>[] = [\n {\n title: t('podsTable.columns.id'),\n field: 'metadata.uid',\n hidden: true,\n },\n {\n title: t('podsTable.columns.name'),\n highlight: true,\n render: (pod: Pod) => {\n return <PodDrawerTrigger pod={pod} />;\n },\n },\n {\n title: t('podsTable.columns.phase'),\n render: (pod: Pod) => pod.status?.phase ?? t('podsTable.unknown'),\n width: 'auto',\n },\n {\n title: t('podsTable.columns.status'),\n render: containerStatuses,\n },\n ];\n const columns: TableColumn<Pod>[] = [...defaultColumns];\n\n if (extraColumns.includes(READY_COLUMNS)) {\n columns.push(...READY);\n }\n if (extraColumns.includes(RESOURCE_COLUMNS)) {\n const resourceColumns: TableColumn<Pod>[] = [\n {\n title: t('podsTable.columns.cpuUsage'),\n render: (pod: Pod) => {\n return <Cpu clusterName={cluster.name} pod={pod} />;\n },\n width: 'auto',\n },\n {\n title: t('podsTable.columns.memoryUsage'),\n render: (pod: Pod) => {\n return <Memory clusterName={cluster.name} pod={pod} />;\n },\n width: 'auto',\n },\n ];\n columns.push(...resourceColumns);\n }\n\n const tableStyle = {\n minWidth: '0',\n width: '100%',\n };\n\n return (\n <div style={tableStyle}>\n <Table\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n // It was observed that in some instances the pod drawer closes when new data (like CPU usage) is available and the table reloads.\n // Mapping the metadata UID to the tables ID fixes this problem.\n data={\n (pods as Pod[]).map((pod: Pod) => ({\n ...pod,\n id: pod?.metadata?.uid,\n })) as any as Pod[]\n }\n columns={columns}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCO,MAAM,aAAA,GAA4B;AAOlC,MAAM,gBAAA,GAA+B;AAoB5C,MAAM,gBAAA,GAAmB,CAAC,EAAE,GAAA,EAAI,KAAoB;AAClD,EAAA,MAAM,SAAS,iBAAA,CAAkB;AAAA,IAC/B,IAAA,EAAM,KAAA;AAAA,IACN,UAAA,EAAY,IAAA;AAAA,IACZ,UAAU,GAAA,CAAI;AAAA,GACf,CAAA;AACD,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAc;AAAA,QACZ,GAAA;AAAA,QACA,OAAA,EAAS,WAAW,cAAc,CAAA;AAAA,QAClC;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEA,MAAM,GAAA,GAAM,CAAC,EAAE,WAAA,EAAa,KAAI,KAAyC;AACvE,EAAA,MAAM,OAAA,GAAU,aAAA,CAAc,WAAA,EAAa,GAAG,CAAA;AAC9C,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAE7D,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,uBAAO,GAAA,CAAC,UAAA,EAAA,EAAY,QAAA,EAAA,CAAA,CAAE,mBAAmB,CAAA,EAAE,CAAA;AAAA,EAC7C;AAEA,EAAA,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAA,kBAAA,CAAmB,OAAO,CAAA,EAAE,CAAA;AACxC,CAAA;AAEA,MAAM,MAAA,GAAS,CAAC,EAAE,WAAA,EAAa,KAAI,KAAyC;AAC1E,EAAA,MAAM,OAAA,GAAU,aAAA,CAAc,WAAA,EAAa,GAAG,CAAA;AAC9C,EAAA,MAAM,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,KAAA,EAAA,EAAI,KAAA,EAAO,UAAA,EACV,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAA,EAAQ,KAAA,EAAO,qBAAqB,KAAA,EAAM;AAAA,MAGnE,IAAA,EACG,IAAA,CAAe,GAAA,CAAI,CAAC,GAAA,MAAc;AAAA,QACjC,GAAG,GAAA;AAAA,QACH,EAAA,EAAI,KAAK,QAAA,EAAU;AAAA,OACrB,CAAE,CAAA;AAAA,MAEJ;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceUtilization.esm.js","sources":["../../../src/components/ResourceUtilization/ResourceUtilization.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\n\nimport { GaugePropsGetColor, LinearGauge } from '@backstage/core-components';\nimport { currentToDeclaredResourceToPerc } from '../../utils/resources';\n\n/**\n * Context for Pod Metrics\n *\n * @public\n */\nexport interface ResourceUtilizationProps {\n compressed?: boolean;\n title: string;\n usage: number | string;\n total: number | string;\n totalFormatted: string;\n}\n\nconst getProgressColor: GaugePropsGetColor = ({\n palette,\n value,\n inverse,\n max,\n}) => {\n if (isNaN(value)) {\n return palette.status.pending;\n }\n const actualMax = max ? max : 100;\n const actualValue = inverse ? actualMax - value : value;\n\n if (actualValue >= actualMax) {\n return palette.status.error;\n } else if (actualValue > 90 || actualValue < 40) {\n return palette.status.warning;\n }\n\n return palette.status.ok;\n};\n\n/**\n * Context for Pod Metrics\n *\n * @public\n */\nexport const ResourceUtilization = ({\n compressed = false,\n title,\n usage,\n total,\n totalFormatted,\n}: ResourceUtilizationProps) => {\n const utilization = currentToDeclaredResourceToPerc(usage, total);\n return (\n <Grid container spacing={0}>\n <Grid item xs={12}>\n <Typography\n variant={compressed ? 'caption' : 'subtitle2'}\n >{`${title}: ${totalFormatted}`}</Typography>\n </Grid>\n <Grid item xs={12}>\n <LinearGauge\n getColor={getProgressColor}\n width={compressed ? 'thin' : 'thick'}\n value={utilization / 100}\n />\n {!compressed && (\n <Typography variant=\"caption\">usage: {`${utilization}%`}</Typography>\n )}\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;AAkCA,MAAM,mBAAuC,CAAC;AAAA,EAC5C,OAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,IAAI,KAAA,CAAM,KAAK,CAAA,EAAG;AAChB,IAAA,OAAO,QAAQ,MAAA,CAAO,OAAA;AAAA,EACxB;AACA,EAAA,MAAM,SAAA,GAAY,MAAM,GAAA,GAAM,GAAA;AAC9B,EAAA,MAAM,WAAA,GAAc,OAAA,GAAU,SAAA,GAAY,KAAA,GAAQ,KAAA;AAElD,EAAA,IAAI,eAAe,SAAA,EAAW;AAC5B,IAAA,OAAO,QAAQ,MAAA,CAAO,KAAA;AAAA,EACxB,CAAA,MAAA,IAAW,WAAA,GAAc,EAAA,IAAM,WAAA,GAAc,EAAA,EAAI;AAC/C,IAAA,OAAO,QAAQ,MAAA,CAAO,OAAA;AAAA,EACxB;AAEA,EAAA,OAAO,QAAQ,MAAA,CAAO,EAAA;AACxB,CAAA;AAOO,MAAM,sBAAsB,CAAC;AAAA,EAClC,UAAA,GAAa,KAAA;AAAA,EACb,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,KAAgC;AAC9B,EAAA,MAAM,WAAA,GAAc,+BAAA,CAAgC,KAAA,EAAO,KAAK,CAAA;AAChE,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,SAAS,CAAA,EACvB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACb,QAAA,kBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,aAAa,SAAA,GAAY,WAAA;AAAA,QAClC,QAAA,EAAA,CAAA,EAAG,KAAK,CAAA,EAAA,EAAK,cAAc,CAAA;AAAA;AAAA,KAAG,EAClC,CAAA;AAAA,oBACA,IAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,IAAI,EAAA,EACb,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,QAAA,EAAU,gBAAA;AAAA,UACV,KAAA,EAAO,aAAa,MAAA,GAAS,OAAA;AAAA,UAC7B,OAAO,WAAA,GAAc;AAAA;AAAA,OACvB;AAAA,MACC,CAAC,UAAA,oBACA,IAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,SAAA,EAAU,QAAA,EAAA;AAAA,QAAA,SAAA;AAAA,QAAQ,GAAG,WAAW,CAAA,CAAA;AAAA,OAAA,EAAI;AAAA,KAAA,EAE5D;AAAA,GAAA,EACF,CAAA;AAEJ
|
|
1
|
+
{"version":3,"file":"ResourceUtilization.esm.js","sources":["../../../src/components/ResourceUtilization/ResourceUtilization.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\n\nimport { GaugePropsGetColor, LinearGauge } from '@backstage/core-components';\nimport { currentToDeclaredResourceToPerc } from '../../utils/resources';\n\n/**\n * Context for Pod Metrics\n *\n * @public\n */\nexport interface ResourceUtilizationProps {\n compressed?: boolean;\n title: string;\n usage: number | string;\n total: number | string;\n totalFormatted: string;\n}\n\nconst getProgressColor: GaugePropsGetColor = ({\n palette,\n value,\n inverse,\n max,\n}) => {\n if (isNaN(value)) {\n return palette.status.pending;\n }\n const actualMax = max ? max : 100;\n const actualValue = inverse ? actualMax - value : value;\n\n if (actualValue >= actualMax) {\n return palette.status.error;\n } else if (actualValue > 90 || actualValue < 40) {\n return palette.status.warning;\n }\n\n return palette.status.ok;\n};\n\n/**\n * Context for Pod Metrics\n *\n * @public\n */\nexport const ResourceUtilization = ({\n compressed = false,\n title,\n usage,\n total,\n totalFormatted,\n}: ResourceUtilizationProps) => {\n const utilization = currentToDeclaredResourceToPerc(usage, total);\n return (\n <Grid container spacing={0}>\n <Grid item xs={12}>\n <Typography\n variant={compressed ? 'caption' : 'subtitle2'}\n >{`${title}: ${totalFormatted}`}</Typography>\n </Grid>\n <Grid item xs={12}>\n <LinearGauge\n getColor={getProgressColor}\n width={compressed ? 'thin' : 'thick'}\n value={utilization / 100}\n />\n {!compressed && (\n <Typography variant=\"caption\">usage: {`${utilization}%`}</Typography>\n )}\n </Grid>\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;AAkCA,MAAM,mBAAuC,CAAC;AAAA,EAC5C,OAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,KAAM;AACJ,EAAA,IAAI,KAAA,CAAM,KAAK,CAAA,EAAG;AAChB,IAAA,OAAO,QAAQ,MAAA,CAAO,OAAA;AAAA,EACxB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AAO,WAAA,GAAc;AAAA;AAAA,OACvB;AAAA,MACC,CAAC,UAAA,oBACA,IAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,SAAA,EAAU,QAAA,EAAA;AAAA,QAAA,SAAA;AAAA,QAAQ,GAAG,WAAW,CAAA,CAAA;AAAA,OAAA,EAAI;AAAA,KAAA,EAE5D;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretsAccordions.esm.js","sources":["../../../src/components/SecretsAccordions/SecretsAccordions.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 { 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 { V1Secret } from '@kubernetes/client-node';\nimport { SecretsDrawer } from './SecretsDrawer.tsx';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\ntype SecretSummaryProps = {\n secret: V1Secret;\n};\n\nconst SecretSummary = ({ secret }: SecretSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={8} item>\n <SecretsDrawer secret={secret} />\n </Grid>\n\n <Grid item>\n <Typography variant=\"subtitle2\">\n Data Count: {secret.data ? Object.keys(secret.data).length : 0}\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\ntype SecretsCardProps = {\n secret: V1Secret;\n};\n\nconst SecretCard = ({ secret }: SecretsCardProps) => {\n const metadata: any = {};\n\n metadata.data = secret.data;\n\n return (\n <StructuredMetadataTable\n metadata={{\n ...metadata,\n }}\n options={{ nestedValuesAsYaml: true }}\n />\n );\n};\n\nexport type SecretsAccordionsProps = {};\n\ntype SecretsAccordionProps = {\n secret: V1Secret;\n};\n\nconst SecretsAccordion = ({ secret }: SecretsAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <SecretSummary secret={secret} />\n </AccordionSummary>\n <AccordionDetails>\n <SecretCard secret={secret} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const SecretsAccordions = ({}: SecretsAccordionsProps) => {\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.secrets.map((secret, i) => (\n <Grid item key={i} xs>\n <SecretsAccordion secret={secret} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,aAAA,GAAgB,CAAC,EAAE,MAAA,EAAO,KAA0B;AACxD,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,aAAA,EAAA,EAAc,QAAgB,CAAA,EACjC,CAAA;AAAA,4BA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AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,YAAA;AAAA,MACf,UAAA,EAAW,YAAA;AAAA,MAEV,2BAAiB,OAAA,CAAQ,GAAA,CAAI,CAAC,MAAA,EAAQ,sBACrC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,oBAAiB,MAAA,EAAgB,CAAA,EAAA,EADpB,CAEhB,CACD;AAAA;AAAA,GACH;AAEJ
|
|
1
|
+
{"version":3,"file":"SecretsAccordions.esm.js","sources":["../../../src/components/SecretsAccordions/SecretsAccordions.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 { 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 { V1Secret } from '@kubernetes/client-node';\nimport { SecretsDrawer } from './SecretsDrawer.tsx';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\ntype SecretSummaryProps = {\n secret: V1Secret;\n};\n\nconst SecretSummary = ({ secret }: SecretSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={8} item>\n <SecretsDrawer secret={secret} />\n </Grid>\n\n <Grid item>\n <Typography variant=\"subtitle2\">\n Data Count: {secret.data ? Object.keys(secret.data).length : 0}\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\ntype SecretsCardProps = {\n secret: V1Secret;\n};\n\nconst SecretCard = ({ secret }: SecretsCardProps) => {\n const metadata: any = {};\n\n metadata.data = secret.data;\n\n return (\n <StructuredMetadataTable\n metadata={{\n ...metadata,\n }}\n options={{ nestedValuesAsYaml: true }}\n />\n );\n};\n\nexport type SecretsAccordionsProps = {};\n\ntype SecretsAccordionProps = {\n secret: V1Secret;\n};\n\nconst SecretsAccordion = ({ secret }: SecretsAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <SecretSummary secret={secret} />\n </AccordionSummary>\n <AccordionDetails>\n <SecretCard secret={secret} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\nexport const SecretsAccordions = ({}: SecretsAccordionsProps) => {\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.secrets.map((secret, i) => (\n <Grid item key={i} xs>\n <SecretsAccordion secret={secret} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,aAAA,GAAgB,CAAC,EAAE,MAAA,EAAO,KAA0B;AACxD,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,EA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AA,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,OAAA,CAAQ,GAAA,CAAI,CAAC,MAAA,EAAQ,sBACrC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAS,IAAE,IAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,oBAAiB,MAAA,EAAgB,CAAA,EAAA,EADpB,CAEhB,CACD;AAAA;AAAA,GACH;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretsDrawer.esm.js","sources":["../../../src/components/SecretsAccordions/SecretsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\nimport type { V1Secret } from '@kubernetes/client-node';\n\nexport const SecretsDrawer = ({\n secret,\n expanded,\n}: {\n secret: V1Secret;\n expanded?: boolean;\n}) => {\n const namespace = secret.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={secret}\n expanded={expanded}\n kind=\"Secret\"\n renderObject={(secretObject: V1Secret) => {\n return secretObject || {};\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 {secret.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Secret\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,MAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,SAAA,GAAY,OAAO,QAAA,EAAU,SAAA;AACnC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,MAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,QAAA;AAAA,MACL,YAAA,EAAc,CAAC,YAAA,KAA2B;AACxC,QAAA,OAAO,gBAAgB,EAAC;AAAA,MAC1B,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,MAAA,CAAO,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC5B,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,QAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,SAAA,oBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,KAAA,EAAO,CAAA,WAAA,EAAc,SAAS,IAAI,CAAA,EACvD;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ
|
|
1
|
+
{"version":3,"file":"SecretsDrawer.esm.js","sources":["../../../src/components/SecretsAccordions/SecretsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\nimport type { V1Secret } from '@kubernetes/client-node';\n\nexport const SecretsDrawer = ({\n secret,\n expanded,\n}: {\n secret: V1Secret;\n expanded?: boolean;\n}) => {\n const namespace = secret.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={secret}\n expanded={expanded}\n kind=\"Secret\"\n renderObject={(secretObject: V1Secret) => {\n return secretObject || {};\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 {secret.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Secret\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,MAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,SAAA,GAAY,OAAO,QAAA,EAAU,SAAA;AACnC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,MAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,QAAA;AAAA,MACL,YAAA,EAAc,CAAC,YAAA,KAA2B;AACxC,QAAA,OAAO,gBAAgB,EAAC;AAAA,MAC1B,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,MAAA,CAAO,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC5B,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,QAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,SAAA,oBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,KAAA,EAAO,CAAA,WAAA,EAAc,SAAS,IAAI,CAAA,EACvD;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceDrawer.esm.js","sources":["../../../src/components/ServicesAccordions/ServiceDrawer.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 { V1Service } 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 ServiceDrawer = ({\n service,\n expanded,\n}: {\n service: V1Service;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = service.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={service}\n expanded={expanded}\n kind=\"Service\"\n renderObject={(serviceObject: V1Service) => {\n return serviceObject.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 {service.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Service\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":";;;;;;;;;;;;;;AAwBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,QAAQ,QAAA,EAAU,SAAA;AACpC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,OAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAc,CAAC,aAAA,KAA6B;AAC1C,QAAA,OAAO,aAAA,CAAc,QAAQ,EAAC;AAAA,MAChC,CAAA;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC7B,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,SAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,6BACC,GAAA,CAAC,IAAA,EAAA,EAAK,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
|
+
{"version":3,"file":"ServiceDrawer.esm.js","sources":["../../../src/components/ServicesAccordions/ServiceDrawer.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 { V1Service } 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 ServiceDrawer = ({\n service,\n expanded,\n}: {\n service: V1Service;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = service.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={service}\n expanded={expanded}\n kind=\"Service\"\n renderObject={(serviceObject: V1Service) => {\n return serviceObject.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 {service.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Service\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":";;;;;;;;;;;;;;AAwBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,QAAQ,QAAA,EAAU,SAAA;AACpC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,OAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAc,CAAC,aAAA,KAA6B;AAC1C,QAAA,OAAO,aAAA,CAAc,QAAQ,EAAC;AAAA,MAChC,CAAA;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC7B,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,SAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,6BACC,GAAA,CAAC,IAAA,EAAA,EAAK,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":"ServicesAccordions.esm.js","sources":["../../../src/components/ServicesAccordions/ServicesAccordions.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 Typography from '@material-ui/core/Typography';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Service } from '@kubernetes/client-node';\nimport { ServiceDrawer } from './ServiceDrawer';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\ntype ServiceSummaryProps = {\n service: V1Service;\n};\n\nconst ServiceSummary = ({ service }: ServiceSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={8} item>\n <ServiceDrawer service={service} />\n </Grid>\n\n <Grid item>\n <Typography variant=\"subtitle2\">\n Type: {service.spec?.type ?? '?'}\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\ntype ServiceCardProps = {\n service: V1Service;\n};\n\nconst ServiceCard = ({ service }: ServiceCardProps) => {\n const metadata: any = {};\n\n if (service.status?.loadBalancer?.ingress?.length ?? -1 > 0) {\n metadata.loadbalancer = service.status?.loadBalancer;\n }\n\n if (service.spec?.type === 'ClusterIP') {\n metadata.clusterIP = service.spec.clusterIP;\n }\n if (service.spec?.type === 'ExternalName') {\n metadata.externalName = service.spec.externalName;\n }\n\n return (\n <StructuredMetadataTable\n metadata={{\n type: service.spec?.type,\n ports: service.spec?.ports,\n ...metadata,\n }}\n options={{ nestedValuesAsYaml: true }}\n />\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport type ServicesAccordionsProps = {};\n\ntype ServiceAccordionProps = {\n service: V1Service;\n};\n\nconst ServiceAccordion = ({ service }: ServiceAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <ServiceSummary service={service} />\n </AccordionSummary>\n <AccordionDetails>\n <ServiceCard service={service} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const ServicesAccordions = ({}: ServicesAccordionsProps) => {\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.services.map((service, i) => (\n <Grid item key={i} xs>\n <ServiceAccordion service={service} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,cAAA,GAAiB,CAAC,EAAE,OAAA,EAAQ,KAA2B;AAC3D,EAAA,uBACE,IA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ServicesAccordions/ServicesAccordions.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 Typography from '@material-ui/core/Typography';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1Service } from '@kubernetes/client-node';\nimport { ServiceDrawer } from './ServiceDrawer';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StructuredMetadataTable } from '@backstage/core-components';\n\ntype ServiceSummaryProps = {\n service: V1Service;\n};\n\nconst ServiceSummary = ({ service }: ServiceSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n spacing={0}\n >\n <Grid xs={8} item>\n <ServiceDrawer service={service} />\n </Grid>\n\n <Grid item>\n <Typography variant=\"subtitle2\">\n Type: {service.spec?.type ?? '?'}\n </Typography>\n </Grid>\n </Grid>\n );\n};\n\ntype ServiceCardProps = {\n service: V1Service;\n};\n\nconst ServiceCard = ({ service }: ServiceCardProps) => {\n const metadata: any = {};\n\n if (service.status?.loadBalancer?.ingress?.length ?? -1 > 0) {\n metadata.loadbalancer = service.status?.loadBalancer;\n }\n\n if (service.spec?.type === 'ClusterIP') {\n metadata.clusterIP = service.spec.clusterIP;\n }\n if (service.spec?.type === 'ExternalName') {\n metadata.externalName = service.spec.externalName;\n }\n\n return (\n <StructuredMetadataTable\n metadata={{\n type: service.spec?.type,\n ports: service.spec?.ports,\n ...metadata,\n }}\n options={{ nestedValuesAsYaml: true }}\n />\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport type ServicesAccordionsProps = {};\n\ntype ServiceAccordionProps = {\n service: V1Service;\n};\n\nconst ServiceAccordion = ({ service }: ServiceAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <ServiceSummary service={service} />\n </AccordionSummary>\n <AccordionDetails>\n <ServiceCard service={service} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const ServicesAccordions = ({}: ServicesAccordionsProps) => {\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.services.map((service, i) => (\n <Grid item key={i} xs>\n <ServiceAccordion service={service} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,cAAA,GAAiB,CAAC,EAAE,OAAA,EAAQ,KAA2B;AAC3D,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,aAAA,EAAA,EAAc,SAAkB,CAAA,EACnC,CAAA;AAAA,4BAEC,IAAA,EAAA,EAAK,IAAA,EAAI,MACR,QAAA,kBAAA,IAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,WAAA,EAAY,QAAA,EAAA;A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A,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,kBAAA,GAAqB,CAAC,EAAC,KAA+B;AACjE,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,QAAA,CAAS,GAAA,CAAI,CAAC,OAAA,EAAS,sBACvC,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":"StatefulSetDrawer.esm.js","sources":["../../../src/components/StatefulSetsAccordions/StatefulSetDrawer.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 { V1StatefulSet } 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 StatefulSetDrawer = ({\n statefulset,\n expanded,\n}: {\n statefulset: V1StatefulSet;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = statefulset.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={statefulset}\n expanded={expanded}\n kind=\"StatefulSet\"\n renderObject={(statefulsetObj: V1StatefulSet) => {\n const conditions = (statefulsetObj.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 updateStrategy: statefulset.spec?.updateStrategy ?? '???',\n podManagementPolicy: statefulset.spec?.podManagementPolicy ?? '???',\n serviceName: statefulset.spec?.serviceName ?? '???',\n selector: statefulset.spec?.selector ?? '???',\n revisionHistoryLimit: statefulset.spec?.revisionHistoryLimit ?? '???',\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 {statefulset.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Stateful Set\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":";;;;;;;;;;;;;;;AA0BO,MAAM,oBAAoB,CAAC;AAAA,EAChC,WAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6B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AAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,WAAA,CAAY,QAAA,EAAU,IAAA,IAAQ,gBAAA,EACjC,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,cAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,6BACC,GAAA,CAAC,IAAA,EAAA,EAAK,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
|
+
{"version":3,"file":"StatefulSetDrawer.esm.js","sources":["../../../src/components/StatefulSetsAccordions/StatefulSetDrawer.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 { V1StatefulSet } 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 StatefulSetDrawer = ({\n statefulset,\n expanded,\n}: {\n statefulset: V1StatefulSet;\n expanded?: boolean;\n}) => {\n const { t } = useTranslationRef(kubernetesReactTranslationRef);\n const namespace = statefulset.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={statefulset}\n expanded={expanded}\n kind=\"StatefulSet\"\n renderObject={(statefulsetObj: V1StatefulSet) => {\n const conditions = (statefulsetObj.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 updateStrategy: statefulset.spec?.updateStrategy ?? '???',\n podManagementPolicy: statefulset.spec?.podManagementPolicy ?? '???',\n serviceName: statefulset.spec?.serviceName ?? '???',\n selector: statefulset.spec?.selector ?? '???',\n revisionHistoryLimit: statefulset.spec?.revisionHistoryLimit ?? '???',\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 {statefulset.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Stateful Set\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":";;;;;;;;;;;;;;;AA0BO,MAAM,oBAAoB,CAAC;AAAA,EAChC,WAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,6BAA6B,CAAA;AAC7D,EAAA,MAAM,SAAA,GAAY,YAAY,QAAA,EAAU,SAAA;AACxC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;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AQ,gBAAA,EACjC,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,cAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,6BACC,GAAA,CAAC,IAAA,EAAA,EAAK,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":"StatefulSetsAccordions.esm.js","sources":["../../../src/components/StatefulSetsAccordions/StatefulSetsAccordions.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 V1Pod,\n V2HorizontalPodAutoscaler,\n V1StatefulSet,\n} from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { StatefulSetDrawer } from './StatefulSetDrawer';\nimport { HorizontalPodAutoscalerDrawer } from '../HorizontalPodAutoscalers';\nimport { getMatchingHpa, 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 StatefulSetsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype StatefulSetAccordionProps = {\n statefulset: V1StatefulSet;\n ownedPods: V1Pod[];\n matchingHpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\ntype StatefulSetSummaryProps = {\n statefulset: V1StatefulSet;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n hpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\nconst StatefulSetSummary = ({\n statefulset,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n hpa,\n}: StatefulSetSummaryProps) => {\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={6} item>\n <StatefulSetDrawer statefulset={statefulset} />\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.minReplicas')} {hpa.spec?.minReplicas ?? '?'} /{' '}\n {t('hpa.maxReplicas')} {hpa.spec?.maxReplicas ?? '?'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.currentCpuUsage')} {cpuUtil ?? '?'}%\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.targetCpuUsage')} {specCpuUtil ?? '?'}%\n </Typography>\n </Grid>\n </Grid>\n </HorizontalPodAutoscalerDrawer>\n </Grid>\n )}\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\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 StatefulSetAccordion = ({\n statefulset,\n ownedPods,\n matchingHpa,\n}: StatefulSetAccordionProps) => {\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 <StatefulSetSummary\n statefulset={statefulset}\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 StatefulSetsAccordions = ({}: StatefulSetsAccordionsProps) => {\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.statefulsets.map((statefulset, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <StatefulSetAccordion\n matchingHpa={getMatchingHpa(\n {\n name: statefulset.metadata?.name,\n namespace: statefulset.metadata?.namespace,\n kind: 'statefulset',\n },\n groupedResponses.horizontalPodAutoscalers,\n )}\n ownedPods={getOwnedResources(statefulset, groupedResponses.pods)}\n statefulset={statefulset}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAM,qBAAqB,CAAC;AAAA,EAC1B,WAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA;AACF,CAAA,KAA+B;AAC7B,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;A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,IAAE,IAAA,EACX,QAAA,kBAAA,GAAA;AAAA,QAAC,oBAAA;AAAA,QAAA;AAAA,UACC,WAAA,EAAa,cAAA;AAAA,YACX;AAAA,cACE,IAAA,EAAM,YAAY,QAAA,EAAU,IAAA;AAAA,cAC5B,SAAA,EAAW,YAAY,QAAA,EAAU,SAAA;AAAA,cACjC,IAAA,EAAM;AAAA,aACR;AAAA,YACA,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA,SAAA,EAAW,iBAAA,CAAkB,WAAA,EAAa,gBAAA,CAAiB,IAAI,CAAA;AAAA,UAC/D;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAdwB,CAe1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"StatefulSetsAccordions.esm.js","sources":["../../../src/components/StatefulSetsAccordions/StatefulSetsAccordions.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 V1Pod,\n V2HorizontalPodAutoscaler,\n V1StatefulSet,\n} from '@kubernetes/client-node';\nimport { PodsTable } from '../Pods';\nimport { StatefulSetDrawer } from './StatefulSetDrawer';\nimport { HorizontalPodAutoscalerDrawer } from '../HorizontalPodAutoscalers';\nimport { getMatchingHpa, 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 StatefulSetsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype StatefulSetAccordionProps = {\n statefulset: V1StatefulSet;\n ownedPods: V1Pod[];\n matchingHpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\ntype StatefulSetSummaryProps = {\n statefulset: V1StatefulSet;\n numberOfCurrentPods: number;\n numberOfPodsWithErrors: number;\n hpa?: V2HorizontalPodAutoscaler;\n children?: ReactNode;\n};\n\nconst StatefulSetSummary = ({\n statefulset,\n numberOfCurrentPods,\n numberOfPodsWithErrors,\n hpa,\n}: StatefulSetSummaryProps) => {\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={6} item>\n <StatefulSetDrawer statefulset={statefulset} />\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.minReplicas')} {hpa.spec?.minReplicas ?? '?'} /{' '}\n {t('hpa.maxReplicas')} {hpa.spec?.maxReplicas ?? '?'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.currentCpuUsage')} {cpuUtil ?? '?'}%\n </Typography>\n </Grid>\n <Grid item>\n <Typography variant=\"subtitle2\">\n {t('hpa.targetCpuUsage')} {specCpuUtil ?? '?'}%\n </Typography>\n </Grid>\n </Grid>\n </HorizontalPodAutoscalerDrawer>\n </Grid>\n )}\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\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 StatefulSetAccordion = ({\n statefulset,\n ownedPods,\n matchingHpa,\n}: StatefulSetAccordionProps) => {\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 <StatefulSetSummary\n statefulset={statefulset}\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 StatefulSetsAccordions = ({}: StatefulSetsAccordionsProps) => {\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.statefulsets.map((statefulset, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <StatefulSetAccordion\n matchingHpa={getMatchingHpa(\n {\n name: statefulset.metadata?.name,\n namespace: statefulset.metadata?.namespace,\n kind: 'statefulset',\n },\n groupedResponses.horizontalPodAutoscalers,\n )}\n ownedPods={getOwnedResources(statefulset, groupedResponses.pods)}\n statefulset={statefulset}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAM,qBAAqB,CAAC;AAAA,EAC1B,WAAA;AAAA,EACA,mBAAA;AAAA,EACA,sBAAA;AAAA,EACA;AACF,CAAA,KAA+B;AAC7B,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,IA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QAAA;AAAA,UACC,WAAA,EAAa,cAAA;AAAA,YACX;AAAA,cACE,IAAA,EAAM,YAAY,QAAA,EAAU,IAAA;AAAA,cAC5B,SAAA,EAAW,YAAY,QAAA,EAAU,SAAA;AAAA,cACjC,IAAA,EAAM;AAAA,aACR;AAAA,YACA,gBAAA,CAAiB;AAAA,WACnB;AAAA,UACA,SAAA,EAAW,iBAAA,CAAkB,WAAA,EAAa,gBAAA,CAAiB,IAAI,CAAA;AAAA,UAC/D;AAAA;AAAA,OACF,EACF,CAAA,EAAA,EAdwB,CAe1B,CACD;AAAA;AAAA,GACH;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cluster.esm.js","sources":["../../src/hooks/Cluster.ts"],"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 { createContext } from 'react';\nimport { ClusterAttributes } from '@backstage/plugin-kubernetes-common';\n\n/**\n * @public\n */\nexport const ClusterContext = createContext<ClusterAttributes>({\n name: '',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,iBAAiB,aAAA,CAAiC;AAAA,EAC7D,IAAA,EAAM;AACR,CAAC
|
|
1
|
+
{"version":3,"file":"Cluster.esm.js","sources":["../../src/hooks/Cluster.ts"],"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 { createContext } from 'react';\nimport { ClusterAttributes } from '@backstage/plugin-kubernetes-common';\n\n/**\n * @public\n */\nexport const ClusterContext = createContext<ClusterAttributes>({\n name: '',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,iBAAiB,aAAA,CAAiC;AAAA,EAC7D,IAAA,EAAM;AACR,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedResponses.esm.js","sources":["../../src/hooks/GroupedResponses.ts"],"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 { createContext } from 'react';\nimport { GroupedResponses } from '@backstage/plugin-kubernetes-common';\n\n/**\n *\n *\n * @public\n */\nexport const GroupedResponsesContext = createContext<GroupedResponses>({\n pods: [],\n replicaSets: [],\n deployments: [],\n daemonSets: [],\n services: [],\n configMaps: [],\n secrets: [],\n horizontalPodAutoscalers: [],\n ingresses: [],\n jobs: [],\n cronJobs: [],\n customResources: [],\n statefulsets: [],\n persistentVolumes: [],\n persistentVolumeClaims: [],\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,0BAA0B,aAAA,CAAgC;AAAA,EACrE,MAAM,EAAC;AAAA,EACP,aAAa,EAAC;AAAA,EACd,aAAa,EAAC;AAAA,EACd,YAAY,EAAC;AAAA,EACb,UAAU,EAAC;AAAA,EACX,YAAY,EAAC;AAAA,EACb,SAAS,EAAC;AAAA,EACV,0BAA0B,EAAC;AAAA,EAC3B,WAAW,EAAC;AAAA,EACZ,MAAM,EAAC;AAAA,EACP,UAAU,EAAC;AAAA,EACX,iBAAiB,EAAC;AAAA,EAClB,cAAc,EAAC;AAAA,EACf,mBAAmB,EAAC;AAAA,EACpB,wBAAwB;AAC1B,CAAC
|
|
1
|
+
{"version":3,"file":"GroupedResponses.esm.js","sources":["../../src/hooks/GroupedResponses.ts"],"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 { createContext } from 'react';\nimport { GroupedResponses } from '@backstage/plugin-kubernetes-common';\n\n/**\n *\n *\n * @public\n */\nexport const GroupedResponsesContext = createContext<GroupedResponses>({\n pods: [],\n replicaSets: [],\n deployments: [],\n daemonSets: [],\n services: [],\n configMaps: [],\n secrets: [],\n horizontalPodAutoscalers: [],\n ingresses: [],\n jobs: [],\n cronJobs: [],\n customResources: [],\n statefulsets: [],\n persistentVolumes: [],\n persistentVolumeClaims: [],\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,0BAA0B,aAAA,CAAgC;AAAA,EACrE,MAAM,EAAC;AAAA,EACP,aAAa,EAAC;AAAA,EACd,aAAa,EAAC;AAAA,EACd,YAAY,EAAC;AAAA,EACb,UAAU,EAAC;AAAA,EACX,YAAY,EAAC;AAAA,EACb,SAAS,EAAC;AAAA,EACV,0BAA0B,EAAC;AAAA,EAC3B,WAAW,EAAC;AAAA,EACZ,MAAM,EAAC;AAAA,EACP,UAAU,EAAC;AAAA,EACX,iBAAiB,EAAC;AAAA,EAClB,cAAc,EAAC;AAAA,EACf,mBAAmB,EAAC;AAAA,EACpB,wBAAwB;AAC1B,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodNamesWithErrors.esm.js","sources":["../../src/hooks/PodNamesWithErrors.ts"],"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 { createContext } from 'react';\n\n/**\n * @public\n */\nexport const PodNamesWithErrorsContext = createContext<Set<string>>(\n new Set<string>(),\n);\n"],"names":[],"mappings":";;AAoBO,MAAM,yBAAA,GAA4B,aAAA;AAAA,sBACnC,GAAA;AACN
|
|
1
|
+
{"version":3,"file":"PodNamesWithErrors.esm.js","sources":["../../src/hooks/PodNamesWithErrors.ts"],"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 { createContext } from 'react';\n\n/**\n * @public\n */\nexport const PodNamesWithErrorsContext = createContext<Set<string>>(\n new Set<string>(),\n);\n"],"names":[],"mappings":";;AAoBO,MAAM,yBAAA,GAA4B,aAAA;AAAA,sBACnC,GAAA;AACN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodNamesWithMetrics.esm.js","sources":["../../src/hooks/PodNamesWithMetrics.ts"],"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 { createContext } from 'react';\nimport { ClientPodStatus } from '@backstage/plugin-kubernetes-common';\n\n/**\n * @public\n */\nexport const PodNamesWithMetricsContext = createContext<\n Map<string, ClientPodStatus>\n>(new Map<string, ClientPodStatus>());\n"],"names":[],"mappings":";;AAqBO,MAAM,0BAAA,GAA6B,aAAA,iBAExC,IAAI,GAAA,EAA8B
|
|
1
|
+
{"version":3,"file":"PodNamesWithMetrics.esm.js","sources":["../../src/hooks/PodNamesWithMetrics.ts"],"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 { createContext } from 'react';\nimport { ClientPodStatus } from '@backstage/plugin-kubernetes-common';\n\n/**\n * @public\n */\nexport const PodNamesWithMetricsContext = createContext<\n Map<string, ClientPodStatus>\n>(new Map<string, ClientPodStatus>());\n"],"names":[],"mappings":";;AAqBO,MAAM,0BAAA,GAA6B,aAAA,iBAExC,IAAI,GAAA,EAA8B;;"}
|