@backstage/plugin-kubernetes-cluster 0.0.10 → 0.0.11-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @backstage/plugin-kubernetes-cluster
2
2
 
3
+ ## 0.0.11-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.14.6-next.1
9
+ - @backstage/plugin-kubernetes-react@0.3.5-next.1
10
+ - @backstage/plugin-catalog-react@1.11.4-next.1
11
+
12
+ ## 0.0.11-next.0
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ - @backstage/catalog-model@1.5.0-next.0
18
+ - @backstage/core-components@0.14.5-next.0
19
+ - @backstage/plugin-catalog-react@1.11.4-next.0
20
+ - @backstage/plugin-kubernetes-common@0.7.6-next.0
21
+ - @backstage/plugin-kubernetes-react@0.3.5-next.0
22
+ - @backstage/core-plugin-api@1.9.2
23
+
3
24
  ## 0.0.10
4
25
 
5
26
  ### Patch Changes
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
3
+ import { Routes, Route } from 'react-router-dom';
4
+ import { ANNOTATION_KUBERNETES_API_SERVER } from '@backstage/plugin-kubernetes-common';
5
+ import { KubernetesClusterContent } from './components/KubernetesClusterContent/KubernetesClusterContent.esm.js';
6
+
7
+ const isKubernetesClusterAvailable = (entity) => {
8
+ var _a;
9
+ return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[ANNOTATION_KUBERNETES_API_SERVER]);
10
+ };
11
+ const Router = () => {
12
+ const { entity } = useEntity();
13
+ if (isKubernetesClusterAvailable(entity)) {
14
+ return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, { path: "/", element: /* @__PURE__ */ React.createElement(KubernetesClusterContent, null) }));
15
+ }
16
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
17
+ MissingAnnotationEmptyState,
18
+ {
19
+ annotation: ANNOTATION_KUBERNETES_API_SERVER
20
+ }
21
+ ));
22
+ };
23
+
24
+ export { Router, isKubernetesClusterAvailable };
25
+ //# sourceMappingURL=Router.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Router.esm.js","sources":["../src/Router.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 React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { Route, Routes } from 'react-router-dom';\nimport { ANNOTATION_KUBERNETES_API_SERVER } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesClusterContent } from './components/KubernetesClusterContent';\n\n/**\n *\n *\n * @public\n */\nexport const isKubernetesClusterAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[ANNOTATION_KUBERNETES_API_SERVER]);\n\n/**\n *\n *\n * @public\n */\nexport const Router = () => {\n const { entity } = useEntity();\n\n if (isKubernetesClusterAvailable(entity)) {\n return (\n <Routes>\n <Route path=\"/\" element={<KubernetesClusterContent />} />\n </Routes>\n );\n }\n\n return (\n <>\n <MissingAnnotationEmptyState\n annotation={ANNOTATION_KUBERNETES_API_SERVER}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AA+Ba,MAAA,4BAAA,GAA+B,CAAC,MAAgB,KAAA;AA/B7D,EAAA,IAAA,EAAA,CAAA;AAgCE,EAAA,OAAA,OAAA,CAAA,CAAQ,EAAO,GAAA,MAAA,CAAA,QAAA,CAAS,WAAhB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAA8B,gCAAiC,CAAA,CAAA,CAAA;AAAA,EAAA;AAOlE,MAAM,SAAS,MAAM;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAE7B,EAAI,IAAA,4BAAA,CAA6B,MAAM,CAAG,EAAA;AACxC,IACE,uBAAA,KAAA,CAAA,aAAA,CAAC,MACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,IAAA,EAAK,KAAI,OAAS,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAyB,EAAA,IAAA,CAAA,EAAI,CACzD,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,KAAA;AAAA,GAEhB,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,60 @@
1
+ import { useApiResources } from './useApiResources.esm.js';
2
+ import React, { useCallback, useEffect } from 'react';
3
+ import { useEntity } from '@backstage/plugin-catalog-react';
4
+ import { Table } from '@backstage/core-components';
5
+ import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
6
+ import { makeStyles } from '@material-ui/core/styles';
7
+
8
+ const useStyles = makeStyles((theme) => ({
9
+ empty: {
10
+ padding: theme.spacing(2),
11
+ display: "flex",
12
+ justifyContent: "center"
13
+ }
14
+ }));
15
+ const defaultColumns = [
16
+ {
17
+ title: "Name",
18
+ highlight: true,
19
+ render: (apiGroup) => {
20
+ return apiGroup.name;
21
+ }
22
+ },
23
+ {
24
+ title: "Preferred Version",
25
+ highlight: true,
26
+ render: (apiGroup) => {
27
+ var _a;
28
+ return (_a = apiGroup.preferredVersion) == null ? void 0 : _a.groupVersion;
29
+ }
30
+ }
31
+ ];
32
+ const ApiResources = () => {
33
+ var _a;
34
+ const classes = useStyles();
35
+ const { entity } = useEntity();
36
+ const { setError } = useKubernetesClusterError();
37
+ const setErrorCallback = useCallback(setError, [setError]);
38
+ const { value, error, loading } = useApiResources({
39
+ clusterName: entity.metadata.name
40
+ });
41
+ useEffect(() => {
42
+ if (error) {
43
+ setErrorCallback(error.message);
44
+ }
45
+ }, [error, setErrorCallback]);
46
+ return /* @__PURE__ */ React.createElement(
47
+ Table,
48
+ {
49
+ title: "API Resources",
50
+ options: { paging: true, search: false, emptyRowsWhenPaging: false },
51
+ isLoading: !value && loading,
52
+ data: (_a = value == null ? void 0 : value.groups) != null ? _a : [],
53
+ emptyContent: /* @__PURE__ */ React.createElement("div", { className: classes.empty }, error !== void 0 ? "Error loading API Resources" : "No API Resources found"),
54
+ columns: defaultColumns
55
+ }
56
+ );
57
+ };
58
+
59
+ export { ApiResources };
60
+ //# sourceMappingURL=ApiResources.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiResources.esm.js","sources":["../../../src/components/ApiResources/ApiResources.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApiResources } from './useApiResources';\nimport React, { useCallback, useEffect } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { IAPIGroup } from '@kubernetes-models/apimachinery/apis/meta/v1';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\nconst defaultColumns: TableColumn<IAPIGroup>[] = [\n {\n title: 'Name',\n highlight: true,\n render: (apiGroup: IAPIGroup) => {\n return apiGroup.name;\n },\n },\n {\n title: 'Preferred Version',\n highlight: true,\n render: (apiGroup: IAPIGroup) => {\n return apiGroup.preferredVersion?.groupVersion;\n },\n },\n];\n\nexport const ApiResources = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n const { value, error, loading } = useApiResources({\n clusterName: entity.metadata.name,\n });\n\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <Table\n title=\"API Resources\"\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n isLoading={!value && loading}\n data={value?.groups ?? []}\n emptyContent={\n <div className={classes.empty}>\n {error !== undefined\n ? 'Error loading API Resources'\n : 'No API Resources found'}\n </div>\n }\n columns={defaultColumns}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA,QAAA;AAAA,GAClB;AACF,CAAE,CAAA,CAAA,CAAA;AAEF,MAAM,cAA2C,GAAA;AAAA,EAC/C;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,IAAA;AAAA,IACX,MAAA,EAAQ,CAAC,QAAwB,KAAA;AAC/B,MAAA,OAAO,QAAS,CAAA,IAAA,CAAA;AAAA,KAClB;AAAA,GACF;A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AA,KAAA,CAAA,GAAA,KAAA,CAAO,MAAP,KAAA,IAAA,GAAA,EAAA,GAAiB,EAAC;AAAA,MACxB,YAAA,sCACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,KACrB,EAAA,EAAA,KAAA,KAAU,KACP,CAAA,GAAA,6BAAA,GACA,wBACN,CAAA;AAAA,MAEF,OAAS,EAAA,cAAA;AAAA,KAAA;AAAA,GACX,CAAA;AAEJ;;;;"}
@@ -0,0 +1,18 @@
1
+ import useAsync from 'react-use/esm/useAsync';
2
+ import { useApi } from '@backstage/core-plugin-api';
3
+ import { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';
4
+
5
+ const useApiResources = ({ clusterName }) => {
6
+ const kubernetesApi = useApi(kubernetesApiRef);
7
+ return useAsync(async () => {
8
+ return await kubernetesApi.proxy({
9
+ clusterName,
10
+ path: "/apis"
11
+ }).then((r) => {
12
+ return r.json();
13
+ });
14
+ }, [clusterName]);
15
+ };
16
+
17
+ export { useApiResources };
18
+ //# sourceMappingURL=useApiResources.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useApiResources.esm.js","sources":["../../../src/components/ApiResources/useApiResources.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';\nimport { IAPIGroupList } from '@kubernetes-models/apimachinery/apis/meta/v1';\n\n/**\n * Arguments for useApiResources\n *\n * @public\n */\nexport interface ApiResourcesOptions {\n clusterName: string;\n}\n\n/**\n * Retrieves the logs for the given pod\n *\n * @public\n */\nexport const useApiResources = ({ clusterName }: ApiResourcesOptions) => {\n const kubernetesApi = useApi(kubernetesApiRef);\n return useAsync(async () => {\n return await kubernetesApi\n .proxy({\n clusterName,\n path: '/apis',\n })\n .then(r => {\n return r.json() as Promise<IAPIGroupList>;\n });\n }, [clusterName]);\n};\n"],"names":[],"mappings":";;;;AAmCO,MAAM,eAAkB,GAAA,CAAC,EAAE,WAAA,EAAuC,KAAA;AACvE,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA,CAAA;AAC7C,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAO,OAAA,MAAM,cACV,KAAM,CAAA;AAAA,MACL,WAAA;AAAA,MACA,IAAM,EAAA,OAAA;AAAA,KACP,CACA,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA;AACT,MAAA,OAAO,EAAE,IAAK,EAAA,CAAA;AAAA,KACf,CAAA,CAAA;AAAA,GACL,EAAG,CAAC,WAAW,CAAC,CAAA,CAAA;AAClB;;;;"}
@@ -0,0 +1,44 @@
1
+ import React, { useCallback, useEffect } from 'react';
2
+ import { InfoCard, StructuredMetadataTable } from '@backstage/core-components';
3
+ import { useEntity } from '@backstage/plugin-catalog-react';
4
+ import { useCluster } from './useCluster.esm.js';
5
+ import Skeleton from '@material-ui/lab/Skeleton';
6
+ import { makeStyles, createStyles } from '@material-ui/core/styles';
7
+ import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
8
+
9
+ const useStyles = makeStyles(
10
+ (_theme) => createStyles({
11
+ root: {
12
+ height: "100%"
13
+ }
14
+ })
15
+ );
16
+ const ClusterOverview = () => {
17
+ var _a, _b;
18
+ const classes = useStyles();
19
+ const { entity } = useEntity();
20
+ const { value, loading, error } = useCluster({
21
+ clusterName: entity.metadata.name
22
+ });
23
+ const { setError } = useKubernetesClusterError();
24
+ const setErrorCallback = useCallback(setError, [setError]);
25
+ useEffect(() => {
26
+ if (error) {
27
+ setErrorCallback(error.message);
28
+ }
29
+ }, [error, setErrorCallback]);
30
+ return /* @__PURE__ */ React.createElement(InfoCard, { title: "Cluster Overview", className: classes.root }, !value && loading && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Skeleton, { height: "35rem" })), value && /* @__PURE__ */ React.createElement(
31
+ StructuredMetadataTable,
32
+ {
33
+ metadata: {
34
+ name: value.name,
35
+ "Backstage auth provider": value.authProvider,
36
+ "OIDC Token Provider": (_a = value.oidcTokenProvider) != null ? _a : "N/A",
37
+ "Dashboard Link": (_b = value.dashboardUrl) != null ? _b : "N/A"
38
+ }
39
+ }
40
+ ));
41
+ };
42
+
43
+ export { ClusterOverview };
44
+ //# sourceMappingURL=ClusterOverview.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClusterOverview.esm.js","sources":["../../../src/components/ClusterOverview/ClusterOverview.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { useCallback, useEffect } from 'react';\nimport { InfoCard, StructuredMetadataTable } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useCluster } from './useCluster';\nimport Skeleton from '@material-ui/lab/Skeleton';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n }),\n);\n\nexport const ClusterOverview = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, loading, error } = useCluster({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <InfoCard title=\"Cluster Overview\" className={classes.root}>\n {!value && loading && (\n <>\n <Skeleton height=\"35rem\" />\n </>\n )}\n {value && (\n <StructuredMetadataTable\n metadata={{\n name: value.name,\n 'Backstage auth provider': value.authProvider,\n 'OIDC Token Provider': value.oidcTokenProvider ?? 'N/A',\n 'Dashboard Link': value.dashboardUrl ?? 'N/A',\n }}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAuBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,WAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA,MAAA;AAAA,KACV;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAEO,MAAM,kBAAkB,MAAM;AA/BrC,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAgCE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,KAAU,UAAW,CAAA;AAAA,IAC3C,WAAA,EAAa,OAAO,QAAS,CAAA,IAAA;AAAA,GAC9B,CAAA,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA,CAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA,CAAA;AAAA,KAChC;AAAA,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,CAAA,CAAA;AAE5B,EAAA,2CACG,QAAS,EAAA,EAAA,KAAA,EAAM,kBAAmB,EAAA,SAAA,EAAW,QAAQ,IACnD,EAAA,EAAA,CAAC,KAAS,IAAA,OAAA,8EAEN,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,QAAO,OAAQ,EAAA,CAC3B,GAED,KACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,uBAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA;AAAA,QACR,MAAM,KAAM,CAAA,IAAA;AAAA,QACZ,2BAA2B,KAAM,CAAA,YAAA;AAAA,QACjC,qBAAA,EAAA,CAAuB,EAAM,GAAA,KAAA,CAAA,iBAAA,KAAN,IAA2B,GAAA,EAAA,GAAA,KAAA;AAAA,QAClD,gBAAA,EAAA,CAAkB,EAAM,GAAA,KAAA,CAAA,YAAA,KAAN,IAAsB,GAAA,EAAA,GAAA,KAAA;AAAA,OAC1C;AAAA,KAAA;AAAA,GAGN,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,13 @@
1
+ import useAsync from 'react-use/esm/useAsync';
2
+ import { useApi } from '@backstage/core-plugin-api';
3
+ import { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';
4
+
5
+ const useCluster = ({ clusterName }) => {
6
+ const kubernetesApi = useApi(kubernetesApiRef);
7
+ return useAsync(async () => {
8
+ return await kubernetesApi.getCluster(clusterName);
9
+ }, [clusterName]);
10
+ };
11
+
12
+ export { useCluster };
13
+ //# sourceMappingURL=useCluster.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCluster.esm.js","sources":["../../../src/components/ClusterOverview/useCluster.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';\n\n/**\n * Arguments for useApiResources\n *\n * @public\n */\nexport interface UseClusterOptions {\n clusterName: string;\n}\n\n/**\n * Retrieves the logs for the given pod\n *\n * @public\n */\nexport const useCluster = ({ clusterName }: UseClusterOptions) => {\n const kubernetesApi = useApi(kubernetesApiRef);\n return useAsync(async () => {\n return await kubernetesApi.getCluster(clusterName);\n }, [clusterName]);\n};\n"],"names":[],"mappings":";;;;AAkCO,MAAM,UAAa,GAAA,CAAC,EAAE,WAAA,EAAqC,KAAA;AAChE,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA,CAAA;AAC7C,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAO,OAAA,MAAM,aAAc,CAAA,UAAA,CAAW,WAAW,CAAA,CAAA;AAAA,GACnD,EAAG,CAAC,WAAW,CAAC,CAAA,CAAA;AAClB;;;;"}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ApiResources } from '../ApiResources/ApiResources.esm.js';
3
+ import Grid from '@material-ui/core/Grid';
4
+ import Typography from '@material-ui/core/Typography';
5
+ import { Nodes } from '../Nodes/Nodes.esm.js';
6
+ import { ClusterOverview } from '../ClusterOverview/ClusterOverview.esm.js';
7
+ import { KubernetesClusterErrorProvider, useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
8
+ import { WarningPanel } from '@backstage/core-components';
9
+
10
+ const ContentGrid = () => {
11
+ const { error } = useKubernetesClusterError();
12
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, error && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(WarningPanel, { title: "Error loading Kubernetes Cluster Plugin" }, /* @__PURE__ */ React.createElement(Typography, null, error))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ClusterOverview, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ApiResources, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Nodes, null))));
13
+ };
14
+ const KubernetesClusterContent = () => {
15
+ return /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null));
16
+ };
17
+
18
+ export { KubernetesClusterContent };
19
+ //# sourceMappingURL=KubernetesClusterContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KubernetesClusterContent.esm.js","sources":["../../../src/components/KubernetesClusterContent/KubernetesClusterContent.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { ApiResources } from '../ApiResources/ApiResources';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Nodes } from '../Nodes/Nodes';\nimport { ClusterOverview } from '../ClusterOverview';\nimport {\n KubernetesClusterErrorProvider,\n useKubernetesClusterError,\n} from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { WarningPanel } from '@backstage/core-components';\n\nconst ContentGrid = () => {\n const { error } = useKubernetesClusterError();\n return (\n <>\n <Grid container>\n {error && (\n <Grid item xs={12}>\n <WarningPanel title=\"Error loading Kubernetes Cluster Plugin\">\n <Typography>{error}</Typography>\n </WarningPanel>\n </Grid>\n )}\n <Grid item xs={6}>\n <ClusterOverview />\n </Grid>\n <Grid item xs={6}>\n <ApiResources />\n </Grid>\n <Grid item xs={12}>\n <Nodes />\n </Grid>\n </Grid>\n </>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const KubernetesClusterContent = () => {\n return (\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA2BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA,CAAA;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IAAA,EAAA,EACZ,yBACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,EAAA,EAAA,sCACZ,YAAa,EAAA,EAAA,KAAA,EAAM,yCAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,IAAA,EAAA,KAAM,CACrB,CACF,CAAA,kBAED,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,IAAA,CACnB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,CAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAa,CAChB,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,sBACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAM,CACT,CACF,CACF,CAAA,CAAA;AAEJ,CAAA,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,22 @@
1
+ import React, { useState, useCallback, useContext } from 'react';
2
+
3
+ const KubernetesClusterErrorContext = React.createContext({
4
+ setError: (_) => {
5
+ }
6
+ });
7
+ const KubernetesClusterErrorProvider = ({
8
+ children
9
+ }) => {
10
+ const [error, setError] = useState(void 0);
11
+ const contextValue = {
12
+ error,
13
+ setError: useCallback((message) => setError(message), [])
14
+ };
15
+ return /* @__PURE__ */ React.createElement(KubernetesClusterErrorContext.Provider, { value: contextValue }, children);
16
+ };
17
+ const useKubernetesClusterError = () => {
18
+ return useContext(KubernetesClusterErrorContext);
19
+ };
20
+
21
+ export { KubernetesClusterErrorContext, KubernetesClusterErrorProvider, useKubernetesClusterError };
22
+ //# sourceMappingURL=KubernetesClusterErrorContext.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KubernetesClusterErrorContext.esm.js","sources":["../../../src/components/KubernetesClusterErrorContext/KubernetesClusterErrorContext.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { useCallback, useContext, useState } from 'react';\n\nexport interface ErrorContext {\n error?: string;\n setError: (message: string) => void;\n}\n\nexport const KubernetesClusterErrorContext = React.createContext<ErrorContext>({\n setError: (_: string) => {},\n});\n\nexport interface KubernetesClusterErrorProviderProps {\n children: React.ReactNode;\n}\n\nexport const KubernetesClusterErrorProvider = ({\n children,\n}: KubernetesClusterErrorProviderProps) => {\n const [error, setError] = useState<string | undefined>(undefined);\n\n const contextValue: ErrorContext = {\n error,\n setError: useCallback((message: string) => setError(message), []),\n };\n\n return (\n <KubernetesClusterErrorContext.Provider value={contextValue}>\n {children}\n </KubernetesClusterErrorContext.Provider>\n );\n};\n\nexport const useKubernetesClusterError = () => {\n return useContext(KubernetesClusterErrorContext);\n};\n"],"names":[],"mappings":";;AAsBa,MAAA,6BAAA,GAAgC,MAAM,aAA4B,CAAA;AAAA,EAC7E,QAAA,EAAU,CAAC,CAAc,KAAA;AAAA,GAAC;AAC5B,CAAC,EAAA;AAMM,MAAM,iCAAiC,CAAC;AAAA,EAC7C,QAAA;AACF,CAA2C,KAAA;AACzC,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAA6B,KAAS,CAAA,CAAA,CAAA;AAEhE,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAA;AAAA,IACA,QAAA,EAAU,YAAY,CAAC,OAAA,KAAoB,SAAS,OAAO,CAAA,EAAG,EAAE,CAAA;AAAA,GAClE,CAAA;AAEA,EAAA,2CACG,6BAA8B,CAAA,QAAA,EAA9B,EAAuC,KAAA,EAAO,gBAC5C,QACH,CAAA,CAAA;AAEJ,EAAA;AAEO,MAAM,4BAA4B,MAAM;AAC7C,EAAA,OAAO,WAAW,6BAA6B,CAAA,CAAA;AACjD;;;;"}
@@ -0,0 +1,114 @@
1
+ import { useNodes } from './useNodes.esm.js';
2
+ import React, { useCallback, useEffect } from 'react';
3
+ import { useEntity } from '@backstage/plugin-catalog-react';
4
+ import { Table, StructuredMetadataTable } from '@backstage/core-components';
5
+ import Grid from '@material-ui/core/Grid';
6
+ import Typography from '@material-ui/core/Typography';
7
+ import { makeStyles } from '@material-ui/core/styles';
8
+ import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
9
+ import { KubernetesDrawer } from '@backstage/plugin-kubernetes-react';
10
+
11
+ const useStyles = makeStyles((theme) => ({
12
+ empty: {
13
+ padding: theme.spacing(2),
14
+ display: "flex",
15
+ justifyContent: "center"
16
+ }
17
+ }));
18
+ const defaultColumns = [
19
+ {
20
+ title: "Name",
21
+ highlight: true,
22
+ width: "auto",
23
+ render: (node) => {
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
25
+ return /* @__PURE__ */ React.createElement(
26
+ KubernetesDrawer,
27
+ {
28
+ kubernetesObject: node,
29
+ label: (_b = (_a = node.metadata) == null ? void 0 : _a.name) != null ? _b : "unknown-node"
30
+ },
31
+ /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Node Info"), /* @__PURE__ */ React.createElement(StructuredMetadataTable, { metadata: (_d = (_c = node.status) == null ? void 0 : _c.nodeInfo) != null ? _d : {} })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Addresses"), /* @__PURE__ */ React.createElement(
32
+ StructuredMetadataTable,
33
+ {
34
+ metadata: (_g = (_f = (_e = node.status) == null ? void 0 : _e.addresses) == null ? void 0 : _f.reduce((accum, next) => {
35
+ accum[next.type] = next.address;
36
+ return accum;
37
+ }, {})) != null ? _g : {}
38
+ }
39
+ )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Taints"), /* @__PURE__ */ React.createElement(
40
+ StructuredMetadataTable,
41
+ {
42
+ metadata: (_j = (_i = (_h = node.spec) == null ? void 0 : _h.taints) == null ? void 0 : _i.reduce((accum, next) => {
43
+ accum[`${next.effect}`] = `${next.key} (${next.value})`;
44
+ return accum;
45
+ }, {})) != null ? _j : {}
46
+ }
47
+ )))
48
+ );
49
+ }
50
+ },
51
+ {
52
+ title: "Schedulable",
53
+ align: "center",
54
+ width: "auto",
55
+ render: (node) => {
56
+ var _a;
57
+ if ((_a = node.spec) == null ? void 0 : _a.unschedulable) {
58
+ return "\u274C";
59
+ }
60
+ return "\u2705";
61
+ }
62
+ },
63
+ {
64
+ title: "Status",
65
+ width: "auto",
66
+ render: (node) => {
67
+ var _a, _b;
68
+ const readyCondition = (_b = (_a = node.status) == null ? void 0 : _a.conditions) == null ? void 0 : _b.find((c) => {
69
+ return c.type === "Ready";
70
+ });
71
+ if (!readyCondition) {
72
+ return "Unknown";
73
+ }
74
+ return readyCondition.status === "True" ? "Ready" : "Not Ready";
75
+ }
76
+ },
77
+ {
78
+ title: "OS",
79
+ width: "auto",
80
+ render: (node) => {
81
+ var _a, _b, _c, _d, _e, _f;
82
+ return `${(_c = (_b = (_a = node.status) == null ? void 0 : _a.nodeInfo) == null ? void 0 : _b.operatingSystem) != null ? _c : "unknown"} (${(_f = (_e = (_d = node.status) == null ? void 0 : _d.nodeInfo) == null ? void 0 : _e.architecture) != null ? _f : "?"})`;
83
+ }
84
+ }
85
+ ];
86
+ const Nodes = () => {
87
+ var _a;
88
+ const classes = useStyles();
89
+ const { entity } = useEntity();
90
+ const { value, error, loading } = useNodes({
91
+ clusterName: entity.metadata.name
92
+ });
93
+ const { setError } = useKubernetesClusterError();
94
+ const setErrorCallback = useCallback(setError, [setError]);
95
+ useEffect(() => {
96
+ if (error) {
97
+ setErrorCallback(error.message);
98
+ }
99
+ }, [error, setErrorCallback]);
100
+ return /* @__PURE__ */ React.createElement(
101
+ Table,
102
+ {
103
+ title: "Nodes",
104
+ options: { paging: true, search: false, emptyRowsWhenPaging: false },
105
+ isLoading: !value && loading,
106
+ data: (_a = value == null ? void 0 : value.items) != null ? _a : [],
107
+ emptyContent: /* @__PURE__ */ React.createElement("div", { className: classes.empty }, error !== void 0 ? "Error loading nodes" : "No nodes found"),
108
+ columns: defaultColumns
109
+ }
110
+ );
111
+ };
112
+
113
+ export { Nodes };
114
+ //# sourceMappingURL=Nodes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Nodes.esm.js","sources":["../../../src/components/Nodes/Nodes.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useNodes } from './useNodes';\nimport React, { useCallback, useEffect } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n StructuredMetadataTable,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { INode } from 'kubernetes-models/v1';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { KubernetesDrawer } from '@backstage/plugin-kubernetes-react';\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\nconst defaultColumns: TableColumn<INode>[] = [\n {\n title: 'Name',\n highlight: true,\n width: 'auto',\n render: (node: INode) => {\n return (\n <KubernetesDrawer\n kubernetesObject={node}\n label={node.metadata?.name ?? 'unknown-node'}\n >\n <Grid container>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Node Info</Typography>\n <StructuredMetadataTable metadata={node.status?.nodeInfo ?? {}} />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Addresses</Typography>\n <StructuredMetadataTable\n metadata={\n node.status?.addresses?.reduce((accum, next) => {\n accum[next.type] = next.address;\n return accum;\n }, {} as any) ?? {}\n }\n />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Taints</Typography>\n <StructuredMetadataTable\n metadata={\n node.spec?.taints?.reduce((accum, next) => {\n accum[`${next.effect}`] = `${next.key} (${next.value})`;\n return accum;\n }, {} as any) ?? {}\n }\n />\n </Grid>\n </Grid>\n </KubernetesDrawer>\n );\n },\n },\n {\n title: 'Schedulable',\n align: 'center',\n width: 'auto',\n render: (node: INode) => {\n if (node.spec?.unschedulable) {\n return '❌';\n }\n return '✅';\n },\n },\n {\n title: 'Status',\n width: 'auto',\n render: (node: INode) => {\n // TODO add an icon\n const readyCondition = node.status?.conditions?.find(c => {\n return c.type === 'Ready';\n });\n if (!readyCondition) {\n return 'Unknown';\n }\n return readyCondition.status === 'True' ? 'Ready' : 'Not Ready';\n },\n },\n {\n title: 'OS',\n width: 'auto',\n render: (node: INode) => {\n return `${node.status?.nodeInfo?.operatingSystem ?? 'unknown'} (${\n node.status?.nodeInfo?.architecture ?? '?'\n })`;\n },\n },\n];\n\nexport const Nodes = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, error, loading } = useNodes({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <Table\n title=\"Nodes\"\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n isLoading={!value && loading}\n data={value?.items ?? []}\n emptyContent={\n <div className={classes.empty}>\n {error !== undefined ? 'Error loading nodes' : 'No nodes found'}\n </div>\n }\n columns={defaultColumns}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,KAAO,EAAA;AAAA,IACL,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CA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KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAO,KAAP,KAAA,IAAA,GAAA,EAAA,GAAgB,EAAC;AAAA,MACvB,YAAA,sCACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,KACrB,EAAA,EAAA,KAAA,KAAU,KAAY,CAAA,GAAA,qBAAA,GAAwB,gBACjD,CAAA;AAAA,MAEF,OAAS,EAAA,cAAA;AAAA,KAAA;AAAA,GACX,CAAA;AAEJ;;;;"}
@@ -0,0 +1,18 @@
1
+ import useAsync from 'react-use/esm/useAsync';
2
+ import { useApi } from '@backstage/core-plugin-api';
3
+ import { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';
4
+
5
+ const useNodes = ({ clusterName }) => {
6
+ const kubernetesApi = useApi(kubernetesApiRef);
7
+ return useAsync(async () => {
8
+ return await kubernetesApi.proxy({
9
+ clusterName,
10
+ path: "/api/v1/nodes?limit=500"
11
+ }).then((r) => {
12
+ return r.json();
13
+ });
14
+ }, [clusterName]);
15
+ };
16
+
17
+ export { useNodes };
18
+ //# sourceMappingURL=useNodes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNodes.esm.js","sources":["../../../src/components/Nodes/useNodes.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';\nimport { NodeList } from 'kubernetes-models/v1';\n\n/**\n * Arguments for useApiResources\n *\n * @public\n */\nexport interface useNodesOptions {\n clusterName: string;\n}\n\n/**\n * Retrieves nodes for a cluster\n *\n * @public\n */\nexport const useNodes = ({ clusterName }: useNodesOptions) => {\n const kubernetesApi = useApi(kubernetesApiRef);\n return useAsync(async () => {\n return await kubernetesApi\n .proxy({\n clusterName,\n path: '/api/v1/nodes?limit=500',\n })\n .then(r => {\n return r.json() as Promise<NodeList>;\n });\n }, [clusterName]);\n};\n"],"names":[],"mappings":";;;;AAmCO,MAAM,QAAW,GAAA,CAAC,EAAE,WAAA,EAAmC,KAAA;AAC5D,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA,CAAA;AAC7C,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAO,OAAA,MAAM,cACV,KAAM,CAAA;AAAA,MACL,WAAA;AAAA,MACA,IAAM,EAAA,yBAAA;AAAA,KACP,CACA,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA;AACT,MAAA,OAAO,EAAE,IAAK,EAAA,CAAA;AAAA,KACf,CAAA,CAAA;AAAA,GACL,EAAG,CAAC,WAAW,CAAC,CAAA,CAAA;AAClB;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,300 +1,3 @@
1
- import { createRouteRef, createPlugin, createRoutableExtension, useApi } from '@backstage/core-plugin-api';
2
- import React, { useState, useCallback, useContext, useEffect } from 'react';
3
- import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
4
- import { Routes, Route } from 'react-router-dom';
5
- import { ANNOTATION_KUBERNETES_API_SERVER } from '@backstage/plugin-kubernetes-common';
6
- import useAsync from 'react-use/esm/useAsync';
7
- import { kubernetesApiRef, KubernetesDrawer } from '@backstage/plugin-kubernetes-react';
8
- import { Table, StructuredMetadataTable, InfoCard, WarningPanel } from '@backstage/core-components';
9
- import { makeStyles, createStyles } from '@material-ui/core/styles';
10
- import Grid from '@material-ui/core/Grid';
11
- import Typography from '@material-ui/core/Typography';
12
- import Skeleton from '@material-ui/lab/Skeleton';
13
-
14
- const rootCatalogKubernetesClusterRouteRef = createRouteRef({
15
- id: "kubernetes-cluster"
16
- });
17
- const kubernetesClusterPlugin = createPlugin({
18
- id: "kubernetes-cluster",
19
- apis: [],
20
- routes: {
21
- entityContent: rootCatalogKubernetesClusterRouteRef
22
- }
23
- });
24
- const EntityKubernetesClusterContent = kubernetesClusterPlugin.provide(
25
- createRoutableExtension({
26
- name: "EntityKubernetesClusterContent",
27
- component: () => Promise.resolve().then(function () { return Router$1; }).then((m) => m.Router),
28
- mountPoint: rootCatalogKubernetesClusterRouteRef
29
- })
30
- );
31
-
32
- const useApiResources = ({ clusterName }) => {
33
- const kubernetesApi = useApi(kubernetesApiRef);
34
- return useAsync(async () => {
35
- return await kubernetesApi.proxy({
36
- clusterName,
37
- path: "/apis"
38
- }).then((r) => {
39
- return r.json();
40
- });
41
- }, [clusterName]);
42
- };
43
-
44
- const KubernetesClusterErrorContext = React.createContext({
45
- setError: (_) => {
46
- }
47
- });
48
- const KubernetesClusterErrorProvider = ({
49
- children
50
- }) => {
51
- const [error, setError] = useState(void 0);
52
- const contextValue = {
53
- error,
54
- setError: useCallback((message) => setError(message), [])
55
- };
56
- return /* @__PURE__ */ React.createElement(KubernetesClusterErrorContext.Provider, { value: contextValue }, children);
57
- };
58
- const useKubernetesClusterError = () => {
59
- return useContext(KubernetesClusterErrorContext);
60
- };
61
-
62
- const useStyles$2 = makeStyles((theme) => ({
63
- empty: {
64
- padding: theme.spacing(2),
65
- display: "flex",
66
- justifyContent: "center"
67
- }
68
- }));
69
- const defaultColumns$1 = [
70
- {
71
- title: "Name",
72
- highlight: true,
73
- render: (apiGroup) => {
74
- return apiGroup.name;
75
- }
76
- },
77
- {
78
- title: "Preferred Version",
79
- highlight: true,
80
- render: (apiGroup) => {
81
- var _a;
82
- return (_a = apiGroup.preferredVersion) == null ? void 0 : _a.groupVersion;
83
- }
84
- }
85
- ];
86
- const ApiResources = () => {
87
- var _a;
88
- const classes = useStyles$2();
89
- const { entity } = useEntity();
90
- const { setError } = useKubernetesClusterError();
91
- const setErrorCallback = useCallback(setError, [setError]);
92
- const { value, error, loading } = useApiResources({
93
- clusterName: entity.metadata.name
94
- });
95
- useEffect(() => {
96
- if (error) {
97
- setErrorCallback(error.message);
98
- }
99
- }, [error, setErrorCallback]);
100
- return /* @__PURE__ */ React.createElement(
101
- Table,
102
- {
103
- title: "API Resources",
104
- options: { paging: true, search: false, emptyRowsWhenPaging: false },
105
- isLoading: !value && loading,
106
- data: (_a = value == null ? void 0 : value.groups) != null ? _a : [],
107
- emptyContent: /* @__PURE__ */ React.createElement("div", { className: classes.empty }, error !== void 0 ? "Error loading API Resources" : "No API Resources found"),
108
- columns: defaultColumns$1
109
- }
110
- );
111
- };
112
-
113
- const useNodes = ({ clusterName }) => {
114
- const kubernetesApi = useApi(kubernetesApiRef);
115
- return useAsync(async () => {
116
- return await kubernetesApi.proxy({
117
- clusterName,
118
- path: "/api/v1/nodes?limit=500"
119
- }).then((r) => {
120
- return r.json();
121
- });
122
- }, [clusterName]);
123
- };
124
-
125
- const useStyles$1 = makeStyles((theme) => ({
126
- empty: {
127
- padding: theme.spacing(2),
128
- display: "flex",
129
- justifyContent: "center"
130
- }
131
- }));
132
- const defaultColumns = [
133
- {
134
- title: "Name",
135
- highlight: true,
136
- width: "auto",
137
- render: (node) => {
138
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
139
- return /* @__PURE__ */ React.createElement(
140
- KubernetesDrawer,
141
- {
142
- kubernetesObject: node,
143
- label: (_b = (_a = node.metadata) == null ? void 0 : _a.name) != null ? _b : "unknown-node"
144
- },
145
- /* @__PURE__ */ React.createElement(Grid, { container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Node Info"), /* @__PURE__ */ React.createElement(StructuredMetadataTable, { metadata: (_d = (_c = node.status) == null ? void 0 : _c.nodeInfo) != null ? _d : {} })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Addresses"), /* @__PURE__ */ React.createElement(
146
- StructuredMetadataTable,
147
- {
148
- metadata: (_g = (_f = (_e = node.status) == null ? void 0 : _e.addresses) == null ? void 0 : _f.reduce((accum, next) => {
149
- accum[next.type] = next.address;
150
- return accum;
151
- }, {})) != null ? _g : {}
152
- }
153
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Taints"), /* @__PURE__ */ React.createElement(
154
- StructuredMetadataTable,
155
- {
156
- metadata: (_j = (_i = (_h = node.spec) == null ? void 0 : _h.taints) == null ? void 0 : _i.reduce((accum, next) => {
157
- accum[`${next.effect}`] = `${next.key} (${next.value})`;
158
- return accum;
159
- }, {})) != null ? _j : {}
160
- }
161
- )))
162
- );
163
- }
164
- },
165
- {
166
- title: "Schedulable",
167
- align: "center",
168
- width: "auto",
169
- render: (node) => {
170
- var _a;
171
- if ((_a = node.spec) == null ? void 0 : _a.unschedulable) {
172
- return "\u274C";
173
- }
174
- return "\u2705";
175
- }
176
- },
177
- {
178
- title: "Status",
179
- width: "auto",
180
- render: (node) => {
181
- var _a, _b;
182
- const readyCondition = (_b = (_a = node.status) == null ? void 0 : _a.conditions) == null ? void 0 : _b.find((c) => {
183
- return c.type === "Ready";
184
- });
185
- if (!readyCondition) {
186
- return "Unknown";
187
- }
188
- return readyCondition.status === "True" ? "Ready" : "Not Ready";
189
- }
190
- },
191
- {
192
- title: "OS",
193
- width: "auto",
194
- render: (node) => {
195
- var _a, _b, _c, _d, _e, _f;
196
- return `${(_c = (_b = (_a = node.status) == null ? void 0 : _a.nodeInfo) == null ? void 0 : _b.operatingSystem) != null ? _c : "unknown"} (${(_f = (_e = (_d = node.status) == null ? void 0 : _d.nodeInfo) == null ? void 0 : _e.architecture) != null ? _f : "?"})`;
197
- }
198
- }
199
- ];
200
- const Nodes = () => {
201
- var _a;
202
- const classes = useStyles$1();
203
- const { entity } = useEntity();
204
- const { value, error, loading } = useNodes({
205
- clusterName: entity.metadata.name
206
- });
207
- const { setError } = useKubernetesClusterError();
208
- const setErrorCallback = useCallback(setError, [setError]);
209
- useEffect(() => {
210
- if (error) {
211
- setErrorCallback(error.message);
212
- }
213
- }, [error, setErrorCallback]);
214
- return /* @__PURE__ */ React.createElement(
215
- Table,
216
- {
217
- title: "Nodes",
218
- options: { paging: true, search: false, emptyRowsWhenPaging: false },
219
- isLoading: !value && loading,
220
- data: (_a = value == null ? void 0 : value.items) != null ? _a : [],
221
- emptyContent: /* @__PURE__ */ React.createElement("div", { className: classes.empty }, error !== void 0 ? "Error loading nodes" : "No nodes found"),
222
- columns: defaultColumns
223
- }
224
- );
225
- };
226
-
227
- const useCluster = ({ clusterName }) => {
228
- const kubernetesApi = useApi(kubernetesApiRef);
229
- return useAsync(async () => {
230
- return await kubernetesApi.getCluster(clusterName);
231
- }, [clusterName]);
232
- };
233
-
234
- const useStyles = makeStyles(
235
- (_theme) => createStyles({
236
- root: {
237
- height: "100%"
238
- }
239
- })
240
- );
241
- const ClusterOverview = () => {
242
- var _a, _b;
243
- const classes = useStyles();
244
- const { entity } = useEntity();
245
- const { value, loading, error } = useCluster({
246
- clusterName: entity.metadata.name
247
- });
248
- const { setError } = useKubernetesClusterError();
249
- const setErrorCallback = useCallback(setError, [setError]);
250
- useEffect(() => {
251
- if (error) {
252
- setErrorCallback(error.message);
253
- }
254
- }, [error, setErrorCallback]);
255
- return /* @__PURE__ */ React.createElement(InfoCard, { title: "Cluster Overview", className: classes.root }, !value && loading && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Skeleton, { height: "35rem" })), value && /* @__PURE__ */ React.createElement(
256
- StructuredMetadataTable,
257
- {
258
- metadata: {
259
- name: value.name,
260
- "Backstage auth provider": value.authProvider,
261
- "OIDC Token Provider": (_a = value.oidcTokenProvider) != null ? _a : "N/A",
262
- "Dashboard Link": (_b = value.dashboardUrl) != null ? _b : "N/A"
263
- }
264
- }
265
- ));
266
- };
267
-
268
- const ContentGrid = () => {
269
- const { error } = useKubernetesClusterError();
270
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true }, error && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(WarningPanel, { title: "Error loading Kubernetes Cluster Plugin" }, /* @__PURE__ */ React.createElement(Typography, null, error))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ClusterOverview, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(ApiResources, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Nodes, null))));
271
- };
272
- const KubernetesClusterContent = () => {
273
- return /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null));
274
- };
275
-
276
- const isKubernetesClusterAvailable = (entity) => {
277
- var _a;
278
- return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[ANNOTATION_KUBERNETES_API_SERVER]);
279
- };
280
- const Router = () => {
281
- const { entity } = useEntity();
282
- if (isKubernetesClusterAvailable(entity)) {
283
- return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, { path: "/", element: /* @__PURE__ */ React.createElement(KubernetesClusterContent, null) }));
284
- }
285
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
286
- MissingAnnotationEmptyState,
287
- {
288
- annotation: ANNOTATION_KUBERNETES_API_SERVER
289
- }
290
- ));
291
- };
292
-
293
- var Router$1 = /*#__PURE__*/Object.freeze({
294
- __proto__: null,
295
- Router: Router,
296
- isKubernetesClusterAvailable: isKubernetesClusterAvailable
297
- });
298
-
299
- export { EntityKubernetesClusterContent, Router, isKubernetesClusterAvailable };
1
+ export { EntityKubernetesClusterContent } from './plugin.esm.js';
2
+ export { Router, isKubernetesClusterAvailable } from './Router.esm.js';
300
3
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts","../src/components/ApiResources/useApiResources.ts","../src/components/KubernetesClusterErrorContext/KubernetesClusterErrorContext.tsx","../src/components/ApiResources/ApiResources.tsx","../src/components/Nodes/useNodes.ts","../src/components/Nodes/Nodes.tsx","../src/components/ClusterOverview/useCluster.ts","../src/components/ClusterOverview/ClusterOverview.tsx","../src/components/KubernetesClusterContent/KubernetesClusterContent.tsx","../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createPlugin,\n createRouteRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nexport const rootCatalogKubernetesClusterRouteRef = createRouteRef({\n id: 'kubernetes-cluster',\n});\n\nexport const kubernetesClusterPlugin = createPlugin({\n id: 'kubernetes-cluster',\n apis: [],\n routes: {\n entityContent: rootCatalogKubernetesClusterRouteRef,\n },\n});\n\n/**\n * Props of EntityKubernetesContent\n *\n * @public\n */\nexport type EntityKubernetesClusterContentProps = {};\n\n/**\n * Props of EntityKubernetesContent\n *\n * @public\n */\nexport const EntityKubernetesClusterContent: (\n props: EntityKubernetesClusterContentProps,\n) => JSX.Element = kubernetesClusterPlugin.provide(\n createRoutableExtension({\n name: 'EntityKubernetesClusterContent',\n component: () => import('./Router').then(m => m.Router),\n mountPoint: rootCatalogKubernetesClusterRouteRef,\n }),\n);\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';\nimport { IAPIGroupList } from '@kubernetes-models/apimachinery/apis/meta/v1';\n\n/**\n * Arguments for useApiResources\n *\n * @public\n */\nexport interface ApiResourcesOptions {\n clusterName: string;\n}\n\n/**\n * Retrieves the logs for the given pod\n *\n * @public\n */\nexport const useApiResources = ({ clusterName }: ApiResourcesOptions) => {\n const kubernetesApi = useApi(kubernetesApiRef);\n return useAsync(async () => {\n return await kubernetesApi\n .proxy({\n clusterName,\n path: '/apis',\n })\n .then(r => {\n return r.json() as Promise<IAPIGroupList>;\n });\n }, [clusterName]);\n};\n","/*\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 React, { useCallback, useContext, useState } from 'react';\n\nexport interface ErrorContext {\n error?: string;\n setError: (message: string) => void;\n}\n\nexport const KubernetesClusterErrorContext = React.createContext<ErrorContext>({\n setError: (_: string) => {},\n});\n\nexport interface KubernetesClusterErrorProviderProps {\n children: React.ReactNode;\n}\n\nexport const KubernetesClusterErrorProvider = ({\n children,\n}: KubernetesClusterErrorProviderProps) => {\n const [error, setError] = useState<string | undefined>(undefined);\n\n const contextValue: ErrorContext = {\n error,\n setError: useCallback((message: string) => setError(message), []),\n };\n\n return (\n <KubernetesClusterErrorContext.Provider value={contextValue}>\n {children}\n </KubernetesClusterErrorContext.Provider>\n );\n};\n\nexport const useKubernetesClusterError = () => {\n return useContext(KubernetesClusterErrorContext);\n};\n","/*\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 { useApiResources } from './useApiResources';\nimport React, { useCallback, useEffect } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport { IAPIGroup } from '@kubernetes-models/apimachinery/apis/meta/v1';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\nconst defaultColumns: TableColumn<IAPIGroup>[] = [\n {\n title: 'Name',\n highlight: true,\n render: (apiGroup: IAPIGroup) => {\n return apiGroup.name;\n },\n },\n {\n title: 'Preferred Version',\n highlight: true,\n render: (apiGroup: IAPIGroup) => {\n return apiGroup.preferredVersion?.groupVersion;\n },\n },\n];\n\nexport const ApiResources = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n const { value, error, loading } = useApiResources({\n clusterName: entity.metadata.name,\n });\n\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <Table\n title=\"API Resources\"\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n isLoading={!value && loading}\n data={value?.groups ?? []}\n emptyContent={\n <div className={classes.empty}>\n {error !== undefined\n ? 'Error loading API Resources'\n : 'No API Resources found'}\n </div>\n }\n columns={defaultColumns}\n />\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';\nimport { NodeList } from 'kubernetes-models/v1';\n\n/**\n * Arguments for useApiResources\n *\n * @public\n */\nexport interface useNodesOptions {\n clusterName: string;\n}\n\n/**\n * Retrieves nodes for a cluster\n *\n * @public\n */\nexport const useNodes = ({ clusterName }: useNodesOptions) => {\n const kubernetesApi = useApi(kubernetesApiRef);\n return useAsync(async () => {\n return await kubernetesApi\n .proxy({\n clusterName,\n path: '/api/v1/nodes?limit=500',\n })\n .then(r => {\n return r.json() as Promise<NodeList>;\n });\n }, [clusterName]);\n};\n","/*\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 { useNodes } from './useNodes';\nimport React, { useCallback, useEffect } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n StructuredMetadataTable,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { INode } from 'kubernetes-models/v1';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { KubernetesDrawer } from '@backstage/plugin-kubernetes-react';\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\nconst defaultColumns: TableColumn<INode>[] = [\n {\n title: 'Name',\n highlight: true,\n width: 'auto',\n render: (node: INode) => {\n return (\n <KubernetesDrawer\n kubernetesObject={node}\n label={node.metadata?.name ?? 'unknown-node'}\n >\n <Grid container>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Node Info</Typography>\n <StructuredMetadataTable metadata={node.status?.nodeInfo ?? {}} />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Addresses</Typography>\n <StructuredMetadataTable\n metadata={\n node.status?.addresses?.reduce((accum, next) => {\n accum[next.type] = next.address;\n return accum;\n }, {} as any) ?? {}\n }\n />\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"h5\">Taints</Typography>\n <StructuredMetadataTable\n metadata={\n node.spec?.taints?.reduce((accum, next) => {\n accum[`${next.effect}`] = `${next.key} (${next.value})`;\n return accum;\n }, {} as any) ?? {}\n }\n />\n </Grid>\n </Grid>\n </KubernetesDrawer>\n );\n },\n },\n {\n title: 'Schedulable',\n align: 'center',\n width: 'auto',\n render: (node: INode) => {\n if (node.spec?.unschedulable) {\n return '❌';\n }\n return '✅';\n },\n },\n {\n title: 'Status',\n width: 'auto',\n render: (node: INode) => {\n // TODO add an icon\n const readyCondition = node.status?.conditions?.find(c => {\n return c.type === 'Ready';\n });\n if (!readyCondition) {\n return 'Unknown';\n }\n return readyCondition.status === 'True' ? 'Ready' : 'Not Ready';\n },\n },\n {\n title: 'OS',\n width: 'auto',\n render: (node: INode) => {\n return `${node.status?.nodeInfo?.operatingSystem ?? 'unknown'} (${\n node.status?.nodeInfo?.architecture ?? '?'\n })`;\n },\n },\n];\n\nexport const Nodes = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, error, loading } = useNodes({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <Table\n title=\"Nodes\"\n options={{ paging: true, search: false, emptyRowsWhenPaging: false }}\n isLoading={!value && loading}\n data={value?.items ?? []}\n emptyContent={\n <div className={classes.empty}>\n {error !== undefined ? 'Error loading nodes' : 'No nodes found'}\n </div>\n }\n columns={defaultColumns}\n />\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { kubernetesApiRef } from '@backstage/plugin-kubernetes-react';\n\n/**\n * Arguments for useApiResources\n *\n * @public\n */\nexport interface UseClusterOptions {\n clusterName: string;\n}\n\n/**\n * Retrieves the logs for the given pod\n *\n * @public\n */\nexport const useCluster = ({ clusterName }: UseClusterOptions) => {\n const kubernetesApi = useApi(kubernetesApiRef);\n return useAsync(async () => {\n return await kubernetesApi.getCluster(clusterName);\n }, [clusterName]);\n};\n","/*\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 React, { useCallback, useEffect } from 'react';\nimport { InfoCard, StructuredMetadataTable } from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useCluster } from './useCluster';\nimport Skeleton from '@material-ui/lab/Skeleton';\nimport { Theme, createStyles, makeStyles } from '@material-ui/core/styles';\nimport { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\n\nconst useStyles = makeStyles((_theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n }),\n);\n\nexport const ClusterOverview = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { value, loading, error } = useCluster({\n clusterName: entity.metadata.name,\n });\n const { setError } = useKubernetesClusterError();\n const setErrorCallback = useCallback(setError, [setError]);\n useEffect(() => {\n if (error) {\n setErrorCallback(error.message);\n }\n }, [error, setErrorCallback]);\n\n return (\n <InfoCard title=\"Cluster Overview\" className={classes.root}>\n {!value && loading && (\n <>\n <Skeleton height=\"35rem\" />\n </>\n )}\n {value && (\n <StructuredMetadataTable\n metadata={{\n name: value.name,\n 'Backstage auth provider': value.authProvider,\n 'OIDC Token Provider': value.oidcTokenProvider ?? 'N/A',\n 'Dashboard Link': value.dashboardUrl ?? 'N/A',\n }}\n />\n )}\n </InfoCard>\n );\n};\n","/*\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 React from 'react';\nimport { ApiResources } from '../ApiResources/ApiResources';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { Nodes } from '../Nodes/Nodes';\nimport { ClusterOverview } from '../ClusterOverview';\nimport {\n KubernetesClusterErrorProvider,\n useKubernetesClusterError,\n} from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext';\nimport { WarningPanel } from '@backstage/core-components';\n\nconst ContentGrid = () => {\n const { error } = useKubernetesClusterError();\n return (\n <>\n <Grid container>\n {error && (\n <Grid item xs={12}>\n <WarningPanel title=\"Error loading Kubernetes Cluster Plugin\">\n <Typography>{error}</Typography>\n </WarningPanel>\n </Grid>\n )}\n <Grid item xs={6}>\n <ClusterOverview />\n </Grid>\n <Grid item xs={6}>\n <ApiResources />\n </Grid>\n <Grid item xs={12}>\n <Nodes />\n </Grid>\n </Grid>\n </>\n );\n};\n\n/**\n *\n *\n * @public\n */\nexport const KubernetesClusterContent = () => {\n return (\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n );\n};\n","/*\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 React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { Route, Routes } from 'react-router-dom';\nimport { ANNOTATION_KUBERNETES_API_SERVER } from '@backstage/plugin-kubernetes-common';\nimport { KubernetesClusterContent } from './components/KubernetesClusterContent';\n\n/**\n *\n *\n * @public\n */\nexport const isKubernetesClusterAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[ANNOTATION_KUBERNETES_API_SERVER]);\n\n/**\n *\n *\n * @public\n */\nexport const Router = () => {\n const { entity } = useEntity();\n\n if (isKubernetesClusterAvailable(entity)) {\n return (\n <Routes>\n <Route path=\"/\" element={<KubernetesClusterContent />} />\n </Routes>\n );\n }\n\n return (\n <>\n <MissingAnnotationEmptyState\n annotation={ANNOTATION_KUBERNETES_API_SERVER}\n />\n </>\n );\n};\n"],"names":["useStyles","defaultColumns"],"mappings":";;;;;;;;;;;;;AAqBO,MAAM,uCAAuC,cAAe,CAAA;AAAA,EACjE,EAAI,EAAA,oBAAA;AACN,CAAC,CAAA,CAAA;AAEM,MAAM,0BAA0B,YAAa,CAAA;AAAA,EAClD,EAAI,EAAA,oBAAA;AAAA,EACJ,MAAM,EAAC;AAAA,EACP,MAAQ,EAAA;AAAA,IACN,aAAe,EAAA,oCAAA;AAAA,GACjB;AACF,CAAC,CAAA,CAAA;AAcM,MAAM,iCAEM,uBAAwB,CAAA,OAAA;AAAA,EACzC,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gCAAA;AAAA,IACN,SAAA,EAAW,MAAM,yDAAmB,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACtD,UAAY,EAAA,oCAAA;AAAA,GACb,CAAA;AACH;;AClBO,MAAM,eAAkB,GAAA,CAAC,EAAE,WAAA,EAAuC,KAAA;AACvE,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA,CAAA;AAC7C,EAAA,OAAO,SAAS,YAAY;AAC1B,IAAO,OAAA,MAAM,cACV,KAAM,CAAA;AAAA,MACL,WAAA;AAAA,MACA,IAAM,EAAA,OAAA;AAAA,KACP,CACA,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA;AACT,MAAA,OAAO,EAAE,IAAK,EAA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,CACF,CAAA,CAAA;AAEJ,CAAA,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACf,CAAA,CAAA;AAEJ,CAAA;;ACjCa,MAAA,4BAAA,GAA+B,CAAC,MAAgB,KAAA;AA/B7D,EAAA,IAAA,EAAA,CAAA;AAgCE,EAAA,OAAA,OAAA,CAAA,CAAQ,EAAO,GAAA,MAAA,CAAA,QAAA,CAAS,WAAhB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAA8B,gCAAiC,CAAA,CAAA,CAAA;AAAA,EAAA;AAOlE,MAAM,SAAS,MAAM;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAE7B,EAAI,IAAA,4BAAA,CAA6B,MAAM,CAAG,EAAA;AACxC,IACE,uBAAA,KAAA,CAAA,aAAA,CAAC,MACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,IAAA,EAAK,KAAI,OAAS,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAyB,EAAA,IAAA,CAAA,EAAI,CACzD,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,KAAA;AAAA,GAEhB,CAAA,CAAA;AAEJ;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,22 @@
1
+ import { createRouteRef, createPlugin, createRoutableExtension } from '@backstage/core-plugin-api';
2
+
3
+ const rootCatalogKubernetesClusterRouteRef = createRouteRef({
4
+ id: "kubernetes-cluster"
5
+ });
6
+ const kubernetesClusterPlugin = createPlugin({
7
+ id: "kubernetes-cluster",
8
+ apis: [],
9
+ routes: {
10
+ entityContent: rootCatalogKubernetesClusterRouteRef
11
+ }
12
+ });
13
+ const EntityKubernetesClusterContent = kubernetesClusterPlugin.provide(
14
+ createRoutableExtension({
15
+ name: "EntityKubernetesClusterContent",
16
+ component: () => import('./Router.esm.js').then((m) => m.Router),
17
+ mountPoint: rootCatalogKubernetesClusterRouteRef
18
+ })
19
+ );
20
+
21
+ export { EntityKubernetesClusterContent, kubernetesClusterPlugin, rootCatalogKubernetesClusterRouteRef };
22
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 createPlugin,\n createRouteRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nexport const rootCatalogKubernetesClusterRouteRef = createRouteRef({\n id: 'kubernetes-cluster',\n});\n\nexport const kubernetesClusterPlugin = createPlugin({\n id: 'kubernetes-cluster',\n apis: [],\n routes: {\n entityContent: rootCatalogKubernetesClusterRouteRef,\n },\n});\n\n/**\n * Props of EntityKubernetesContent\n *\n * @public\n */\nexport type EntityKubernetesClusterContentProps = {};\n\n/**\n * Props of EntityKubernetesContent\n *\n * @public\n */\nexport const EntityKubernetesClusterContent: (\n props: EntityKubernetesClusterContentProps,\n) => JSX.Element = kubernetesClusterPlugin.provide(\n createRoutableExtension({\n name: 'EntityKubernetesClusterContent',\n component: () => import('./Router').then(m => m.Router),\n mountPoint: rootCatalogKubernetesClusterRouteRef,\n }),\n);\n"],"names":[],"mappings":";;AAqBO,MAAM,uCAAuC,cAAe,CAAA;AAAA,EACjE,EAAI,EAAA,oBAAA;AACN,CAAC,EAAA;AAEM,MAAM,0BAA0B,YAAa,CAAA;AAAA,EAClD,EAAI,EAAA,oBAAA;AAAA,EACJ,MAAM,EAAC;AAAA,EACP,MAAQ,EAAA;AAAA,IACN,aAAe,EAAA,oCAAA;AAAA,GACjB;AACF,CAAC,EAAA;AAcM,MAAM,iCAEM,uBAAwB,CAAA,OAAA;AAAA,EACzC,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gCAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,iBAAU,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACtD,UAAY,EAAA,oCAAA;AAAA,GACb,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-cluster",
3
- "version": "0.0.10",
3
+ "version": "0.0.11-next.1",
4
4
  "description": "A Backstage plugin that shows details of Kubernetes clusters",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin"
@@ -37,12 +37,12 @@
37
37
  "test": "backstage-cli package test"
38
38
  },
39
39
  "dependencies": {
40
- "@backstage/catalog-model": "^1.4.5",
41
- "@backstage/core-components": "^0.14.4",
40
+ "@backstage/catalog-model": "^1.5.0-next.0",
41
+ "@backstage/core-components": "^0.14.6-next.1",
42
42
  "@backstage/core-plugin-api": "^1.9.2",
43
- "@backstage/plugin-catalog-react": "^1.11.3",
44
- "@backstage/plugin-kubernetes-common": "^0.7.5",
45
- "@backstage/plugin-kubernetes-react": "^0.3.4",
43
+ "@backstage/plugin-catalog-react": "^1.11.4-next.1",
44
+ "@backstage/plugin-kubernetes-common": "^0.7.6-next.0",
45
+ "@backstage/plugin-kubernetes-react": "^0.3.5-next.1",
46
46
  "@kubernetes-models/apimachinery": "^1.1.0",
47
47
  "@kubernetes-models/base": "^4.0.1",
48
48
  "@material-ui/core": "^4.12.2",
@@ -56,8 +56,8 @@
56
56
  "react-use": "^17.2.4"
57
57
  },
58
58
  "devDependencies": {
59
- "@backstage/cli": "^0.26.3",
60
- "@backstage/test-utils": "^1.5.4",
59
+ "@backstage/cli": "^0.26.5-next.0",
60
+ "@backstage/test-utils": "^1.5.5-next.0",
61
61
  "@testing-library/dom": "^10.0.0",
62
62
  "@testing-library/jest-dom": "^6.0.0",
63
63
  "@testing-library/react": "^15.0.0",