@backstage/plugin-kubernetes-react 0.5.10-next.0 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api/KubernetesBackendClient.esm.js.map +1 -1
  3. package/dist/api/KubernetesClusterLinkFormatter.esm.js.map +1 -1
  4. package/dist/api/KubernetesProxyClient.esm.js.map +1 -1
  5. package/dist/api/formatters/AksClusterLinksFormatter.esm.js.map +1 -1
  6. package/dist/api/formatters/EksClusterLinksFormatter.esm.js.map +1 -1
  7. package/dist/api/formatters/GkeClusterLinksFormatter.esm.js.map +1 -1
  8. package/dist/api/formatters/HeadlampClusterLinksFormatter.esm.js.map +1 -1
  9. package/dist/api/formatters/OpenshiftClusterLinksFormatter.esm.js.map +1 -1
  10. package/dist/api/formatters/RancherClusterLinksFormatter.esm.js.map +1 -1
  11. package/dist/api/formatters/StandardClusterLinksFormatter.esm.js.map +1 -1
  12. package/dist/api/formatters/index.esm.js.map +1 -1
  13. package/dist/api/types.esm.js.map +1 -1
  14. package/dist/components/Cluster/Cluster.esm.js.map +1 -1
  15. package/dist/components/CronJobsAccordions/CronJobsAccordions.esm.js.map +1 -1
  16. package/dist/components/CronJobsAccordions/CronJobsDrawer.esm.js.map +1 -1
  17. package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js +1 -1
  18. package/dist/components/CustomResources/ArgoRollouts/Rollout.esm.js.map +1 -1
  19. package/dist/components/CustomResources/ArgoRollouts/RolloutDrawer.esm.js.map +1 -1
  20. package/dist/components/CustomResources/ArgoRollouts/StepsProgress.esm.js.map +1 -1
  21. package/dist/components/CustomResources/CustomResources.esm.js.map +1 -1
  22. package/dist/components/CustomResources/DefaultCustomResource.esm.js.map +1 -1
  23. package/dist/components/CustomResources/DefaultCustomResourceDrawer.esm.js.map +1 -1
  24. package/dist/components/DaemonSetsAccordions/DaemonSetsAccordions.esm.js.map +1 -1
  25. package/dist/components/DaemonSetsAccordions/DaemonSetsDrawer.esm.js.map +1 -1
  26. package/dist/components/DeploymentsAccordions/DeploymentDrawer.esm.js.map +1 -1
  27. package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js +1 -1
  28. package/dist/components/DeploymentsAccordions/DeploymentsAccordions.esm.js.map +1 -1
  29. package/dist/components/ErrorPanel/ErrorPanel.esm.js.map +1 -1
  30. package/dist/components/ErrorReporting/ErrorReporting.esm.js.map +1 -1
  31. package/dist/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.esm.js.map +1 -1
  32. package/dist/components/IngressesAccordions/IngressDrawer.esm.js.map +1 -1
  33. package/dist/components/IngressesAccordions/IngressesAccordions.esm.js.map +1 -1
  34. package/dist/components/JobsAccordions/JobsAccordions.esm.js.map +1 -1
  35. package/dist/components/JobsAccordions/JobsDrawer.esm.js.map +1 -1
  36. package/dist/components/KubernetesDialog/KubernetesDialog.esm.js.map +1 -1
  37. package/dist/components/KubernetesDrawer/KubernetesDrawer.esm.js.map +1 -1
  38. package/dist/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.esm.js.map +1 -1
  39. package/dist/components/KubernetesDrawer/ManifestYaml.esm.js.map +1 -1
  40. package/dist/components/PodExecTerminal/PodExecTerminal.esm.js.map +1 -1
  41. package/dist/components/PodExecTerminal/PodExecTerminalAttachAddon.esm.js.map +1 -1
  42. package/dist/components/PodExecTerminal/PodExecTerminalDialog.esm.js.map +1 -1
  43. package/dist/components/Pods/ErrorList/ErrorList.esm.js.map +1 -1
  44. package/dist/components/Pods/Events/Events.esm.js.map +1 -1
  45. package/dist/components/Pods/Events/useEvents.esm.js.map +1 -1
  46. package/dist/components/Pods/FixDialog/FixDialog.esm.js.map +1 -1
  47. package/dist/components/Pods/PodDelete/PodDeleteButton.esm.js.map +1 -1
  48. package/dist/components/Pods/PodDelete/usePodDelete.esm.js.map +1 -1
  49. package/dist/components/Pods/PodDrawer/ContainerCard.esm.js.map +1 -1
  50. package/dist/components/Pods/PodDrawer/PendingPodContent.esm.js.map +1 -1
  51. package/dist/components/Pods/PodDrawer/PodDrawer.esm.js.map +1 -1
  52. package/dist/components/Pods/PodLogs/PodLogs.esm.js.map +1 -1
  53. package/dist/components/Pods/PodLogs/PodLogsDialog.esm.js.map +1 -1
  54. package/dist/components/Pods/PodLogs/usePodLogs.esm.js.map +1 -1
  55. package/dist/components/Pods/PodsTable.esm.js +1 -1
  56. package/dist/components/Pods/PodsTable.esm.js.map +1 -1
  57. package/dist/components/ResourceUtilization/ResourceUtilization.esm.js.map +1 -1
  58. package/dist/components/ServicesAccordions/ServiceDrawer.esm.js.map +1 -1
  59. package/dist/components/ServicesAccordions/ServicesAccordions.esm.js.map +1 -1
  60. package/dist/components/StatefulSetsAccordions/StatefulSetDrawer.esm.js.map +1 -1
  61. package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js +1 -1
  62. package/dist/components/StatefulSetsAccordions/StatefulSetsAccordions.esm.js.map +1 -1
  63. package/dist/hooks/Cluster.esm.js.map +1 -1
  64. package/dist/hooks/GroupedResponses.esm.js.map +1 -1
  65. package/dist/hooks/PodNamesWithErrors.esm.js.map +1 -1
  66. package/dist/hooks/PodNamesWithMetrics.esm.js.map +1 -1
  67. package/dist/hooks/auth.esm.js.map +1 -1
  68. package/dist/hooks/useCustomResources.esm.js.map +1 -1
  69. package/dist/hooks/useIsPodDeleteEnabled.esm.js.map +1 -1
  70. package/dist/hooks/useIsPodExecTerminalEnabled.esm.js.map +1 -1
  71. package/dist/hooks/useIsPodExecTerminalSupported.esm.js.map +1 -1
  72. package/dist/hooks/useKubernetesObjects.esm.js.map +1 -1
  73. package/dist/hooks/useMatchingErrors.esm.js.map +1 -1
  74. package/dist/hooks/usePodMetrics.esm.js.map +1 -1
  75. package/dist/kubernetes-auth-provider/AksKubernetesAuthProvider.esm.js.map +1 -1
  76. package/dist/kubernetes-auth-provider/GoogleKubernetesAuthProvider.esm.js.map +1 -1
  77. package/dist/kubernetes-auth-provider/KubernetesAuthProviders.esm.js.map +1 -1
  78. package/dist/kubernetes-auth-provider/OidcKubernetesAuthProvider.esm.js.map +1 -1
  79. package/dist/kubernetes-auth-provider/ServerSideAuthProvider.esm.js.map +1 -1
  80. package/dist/kubernetes-auth-provider/types.esm.js.map +1 -1
  81. package/dist/translation.esm.js.map +1 -1
  82. package/dist/utils/crons.esm.js.map +1 -1
  83. package/dist/utils/owner.esm.js.map +1 -1
  84. package/dist/utils/pod.esm.js +1 -1
  85. package/dist/utils/pod.esm.js.map +1 -1
  86. package/dist/utils/resources.esm.js.map +1 -1
  87. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @backstage/plugin-kubernetes-react
2
2
 
3
+ ## 0.5.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.17.5
9
+
3
10
  ## 0.5.10-next.0
4
11
 
5
12
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"KubernetesBackendClient.esm.js","sources":["../../src/api/KubernetesBackendClient.ts"],"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 { KubernetesApi } from './types';\nimport {\n KubernetesRequestBody,\n ObjectsByEntityResponse,\n WorkloadsByEntityRequest,\n CustomObjectsByEntityRequest,\n} from '@backstage/plugin-kubernetes-common';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { KubernetesAuthProvidersApi } from '../kubernetes-auth-provider';\nimport { NotFoundError } from '@backstage/errors';\n\n/** @public */\nexport class KubernetesBackendClient implements KubernetesApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n private readonly kubernetesAuthProvidersApi: KubernetesAuthProvidersApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n kubernetesAuthProvidersApi: KubernetesAuthProvidersApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n this.kubernetesAuthProvidersApi = options.kubernetesAuthProvidersApi;\n }\n\n private async handleResponse(response: Response): Promise<any> {\n if (!response.ok) {\n const payload = await response.text();\n let message;\n switch (response.status) {\n case 404:\n message =\n 'Could not find the Kubernetes Backend (HTTP 404). Make sure the plugin has been fully installed.';\n break;\n default:\n message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;\n }\n throw new Error(message);\n }\n\n return await response.json();\n }\n\n private async postRequired(path: string, requestBody: any): Promise<any> {\n const url = `${await this.discoveryApi.getBaseUrl('kubernetes')}${path}`;\n const response = await this.fetchApi.fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(requestBody),\n });\n\n return this.handleResponse(response);\n }\n\n public async getCluster(clusterName: string): Promise<{\n name: string;\n authProvider: string;\n oidcTokenProvider?: string;\n }> {\n const cluster = await this.getClusters().then(clusters =>\n clusters.find(c => c.name === clusterName),\n );\n if (!cluster) {\n throw new NotFoundError(`Cluster ${clusterName} not found`);\n }\n\n return cluster;\n }\n\n private async getCredentials(\n authProvider: string,\n oidcTokenProvider?: string,\n ): Promise<{ token?: string }> {\n return await this.kubernetesAuthProvidersApi.getCredentials(\n authProvider === 'oidc'\n ? `${authProvider}.${oidcTokenProvider}`\n : authProvider,\n );\n }\n\n async getObjectsByEntity(\n requestBody: KubernetesRequestBody,\n ): Promise<ObjectsByEntityResponse> {\n return await this.postRequired(\n `/services/${requestBody.entity.metadata.name}`,\n requestBody,\n );\n }\n\n async getWorkloadsByEntity(\n request: WorkloadsByEntityRequest,\n ): Promise<ObjectsByEntityResponse> {\n return await this.postRequired('/resources/workloads/query', {\n auth: request.auth,\n entityRef: stringifyEntityRef(request.entity),\n });\n }\n\n async getCustomObjectsByEntity(\n request: CustomObjectsByEntityRequest,\n ): Promise<ObjectsByEntityResponse> {\n return await this.postRequired(`/resources/custom/query`, {\n entityRef: stringifyEntityRef(request.entity),\n auth: request.auth,\n customResources: request.customResources,\n });\n }\n\n async getClusters(): Promise<{ name: string; authProvider: string }[]> {\n const url = `${await this.discoveryApi.getBaseUrl('kubernetes')}/clusters`;\n const response = await this.fetchApi.fetch(url);\n\n return (await this.handleResponse(response)).items;\n }\n\n async proxy(options: {\n clusterName: string;\n path: string;\n init?: RequestInit;\n }): Promise<Response> {\n const { authProvider, oidcTokenProvider } = await this.getCluster(\n options.clusterName,\n );\n const kubernetesCredentials = await this.getCredentials(\n authProvider,\n oidcTokenProvider,\n );\n const url = `${await this.discoveryApi.getBaseUrl('kubernetes')}/proxy${\n options.path\n }`;\n const headers = KubernetesBackendClient.getKubernetesHeaders(\n options,\n kubernetesCredentials?.token,\n authProvider,\n oidcTokenProvider,\n );\n return await this.fetchApi.fetch(url, { ...options.init, headers });\n }\n\n private static getKubernetesHeaders(\n options: {\n clusterName: string;\n path: string;\n init?: RequestInit;\n },\n k8sToken: string | undefined,\n authProvider: string,\n oidcTokenProvider: string | undefined,\n ) {\n const kubernetesAuthHeader =\n KubernetesBackendClient.getKubernetesAuthHeaderByAuthProvider(\n authProvider,\n oidcTokenProvider,\n );\n return {\n ...options.init?.headers,\n [`Backstage-Kubernetes-Cluster`]: options.clusterName,\n ...(k8sToken && {\n [kubernetesAuthHeader]: k8sToken,\n }),\n };\n }\n\n private static getKubernetesAuthHeaderByAuthProvider(\n authProvider: string,\n oidcTokenProvider: string | undefined,\n ): string {\n let header: string = 'Backstage-Kubernetes-Authorization';\n\n header = header.concat('-', authProvider);\n\n if (oidcTokenProvider) header = header.concat('-', oidcTokenProvider);\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AA8B,4BAAA,CAAA,GAAG,OAAQ,CAAA,WAAA;AAAA,MAC1C,GAAI,QAAY,IAAA;AAAA,QACd,CAAC,oBAAoB,GAAG;AAAA;AAC1B,KACF;AAAA;AACF,EAEA,OAAe,qCACb,CAAA,YAAA,EACA,iBACQ,EAAA;AACR,IAAA,IAAI,MAAiB,GAAA,oCAAA;AAErB,IAAS,MAAA,GAAA,MAAA,CAAO,MAAO,CAAA,GAAA,EAAK,YAAY,CAAA;AAExC,IAAA,IAAI,iBAAmB,EAAA,MAAA,GAAS,MAAO,CAAA,MAAA,CAAO,KAAK,iBAAiB,CAAA;AAEpE,IAAO,OAAA,MAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"KubernetesBackendClient.esm.js","sources":["../../src/api/KubernetesBackendClient.ts"],"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 { KubernetesApi } from './types';\nimport {\n KubernetesRequestBody,\n ObjectsByEntityResponse,\n WorkloadsByEntityRequest,\n CustomObjectsByEntityRequest,\n} from '@backstage/plugin-kubernetes-common';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { KubernetesAuthProvidersApi } from '../kubernetes-auth-provider';\nimport { NotFoundError } from '@backstage/errors';\n\n/** @public */\nexport class KubernetesBackendClient implements KubernetesApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n private readonly kubernetesAuthProvidersApi: KubernetesAuthProvidersApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n kubernetesAuthProvidersApi: KubernetesAuthProvidersApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n this.kubernetesAuthProvidersApi = options.kubernetesAuthProvidersApi;\n }\n\n private async handleResponse(response: Response): Promise<any> {\n if (!response.ok) {\n const payload = await response.text();\n let message;\n switch (response.status) {\n case 404:\n message =\n 'Could not find the Kubernetes Backend (HTTP 404). Make sure the plugin has been fully installed.';\n break;\n default:\n message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;\n }\n throw new Error(message);\n }\n\n return await response.json();\n }\n\n private async postRequired(path: string, requestBody: any): Promise<any> {\n const url = `${await this.discoveryApi.getBaseUrl('kubernetes')}${path}`;\n const response = await this.fetchApi.fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(requestBody),\n });\n\n return this.handleResponse(response);\n }\n\n public async getCluster(clusterName: string): Promise<{\n name: string;\n authProvider: string;\n oidcTokenProvider?: string;\n }> {\n const cluster = await this.getClusters().then(clusters =>\n clusters.find(c => c.name === clusterName),\n );\n if (!cluster) {\n throw new NotFoundError(`Cluster ${clusterName} not found`);\n }\n\n return cluster;\n }\n\n private async getCredentials(\n authProvider: string,\n oidcTokenProvider?: string,\n ): Promise<{ token?: string }> {\n return await this.kubernetesAuthProvidersApi.getCredentials(\n authProvider === 'oidc'\n ? `${authProvider}.${oidcTokenProvider}`\n : authProvider,\n );\n }\n\n async getObjectsByEntity(\n requestBody: KubernetesRequestBody,\n ): Promise<ObjectsByEntityResponse> {\n return await this.postRequired(\n `/services/${requestBody.entity.metadata.name}`,\n requestBody,\n );\n }\n\n async getWorkloadsByEntity(\n request: WorkloadsByEntityRequest,\n ): Promise<ObjectsByEntityResponse> {\n return await this.postRequired('/resources/workloads/query', {\n auth: request.auth,\n entityRef: stringifyEntityRef(request.entity),\n });\n }\n\n async getCustomObjectsByEntity(\n request: CustomObjectsByEntityRequest,\n ): Promise<ObjectsByEntityResponse> {\n return await this.postRequired(`/resources/custom/query`, {\n entityRef: stringifyEntityRef(request.entity),\n auth: request.auth,\n customResources: request.customResources,\n });\n }\n\n async getClusters(): Promise<{ name: string; authProvider: string }[]> {\n const url = `${await this.discoveryApi.getBaseUrl('kubernetes')}/clusters`;\n const response = await this.fetchApi.fetch(url);\n\n return (await this.handleResponse(response)).items;\n }\n\n async proxy(options: {\n clusterName: string;\n path: string;\n init?: RequestInit;\n }): Promise<Response> {\n const { authProvider, oidcTokenProvider } = await this.getCluster(\n options.clusterName,\n );\n const kubernetesCredentials = await this.getCredentials(\n authProvider,\n oidcTokenProvider,\n );\n const url = `${await this.discoveryApi.getBaseUrl('kubernetes')}/proxy${\n options.path\n }`;\n const headers = KubernetesBackendClient.getKubernetesHeaders(\n options,\n kubernetesCredentials?.token,\n authProvider,\n oidcTokenProvider,\n );\n return await this.fetchApi.fetch(url, { ...options.init, headers });\n }\n\n private static getKubernetesHeaders(\n options: {\n clusterName: string;\n path: string;\n init?: RequestInit;\n },\n k8sToken: string | undefined,\n authProvider: string,\n oidcTokenProvider: string | undefined,\n ) {\n const kubernetesAuthHeader =\n KubernetesBackendClient.getKubernetesAuthHeaderByAuthProvider(\n authProvider,\n oidcTokenProvider,\n );\n return {\n ...options.init?.headers,\n [`Backstage-Kubernetes-Cluster`]: options.clusterName,\n ...(k8sToken && {\n [kubernetesAuthHeader]: k8sToken,\n }),\n };\n }\n\n private static getKubernetesAuthHeaderByAuthProvider(\n authProvider: string,\n oidcTokenProvider: string | undefined,\n ): string {\n let header: string = 'Backstage-Kubernetes-Authorization';\n\n header = header.concat('-', authProvider);\n\n if (oidcTokenProvider) header = header.concat('-', oidcTokenProvider);\n\n return header;\n }\n}\n"],"names":[],"mappings":";;;AA6BO,MAAM,uBAAA,CAAiD;AAAA,EAC3C,YAAA;AAAA,EACA,QAAA;AAAA,EACA,0BAAA;AAAA,EAEjB,YAAY,OAAA,EAIT;AACD,IAAA,IAAA,CAAK,eAAe,OAAA,C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AAC1B,KACF;AAAA,EACF;AAAA,EAEA,OAAe,qCAAA,CACb,YAAA,EACA,iBAAA,EACQ;AACR,IAAA,IAAI,MAAA,GAAiB,oCAAA;AAErB,IAAA,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,GAAA,EAAK,YAAY,CAAA;AAExC,IAAA,IAAI,iBAAA,EAAmB,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,KAAK,iBAAiB,CAAA;AAEpE,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"KubernetesClusterLinkFormatter.esm.js","sources":["../../src/api/KubernetesClusterLinkFormatter.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 */\n\nimport {\n KubernetesClusterLinkFormatterApi,\n FormatClusterLinkOptions,\n} from './types';\nimport { ClusterLinksFormatter } from '../types';\n\n/** @public */\nexport class KubernetesClusterLinkFormatter\n implements KubernetesClusterLinkFormatterApi\n{\n private readonly formatters: Record<string, ClusterLinksFormatter>;\n private readonly defaultFormatterName: string;\n\n constructor(options: {\n formatters: Record<string, ClusterLinksFormatter>;\n defaultFormatterName: string;\n }) {\n this.formatters = options.formatters;\n this.defaultFormatterName = options.defaultFormatterName;\n }\n async formatClusterLink(options: FormatClusterLinkOptions) {\n if (!options.dashboardUrl && !options.dashboardParameters) {\n return undefined;\n }\n if (options.dashboardUrl && !options.object) {\n return options.dashboardUrl;\n }\n const app = options.dashboardApp ?? this.defaultFormatterName;\n const formatter = this.formatters[app];\n if (!formatter) {\n throw new Error(`Could not find Kubernetes dashboard app named '${app}'`);\n }\n const url = await formatter.formatClusterLink({\n dashboardUrl: options.dashboardUrl\n ? new URL(options.dashboardUrl)\n : undefined,\n dashboardParameters: options.dashboardParameters,\n object: options.object,\n kind: options.kind,\n });\n return url.toString();\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,8BAEb,CAAA;AAAA,EACmB,UAAA;AAAA,EACA,oBAAA;AAAA,EAEjB,YAAY,OAGT,EAAA;AACD,IAAA,IAAA,CAAK,aAAa,OAAQ,CAAA,UAAA;AAC1B,IAAA,IAAA,CAAK,uBAAuB,OAAQ,CAAA,oBAAA;AAAA;AACtC,EACA,MAAM,kBAAkB,OAAmC,EAAA;AACzD,IAAA,IAAI,CAAC,OAAA,CAAQ,YAAgB,IAAA,CAAC,QAAQ,mBAAqB,EAAA;AACzD,MAAO,OAAA,KAAA,CAAA;AAAA;AAET,IAAA,IAAI,OAAQ,CAAA,YAAA,IAAgB,CAAC,OAAA,CAAQ,MAAQ,EAAA;AAC3C,MAAA,OAAO,OAAQ,CAAA,YAAA;AAAA;AAEjB,IAAM,MAAA,GAAA,GAAM,OAAQ,CAAA,YAAA,IAAgB,IAAK,CAAA,oBAAA;AACzC,IAAM,MAAA,SAAA,GAAY,IAAK,CAAA,UAAA,CAAW,GAAG,CAAA;AACrC,IAAA,IAAI,CAAC,SAAW,EAAA;AACd,MAAA,MAAM,IAAI,KAAA,CAAM,CAAkD,+CAAA,EAAA,GAAG,CAAG,CAAA,CAAA,CAAA;AAAA;AAE1E,IAAM,MAAA,GAAA,GAAM,MAAM,SAAA,CAAU,iBAAkB,CAAA;AAAA,MAC5C,cAAc,OAAQ,CAAA,YAAA,GAClB,IAAI,GAAI,CAAA,OAAA,CAAQ,YAAY,CAC5B,GAAA,KAAA,CAAA;AAAA,MACJ,qBAAqB,OAAQ,CAAA,mBAAA;AAAA,MAC7B,QAAQ,OAAQ,CAAA,MAAA;AAAA,MAChB,MAAM,OAAQ,CAAA;AAAA,KACf,CAAA;AACD,IAAA,OAAO,IAAI,QAAS,EAAA;AAAA;AAExB;;;;"}
1
+ {"version":3,"file":"KubernetesClusterLinkFormatter.esm.js","sources":["../../src/api/KubernetesClusterLinkFormatter.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 */\n\nimport {\n KubernetesClusterLinkFormatterApi,\n FormatClusterLinkOptions,\n} from './types';\nimport { ClusterLinksFormatter } from '../types';\n\n/** @public */\nexport class KubernetesClusterLinkFormatter\n implements KubernetesClusterLinkFormatterApi\n{\n private readonly formatters: Record<string, ClusterLinksFormatter>;\n private readonly defaultFormatterName: string;\n\n constructor(options: {\n formatters: Record<string, ClusterLinksFormatter>;\n defaultFormatterName: string;\n }) {\n this.formatters = options.formatters;\n this.defaultFormatterName = options.defaultFormatterName;\n }\n async formatClusterLink(options: FormatClusterLinkOptions) {\n if (!options.dashboardUrl && !options.dashboardParameters) {\n return undefined;\n }\n if (options.dashboardUrl && !options.object) {\n return options.dashboardUrl;\n }\n const app = options.dashboardApp ?? this.defaultFormatterName;\n const formatter = this.formatters[app];\n if (!formatter) {\n throw new Error(`Could not find Kubernetes dashboard app named '${app}'`);\n }\n const url = await formatter.formatClusterLink({\n dashboardUrl: options.dashboardUrl\n ? new URL(options.dashboardUrl)\n : undefined,\n dashboardParameters: options.dashboardParameters,\n object: options.object,\n kind: options.kind,\n });\n return url.toString();\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,8BAAA,CAEb;AAAA,EACmB,UAAA;AAAA,EACA,oBAAA;AAAA,EAEjB,YAAY,OAAA,EAGT;AACD,IAAA,IAAA,CAAK,aAAa,OAAA,CAAQ,UAAA;AAC1B,IAAA,IAAA,CAAK,uBAAuB,OAAA,CAAQ,oBAAA;AAAA,EACtC;AAAA,EACA,MAAM,kBAAkB,OAAA,EAAmC;AACzD,IAAA,IAAI,CAAC,OAAA,CAAQ,YAAA,IAAgB,CAAC,QAAQ,mBAAA,EAAqB;AACzD,MAAA,OAAO,MAAA;AAAA,IACT;AACA,IAAA,IAAI,OAAA,CAAQ,YAAA,IAAgB,CAAC,OAAA,CAAQ,MAAA,EAAQ;AAC3C,MAAA,OAAO,OAAA,CAAQ,YAAA;AAAA,IACjB;AACA,IAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,YAAA,IAAgB,IAAA,CAAK,oBAAA;AACzC,IAAA,MAAM,SAAA,GAAY,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA;AACrC,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,+CAAA,EAAkD,GAAG,CAAA,CAAA,CAAG,CAAA;AAAA,IAC1E;AACA,IAAA,MAAM,GAAA,GAAM,MAAM,SAAA,CAAU,iBAAA,CAAkB;AAAA,MAC5C,cAAc,OAAA,CAAQ,YAAA,GAClB,IAAI,GAAA,CAAI,OAAA,CAAQ,YAAY,CAAA,GAC5B,MAAA;AAAA,MACJ,qBAAqB,OAAA,CAAQ,mBAAA;AAAA,MAC7B,QAAQ,OAAA,CAAQ,MAAA;AAAA,MAChB,MAAM,OAAA,CAAQ;AAAA,KACf,CAAA;AACD,IAAA,OAAO,IAAI,QAAA,EAAS;AAAA,EACtB;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"KubernetesProxyClient.esm.js","sources":["../../src/api/KubernetesProxyClient.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 { KubernetesApi } from './types';\nimport { Event } from 'kubernetes-models/v1';\n\n/**\n * A client for common requests through the proxy endpoint of the kubernetes backend plugin.\n *\n * @public\n */\nexport class KubernetesProxyClient {\n private readonly kubernetesApi: KubernetesApi;\n\n constructor(options: { kubernetesApi: KubernetesApi }) {\n this.kubernetesApi = options.kubernetesApi;\n }\n\n private async handleText(response: Response): Promise<string> {\n if (!response.ok) {\n const payload = await response.text();\n let message;\n switch (response.status) {\n default:\n message = `Proxy request failed with ${response.status} ${response.statusText}, ${payload}`;\n }\n throw new Error(message);\n }\n\n return await response.text();\n }\n\n private async handleJson(response: Response): Promise<any> {\n if (!response.ok) {\n const payload = await response.text();\n let message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;\n switch (response.status) {\n case 404:\n message = `Proxy request failed with ${response.status} ${response.statusText}, ${payload}`;\n break;\n default:\n message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;\n }\n throw new Error(message);\n }\n\n return await response.json();\n }\n\n async getEventsByInvolvedObjectName({\n clusterName,\n involvedObjectName,\n namespace,\n }: {\n clusterName: string;\n involvedObjectName: string;\n namespace: string;\n }): Promise<Event[]> {\n return await this.kubernetesApi\n .proxy({\n clusterName,\n path: `/api/v1/namespaces/${namespace}/events?fieldSelector=involvedObject.name=${involvedObjectName}`,\n init: {\n method: 'GET',\n },\n })\n .then(response => this.handleJson(response))\n .then(eventList => eventList.items);\n }\n\n async getPodLogs({\n podName,\n namespace,\n clusterName,\n containerName,\n previous,\n }: {\n podName: string;\n namespace: string;\n clusterName: string;\n containerName: string;\n previous?: boolean;\n }): Promise<{ text: string }> {\n const params = new URLSearchParams({\n container: containerName,\n });\n if (previous) {\n params.append('previous', '');\n }\n return await this.kubernetesApi\n .proxy({\n clusterName: clusterName,\n path: `/api/v1/namespaces/${namespace}/pods/${podName}/log?${params.toString()}`,\n init: {\n method: 'GET',\n },\n })\n .then(response => this.handleText(response))\n .then(text => ({ text }));\n }\n\n async deletePod({\n podName,\n namespace,\n clusterName,\n }: {\n podName: string;\n namespace: string;\n clusterName: string;\n }): Promise<{ text: string }> {\n return await this.kubernetesApi\n .proxy({\n clusterName: clusterName,\n path: `/api/v1/namespaces/${namespace}/pods/${podName}`,\n init: {\n method: 'DELETE',\n },\n })\n .then(response => this.handleText(response))\n .then(text => ({ text }));\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,qBAAsB,CAAA;AAAA,EAChB,aAAA;AAAA,EAEjB,YAAY,OAA2C,EAAA;AACrD,IAAA,IAAA,CAAK,gBAAgB,OAAQ,CAAA,aAAA;AAAA;AAC/B,EAEA,MAAc,WAAW,QAAqC,EAAA;AAC5D,IAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,MAAM,MAAA,OAAA,GAAU,MAAM,QAAA,CAAS,IAAK,EAAA;AACpC,MAAI,IAAA,OAAA;AACJ,MAAA,QAAQ,SAAS,MAAQ;AAAA,QACvB;AACE,UAAA,OAAA,GAAU,6BAA6B,QAAS,CAAA,MAAM,IAAI,QAAS,CAAA,UAAU,KAAK,OAAO,CAAA,CAAA;AAAA;AAE7F,MAAM,MAAA,IAAI,MAAM,OAAO,CAAA;AAAA;AAGzB,IAAO,OAAA,MAAM,SAAS,IAAK,EAAA;AAAA;AAC7B,EAEA,MAAc,WAAW,QAAkC,EAAA;AACzD,IAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,MAAM,MAAA,OAAA,GAAU,MAAM,QAAA,CAAS,IAAK,EAAA;AACpC,MAAI,IAAA,OAAA,GAAU,uBAAuB,QAAS,CAAA,MAAM,IAAI,QAAS,CAAA,UAAU,KAAK,OAAO,CAAA,CAAA;AACvF,MAAA,QAAQ,SAAS,MAAQ;AAAA,QACvB,KAAK,GAAA;AACH,UAAA,OAAA,GA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,CAAQ,KAAA,EAAA,MAAA,CAAO,UAAU,CAAA,CAAA;AAAA,MAC9E,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAA;AAAA;AACV,KACD,CAAA,CACA,IAAK,CAAA,CAAA,QAAA,KAAY,IAAK,CAAA,UAAA,CAAW,QAAQ,CAAC,CAC1C,CAAA,IAAA,CAAK,CAAS,IAAA,MAAA,EAAE,MAAO,CAAA,CAAA;AAAA;AAC5B,EAEA,MAAM,SAAU,CAAA;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GAK4B,EAAA;AAC5B,IAAO,OAAA,MAAM,IAAK,CAAA,aAAA,CACf,KAAM,CAAA;AAAA,MACL,WAAA;AAAA,MACA,IAAM,EAAA,CAAA,mBAAA,EAAsB,SAAS,CAAA,MAAA,EAAS,OAAO,CAAA,CAAA;AAAA,MACrD,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAA;AAAA;AACV,KACD,CAAA,CACA,IAAK,CAAA,CAAA,QAAA,KAAY,IAAK,CAAA,UAAA,CAAW,QAAQ,CAAC,CAC1C,CAAA,IAAA,CAAK,CAAS,IAAA,MAAA,EAAE,MAAO,CAAA,CAAA;AAAA;AAE9B;;;;"}
1
+ {"version":3,"file":"KubernetesProxyClient.esm.js","sources":["../../src/api/KubernetesProxyClient.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 { KubernetesApi } from './types';\nimport { Event } from 'kubernetes-models/v1';\n\n/**\n * A client for common requests through the proxy endpoint of the kubernetes backend plugin.\n *\n * @public\n */\nexport class KubernetesProxyClient {\n private readonly kubernetesApi: KubernetesApi;\n\n constructor(options: { kubernetesApi: KubernetesApi }) {\n this.kubernetesApi = options.kubernetesApi;\n }\n\n private async handleText(response: Response): Promise<string> {\n if (!response.ok) {\n const payload = await response.text();\n let message;\n switch (response.status) {\n default:\n message = `Proxy request failed with ${response.status} ${response.statusText}, ${payload}`;\n }\n throw new Error(message);\n }\n\n return await response.text();\n }\n\n private async handleJson(response: Response): Promise<any> {\n if (!response.ok) {\n const payload = await response.text();\n let message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;\n switch (response.status) {\n case 404:\n message = `Proxy request failed with ${response.status} ${response.statusText}, ${payload}`;\n break;\n default:\n message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;\n }\n throw new Error(message);\n }\n\n return await response.json();\n }\n\n async getEventsByInvolvedObjectName({\n clusterName,\n involvedObjectName,\n namespace,\n }: {\n clusterName: string;\n involvedObjectName: string;\n namespace: string;\n }): Promise<Event[]> {\n return await this.kubernetesApi\n .proxy({\n clusterName,\n path: `/api/v1/namespaces/${namespace}/events?fieldSelector=involvedObject.name=${involvedObjectName}`,\n init: {\n method: 'GET',\n },\n })\n .then(response => this.handleJson(response))\n .then(eventList => eventList.items);\n }\n\n async getPodLogs({\n podName,\n namespace,\n clusterName,\n containerName,\n previous,\n }: {\n podName: string;\n namespace: string;\n clusterName: string;\n containerName: string;\n previous?: boolean;\n }): Promise<{ text: string }> {\n const params = new URLSearchParams({\n container: containerName,\n });\n if (previous) {\n params.append('previous', '');\n }\n return await this.kubernetesApi\n .proxy({\n clusterName: clusterName,\n path: `/api/v1/namespaces/${namespace}/pods/${podName}/log?${params.toString()}`,\n init: {\n method: 'GET',\n },\n })\n .then(response => this.handleText(response))\n .then(text => ({ text }));\n }\n\n async deletePod({\n podName,\n namespace,\n clusterName,\n }: {\n podName: string;\n namespace: string;\n clusterName: string;\n }): Promise<{ text: string }> {\n return await this.kubernetesApi\n .proxy({\n clusterName: clusterName,\n path: `/api/v1/namespaces/${namespace}/pods/${podName}`,\n init: {\n method: 'DELETE',\n },\n })\n .then(response => this.handleText(response))\n .then(text => ({ text }));\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,qBAAA,CAAsB;AAAA,EAChB,aAAA;AAAA,EAEjB,YAAY,OAAA,EAA2C;AACrD,IAAA,IAAA,CAAK,gBAAgB,OAAA,CAAQ,aAAA;AAAA,EAC/B;AAAA,EAEA,MAAc,WAAW,QAAA,EAAqC;AAC5D,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,OAAA,GAAU,MAAM,QAAA,CAAS,IAAA,EAAK;AACpC,MAAA,IAAI,OAAA;AACJ,MAAA,QAAQ,SAAS,MAAA;AAAQ,QACvB;AACE,UAAA,OAAA,GAAU,6BAA6B,QAAA,CAAS,MAAM,IAAI,QAAA,CAAS,UAAU,KAAK,OAAO,CAAA,CAAA;AAAA;AAE7F,MAAA,MAAM,IAAI,MAAM,OAAO,CAAA;AAAA,IACzB;AAEA,IAAA,OAAO,MAAM,SAAS,IAAA,EAAK;AAAA,EAC7B;AAAA,EAEA,MAAc,WAAW,QAAA,EAAkC;AACzD,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,OAAA,GAAU,MAAM,QAAA,CAAS,IAAA,EAAK;AACpC,MAAA,IAAI,OAAA,GAAU,uBAAuB,QAAA,CAAS,MAAM,IAAI,QAAA,CAAS,UAAU,KAAK,OAAO,CAAA,CAAA;AACvF,MAAA,QAAQ,SAAS,MAAA;AAAQ,QACvB,KAAK,GAAA;AACH,UAAA,OAAA,GAAU,6BAA6B,QAAA,CAAS,MAAM,IAAI,QAAA,CAAS,UAAU,KAAK,OAAO,CAAA,CAAA;AACzF,UAAA;AAAA,QACF;AACE,UAAA,OAAA,GAAU,uBAAuB,QAAA,CAAS,MAAM,IAAI,QAAA,CAAS,UAAU,KAAK,OAAO,CAAA,CAAA;AAAA;AAEvF,MAAA,MAAM,IAAI,MAAM,OA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,CAAA,IAAA,MAAS,EAAE,MAAK,CAAE,CAAA;AAAA,EAC5B;AAAA,EAEA,MAAM,SAAA,CAAU;AAAA,IACd,OAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF,EAI8B;AAC5B,IAAA,OAAO,MAAM,IAAA,CAAK,aAAA,CACf,KAAA,CAAM;AAAA,MACL,WAAA;AAAA,MACA,IAAA,EAAM,CAAA,mBAAA,EAAsB,SAAS,CAAA,MAAA,EAAS,OAAO,CAAA,CAAA;AAAA,MACrD,IAAA,EAAM;AAAA,QACJ,MAAA,EAAQ;AAAA;AACV,KACD,CAAA,CACA,IAAA,CAAK,CAAA,QAAA,KAAY,IAAA,CAAK,UAAA,CAAW,QAAQ,CAAC,CAAA,CAC1C,IAAA,CAAK,CAAA,IAAA,MAAS,EAAE,MAAK,CAAE,CAAA;AAAA,EAC5B;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AksClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/AksClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\nconst basePath =\n 'https://portal.azure.com/#blade/Microsoft_Azure_ContainerService/AksK8ResourceMenuBlade/overview-Deployment/aksClusterId';\n\nconst requiredParams = ['subscriptionId', 'resourceGroup', 'clusterName'];\n\n/** @public */\nexport class AksClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions) {\n if (!options.dashboardParameters) {\n throw new Error('AKS dashboard requires a dashboardParameters option');\n }\n const args = options.dashboardParameters;\n for (const param of requiredParams) {\n if (typeof args[param] !== 'string') {\n throw new Error(\n `AKS dashboard requires a \"${param}\" of type string in the dashboardParameters option`,\n );\n }\n }\n\n const path = `/subscriptions/${args.subscriptionId}/resourceGroups/${args.resourceGroup}/providers/Microsoft.ContainerService/managedClusters/${args.clusterName}`;\n\n const { name, namespace, uid } = options.object.metadata;\n const { selector } = options.object.spec;\n const params = {\n kind: options.kind,\n metadata: { name, namespace, uid },\n spec: {\n selector,\n },\n };\n\n return new URL(\n `${basePath}/${encodeURIComponent(path)}/resource/${encodeURIComponent(\n JSON.stringify(params),\n )}`,\n );\n }\n}\n"],"names":[],"mappings":"AAoBA,MAAM,QACJ,GAAA,0HAAA;AAEF,MAAM,cAAiB,GAAA,CAAC,gBAAkB,EAAA,eAAA,EAAiB,aAAa,CAAA;AAGjE,MAAM,wBAA0D,CAAA;AAAA,EACrE,MAAM,kBAAkB,OAAuC,EAAA;AAC7D,IAAI,IAAA,CAAC,QAAQ,mBAAqB,EAAA;AAChC,MAAM,MAAA,IAAI,MAAM,qDAAqD,CAAA;AAAA;AAEvE,IAAA,MAAM,OAAO,OAAQ,CAAA,mBAAA;AACrB,IAAA,KAAA,MAAW,SAAS,cAAgB,EAAA;AAClC,MAAA,IAAI,OAAO,IAAA,CAAK,KAAK,CAAA,KAAM,QAAU,EAAA;AACnC,QAAA,MAAM,IAAI,KAAA;AAAA,UACR,6BAA6B,KAAK,CAAA,kDAAA;AAAA,SACpC;AAAA;AACF;AAGF,IAAM,MAAA,IAAA,GAAO,kBAAkB,IAAK,CAAA,cAAc,mBAAmB,IAAK,CAAA,aAAa,CAAyD,sDAAA,EAAA,IAAA,CAAK,WAAW,CAAA,CAAA;AAEhK,IAAA,MAAM,EAAE,IAAM,EAAA,SAAA,EAAW,GAAI,EAAA,GAAI,QAAQ,MAAO,CAAA,QAAA;AAChD,IAAA,MAAM,EAAE,QAAA,EAAa,GAAA,OAAA,CAAQ,MAAO,CAAA,IAAA;AACpC,IAAA,MAAM,MAAS,GAAA;AAAA,MACb,MAAM,OAAQ,CAAA,IAAA;AAAA,MACd,QAAU,EAAA,EAAE,IAAM,EAAA,SAAA,EAAW,GAAI,EAAA;AAAA,MACjC,IAAM,EAAA;AAAA,QACJ;AAAA;AACF,KACF;AAEA,IAAA,OAAO,IAAI,GAAA;AAAA,MACT,GAAG,QAAQ,CAAA,CAAA,EAAI,kBAAmB,CAAA,IAAI,CAAC,CAAa,UAAA,EAAA,kBAAA;AAAA,QAClD,IAAA,CAAK,UAAU,MAAM;AAAA,OACtB,CAAA;AAAA,KACH;AAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AksClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/AksClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\nconst basePath =\n 'https://portal.azure.com/#blade/Microsoft_Azure_ContainerService/AksK8ResourceMenuBlade/overview-Deployment/aksClusterId';\n\nconst requiredParams = ['subscriptionId', 'resourceGroup', 'clusterName'];\n\n/** @public */\nexport class AksClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions) {\n if (!options.dashboardParameters) {\n throw new Error('AKS dashboard requires a dashboardParameters option');\n }\n const args = options.dashboardParameters;\n for (const param of requiredParams) {\n if (typeof args[param] !== 'string') {\n throw new Error(\n `AKS dashboard requires a \"${param}\" of type string in the dashboardParameters option`,\n );\n }\n }\n\n const path = `/subscriptions/${args.subscriptionId}/resourceGroups/${args.resourceGroup}/providers/Microsoft.ContainerService/managedClusters/${args.clusterName}`;\n\n const { name, namespace, uid } = options.object.metadata;\n const { selector } = options.object.spec;\n const params = {\n kind: options.kind,\n metadata: { name, namespace, uid },\n spec: {\n selector,\n },\n };\n\n return new URL(\n `${basePath}/${encodeURIComponent(path)}/resource/${encodeURIComponent(\n JSON.stringify(params),\n )}`,\n );\n }\n}\n"],"names":[],"mappings":"AAoBA,MAAM,QAAA,GACJ,0HAAA;AAEF,MAAM,cAAA,GAAiB,CAAC,gBAAA,EAAkB,eAAA,EAAiB,aAAa,CAAA;AAGjE,MAAM,wBAAA,CAA0D;AAAA,EACrE,MAAM,kBAAkB,OAAA,EAAuC;AAC7D,IAAA,IAAI,CAAC,QAAQ,mBAAA,EAAqB;AAChC,MAAA,MAAM,IAAI,MAAM,qDAAqD,CAAA;AAAA,IACvE;AACA,IAAA,MAAM,OAAO,OAAA,CAAQ,mBAAA;AACrB,IAAA,KAAA,MAAW,SAAS,cAAA,EAAgB;AAClC,MAAA,IAAI,OAAO,IAAA,CAAK,KAAK,CAAA,KAAM,QAAA,EAAU;AACnC,QAAA,MAAM,IAAI,KAAA;AAAA,UACR,6BAA6B,KAAK,CAAA,kDAAA;AAAA,SACpC;AAAA,MACF;AAAA,IACF;AAEA,IAAA,MAAM,IAAA,GAAO,kBAAkB,IAAA,CAAK,cAAc,mBAAmB,IAAA,CAAK,aAAa,CAAA,sDAAA,EAAyD,IAAA,CAAK,WAAW,CAAA,CAAA;AAEhK,IAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,GAAA,EAAI,GAAI,QAAQ,MAAA,CAAO,QAAA;AAChD,IAAA,MAAM,EAAE,QAAA,EAAS,GAAI,OAAA,CAAQ,MAAA,CAAO,IAAA;AACpC,IAAA,MAAM,MAAA,GAAS;AAAA,MACb,MAAM,OAAA,CAAQ,IAAA;AAAA,MACd,QAAA,EAAU,EAAE,IAAA,EAAM,SAAA,EAAW,GAAA,EAAI;AAAA,MACjC,IAAA,EAAM;AAAA,QACJ;AAAA;AACF,KACF;AAEA,IAAA,OAAO,IAAI,GAAA;AAAA,MACT,GAAG,QAAQ,CAAA,CAAA,EAAI,kBAAA,CAAmB,IAAI,CAAC,CAAA,UAAA,EAAa,kBAAA;AAAA,QAClD,IAAA,CAAK,UAAU,MAAM;AAAA,OACtB,CAAA;AAAA,KACH;AAAA,EACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EksClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/EksClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\n/** @public */\nexport class EksClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(\n _options: ClusterLinksFormatterOptions,\n ): Promise<URL> {\n throw new Error(\n 'EKS formatter is not yet implemented. Please, contribute!',\n );\n }\n}\n"],"names":[],"mappings":"AAqBO,MAAM,wBAA0D,CAAA;AAAA,EACrE,MAAM,kBACJ,QACc,EAAA;AACd,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EksClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/EksClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\n/** @public */\nexport class EksClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(\n _options: ClusterLinksFormatterOptions,\n ): Promise<URL> {\n throw new Error(\n 'EKS formatter is not yet implemented. Please, contribute!',\n );\n }\n}\n"],"names":[],"mappings":"AAqBO,MAAM,wBAAA,CAA0D;AAAA,EACrE,MAAM,kBACJ,QAAA,EACc;AACd,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GkeClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/GkeClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\nimport { ProfileInfoApi } from '@backstage/core-plugin-api';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployment',\n pod: 'pod',\n ingress: 'ingress',\n service: 'service',\n horizontalpodautoscaler: 'deployment',\n};\n\n/** @public */\nexport class GkeClusterLinksFormatter implements ClusterLinksFormatter {\n constructor(private readonly googleAuthApi: ProfileInfoApi | undefined) {}\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardParameters) {\n throw new Error('GKE dashboard requires a dashboardParameters option');\n }\n const args = options.dashboardParameters;\n if (typeof args.projectId !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"projectId\" of type string in the dashboardParameters option',\n );\n }\n if (typeof args.region !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"region\" of type string in the dashboardParameters option',\n );\n }\n if (typeof args.clusterName !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"clusterName\" of type string in the dashboardParameters option',\n );\n }\n const basePath = new URL('https://console.cloud.google.com/');\n const region = encodeURIComponent(args.region);\n const clusterName = encodeURIComponent(args.clusterName);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n let path: string;\n if (namespace && name && validKind) {\n const kindsWithDetails = ['ingress', 'pod'];\n const landingPage = kindsWithDetails.includes(validKind)\n ? 'details'\n : 'overview';\n path = `kubernetes/${validKind}/${region}/${clusterName}/${namespace}/${name}/${landingPage}`;\n } else {\n path = `kubernetes/clusters/details/${region}/${clusterName}/details`;\n }\n const result = new URL(path, basePath);\n result.searchParams.set('project', args.projectId);\n if (this.googleAuthApi) {\n const profile = await this.googleAuthApi.getProfile({ optional: true });\n if (profile?.email) {\n result.searchParams.set('authuser', profile.email);\n }\n }\n return result;\n }\n}\n"],"names":[],"mappings":"AAqBA,MAAM,YAAuC,GAAA;AAAA,EAC3C,UAAY,EAAA,YAAA;AAAA,EACZ,GAAK,EAAA,KAAA;AAAA,EACL,OAAS,EAAA,SAAA;AAAA,EACT,OAAS,EAAA,SAAA;AAAA,EACT,uBAAyB,EAAA;AAC3B,CAAA;AAGO,MAAM,wBAA0D,CAAA;AAAA,EACrE,YAA6B,aAA2C,EAAA;AAA3C,IAAA,IAAA,CAAA,aAAA,GAAA,aAAA;AAAA;AAA4C,EACzE,MAAM,k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AA,UAAA;AACJ,MAAO,IAAA,GAAA,CAAA,WAAA,EAAc,SAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA;AAAA,KACtF,MAAA;AACL,MAAO,IAAA,GAAA,CAAA,4BAAA,EAA+B,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,QAAA,CAAA;AAAA;AAE7D,IAAA,MAAM,MAAS,GAAA,IAAI,GAAI,CAAA,IAAA,EAAM,QAAQ,CAAA;AACrC,IAAA,MAAA,CAAO,YAAa,CAAA,GAAA,CAAI,SAAW,EAAA,IAAA,CAAK,SAAS,CAAA;AACjD,IAAA,IAAI,KAAK,aAAe,EAAA;AACtB,MAAM,MAAA,OAAA,GAAU,MAAM,IAAK,CAAA,aAAA,CAAc,WAAW,EAAE,QAAA,EAAU,MAAM,CAAA;AACtE,MAAA,IAAI,SAAS,KAAO,EAAA;AAClB,QAAA,MAAA,CAAO,YAAa,CAAA,GAAA,CAAI,UAAY,EAAA,OAAA,CAAQ,KAAK,CAAA;AAAA;AACnD;AAEF,IAAO,OAAA,MAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"GkeClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/GkeClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\nimport { ProfileInfoApi } from '@backstage/core-plugin-api';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployment',\n pod: 'pod',\n ingress: 'ingress',\n service: 'service',\n horizontalpodautoscaler: 'deployment',\n};\n\n/** @public */\nexport class GkeClusterLinksFormatter implements ClusterLinksFormatter {\n constructor(private readonly googleAuthApi: ProfileInfoApi | undefined) {}\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardParameters) {\n throw new Error('GKE dashboard requires a dashboardParameters option');\n }\n const args = options.dashboardParameters;\n if (typeof args.projectId !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"projectId\" of type string in the dashboardParameters option',\n );\n }\n if (typeof args.region !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"region\" of type string in the dashboardParameters option',\n );\n }\n if (typeof args.clusterName !== 'string') {\n throw new Error(\n 'GKE dashboard requires a \"clusterName\" of type string in the dashboardParameters option',\n );\n }\n const basePath = new URL('https://console.cloud.google.com/');\n const region = encodeURIComponent(args.region);\n const clusterName = encodeURIComponent(args.clusterName);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n let path: string;\n if (namespace && name && validKind) {\n const kindsWithDetails = ['ingress', 'pod'];\n const landingPage = kindsWithDetails.includes(validKind)\n ? 'details'\n : 'overview';\n path = `kubernetes/${validKind}/${region}/${clusterName}/${namespace}/${name}/${landingPage}`;\n } else {\n path = `kubernetes/clusters/details/${region}/${clusterName}/details`;\n }\n const result = new URL(path, basePath);\n result.searchParams.set('project', args.projectId);\n if (this.googleAuthApi) {\n const profile = await this.googleAuthApi.getProfile({ optional: true });\n if (profile?.email) {\n result.searchParams.set('authuser', profile.email);\n }\n }\n return result;\n }\n}\n"],"names":[],"mappings":"AAqBA,MAAM,YAAA,GAAuC;AAAA,EAC3C,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,KAAA;AAAA,EACL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AkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,IAAA;AACJ,IAAA,IAAI,SAAA,IAAa,QAAQ,SAAA,EAAW;AAClC,MAAA,MAAM,gBAAA,GAAmB,CAAC,SAAA,EAAW,KAAK,CAAA;AAC1C,MAAA,MAAM,WAAA,GAAc,gBAAA,CAAiB,QAAA,CAAS,SAAS,IACnD,SAAA,GACA,UAAA;AACJ,MAAA,IAAA,GAAO,CAAA,WAAA,EAAc,SAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA;AAAA,IAC7F,CAAA,MAAO;AACL,MAAA,IAAA,GAAO,CAAA,4BAAA,EAA+B,MAAM,CAAA,CAAA,EAAI,WAAW,CAAA,QAAA,CAAA;AAAA,IAC7D;AACA,IAAA,MAAM,MAAA,GAAS,IAAI,GAAA,CAAI,IAAA,EAAM,QAAQ,CAAA;AACrC,IAAA,MAAA,CAAO,YAAA,CAAa,GAAA,CAAI,SAAA,EAAW,IAAA,CAAK,SAAS,CAAA;AACjD,IAAA,IAAI,KAAK,aAAA,EAAe;AACtB,MAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,aAAA,CAAc,WAAW,EAAE,QAAA,EAAU,MAAM,CAAA;AACtE,MAAA,IAAI,SAAS,KAAA,EAAO;AAClB,QAAA,MAAA,CAAO,YAAA,CAAa,GAAA,CAAI,UAAA,EAAY,OAAA,CAAQ,KAAK,CAAA;AAAA,MACnD;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeadlampClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/HeadlampClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\n/** @public */\nexport class HeadlampClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n const { dashboardUrl, dashboardParameters, object, kind } = options;\n\n if (!dashboardUrl && !dashboardParameters?.internal) {\n throw new Error(\n 'Dashboard URL is required or dashboardInternal must be true',\n );\n }\n\n const clusterName =\n (dashboardParameters?.clusterName as string) ?? 'default';\n const path = this.getHeadlampPath(kind, object, clusterName);\n if (!path) {\n throw new Error(`Could not find path for kind: ${kind}`);\n }\n\n let baseUrl: URL;\n\n if (dashboardParameters?.internal) {\n baseUrl = new URL(window.location.origin);\n baseUrl.pathname =\n (dashboardParameters.headlampRoute as string) || '/headlamp';\n } else {\n if (!dashboardUrl?.href) {\n throw new Error(\n 'Dashboard URL is required when not using internal dashboard',\n );\n }\n baseUrl = new URL(dashboardUrl.href);\n }\n\n baseUrl.searchParams.set('to', path);\n return baseUrl;\n }\n\n private readonly NAMESPACED_RESOURCES = new Set([\n 'pod',\n 'deployment',\n 'replicaset',\n 'statefulset',\n 'daemonset',\n 'job',\n 'cronjob',\n 'service',\n 'ingress',\n 'configmap',\n 'secret',\n 'serviceaccount',\n 'role',\n 'rolebinding',\n 'networkpolicy',\n 'horizontalpodautoscaler',\n 'poddisruptionbudget',\n 'persistentvolumeclaim',\n ]);\n\n private getHeadlampPath(\n kind: string,\n object: {\n metadata?: {\n name?: string;\n namespace?: string;\n };\n },\n clusterName: string,\n ): string {\n const lowercaseKind = kind.toLocaleLowerCase('en-US');\n const { name } = object.metadata ?? {};\n let { namespace } = object.metadata ?? {};\n\n if (!name) {\n throw new Error(`Resource name is required for kind: ${kind}`);\n }\n\n // Add namespace validation\n if (this.NAMESPACED_RESOURCES.has(lowercaseKind) && !namespace) {\n throw new Error(`Namespace is required for namespaced resource: ${kind}`);\n }\n if (!namespace) {\n namespace = 'default';\n }\n\n const pathMap: Record<string, string> = {\n namespace: `/c/${clusterName}/namespaces/${name}`,\n node: `/c/${clusterName}/nodes/${name}`,\n persistentvolume: `/c/${clusterName}/storage/persistentvolumes/${name}`,\n persistentvolumeclaim: `/c/${clusterName}/storage/persistentvolumeclaims/${namespace}/${name}`,\n pod: `/c/${clusterName}/pods/${namespace}/${name}`,\n deployment: `/c/${clusterName}/deployments/${namespace}/${name}`,\n replicaset: `/c/${clusterName}/replicasets/${namespace}/${name}`,\n statefulset: `/c/${clusterName}/statefulsets/${namespace}/${name}`,\n daemonset: `/c/${clusterName}/daemonsets/${namespace}/${name}`,\n job: `/c/${clusterName}/jobs/${namespace}/${name}`,\n cronjob: `/c/${clusterName}/cronjobs/${namespace}/${name}`,\n service: `/c/${clusterName}/services/${namespace}/${name}`,\n ingress: `/c/${clusterName}/ingresses/${namespace}/${name}`,\n configmap: `/c/${clusterName}/configmaps/${namespace}/${name}`,\n secret: `/c/${clusterName}/secrets/${namespace}/${name}`,\n serviceaccount: `/c/${clusterName}/serviceaccounts/${namespace}/${name}`,\n role: `/c/${clusterName}/roles/${namespace}/${name}`,\n rolebinding: `/c/${clusterName}/rolebindings/${namespace}/${name}`,\n clusterrole: `/c/${clusterName}/clusterroles/${name}`,\n clusterrolebinding: `/c/${clusterName}/clusterrolebindings/${name}`,\n storageclass: `/c/${clusterName}/storage/storageclasses/${name}`,\n networkpolicy: `/c/${clusterName}/networkpolicies/${namespace}/${name}`,\n horizontalpodautoscaler: `/c/${clusterName}/horizontalpodautoscalers/${namespace}/${name}`,\n poddisruptionbudget: `/c/${clusterName}/poddisruptionbudgets/${namespace}/${name}`,\n customresourcedefinition: `/c/${clusterName}/customresourcedefinitions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,GAAA,EAAA,WAAW,CAAiB,cAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MAChE,WAAa,EAAA,CAAA,GAAA,EAAM,WAAW,CAAA,cAAA,EAAiB,IAAI,CAAA,CAAA;AAAA,MACnD,kBAAoB,EAAA,CAAA,GAAA,EAAM,WAAW,CAAA,qBAAA,EAAwB,IAAI,CAAA,CAAA;AAAA,MACjE,YAAc,EAAA,CAAA,GAAA,EAAM,WAAW,CAAA,wBAAA,EAA2B,IAAI,CAAA,CAAA;AAAA,MAC9D,eAAe,CAAM,GAAA,EAAA,WAAW,CAAoB,iBAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MACrE,yBAAyB,CAAM,GAAA,EAAA,WAAW,CAA6B,0BAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MACxF,qBAAqB,CAAM,GAAA,EAAA,WAAW,CAAyB,sBAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MAChF,wBAA0B,EAAA,CAAA,GAAA,EAAM,WAAW,CAAA,2BAAA,EAA8B,IAAI,CAAA;AAAA,KAC/E;AAEA,IAAO,OAAA,OAAA,CAAQ,aAAa,CAAK,IAAA,EAAA;AAAA;AAErC;;;;"}
1
+ {"version":3,"file":"HeadlampClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/HeadlampClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\n/** @public */\nexport class HeadlampClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n const { dashboardUrl, dashboardParameters, object, kind } = options;\n\n if (!dashboardUrl && !dashboardParameters?.internal) {\n throw new Error(\n 'Dashboard URL is required or dashboardInternal must be true',\n );\n }\n\n const clusterName =\n (dashboardParameters?.clusterName as string) ?? 'default';\n const path = this.getHeadlampPath(kind, object, clusterName);\n if (!path) {\n throw new Error(`Could not find path for kind: ${kind}`);\n }\n\n let baseUrl: URL;\n\n if (dashboardParameters?.internal) {\n baseUrl = new URL(window.location.origin);\n baseUrl.pathname =\n (dashboardParameters.headlampRoute as string) || '/headlamp';\n } else {\n if (!dashboardUrl?.href) {\n throw new Error(\n 'Dashboard URL is required when not using internal dashboard',\n );\n }\n baseUrl = new URL(dashboardUrl.href);\n }\n\n baseUrl.searchParams.set('to', path);\n return baseUrl;\n }\n\n private readonly NAMESPACED_RESOURCES = new Set([\n 'pod',\n 'deployment',\n 'replicaset',\n 'statefulset',\n 'daemonset',\n 'job',\n 'cronjob',\n 'service',\n 'ingress',\n 'configmap',\n 'secret',\n 'serviceaccount',\n 'role',\n 'rolebinding',\n 'networkpolicy',\n 'horizontalpodautoscaler',\n 'poddisruptionbudget',\n 'persistentvolumeclaim',\n ]);\n\n private getHeadlampPath(\n kind: string,\n object: {\n metadata?: {\n name?: string;\n namespace?: string;\n };\n },\n clusterName: string,\n ): string {\n const lowercaseKind = kind.toLocaleLowerCase('en-US');\n const { name } = object.metadata ?? {};\n let { namespace } = object.metadata ?? {};\n\n if (!name) {\n throw new Error(`Resource name is required for kind: ${kind}`);\n }\n\n // Add namespace validation\n if (this.NAMESPACED_RESOURCES.has(lowercaseKind) && !namespace) {\n throw new Error(`Namespace is required for namespaced resource: ${kind}`);\n }\n if (!namespace) {\n namespace = 'default';\n }\n\n const pathMap: Record<string, string> = {\n namespace: `/c/${clusterName}/namespaces/${name}`,\n node: `/c/${clusterName}/nodes/${name}`,\n persistentvolume: `/c/${clusterName}/storage/persistentvolumes/${name}`,\n persistentvolumeclaim: `/c/${clusterName}/storage/persistentvolumeclaims/${namespace}/${name}`,\n pod: `/c/${clusterName}/pods/${namespace}/${name}`,\n deployment: `/c/${clusterName}/deployments/${namespace}/${name}`,\n replicaset: `/c/${clusterName}/replicasets/${namespace}/${name}`,\n statefulset: `/c/${clusterName}/statefulsets/${namespace}/${name}`,\n daemonset: `/c/${clusterName}/daemonsets/${namespace}/${name}`,\n job: `/c/${clusterName}/jobs/${namespace}/${name}`,\n cronjob: `/c/${clusterName}/cronjobs/${namespace}/${name}`,\n service: `/c/${clusterName}/services/${namespace}/${name}`,\n ingress: `/c/${clusterName}/ingresses/${namespace}/${name}`,\n configmap: `/c/${clusterName}/configmaps/${namespace}/${name}`,\n secret: `/c/${clusterName}/secrets/${namespace}/${name}`,\n serviceaccount: `/c/${clusterName}/serviceaccounts/${namespace}/${name}`,\n role: `/c/${clusterName}/roles/${namespace}/${name}`,\n rolebinding: `/c/${clusterName}/rolebindings/${namespace}/${name}`,\n clusterrole: `/c/${clusterName}/clusterroles/${name}`,\n clusterrolebinding: `/c/${clusterName}/clusterrolebindings/${name}`,\n storageclass: `/c/${clusterName}/storage/storageclasses/${name}`,\n networkpolicy: `/c/${clusterName}/networkpolicies/${namespace}/${name}`,\n horizontalpodautoscaler: `/c/${clusterName}/horizontalpodautoscalers/${namespace}/${name}`,\n poddisruptionbudget: `/c/${clusterName}/poddisruptionbudgets/${namespace}/${name}`,\n customresourcedefinition: `/c/${clusterName}/customresourcedefinitions/${name}`,\n };\n\n return pathMap[lowercaseKind] ?? '';\n }\n}\n"],"names":[],"mappings":"AAsBO,MAAM,6BAAA,CAA+D;AAAA,EAC1E,MAAM,kBAAkB,OAAA,EAAqD;AAC3E,IAAA,MAAM,EAAE,YAAA,EAAc,mBAAA,EAAqB,MAAA,EAAQ,MAAK,GAAI,OAAA;AAE5D,IAAA,IAAI,CAAC,YAAA,IAAgB,CAAC,mBA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AAwB,IAAI,CAAA,CAAA;AAAA,MACjE,YAAA,EAAc,CAAA,GAAA,EAAM,WAAW,CAAA,wBAAA,EAA2B,IAAI,CAAA,CAAA;AAAA,MAC9D,eAAe,CAAA,GAAA,EAAM,WAAW,CAAA,iBAAA,EAAoB,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MACrE,yBAAyB,CAAA,GAAA,EAAM,WAAW,CAAA,0BAAA,EAA6B,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MACxF,qBAAqB,CAAA,GAAA,EAAM,WAAW,CAAA,sBAAA,EAAyB,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MAChF,wBAAA,EAA0B,CAAA,GAAA,EAAM,WAAW,CAAA,2BAAA,EAA8B,IAAI,CAAA;AAAA,KAC/E;AAEA,IAAA,OAAO,OAAA,CAAQ,aAAa,CAAA,IAAK,EAAA;AAAA,EACnC;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/OpenshiftClusterLinksFormatter.ts"],"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 { ClusterLinksFormatterOptions } from '../../types';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployments',\n ingress: 'ingresses',\n service: 'services',\n horizontalpodautoscaler: 'horizontalpodautoscalers',\n persistentvolume: 'persistentvolumes',\n};\n\n/** @public */\nexport class OpenshiftClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardUrl) {\n throw new Error('OpenShift dashboard requires a dashboardUrl option');\n }\n const basePath = new URL(options.dashboardUrl.href);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n if (!basePath.pathname.endsWith('/')) {\n // a dashboard url with a path should end with a slash otherwise\n // the new combined URL will replace the last segment with the appended path!\n // https://foobar.com/abc/def + k8s/cluster/projects/test --> https://foobar.com/abc/k8s/cluster/projects/test\n // https://foobar.com/abc/def/ + k8s/cluster/projects/test --> https://foobar.com/abc/def/k8s/cluster/projects/test\n basePath.pathname += '/';\n }\n let path = '';\n if (namespace) {\n if (name && validKind) {\n path = `k8s/ns/${namespace}/${validKind}/${name}`;\n } else {\n path = `k8s/cluster/projects/${namespace}`;\n }\n } else if (validKind) {\n path = `k8s/cluster/${validKind}`;\n if (name) {\n path += `/${name}`;\n }\n }\n return new URL(path, basePath);\n }\n}\n"],"names":[],"mappings":"AAiBA,MAAM,YAAuC,GAAA;AAAA,EAC3C,UAAY,EAAA,aAAA;AAAA,EACZ,OAAS,EAAA,WAAA;AAAA,EACT,OAAS,EAAA,UAAA;AAAA,EACT,uBAAyB,EAAA,0BAAA;AAAA,EACzB,gBAAkB,EAAA;AACpB,CAAA;AAGO,MAAM,8BAA+B,CAAA;AAAA,EAC1C,MAAM,kBAAkB,OAAqD,EAAA;AAC3E,IAAI,IAAA,CAAC,QAAQ,YAAc,EAAA;AACzB,MAAM,MAAA,IAAI,MAAM,oDAAoD,CAAA;AAAA;AAEtE,IAAA,MAAM,QAAW,GAAA,IAAI,GAAI,CAAA,OAAA,CAAQ,aAAa,IAAI,CAAA;AAClD,IAAA,MAAM,OAAO,kBAAmB,CAAA,OAAA,CAAQ,MAAO,CAAA,QAAA,EAAU,QAAQ,EAAE,CAAA;AACnE,IAAA,MAAM,SAAY,GAAA,kBAAA;AAAA,MAChB,OAAA,CAAQ,MAAO,CAAA,QAAA,EAAU,SAAa,IAAA;AAAA,KACxC;AACA,IAAA,MAAM,YAAY,YAAa,CAAA,OAAA,CAAQ,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,CAAC,QAAA,CAAS,QAAS,CAAA,QAAA,CAAS,GAAG,CAAG,EAAA;AAKpC,MAAA,QAAA,CAAS,QAAY,IAAA,GAAA;AAAA;AAEvB,IAAA,IAAI,IAAO,GAAA,EAAA;AACX,IAAA,IAAI,SAAW,EAAA;AACb,MAAA,IAAI,QAAQ,SAAW,EAAA;AACrB,QAAA,IAAA,GAAO,CAAU,OAAA,EAAA,SAAS,CAAI,CAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,OAC1C,MAAA;AACL,QAAA,IAAA,GAAO,wBAAwB,SAAS,CAAA,CAAA;AAAA;AAC1C,eACS,SAAW,EAAA;AACpB,MAAA,IAAA,GAAO,eAAe,SAAS,CAAA,CAAA;AAC/B,MAAA,IAAI,IAAM,EAAA;AACR,QAAA,IAAA,IAAQ,IAAI,IAAI,CAAA,CAAA;AAAA;AAClB;AAEF,IAAO,OAAA,IAAI,GAAI,CAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AAEjC;;;;"}
1
+ {"version":3,"file":"OpenshiftClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/OpenshiftClusterLinksFormatter.ts"],"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 { ClusterLinksFormatterOptions } from '../../types';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployments',\n ingress: 'ingresses',\n service: 'services',\n horizontalpodautoscaler: 'horizontalpodautoscalers',\n persistentvolume: 'persistentvolumes',\n};\n\n/** @public */\nexport class OpenshiftClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardUrl) {\n throw new Error('OpenShift dashboard requires a dashboardUrl option');\n }\n const basePath = new URL(options.dashboardUrl.href);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n if (!basePath.pathname.endsWith('/')) {\n // a dashboard url with a path should end with a slash otherwise\n // the new combined URL will replace the last segment with the appended path!\n // https://foobar.com/abc/def + k8s/cluster/projects/test --> https://foobar.com/abc/k8s/cluster/projects/test\n // https://foobar.com/abc/def/ + k8s/cluster/projects/test --> https://foobar.com/abc/def/k8s/cluster/projects/test\n basePath.pathname += '/';\n }\n let path = '';\n if (namespace) {\n if (name && validKind) {\n path = `k8s/ns/${namespace}/${validKind}/${name}`;\n } else {\n path = `k8s/cluster/projects/${namespace}`;\n }\n } else if (validKind) {\n path = `k8s/cluster/${validKind}`;\n if (name) {\n path += `/${name}`;\n }\n }\n return new URL(path, basePath);\n }\n}\n"],"names":[],"mappings":"AAiBA,MAAM,YAAA,GAAuC;AAAA,EAC3C,UAAA,EAAY,aAAA;AAAA,EACZ,OAAA,EAAS,WAAA;AAAA,EACT,OAAA,EAAS,UAAA;AAAA,EACT,uBAAA,EAAyB,0BAAA;AAAA,EACzB,gBAAA,EAAkB;AACpB,CAAA;AAGO,MAAM,8BAAA,CAA+B;AAAA,EAC1C,MAAM,kBAAkB,OAAA,EAAqD;AAC3E,IAAA,IAAI,CAAC,QAAQ,YAAA,EAAc;AACzB,MAAA,MAAM,IAAI,MAAM,oDAAoD,CAAA;AAAA,IACtE;AACA,IAAA,MAAM,QAAA,GAAW,IAAI,GAAA,CAAI,OAAA,CAAQ,aAAa,IAAI,CAAA;AAClD,IAAA,MAAM,OAAO,kBAAA,CAAmB,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,QAAQ,EAAE,CAAA;AACnE,IAAA,MAAM,SAAA,GAAY,kBAAA;AAAA,MAChB,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,SAAA,IAAa;AAAA,KACxC;AACA,IAAA,MAAM,YAAY,YAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,CAAC,QAAA,CAAS,QAAA,CAAS,QAAA,CAAS,GAAG,CAAA,EAAG;AAKpC,MAAA,QAAA,CAAS,QAAA,IAAY,GAAA;AAAA,IACvB;AACA,IAAA,IAAI,IAAA,GAAO,EAAA;AACX,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,IAAI,QAAQ,SAAA,EAAW;AACrB,QAAA,IAAA,GAAO,CAAA,OAAA,EAAU,SAAS,CAAA,CAAA,EAAI,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,MACjD,CAAA,MAAO;AACL,QAAA,IAAA,GAAO,wBAAwB,SAAS,CAAA,CAAA;AAAA,MAC1C;AAAA,IACF,WAAW,SAAA,EAAW;AACpB,MAAA,IAAA,GAAO,eAAe,SAAS,CAAA,CAAA;AAC/B,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,IAAA,IAAQ,IAAI,IAAI,CAAA,CAAA;AAAA,MAClB;AAAA,IACF;AACA,IAAA,OAAO,IAAI,GAAA,CAAI,IAAA,EAAM,QAAQ,CAAA;AAAA,EAC/B;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RancherClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/RancherClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'apps.deployment',\n ingress: 'networking.k8s.io.ingress',\n service: 'service',\n horizontalpodautoscaler: 'autoscaling.horizontalpodautoscaler',\n};\n\n/** @public */\nexport class RancherClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardUrl) {\n throw new Error('Rancher dashboard requires a dashboardUrl option');\n }\n const basePath = new URL(options.dashboardUrl.href);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n if (!basePath.pathname.endsWith('/')) {\n // a dashboard url with a path should end with a slash otherwise\n // the new combined URL will replace the last segment with the appended path!\n // https://foobar.com/abc/def + explorer/service/test --> https://foobar.com/abc/explorer/service/test\n // https://foobar.com/abc/def/ + explorer/service/test --> https://foobar.com/abc/def/explorer/service/test\n basePath.pathname += '/';\n }\n let path = '';\n if (validKind && name && namespace) {\n path = `explorer/${validKind}/${namespace}/${name}`;\n } else if (namespace) {\n path = 'explorer/workload';\n }\n return new URL(path, basePath);\n }\n}\n"],"names":[],"mappings":"AAoBA,MAAM,YAAuC,GAAA;AAAA,EAC3C,UAAY,EAAA,iBAAA;AAAA,EACZ,OAAS,EAAA,2BAAA;AAAA,EACT,OAAS,EAAA,SAAA;AAAA,EACT,uBAAyB,EAAA;AAC3B,CAAA;AAGO,MAAM,4BAA8D,CAAA;AAAA,EACzE,MAAM,kBAAkB,OAAqD,EAAA;AAC3E,IAAI,IAAA,CAAC,QAAQ,YAAc,EAAA;AACzB,MAAM,MAAA,IAAI,MAAM,kDAAkD,CAAA;AAAA;AAEpE,IAAA,MAAM,QAAW,GAAA,IAAI,GAAI,CAAA,OAAA,CAAQ,aAAa,IAAI,CAAA;AAClD,IAAA,MAAM,OAAO,kBAAmB,CAAA,OAAA,CAAQ,MAAO,CAAA,QAAA,EAAU,QAAQ,EAAE,CAAA;AACnE,IAAA,MAAM,SAAY,GAAA,kBAAA;AAAA,MAChB,OAAA,CAAQ,MAAO,CAAA,QAAA,EAAU,SAAa,IAAA;AAAA,KACxC;AACA,IAAA,MAAM,YAAY,YAAa,CAAA,OAAA,CAAQ,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,CAAC,QAAA,CAAS,QAAS,CAAA,QAAA,CAAS,GAAG,CAAG,EAAA;AAKpC,MAAA,QAAA,CAAS,QAAY,IAAA,GAAA;AAAA;AAEvB,IAAA,IAAI,IAAO,GAAA,EAAA;AACX,IAAI,IAAA,SAAA,IAAa,QAAQ,SAAW,EAAA;AAClC,MAAA,IAAA,GAAO,CAAY,SAAA,EAAA,SAAS,CAAI,CAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,eACxC,SAAW,EAAA;AACpB,MAAO,IAAA,GAAA,mBAAA;AAAA;AAET,IAAO,OAAA,IAAI,GAAI,CAAA,IAAA,EAAM,QAAQ,CAAA;AAAA;AAEjC;;;;"}
1
+ {"version":3,"file":"RancherClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/RancherClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'apps.deployment',\n ingress: 'networking.k8s.io.ingress',\n service: 'service',\n horizontalpodautoscaler: 'autoscaling.horizontalpodautoscaler',\n};\n\n/** @public */\nexport class RancherClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardUrl) {\n throw new Error('Rancher dashboard requires a dashboardUrl option');\n }\n const basePath = new URL(options.dashboardUrl.href);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n if (!basePath.pathname.endsWith('/')) {\n // a dashboard url with a path should end with a slash otherwise\n // the new combined URL will replace the last segment with the appended path!\n // https://foobar.com/abc/def + explorer/service/test --> https://foobar.com/abc/explorer/service/test\n // https://foobar.com/abc/def/ + explorer/service/test --> https://foobar.com/abc/def/explorer/service/test\n basePath.pathname += '/';\n }\n let path = '';\n if (validKind && name && namespace) {\n path = `explorer/${validKind}/${namespace}/${name}`;\n } else if (namespace) {\n path = 'explorer/workload';\n }\n return new URL(path, basePath);\n }\n}\n"],"names":[],"mappings":"AAoBA,MAAM,YAAA,GAAuC;AAAA,EAC3C,UAAA,EAAY,iBAAA;AAAA,EACZ,OAAA,EAAS,2BAAA;AAAA,EACT,OAAA,EAAS,SAAA;AAAA,EACT,uBAAA,EAAyB;AAC3B,CAAA;AAGO,MAAM,4BAAA,CAA8D;AAAA,EACzE,MAAM,kBAAkB,OAAA,EAAqD;AAC3E,IAAA,IAAI,CAAC,QAAQ,YAAA,EAAc;AACzB,MAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AAAA,IACpE;AACA,IAAA,MAAM,QAAA,GAAW,IAAI,GAAA,CAAI,OAAA,CAAQ,aAAa,IAAI,CAAA;AAClD,IAAA,MAAM,OAAO,kBAAA,CAAmB,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,QAAQ,EAAE,CAAA;AACnE,IAAA,MAAM,SAAA,GAAY,kBAAA;AAAA,MAChB,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,SAAA,IAAa;AAAA,KACxC;AACA,IAAA,MAAM,YAAY,YAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,CAAC,QAAA,CAAS,QAAA,CAAS,QAAA,CAAS,GAAG,CAAA,EAAG;AAKpC,MAAA,QAAA,CAAS,QAAA,IAAY,GAAA;AAAA,IACvB;AACA,IAAA,IAAI,IAAA,GAAO,EAAA;AACX,IAAA,IAAI,SAAA,IAAa,QAAQ,SAAA,EAAW;AAClC,MAAA,IAAA,GAAO,CAAA,SAAA,EAAY,SAAS,CAAA,CAAA,EAAI,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,IACnD,WAAW,SAAA,EAAW;AACpB,MAAA,IAAA,GAAO,mBAAA;AAAA,IACT;AACA,IAAA,OAAO,IAAI,GAAA,CAAI,IAAA,EAAM,QAAQ,CAAA;AAAA,EAC/B;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StandardClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/StandardClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployment',\n pod: 'pod',\n ingress: 'ingress',\n service: 'service',\n horizontalpodautoscaler: 'deployment',\n statefulset: 'statefulset',\n};\n\n/** @public */\nexport class StandardClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardUrl) {\n throw new Error('standard dashboard requires a dashboardUrl option');\n }\n const result = new URL(options.dashboardUrl.href);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n if (!result.pathname.endsWith('/')) {\n result.pathname += '/';\n }\n if (validKind && name && namespace) {\n result.hash = `/${validKind}/${namespace}/${name}`;\n } else if (namespace) {\n result.hash = '/workloads';\n }\n if (namespace) {\n // Note that Angular SPA requires a hash and the query parameter should be part of it\n result.hash += `?namespace=${namespace}`;\n }\n return result;\n }\n}\n"],"names":[],"mappings":"AAoBA,MAAM,YAAuC,GAAA;AAAA,EAC3C,UAAY,EAAA,YAAA;AAAA,EACZ,GAAK,EAAA,KAAA;AAAA,EACL,OAAS,EAAA,SAAA;AAAA,EACT,OAAS,EAAA,SAAA;AAAA,EACT,uBAAyB,EAAA,YAAA;AAAA,EACzB,WAAa,EAAA;AACf,CAAA;AAGO,MAAM,6BAA+D,CAAA;AAAA,EAC1E,MAAM,kBAAkB,OAAqD,EAAA;AAC3E,IAAI,IAAA,CAAC,QAAQ,YAAc,EAAA;AACzB,MAAM,MAAA,IAAI,MAAM,mDAAmD,CAAA;AAAA;AAErE,IAAA,MAAM,MAAS,GAAA,IAAI,GAAI,CAAA,OAAA,CAAQ,aAAa,IAAI,CAAA;AAChD,IAAA,MAAM,OAAO,kBAAmB,CAAA,OAAA,CAAQ,MAAO,CAAA,QAAA,EAAU,QAAQ,EAAE,CAAA;AACnE,IAAA,MAAM,SAAY,GAAA,kBAAA;AAAA,MAChB,OAAA,CAAQ,MAAO,CAAA,QAAA,EAAU,SAAa,IAAA;AAAA,KACxC;AACA,IAAA,MAAM,YAAY,YAAa,CAAA,OAAA,CAAQ,IAAK,CAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,CAAC,MAAA,CAAO,QAAS,CAAA,QAAA,CAAS,GAAG,CAAG,EAAA;AAClC,MAAA,MAAA,CAAO,QAAY,IAAA,GAAA;AAAA;AAErB,IAAI,IAAA,SAAA,IAAa,QAAQ,SAAW,EAAA;AAClC,MAAA,MAAA,CAAO,OAAO,CAAI,CAAA,EAAA,SAAS,CAAI,CAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,eACvC,SAAW,EAAA;AACpB,MAAA,MAAA,CAAO,IAAO,GAAA,YAAA;AAAA;AAEhB,IAAA,IAAI,SAAW,EAAA;AAEb,MAAO,MAAA,CAAA,IAAA,IAAQ,cAAc,SAAS,CAAA,CAAA;AAAA;AAExC,IAAO,OAAA,MAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"StandardClusterLinksFormatter.esm.js","sources":["../../../src/api/formatters/StandardClusterLinksFormatter.ts"],"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 {\n ClusterLinksFormatter,\n ClusterLinksFormatterOptions,\n} from '../../types';\n\nconst kindMappings: Record<string, string> = {\n deployment: 'deployment',\n pod: 'pod',\n ingress: 'ingress',\n service: 'service',\n horizontalpodautoscaler: 'deployment',\n statefulset: 'statefulset',\n};\n\n/** @public */\nexport class StandardClusterLinksFormatter implements ClusterLinksFormatter {\n async formatClusterLink(options: ClusterLinksFormatterOptions): Promise<URL> {\n if (!options.dashboardUrl) {\n throw new Error('standard dashboard requires a dashboardUrl option');\n }\n const result = new URL(options.dashboardUrl.href);\n const name = encodeURIComponent(options.object.metadata?.name ?? '');\n const namespace = encodeURIComponent(\n options.object.metadata?.namespace ?? '',\n );\n const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')];\n if (!result.pathname.endsWith('/')) {\n result.pathname += '/';\n }\n if (validKind && name && namespace) {\n result.hash = `/${validKind}/${namespace}/${name}`;\n } else if (namespace) {\n result.hash = '/workloads';\n }\n if (namespace) {\n // Note that Angular SPA requires a hash and the query parameter should be part of it\n result.hash += `?namespace=${namespace}`;\n }\n return result;\n }\n}\n"],"names":[],"mappings":"AAoBA,MAAM,YAAA,GAAuC;AAAA,EAC3C,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,KAAA;AAAA,EACL,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,SAAA;AAAA,EACT,uBAAA,EAAyB,YAAA;AAAA,EACzB,WAAA,EAAa;AACf,CAAA;AAGO,MAAM,6BAAA,CAA+D;AAAA,EAC1E,MAAM,kBAAkB,OAAA,EAAqD;AAC3E,IAAA,IAAI,CAAC,QAAQ,YAAA,EAAc;AACzB,MAAA,MAAM,IAAI,MAAM,mDAAmD,CAAA;AAAA,IACrE;AACA,IAAA,MAAM,MAAA,GAAS,IAAI,GAAA,CAAI,OAAA,CAAQ,aAAa,IAAI,CAAA;AAChD,IAAA,MAAM,OAAO,kBAAA,CAAmB,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,QAAQ,EAAE,CAAA;AACnE,IAAA,MAAM,SAAA,GAAY,kBAAA;AAAA,MAChB,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,SAAA,IAAa;AAAA,KACxC;AACA,IAAA,MAAM,YAAY,YAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAC,CAAA;AACtE,IAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,QAAA,CAAS,GAAG,CAAA,EAAG;AAClC,MAAA,MAAA,CAAO,QAAA,IAAY,GAAA;AAAA,IACrB;AACA,IAAA,IAAI,SAAA,IAAa,QAAQ,SAAA,EAAW;AAClC,MAAA,MAAA,CAAO,OAAO,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,SAAS,IAAI,IAAI,CAAA,CAAA;AAAA,IAClD,WAAW,SAAA,EAAW;AACpB,MAAA,MAAA,CAAO,IAAA,GAAO,YAAA;AAAA,IAChB;AACA,IAAA,IAAI,SAAA,EAAW;AAEb,MAAA,MAAA,CAAO,IAAA,IAAQ,cAAc,SAAS,CAAA,CAAA;AAAA,IACxC;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/api/formatters/index.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 */\n\nimport { AksClusterLinksFormatter } from './AksClusterLinksFormatter';\nimport { ClusterLinksFormatter } from '../../types';\nimport { EksClusterLinksFormatter } from './EksClusterLinksFormatter';\nimport { GkeClusterLinksFormatter } from './GkeClusterLinksFormatter';\nimport { StandardClusterLinksFormatter } from './StandardClusterLinksFormatter';\nimport { OpenshiftClusterLinksFormatter } from './OpenshiftClusterLinksFormatter';\nimport { RancherClusterLinksFormatter } from './RancherClusterLinksFormatter';\nimport { HeadlampClusterLinksFormatter } from './HeadlampClusterLinksFormatter';\nimport { ProfileInfoApi } from '@backstage/core-plugin-api';\n\nexport {\n StandardClusterLinksFormatter,\n AksClusterLinksFormatter,\n EksClusterLinksFormatter,\n GkeClusterLinksFormatter,\n OpenshiftClusterLinksFormatter,\n RancherClusterLinksFormatter,\n HeadlampClusterLinksFormatter,\n};\n\n/** @public */\nexport const DEFAULT_FORMATTER_NAME = 'standard';\n\n/** @public */\nexport function getDefaultFormatters(deps: {\n googleAuthApi: ProfileInfoApi;\n}): Record<string, ClusterLinksFormatter> {\n return {\n standard: new StandardClusterLinksFormatter(),\n aks: new AksClusterLinksFormatter(),\n eks: new EksClusterLinksFormatter(),\n gke: new GkeClusterLinksFormatter(deps.googleAuthApi),\n openshift: new OpenshiftClusterLinksFormatter(),\n rancher: new RancherClusterLinksFormatter(),\n headlamp: new HeadlampClusterLinksFormatter(),\n };\n}\n"],"names":[],"mappings":";;;;;;;;AAqCO,MAAM,sBAAyB,GAAA;AAG/B,SAAS,qBAAqB,IAEK,EAAA;AACxC,EAAO,OAAA;AAAA,IACL,QAAA,EAAU,IAAI,6BAA8B,EAAA;AAAA,IAC5C,GAAA,EAAK,IAAI,wBAAyB,EAAA;AAAA,IAClC,GAAA,EAAK,IAAI,wBAAyB,EAAA;AAAA,IAClC,GAAK,EAAA,IAAI,wBAAyB,CAAA,IAAA,CAAK,aAAa,CAAA;AAAA,IACpD,SAAA,EAAW,IAAI,8BAA+B,EAAA;AAAA,IAC9C,OAAA,EAAS,IAAI,4BAA6B,EAAA;AAAA,IAC1C,QAAA,EAAU,IAAI,6BAA8B;AAAA,GAC9C;AACF;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/api/formatters/index.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 */\n\nimport { AksClusterLinksFormatter } from './AksClusterLinksFormatter';\nimport { ClusterLinksFormatter } from '../../types';\nimport { EksClusterLinksFormatter } from './EksClusterLinksFormatter';\nimport { GkeClusterLinksFormatter } from './GkeClusterLinksFormatter';\nimport { StandardClusterLinksFormatter } from './StandardClusterLinksFormatter';\nimport { OpenshiftClusterLinksFormatter } from './OpenshiftClusterLinksFormatter';\nimport { RancherClusterLinksFormatter } from './RancherClusterLinksFormatter';\nimport { HeadlampClusterLinksFormatter } from './HeadlampClusterLinksFormatter';\nimport { ProfileInfoApi } from '@backstage/core-plugin-api';\n\nexport {\n StandardClusterLinksFormatter,\n AksClusterLinksFormatter,\n EksClusterLinksFormatter,\n GkeClusterLinksFormatter,\n OpenshiftClusterLinksFormatter,\n RancherClusterLinksFormatter,\n HeadlampClusterLinksFormatter,\n};\n\n/** @public */\nexport const DEFAULT_FORMATTER_NAME = 'standard';\n\n/** @public */\nexport function getDefaultFormatters(deps: {\n googleAuthApi: ProfileInfoApi;\n}): Record<string, ClusterLinksFormatter> {\n return {\n standard: new StandardClusterLinksFormatter(),\n aks: new AksClusterLinksFormatter(),\n eks: new EksClusterLinksFormatter(),\n gke: new GkeClusterLinksFormatter(deps.googleAuthApi),\n openshift: new OpenshiftClusterLinksFormatter(),\n rancher: new RancherClusterLinksFormatter(),\n headlamp: new HeadlampClusterLinksFormatter(),\n };\n}\n"],"names":[],"mappings":";;;;;;;;AAqCO,MAAM,sBAAA,GAAyB;AAG/B,SAAS,qBAAqB,IAAA,EAEK;AACxC,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,IAAI,6BAAA,EAA8B;AAAA,IAC5C,GAAA,EAAK,IAAI,wBAAA,EAAyB;AAAA,IAClC,GAAA,EAAK,IAAI,wBAAA,EAAyB;AAAA,IAClC,GAAA,EAAK,IAAI,wBAAA,CAAyB,IAAA,CAAK,aAAa,CAAA;AAAA,IACpD,SAAA,EAAW,IAAI,8BAAA,EAA+B;AAAA,IAC9C,OAAA,EAAS,IAAI,4BAAA,EAA6B;AAAA,IAC1C,QAAA,EAAU,IAAI,6BAAA;AAA8B,GAC9C;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.esm.js","sources":["../../src/api/types.ts"],"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 {\n KubernetesRequestBody,\n ObjectsByEntityResponse,\n WorkloadsByEntityRequest,\n CustomObjectsByEntityRequest,\n} from '@backstage/plugin-kubernetes-common';\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport { Event } from 'kubernetes-models/v1';\nimport { JsonObject } from '@backstage/types';\n\n/** @public */\nexport const kubernetesApiRef = createApiRef<KubernetesApi>({\n id: 'plugin.kubernetes.service',\n});\n\n/** @public */\nexport const kubernetesProxyApiRef = createApiRef<KubernetesProxyApi>({\n id: 'plugin.kubernetes.proxy-service',\n});\n\n/** @public */\nexport const kubernetesClusterLinkFormatterApiRef =\n createApiRef<KubernetesClusterLinkFormatterApi>({\n id: 'plugin.kubernetes.cluster-link-formatter-service',\n });\n\n/** @public */\nexport interface KubernetesApi {\n getObjectsByEntity(\n requestBody: KubernetesRequestBody,\n ): Promise<ObjectsByEntityResponse>;\n getClusters(): Promise<\n {\n name: string;\n authProvider: string;\n oidcTokenProvider?: string;\n }[]\n >;\n getCluster(clusterName: string): Promise<\n | {\n name: string;\n authProvider: string;\n oidcTokenProvider?: string;\n dashboardUrl?: string;\n }\n | undefined\n >;\n getWorkloadsByEntity(\n request: WorkloadsByEntityRequest,\n ): Promise<ObjectsByEntityResponse>;\n getCustomObjectsByEntity(\n request: CustomObjectsByEntityRequest,\n ): Promise<ObjectsByEntityResponse>;\n proxy(options: {\n clusterName: string;\n path: string;\n init?: RequestInit;\n }): Promise<Response>;\n}\n\n/** @public */\nexport interface KubernetesProxyApi {\n getPodLogs(request: {\n podName: string;\n namespace: string;\n clusterName: string;\n containerName: string;\n previous?: boolean;\n }): Promise<{ text: string }>;\n deletePod(request: {\n podName: string;\n namespace: string;\n clusterName: string;\n }): Promise<{ text: string }>;\n getEventsByInvolvedObjectName(request: {\n clusterName: string;\n involvedObjectName: string;\n namespace: string;\n }): Promise<Event[]>;\n}\n\n/**\n * @public\n */\nexport type FormatClusterLinkOptions = {\n dashboardUrl?: string;\n dashboardApp?: string;\n dashboardParameters?: JsonObject;\n object: any;\n kind: string;\n};\n\n/** @public */\nexport interface KubernetesClusterLinkFormatterApi {\n formatClusterLink(\n options: FormatClusterLinkOptions,\n ): Promise<string | undefined>;\n}\n"],"names":[],"mappings":";;AA2BO,MAAM,mBAAmB,YAA4B,CAAA;AAAA,EAC1D,EAAI,EAAA;AACN,CAAC;AAGM,MAAM,wBAAwB,YAAiC,CAAA;AAAA,EACpE,EAAI,EAAA;AACN,CAAC;AAGM,MAAM,uCACX,YAAgD,CAAA;AAAA,EAC9C,EAAI,EAAA;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"types.esm.js","sources":["../../src/api/types.ts"],"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 {\n KubernetesRequestBody,\n ObjectsByEntityResponse,\n WorkloadsByEntityRequest,\n CustomObjectsByEntityRequest,\n} from '@backstage/plugin-kubernetes-common';\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport { Event } from 'kubernetes-models/v1';\nimport { JsonObject } from '@backstage/types';\n\n/** @public */\nexport const kubernetesApiRef = createApiRef<KubernetesApi>({\n id: 'plugin.kubernetes.service',\n});\n\n/** @public */\nexport const kubernetesProxyApiRef = createApiRef<KubernetesProxyApi>({\n id: 'plugin.kubernetes.proxy-service',\n});\n\n/** @public */\nexport const kubernetesClusterLinkFormatterApiRef =\n createApiRef<KubernetesClusterLinkFormatterApi>({\n id: 'plugin.kubernetes.cluster-link-formatter-service',\n });\n\n/** @public */\nexport interface KubernetesApi {\n getObjectsByEntity(\n requestBody: KubernetesRequestBody,\n ): Promise<ObjectsByEntityResponse>;\n getClusters(): Promise<\n {\n name: string;\n authProvider: string;\n oidcTokenProvider?: string;\n }[]\n >;\n getCluster(clusterName: string): Promise<\n | {\n name: string;\n authProvider: string;\n oidcTokenProvider?: string;\n dashboardUrl?: string;\n }\n | undefined\n >;\n getWorkloadsByEntity(\n request: WorkloadsByEntityRequest,\n ): Promise<ObjectsByEntityResponse>;\n getCustomObjectsByEntity(\n request: CustomObjectsByEntityRequest,\n ): Promise<ObjectsByEntityResponse>;\n proxy(options: {\n clusterName: string;\n path: string;\n init?: RequestInit;\n }): Promise<Response>;\n}\n\n/** @public */\nexport interface KubernetesProxyApi {\n getPodLogs(request: {\n podName: string;\n namespace: string;\n clusterName: string;\n containerName: string;\n previous?: boolean;\n }): Promise<{ text: string }>;\n deletePod(request: {\n podName: string;\n namespace: string;\n clusterName: string;\n }): Promise<{ text: string }>;\n getEventsByInvolvedObjectName(request: {\n clusterName: string;\n involvedObjectName: string;\n namespace: string;\n }): Promise<Event[]>;\n}\n\n/**\n * @public\n */\nexport type FormatClusterLinkOptions = {\n dashboardUrl?: string;\n dashboardApp?: string;\n dashboardParameters?: JsonObject;\n object: any;\n kind: string;\n};\n\n/** @public */\nexport interface KubernetesClusterLinkFormatterApi {\n formatClusterLink(\n options: FormatClusterLinkOptions,\n ): Promise<string | undefined>;\n}\n"],"names":[],"mappings":";;AA2BO,MAAM,mBAAmB,YAAA,CAA4B;AAAA,EAC1D,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,wBAAwB,YAAA,CAAiC;AAAA,EACpE,EAAA,EAAI;AACN,CAAC;AAGM,MAAM,uCACX,YAAA,CAAgD;AAAA,EAC9C,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Cluster.esm.js","sources":["../../../src/components/Cluster/Cluster.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ClientPodStatus,\n ClusterObjects,\n groupResponses,\n} from '@backstage/plugin-kubernetes-common';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { DeploymentsAccordions } from '../DeploymentsAccordions';\nimport { StatefulSetsAccordions } from '../StatefulSetsAccordions';\nimport { IngressesAccordions } from '../IngressesAccordions';\nimport { ServicesAccordions } from '../ServicesAccordions';\nimport { CronJobsAccordions } from '../CronJobsAccordions';\nimport { CustomResources } from '../CustomResources';\nimport { DaemonSetsAccordions } from '../DaemonSetsAccordions';\nimport {\n ClusterContext,\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\n\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { PodMetricsContext } from '../../hooks/usePodMetrics';\n\ntype ClusterSummaryProps = {\n clusterName: string;\n totalNumberOfPods: number;\n numberOfPodsWithErrors: number;\n children?: ReactNode;\n};\n\nconst ClusterSummary = ({\n clusterName,\n totalNumberOfPods,\n numberOfPodsWithErrors,\n}: ClusterSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid\n xs={6}\n item\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item xs>\n <Typography variant=\"body1\">{clusterName}</Typography>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Cluster\n </Typography>\n </Grid>\n </Grid>\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n <StatusOK>{totalNumberOfPods} pods</StatusOK>\n </Grid>\n <Grid item>\n {numberOfPodsWithErrors > 0 ? (\n <StatusError>{numberOfPodsWithErrors} pods with errors</StatusError>\n ) : (\n <StatusOK>No pods with errors</StatusOK>\n )}\n </Grid>\n </Grid>\n </Grid>\n );\n};\n\n/**\n * Props for Cluster\n *\n * @public\n */\nexport type ClusterProps = {\n clusterObjects: ClusterObjects;\n podsWithErrors: Set<string>;\n children?: ReactNode;\n};\n\n/**\n * Component for rendering Kubernetes resources in a cluster\n *\n * @public\n */\nexport const Cluster = ({ clusterObjects, podsWithErrors }: ClusterProps) => {\n const groupedResponses = groupResponses(clusterObjects.resources);\n\n const podMetricsMap = new Map<string, ClientPodStatus[]>();\n podMetricsMap.set(clusterObjects.cluster.name, clusterObjects.podMetrics);\n return (\n <ClusterContext.Provider value={clusterObjects.cluster}>\n <GroupedResponsesContext.Provider value={groupedResponses}>\n <PodMetricsContext.Provider value={podMetricsMap}>\n <PodNamesWithErrorsContext.Provider value={podsWithErrors}>\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <ClusterSummary\n clusterName={\n clusterObjects.cluster.title || clusterObjects.cluster.name\n }\n totalNumberOfPods={groupedResponses.pods.length}\n numberOfPodsWithErrors={podsWithErrors.size}\n />\n </AccordionSummary>\n <AccordionDetails>\n <Grid container direction=\"column\">\n {groupedResponses.customResources.length > 0 ? (\n <Grid item>\n <CustomResources />\n </Grid>\n ) : undefined}\n {groupedResponses.deployments.length > 0 ? (\n <Grid item>\n <DeploymentsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.daemonSets.length > 0 ? (\n <Grid item>\n <DaemonSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.statefulsets.length > 0 ? (\n <Grid item>\n <StatefulSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.ingresses.length > 0 ? (\n <Grid item>\n <IngressesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.services.length > 0 ? (\n <Grid item>\n <ServicesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.cronJobs.length > 0 ? (\n <Grid item>\n <CronJobsAccordions />\n </Grid>\n ) : undefined}\n </Grid>\n </AccordionDetails>\n </Accordion>\n </PodNamesWithErrorsContext.Provider>\n </PodMetricsContext.Provider>\n </GroupedResponsesContext.Provider>\n </ClusterContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAM,iBAAiB,CAAC;AAAA,EACtB,WAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAA2B,KAAA;AACzB,EACE,uBAAA,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAS,EAAA,IAAA;AAAA,MACT,SAAU,EAAA,KAAA;AAAA,MACV,cAAe,EAAA,eAAA;AAAA,MACf,UAAW,EAAA,YAAA;AAAA,MACX,O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A,GAAA,CAAC,kBAAmB,EAAA,EAAA,CAAA,EACtB,CACE,GAAA,KAAA,CAAA;AAAA,MACH,gBAAA,CAAiB,QAAS,CAAA,MAAA,GAAS,CAClC,mBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IACR,EAAA,QAAA,kBAAA,GAAA,CAAC,kBAAmB,EAAA,EAAA,CAAA,EACtB,CACE,GAAA,KAAA;AAAA,KAAA,EACN,CACF,EAAA;AAAA,GACF,EAAA,CAAA,EACF,CACF,EAAA,CAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Cluster.esm.js","sources":["../../../src/components/Cluster/Cluster.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ClientPodStatus,\n ClusterObjects,\n groupResponses,\n} from '@backstage/plugin-kubernetes-common';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { DeploymentsAccordions } from '../DeploymentsAccordions';\nimport { StatefulSetsAccordions } from '../StatefulSetsAccordions';\nimport { IngressesAccordions } from '../IngressesAccordions';\nimport { ServicesAccordions } from '../ServicesAccordions';\nimport { CronJobsAccordions } from '../CronJobsAccordions';\nimport { CustomResources } from '../CustomResources';\nimport { DaemonSetsAccordions } from '../DaemonSetsAccordions';\nimport {\n ClusterContext,\n GroupedResponsesContext,\n PodNamesWithErrorsContext,\n} from '../../hooks';\n\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { PodMetricsContext } from '../../hooks/usePodMetrics';\n\ntype ClusterSummaryProps = {\n clusterName: string;\n totalNumberOfPods: number;\n numberOfPodsWithErrors: number;\n children?: ReactNode;\n};\n\nconst ClusterSummary = ({\n clusterName,\n totalNumberOfPods,\n numberOfPodsWithErrors,\n}: ClusterSummaryProps) => {\n return (\n <Grid\n container\n direction=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid\n xs={6}\n item\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item xs>\n <Typography variant=\"body1\">{clusterName}</Typography>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n Cluster\n </Typography>\n </Grid>\n </Grid>\n <Grid\n item\n container\n xs={3}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n <StatusOK>{totalNumberOfPods} pods</StatusOK>\n </Grid>\n <Grid item>\n {numberOfPodsWithErrors > 0 ? (\n <StatusError>{numberOfPodsWithErrors} pods with errors</StatusError>\n ) : (\n <StatusOK>No pods with errors</StatusOK>\n )}\n </Grid>\n </Grid>\n </Grid>\n );\n};\n\n/**\n * Props for Cluster\n *\n * @public\n */\nexport type ClusterProps = {\n clusterObjects: ClusterObjects;\n podsWithErrors: Set<string>;\n children?: ReactNode;\n};\n\n/**\n * Component for rendering Kubernetes resources in a cluster\n *\n * @public\n */\nexport const Cluster = ({ clusterObjects, podsWithErrors }: ClusterProps) => {\n const groupedResponses = groupResponses(clusterObjects.resources);\n\n const podMetricsMap = new Map<string, ClientPodStatus[]>();\n podMetricsMap.set(clusterObjects.cluster.name, clusterObjects.podMetrics);\n return (\n <ClusterContext.Provider value={clusterObjects.cluster}>\n <GroupedResponsesContext.Provider value={groupedResponses}>\n <PodMetricsContext.Provider value={podMetricsMap}>\n <PodNamesWithErrorsContext.Provider value={podsWithErrors}>\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <ClusterSummary\n clusterName={\n clusterObjects.cluster.title || clusterObjects.cluster.name\n }\n totalNumberOfPods={groupedResponses.pods.length}\n numberOfPodsWithErrors={podsWithErrors.size}\n />\n </AccordionSummary>\n <AccordionDetails>\n <Grid container direction=\"column\">\n {groupedResponses.customResources.length > 0 ? (\n <Grid item>\n <CustomResources />\n </Grid>\n ) : undefined}\n {groupedResponses.deployments.length > 0 ? (\n <Grid item>\n <DeploymentsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.daemonSets.length > 0 ? (\n <Grid item>\n <DaemonSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.statefulsets.length > 0 ? (\n <Grid item>\n <StatefulSetsAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.ingresses.length > 0 ? (\n <Grid item>\n <IngressesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.services.length > 0 ? (\n <Grid item>\n <ServicesAccordions />\n </Grid>\n ) : undefined}\n {groupedResponses.cronJobs.length > 0 ? (\n <Grid item>\n <CronJobsAccordions />\n </Grid>\n ) : undefined}\n </Grid>\n </AccordionDetails>\n </Accordion>\n </PodNamesWithErrorsContext.Provider>\n </PodMetricsContext.Provider>\n </GroupedResponsesContext.Provider>\n </ClusterContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAM,iBAAiB,CAAC;AAAA,EACtB,WAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAA,KAA2B;AACzB,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAU,KAAA;AAAA,MACV,cAAA,EAAe,eAAA;AAAA,MACf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GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB,CAAA,GACE,MAAA;AAAA,MACH,gBAAA,CAAiB,QAAA,CAAS,MAAA,GAAS,CAAA,mBAClC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,CAAA,EACtB,CAAA,GACE;AAAA,KAAA,EACN,CAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CronJobsAccordions.esm.js","sources":["../../../src/components/CronJobsAccordions/CronJobsAccordions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactNode, useContext } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1CronJob, V1Job } from '@kubernetes/client-node';\nimport { JobsAccordions } from '../JobsAccordions';\nimport { CronJobDrawer } from './CronJobsDrawer';\nimport { getOwnedResources } from '../../utils/owner';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { humanizeCron } from '../../utils/crons';\n\n/**\n *\n *\n * @public\n */\nexport type CronJobsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype CronJobAccordionProps = {\n cronJob: V1CronJob;\n ownedJobs: V1Job[];\n children?: ReactNode;\n};\n\ntype CronJobSummaryProps = {\n cronJob: V1CronJob;\n children?: ReactNode;\n};\n\nconst CronJobSummary = ({ cronJob }: CronJobSummaryProps) => {\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 <CronJobDrawer cronJob={cronJob} />\n </Grid>\n <Grid\n item\n container\n xs={6}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n {cronJob.spec?.suspend ? (\n <StatusError>Suspended</StatusError>\n ) : (\n <StatusOK>Active</StatusOK>\n )}\n </Grid>\n <Grid item>\n <Typography variant=\"body1\">\n Schedule:{' '}\n {cronJob.spec?.schedule\n ? `${cronJob.spec.schedule} (${humanizeCron(\n cronJob.spec.schedule,\n )})`\n : 'N/A'}\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n );\n};\n\nconst CronJobAccordion = ({ cronJob, ownedJobs }: CronJobAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <CronJobSummary cronJob={cronJob} />\n </AccordionSummary>\n <AccordionDetails>\n <JobsAccordions jobs={ownedJobs.reverse()} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const CronJobsAccordions = ({}: CronJobsAccordionsProps) => {\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.cronJobs.map((cronJob, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <CronJobAccordion\n ownedJobs={getOwnedResources(cronJob, groupedResponses.jobs)}\n cronJob={cronJob}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\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iBAAA,CAAkB,OAAS,EAAA,gBAAA,CAAiB,IAAI,CAAA;AAAA,UAC3D;AAAA;AAAA,OACF,EACF,CANwB,EAAA,EAAA,CAO1B,CACD;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"CronJobsAccordions.esm.js","sources":["../../../src/components/CronJobsAccordions/CronJobsAccordions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactNode, useContext } from 'react';\nimport Accordion from '@material-ui/core/Accordion';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport AccordionSummary from '@material-ui/core/AccordionSummary';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport type { V1CronJob, V1Job } from '@kubernetes/client-node';\nimport { JobsAccordions } from '../JobsAccordions';\nimport { CronJobDrawer } from './CronJobsDrawer';\nimport { getOwnedResources } from '../../utils/owner';\nimport { GroupedResponsesContext } from '../../hooks';\nimport { StatusError, StatusOK } from '@backstage/core-components';\nimport { humanizeCron } from '../../utils/crons';\n\n/**\n *\n *\n * @public\n */\nexport type CronJobsAccordionsProps = {\n children?: ReactNode;\n};\n\ntype CronJobAccordionProps = {\n cronJob: V1CronJob;\n ownedJobs: V1Job[];\n children?: ReactNode;\n};\n\ntype CronJobSummaryProps = {\n cronJob: V1CronJob;\n children?: ReactNode;\n};\n\nconst CronJobSummary = ({ cronJob }: CronJobSummaryProps) => {\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 <CronJobDrawer cronJob={cronJob} />\n </Grid>\n <Grid\n item\n container\n xs={6}\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-end\"\n spacing={0}\n >\n <Grid item>\n {cronJob.spec?.suspend ? (\n <StatusError>Suspended</StatusError>\n ) : (\n <StatusOK>Active</StatusOK>\n )}\n </Grid>\n <Grid item>\n <Typography variant=\"body1\">\n Schedule:{' '}\n {cronJob.spec?.schedule\n ? `${cronJob.spec.schedule} (${humanizeCron(\n cronJob.spec.schedule,\n )})`\n : 'N/A'}\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n );\n};\n\nconst CronJobAccordion = ({ cronJob, ownedJobs }: CronJobAccordionProps) => {\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }} variant=\"outlined\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <CronJobSummary cronJob={cronJob} />\n </AccordionSummary>\n <AccordionDetails>\n <JobsAccordions jobs={ownedJobs.reverse()} />\n </AccordionDetails>\n </Accordion>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const CronJobsAccordions = ({}: CronJobsAccordionsProps) => {\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.cronJobs.map((cronJob, i) => (\n <Grid container item key={i} xs>\n <Grid item xs>\n <CronJobAccordion\n ownedJobs={getOwnedResources(cronJob, groupedResponses.jobs)}\n cronJob={cronJob}\n />\n </Grid>\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,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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Accordions/CronJobsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { V1CronJob } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\n\nexport const CronJobDrawer = ({\n cronJob,\n expanded,\n}: {\n cronJob: V1CronJob;\n expanded?: boolean;\n}) => {\n const namespace = cronJob.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={cronJob}\n expanded={expanded}\n kind=\"CronJob\"\n renderObject={(cronJobObj: V1CronJob) => ({\n schedule: cronJobObj.spec?.schedule ?? '???',\n startingDeadlineSeconds:\n cronJobObj.spec?.startingDeadlineSeconds ?? '???',\n concurrencyPolicy: cronJobObj.spec?.concurrencyPolicy ?? '???',\n lastScheduleTime: cronJobObj.status?.lastScheduleTime ?? '???',\n })}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {cronJob.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n CronJob\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBO,MAAM,gB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YACC,SACC,oBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IACR,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAK,OAAQ,EAAA,KAAA,EAAO,CAAc,WAAA,EAAA,SAAS,IAAI,CACvD,EAAA;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"CronJobsDrawer.esm.js","sources":["../../../src/components/CronJobsAccordions/CronJobsDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { V1CronJob } from '@kubernetes/client-node';\nimport { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport Chip from '@material-ui/core/Chip';\n\nexport const CronJobDrawer = ({\n cronJob,\n expanded,\n}: {\n cronJob: V1CronJob;\n expanded?: boolean;\n}) => {\n const namespace = cronJob.metadata?.namespace;\n return (\n <KubernetesStructuredMetadataTableDrawer\n object={cronJob}\n expanded={expanded}\n kind=\"CronJob\"\n renderObject={(cronJobObj: V1CronJob) => ({\n schedule: cronJobObj.spec?.schedule ?? '???',\n startingDeadlineSeconds:\n cronJobObj.spec?.startingDeadlineSeconds ?? '???',\n concurrencyPolicy: cronJobObj.spec?.concurrencyPolicy ?? '???',\n lastScheduleTime: cronJobObj.status?.lastScheduleTime ?? '???',\n })}\n >\n <Grid\n container\n direction=\"column\"\n justifyContent=\"flex-start\"\n alignItems=\"flex-start\"\n spacing={0}\n >\n <Grid item>\n <Typography variant=\"body1\">\n {cronJob.metadata?.name ?? 'unknown object'}\n </Typography>\n </Grid>\n <Grid item>\n <Typography color=\"textSecondary\" variant=\"subtitle1\">\n CronJob\n </Typography>\n </Grid>\n {namespace && (\n <Grid item>\n <Chip size=\"small\" label={`namespace: ${namespace}`} />\n </Grid>\n )}\n </Grid>\n </KubernetesStructuredMetadataTableDrawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,MAAM,SAAA,GAAY,QAAQ,QAAA,EAAU,SAAA;AACpC,EAAA,uBACE,GAAA;AAAA,IAAC,uCAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,OAAA;AAAA,MACR,QAAA;AAAA,MACA,IAAA,EAAK,SAAA;AAAA,MACL,YAAA,EAAc,CAAC,UAAA,MAA2B;AAAA,QACxC,QAAA,EAAU,UAAA,CAAW,IAAA,EAAM,QAAA,IAAY,KAAA;AAAA,QACvC,uBAAA,EACE,UAAA,CAAW,IAAA,EAAM,uBAAA,IAA2B,KAAA;AAAA,QAC9C,iBAAA,EAAmB,UAAA,CAAW,IAAA,EAAM,iBAAA,IAAqB,KAAA;AAAA,QACzD,gBAAA,EAAkB,UAAA,CAAW,MAAA,EAAQ,gBAAA,IAAoB;AAAA,OAC3D,CAAA;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAU,QAAA;AAAA,UACV,cAAA,EAAe,YAAA;AAAA,UACf,UAAA,EAAW,YAAA;AAAA,UACX,OAAA,EAAS,CAAA;AAAA,UAET,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,OAAA,CAAQ,QAAA,EAAU,IAAA,IAAQ,gBAAA,EAC7B,CAAA,EACF,CAAA;AAAA,4BACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,eAAA,EAAgB,OAAA,EAAQ,WAAA,EAAY,QAAA,EAAA,SAAA,EAEtD,CAAA,EACF,CAAA;AAAA,YACC,SAAA,oBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,OAAA,EAAQ,KAAA,EAAO,CAAA,WAAA,EAAc,SAAS,IAAI,CAAA,EACvD;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ;;;;"}
@@ -48,7 +48,7 @@ import { RolloutDrawer } from './RolloutDrawer.esm.js';
48
48
  import PauseIcon from '@material-ui/icons/Pause';
49
49
  import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
50
50
  import { StepsProgress } from './StepsProgress.esm.js';
51
- import { getMatchingHpa, getOwnedPodsThroughReplicaSets } from '../../../utils/owner.esm.js';
51
+ import { getOwnedPodsThroughReplicaSets, getMatchingHpa } from '../../../utils/owner.esm.js';
52
52
 
53
53
  const AbortedTitle = /* @__PURE__ */ jsxs(
54
54
  "div",