@backstage/plugin-kubernetes-cluster 0.0.24-next.1 → 0.0.24

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,39 @@
1
1
  # @backstage/plugin-kubernetes-cluster
2
2
 
3
+ ## 0.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
8
+
9
+ <https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
10
+
11
+ - Updated dependencies
12
+ - @backstage/plugin-catalog-react@1.17.0
13
+ - @backstage/core-components@0.17.1
14
+ - @backstage/core-plugin-api@1.10.6
15
+ - @backstage/plugin-kubernetes-react@0.5.6
16
+ - @backstage/plugin-permission-react@0.4.33
17
+ - @backstage/catalog-model@1.7.3
18
+ - @backstage/plugin-kubernetes-common@0.9.4
19
+
20
+ ## 0.0.24-next.2
21
+
22
+ ### Patch Changes
23
+
24
+ - a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
25
+
26
+ <https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
27
+
28
+ - Updated dependencies
29
+ - @backstage/core-components@0.17.1-next.1
30
+ - @backstage/core-plugin-api@1.10.6-next.0
31
+ - @backstage/plugin-kubernetes-react@0.5.6-next.1
32
+ - @backstage/plugin-permission-react@0.4.33-next.0
33
+ - @backstage/plugin-catalog-react@1.17.0-next.2
34
+ - @backstage/catalog-model@1.7.3
35
+ - @backstage/plugin-kubernetes-common@0.9.4
36
+
3
37
  ## 0.0.24-next.1
4
38
 
5
39
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
3
3
  import { Routes, Route } from 'react-router-dom';
4
4
  import { ANNOTATION_KUBERNETES_API_SERVER } from '@backstage/plugin-kubernetes-common';
@@ -8,14 +8,14 @@ const isKubernetesClusterAvailable = (entity) => Boolean(entity.metadata.annotat
8
8
  const Router = () => {
9
9
  const { entity } = useEntity();
10
10
  if (isKubernetesClusterAvailable(entity)) {
11
- return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, { path: "/", element: /* @__PURE__ */ React.createElement(KubernetesClusterContent, null) }));
11
+ return /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsx(Route, { path: "/", element: /* @__PURE__ */ jsx(KubernetesClusterContent, {}) }) });
12
12
  }
13
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
14
14
  MissingAnnotationEmptyState,
15
15
  {
16
16
  annotation: ANNOTATION_KUBERNETES_API_SERVER
17
17
  }
18
- ));
18
+ ) });
19
19
  };
20
20
 
21
21
  export { Router, isKubernetesClusterAvailable };
@@ -1 +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,MAC3C,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,gCAAgC,CAAC;AAOlE,MAAM,SAAS,MAAM;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;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;AAAA;AAIJ,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA;AAAA;AAAA,GAEhB,CAAA;AAEJ;;;;"}
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 { 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":";;;;;;AA8Ba,MAAA,4BAAA,GAA+B,CAAC,MAC3C,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,gCAAgC,CAAC;AAOlE,MAAM,SAAS,MAAM;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAI,IAAA,4BAAA,CAA6B,MAAM,CAAG,EAAA;AACxC,IACE,uBAAA,GAAA,CAAC,MACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,KAAM,EAAA,EAAA,IAAA,EAAK,KAAI,OAAS,kBAAA,GAAA,CAAC,wBAAyB,EAAA,EAAA,CAAA,EAAI,CACzD,EAAA,CAAA;AAAA;AAIJ,EAAA,uBAEI,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,2BAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA;AAAA;AAAA,GAEhB,EAAA,CAAA;AAEJ;;;;"}
@@ -1,5 +1,6 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { useApiResources } from './useApiResources.esm.js';
2
- import React, { useCallback, useEffect } from 'react';
3
+ import { useCallback, useEffect } from 'react';
3
4
  import { useEntity } from '@backstage/plugin-catalog-react';
4
5
  import { Table } from '@backstage/core-components';
5
6
  import { useKubernetesClusterError } from '../KubernetesClusterErrorContext/KubernetesClusterErrorContext.esm.js';
@@ -41,14 +42,14 @@ const ApiResources = () => {
41
42
  setErrorCallback(error.message);
42
43
  }
43
44
  }, [error, setErrorCallback]);
44
- return /* @__PURE__ */ React.createElement(
45
+ return /* @__PURE__ */ jsx(
45
46
  Table,
46
47
  {
47
48
  title: "API Resources",
48
49
  options: { paging: true, search: false, emptyRowsWhenPaging: false },
49
50
  isLoading: !value && loading,
50
51
  data: value?.groups ?? [],
51
- emptyContent: /* @__PURE__ */ React.createElement("div", { className: classes.empty }, error !== void 0 ? "Error loading API Resources" : "No API Resources found"),
52
+ emptyContent: /* @__PURE__ */ jsx("div", { className: classes.empty, children: error !== void 0 ? "Error loading API Resources" : "No API Resources found" }),
52
53
  columns: defaultColumns
53
54
  }
54
55
  );
@@ -1 +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;AAAA;AAEpB,CAAE,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,I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
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 { 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 ? 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,CAAA;AAE5B,EACE,uBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,eAAA;AAAA,MACN,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAQ,EAAA,KAAA,EAAO,qBAAqB,KAAM,EAAA;AAAA,MACnE,SAAA,EAAW,CAAC,KAAS,IAAA,OAAA;AAAA,MACrB,IAAA,EAAM,KAAO,EAAA,MAAA,IAAU,EAAC;AAAA,MACxB,YAAA,sBACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,KACrB,EAAA,QAAA,EAAA,KAAA,KAAU,KACP,CAAA,GAAA,6BAAA,GACA,wBACN,EAAA,CAAA;AAAA,MAEF,OAAS,EAAA;AAAA;AAAA,GACX;AAEJ;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useCallback, useEffect } from 'react';
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useCallback, useEffect } from 'react';
2
3
  import { InfoCard, StructuredMetadataTable } from '@backstage/core-components';
3
4
  import { useEntity } from '@backstage/plugin-catalog-react';
4
5
  import { useCluster } from './useCluster.esm.js';
@@ -26,18 +27,21 @@ const ClusterOverview = () => {
26
27
  setErrorCallback(error.message);
27
28
  }
28
29
  }, [error, setErrorCallback]);
29
- 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(
30
- StructuredMetadataTable,
31
- {
32
- metadata: {
33
- name: value.name,
34
- "Backstage auth provider": value.authProvider,
35
- "OIDC Token Provider": value.oidcTokenProvider ?? "N/A",
36
- "Dashboard Link": value.dashboardUrl ?? "N/A"
37
- },
38
- options: { nestedValuesAsYaml: true }
39
- }
40
- ));
30
+ return /* @__PURE__ */ jsxs(InfoCard, { title: "Cluster Overview", className: classes.root, children: [
31
+ !value && loading && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Skeleton, { height: "35rem" }) }),
32
+ value && /* @__PURE__ */ jsx(
33
+ StructuredMetadataTable,
34
+ {
35
+ metadata: {
36
+ name: value.name,
37
+ "Backstage auth provider": value.authProvider,
38
+ "OIDC Token Provider": value.oidcTokenProvider ?? "N/A",
39
+ "Dashboard Link": value.dashboardUrl ?? "N/A"
40
+ },
41
+ options: { nestedValuesAsYaml: true }
42
+ }
43
+ )
44
+ ] });
41
45
  };
42
46
 
43
47
  export { ClusterOverview };
@@ -1 +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 options={{ nestedValuesAsYaml: true }}\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;AAAA;AACV,GACD;AACH,CAAA;AAEO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,KAAU,UAAW,CAAA;AAAA,IAC3C,WAAA,EAAa,OAAO,QAAS,CAAA;AAAA,GAC9B,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA;AAChC,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,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,EAAuB,MAAM,iBAAqB,IAAA,KAAA;AAAA,QAClD,gBAAA,EAAkB,MAAM,YAAgB,IAAA;AAAA,OAC1C;AAAA,MACA,OAAA,EAAS,EAAE,kBAAA,EAAoB,IAAK;AAAA;AAAA,GAG1C,CAAA;AAEJ;;;;"}
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 { 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 options={{ nestedValuesAsYaml: true }}\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;AAAA;AACV,GACD;AACH,CAAA;AAEO,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,KAAU,UAAW,CAAA;AAAA,IAC3C,WAAA,EAAa,OAAO,QAAS,CAAA;AAAA,GAC9B,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA;AAChC,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,CAAA;AAE5B,EAAA,4BACG,QAAS,EAAA,EAAA,KAAA,EAAM,kBAAmB,EAAA,SAAA,EAAW,QAAQ,IACnD,EAAA,QAAA,EAAA;AAAA,IAAA,CAAC,SAAS,OACT,oBAAA,GAAA,CAAA,QAAA,EAAA,EACE,8BAAC,QAAS,EAAA,EAAA,MAAA,EAAO,SAAQ,CAC3B,EAAA,CAAA;AAAA,IAED,KACC,oBAAA,GAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,QAAU,EAAA;AAAA,UACR,MAAM,KAAM,CAAA,IAAA;AAAA,UACZ,2BAA2B,KAAM,CAAA,YAAA;AAAA,UACjC,qBAAA,EAAuB,MAAM,iBAAqB,IAAA,KAAA;AAAA,UAClD,gBAAA,EAAkB,MAAM,YAAgB,IAAA;AAAA,SAC1C;AAAA,QACA,OAAA,EAAS,EAAE,kBAAA,EAAoB,IAAK;AAAA;AAAA;AACtC,GAEJ,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { ApiResources } from '../ApiResources/ApiResources.esm.js';
3
3
  import Grid from '@material-ui/core/Grid';
4
4
  import Typography from '@material-ui/core/Typography';
@@ -13,23 +13,28 @@ import { kubernetesClusterTranslationRef } from '../../translation.esm.js';
13
13
 
14
14
  const ContentGrid = () => {
15
15
  const { error } = useKubernetesClusterError();
16
- 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))));
16
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Grid, { container: true, children: [
17
+ error && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(WarningPanel, { title: "Error loading Kubernetes Cluster Plugin", children: /* @__PURE__ */ jsx(Typography, { children: error }) }) }),
18
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(ClusterOverview, {}) }),
19
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(ApiResources, {}) }),
20
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Nodes, {}) })
21
+ ] }) });
17
22
  };
18
23
  const KubernetesClusterContent = () => {
19
24
  const { t } = useTranslationRef(kubernetesClusterTranslationRef);
20
- return /* @__PURE__ */ React.createElement(
25
+ return /* @__PURE__ */ jsx(
21
26
  RequirePermission,
22
27
  {
23
28
  permission: kubernetesClustersReadPermission,
24
- errorPage: /* @__PURE__ */ React.createElement(
29
+ errorPage: /* @__PURE__ */ jsx(
25
30
  WarningPanel,
26
31
  {
27
32
  title: t("kubernetesClusterContentPage.permissionAlert.title"),
28
33
  message: t("kubernetesClusterContentPage.permissionAlert.message")
29
34
  }
30
- )
31
- },
32
- /* @__PURE__ */ React.createElement(KubernetesClusterErrorProvider, null, /* @__PURE__ */ React.createElement(ContentGrid, null))
35
+ ),
36
+ children: /* @__PURE__ */ jsx(KubernetesClusterErrorProvider, { children: /* @__PURE__ */ jsx(ContentGrid, {}) })
37
+ }
33
38
  );
34
39
  };
35
40
 
@@ -1 +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';\nimport { kubernetesClustersReadPermission } from '@backstage/plugin-kubernetes-common';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesClusterTranslationRef } from '../../translation';\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 const { t } = useTranslationRef(kubernetesClusterTranslationRef);\n\n return (\n <RequirePermission\n permission={kubernetesClustersReadPermission}\n errorPage={\n <WarningPanel\n title={t('kubernetesClusterContentPage.permissionAlert.title')}\n message={t('kubernetesClusterContentPage.permissionAlert.message')}\n />\n }\n >\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAA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AAAA,GACF;AAEJ;;;;"}
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 { 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';\nimport { kubernetesClustersReadPermission } from '@backstage/plugin-kubernetes-common';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { kubernetesClusterTranslationRef } from '../../translation';\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 const { t } = useTranslationRef(kubernetesClusterTranslationRef);\n\n return (\n <RequirePermission\n permission={kubernetesClustersReadPermission}\n errorPage={\n <WarningPanel\n title={t('kubernetesClusterContentPage.permissionAlert.title')}\n message={t('kubernetesClusterContentPage.permissionAlert.message')}\n />\n }\n >\n <KubernetesClusterErrorProvider>\n <ContentGrid />\n </KubernetesClusterErrorProvider>\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA8BA,MAAM,cAAc,MAAM;AACxB,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,yBAA0B,EAAA;AAC5C,EAAA,uBAEI,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,kBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IACZ,EAAA,QAAA,EAAA;AAAA,IAAA,KAAA,oBACE,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA,CAAC,YAAa,EAAA,EAAA,KAAA,EAAM,yCAClB,EAAA,QAAA,kBAAA,GAAA,CAAC,UAAY,EAAA,EAAA,QAAA,EAAA,KAAA,EAAM,GACrB,CACF,EAAA,CAAA;AAAA,oBAEF,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,QAAA,kBAAA,GAAA,CAAC,mBAAgB,CACnB,EAAA,CAAA;AAAA,oBACA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,QAAA,kBAAA,GAAA,CAAC,gBAAa,CAChB,EAAA,CAAA;AAAA,oBACA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA,CAAC,SAAM,CACT,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ,CAAA;AAOO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,+BAA+B,CAAA;AAE/D,EACE,uBAAA,GAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gCAAA;AAAA,MACZ,SACE,kBAAA,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,EAAE,oDAAoD,CAAA;AAAA,UAC7D,OAAA,EAAS,EAAE,sDAAsD;AAAA;AAAA,OACnE;AAAA,MAGF,QAAC,kBAAA,GAAA,CAAA,8BAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,WAAA,EAAA,EAAY,CACf,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,6 +1,7 @@
1
- import React, { useState, useCallback, useContext } from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { createContext, useState, useCallback, useContext } from 'react';
2
3
 
3
- const KubernetesClusterErrorContext = React.createContext({
4
+ const KubernetesClusterErrorContext = createContext({
4
5
  setError: (_) => {
5
6
  }
6
7
  });
@@ -12,7 +13,7 @@ const KubernetesClusterErrorProvider = ({
12
13
  error,
13
14
  setError: useCallback((message) => setError(message), [])
14
15
  };
15
- return /* @__PURE__ */ React.createElement(KubernetesClusterErrorContext.Provider, { value: contextValue }, children);
16
+ return /* @__PURE__ */ jsx(KubernetesClusterErrorContext.Provider, { value: contextValue, children });
16
17
  };
17
18
  const useKubernetesClusterError = () => {
18
19
  return useContext(KubernetesClusterErrorContext);
@@ -1 +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;AAC3B,CAAC;AAMM,MAAM,iCAAiC,CAAC;AAAA,EAC7C;AACF,CAA2C,KAAA;AACzC,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAA6B,KAAS,CAAA,CAAA;AAEhE,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAA;AAAA,IACA,QAAA,EAAU,YAAY,CAAC,OAAA,KAAoB,SAAS,OAAO,CAAA,EAAG,EAAE;AAAA,GAClE;AAEA,EAAA,2CACG,6BAA8B,CAAA,QAAA,EAA9B,EAAuC,KAAA,EAAO,gBAC5C,QACH,CAAA;AAEJ;AAEO,MAAM,4BAA4B,MAAM;AAC7C,EAAA,OAAO,WAAW,6BAA6B,CAAA;AACjD;;;;"}
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 {\n ReactNode,\n createContext,\n useCallback,\n useContext,\n useState,\n} from 'react';\n\nexport interface ErrorContext {\n error?: string;\n setError: (message: string) => void;\n}\n\nexport const KubernetesClusterErrorContext = createContext<ErrorContext>({\n setError: (_: string) => {},\n});\n\nexport interface KubernetesClusterErrorProviderProps {\n children: 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":";;;AA4BO,MAAM,gCAAgC,aAA4B,CAAA;AAAA,EACvE,QAAA,EAAU,CAAC,CAAc,KAAA;AAAA;AAC3B,CAAC;AAMM,MAAM,iCAAiC,CAAC;AAAA,EAC7C;AACF,CAA2C,KAAA;AACzC,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAA6B,KAAS,CAAA,CAAA;AAEhE,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAA;AAAA,IACA,QAAA,EAAU,YAAY,CAAC,OAAA,KAAoB,SAAS,OAAO,CAAA,EAAG,EAAE;AAAA,GAClE;AAEA,EAAA,2BACG,6BAA8B,CAAA,QAAA,EAA9B,EAAuC,KAAA,EAAO,cAC5C,QACH,EAAA,CAAA;AAEJ;AAEO,MAAM,4BAA4B,MAAM;AAC7C,EAAA,OAAO,WAAW,6BAA6B,CAAA;AACjD;;;;"}
@@ -1,5 +1,6 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
1
2
  import { useNodes } from './useNodes.esm.js';
2
- import React, { useCallback, useEffect } from 'react';
3
+ import { useCallback, useEffect } from 'react';
3
4
  import { useEntity } from '@backstage/plugin-catalog-react';
4
5
  import { Table, StructuredMetadataTable } from '@backstage/core-components';
5
6
  import Grid from '@material-ui/core/Grid';
@@ -21,37 +22,50 @@ const defaultColumns = [
21
22
  highlight: true,
22
23
  width: "auto",
23
24
  render: (node) => {
24
- return /* @__PURE__ */ React.createElement(
25
+ return /* @__PURE__ */ jsx(
25
26
  KubernetesDrawer,
26
27
  {
27
28
  kubernetesObject: node,
28
- label: node.metadata?.name ?? "unknown-node"
29
- },
30
- /* @__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(
31
- StructuredMetadataTable,
32
- {
33
- metadata: node.status?.nodeInfo ?? {},
34
- options: { nestedValuesAsYaml: true }
35
- }
36
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Addresses"), /* @__PURE__ */ React.createElement(
37
- StructuredMetadataTable,
38
- {
39
- metadata: node.status?.addresses?.reduce((accum, next) => {
40
- accum[next.type] = next.address;
41
- return accum;
42
- }, {}) ?? {},
43
- options: { nestedValuesAsYaml: true }
44
- }
45
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Taints"), /* @__PURE__ */ React.createElement(
46
- StructuredMetadataTable,
47
- {
48
- metadata: node.spec?.taints?.reduce((accum, next) => {
49
- accum[`${next.effect}`] = `${next.key} (${next.value})`;
50
- return accum;
51
- }, {}) ?? {},
52
- options: { nestedValuesAsYaml: true }
53
- }
54
- )))
29
+ label: node.metadata?.name ?? "unknown-node",
30
+ children: /* @__PURE__ */ jsxs(Grid, { container: true, children: [
31
+ /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
32
+ /* @__PURE__ */ jsx(Typography, { variant: "h5", children: "Node Info" }),
33
+ /* @__PURE__ */ jsx(
34
+ StructuredMetadataTable,
35
+ {
36
+ metadata: node.status?.nodeInfo ?? {},
37
+ options: { nestedValuesAsYaml: true }
38
+ }
39
+ )
40
+ ] }),
41
+ /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
42
+ /* @__PURE__ */ jsx(Typography, { variant: "h5", children: "Addresses" }),
43
+ /* @__PURE__ */ jsx(
44
+ StructuredMetadataTable,
45
+ {
46
+ metadata: node.status?.addresses?.reduce((accum, next) => {
47
+ accum[next.type] = next.address;
48
+ return accum;
49
+ }, {}) ?? {},
50
+ options: { nestedValuesAsYaml: true }
51
+ }
52
+ )
53
+ ] }),
54
+ /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
55
+ /* @__PURE__ */ jsx(Typography, { variant: "h5", children: "Taints" }),
56
+ /* @__PURE__ */ jsx(
57
+ StructuredMetadataTable,
58
+ {
59
+ metadata: node.spec?.taints?.reduce((accum, next) => {
60
+ accum[`${next.effect}`] = `${next.key} (${next.value})`;
61
+ return accum;
62
+ }, {}) ?? {},
63
+ options: { nestedValuesAsYaml: true }
64
+ }
65
+ )
66
+ ] })
67
+ ] })
68
+ }
55
69
  );
56
70
  }
57
71
  },
@@ -100,14 +114,14 @@ const Nodes = () => {
100
114
  setErrorCallback(error.message);
101
115
  }
102
116
  }, [error, setErrorCallback]);
103
- return /* @__PURE__ */ React.createElement(
117
+ return /* @__PURE__ */ jsx(
104
118
  Table,
105
119
  {
106
120
  title: "Nodes",
107
121
  options: { paging: true, search: false, emptyRowsWhenPaging: false },
108
122
  isLoading: !value && loading,
109
123
  data: value?.items ?? [],
110
- emptyContent: /* @__PURE__ */ React.createElement("div", { className: classes.empty }, error !== void 0 ? "Error loading nodes" : "No nodes found"),
124
+ emptyContent: /* @__PURE__ */ jsx("div", { className: classes.empty, children: error !== void 0 ? "Error loading nodes" : "No nodes found" }),
111
125
  columns: defaultColumns
112
126
  }
113
127
  );
@@ -1 +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\n metadata={node.status?.nodeInfo ?? {}}\n options={{ nestedValuesAsYaml: true }}\n />\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 options={{ nestedValuesAsYaml: true }}\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 options={{ nestedValuesAsYaml: true }}\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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AE5B,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,OAAA;AAAA,MACN,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAQ,EAAA,KAAA,EAAO,qBAAqB,KAAM,EAAA;AAAA,MACnE,SAAA,EAAW,CAAC,KAAS,IAAA,OAAA;AAAA,MACrB,IAAA,EAAM,KAAO,EAAA,KAAA,IAAS,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;AAAA;AAAA,GACX;AAEJ;;;;"}
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 { 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\n metadata={node.status?.nodeInfo ?? {}}\n options={{ nestedValuesAsYaml: true }}\n />\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 options={{ nestedValuesAsYaml: true }}\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 options={{ nestedValuesAsYaml: true }}\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,CAAA;AAAA,IACxB,OAAS,EAAA,MAAA;AAAA,IACT,cAAgB,EAAA;AAAA;AAEpB,CAAE,CAAA,CAAA;AAEF,MAAM,cAAuC,GAAA;AAAA,EAC3C;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,IAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,IAAgB,KAAA;AACvB,MACE,uBAAA,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,gBAAkB,EAAA,IAAA;AAAA,UAClB,KAAA,EAAO,IAAK,CAAA,QAAA,EAAU,IAAQ,IAAA,cAAA;AAAA,UAE9B,QAAA,kBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,IACb,EAAA,QAAA,EAAA;AAAA,4BAAA,IAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,EACb,EAAA,QAAA,EAAA;AAAA,8BAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,IAAA,EAAK,QAAS,EAAA,WAAA,EAAA,CAAA;AAAA,8BAClC,GAAA;AAAA,gBAAC,uBAAA;AAAA,gBAAA;AAAA,kBACC,QAAU,EAAA,IAAA,CAAK,MAA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,SAAU,EAAA;AAC7B,EAAA,MAAM,EAAE,KAAA,EAAO,KAAO,EAAA,OAAA,KAAY,QAAS,CAAA;AAAA,IACzC,WAAA,EAAa,OAAO,QAAS,CAAA;AAAA,GAC9B,CAAA;AACD,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,yBAA0B,EAAA;AAC/C,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,QAAU,EAAA,CAAC,QAAQ,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA;AAChC,GACC,EAAA,CAAC,KAAO,EAAA,gBAAgB,CAAC,CAAA;AAE5B,EACE,uBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,OAAA;AAAA,MACN,SAAS,EAAE,MAAA,EAAQ,MAAM,MAAQ,EAAA,KAAA,EAAO,qBAAqB,KAAM,EAAA;AAAA,MACnE,SAAA,EAAW,CAAC,KAAS,IAAA,OAAA;AAAA,MACrB,IAAA,EAAM,KAAO,EAAA,KAAA,IAAS,EAAC;AAAA,MACvB,YAAA,sBACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,KACrB,EAAA,QAAA,EAAA,KAAA,KAAU,KAAY,CAAA,GAAA,qBAAA,GAAwB,gBACjD,EAAA,CAAA;AAAA,MAEF,OAAS,EAAA;AAAA;AAAA,GACX;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Entity } from '@backstage/catalog-model';
3
3
 
4
4
  /**
@@ -25,6 +25,6 @@ declare const isKubernetesClusterAvailable: (entity: Entity) => boolean;
25
25
  *
26
26
  * @public
27
27
  */
28
- declare const Router: () => React.JSX.Element;
28
+ declare const Router: () => react_jsx_runtime.JSX.Element;
29
29
 
30
30
  export { EntityKubernetesClusterContent, type EntityKubernetesClusterContentProps, Router, isKubernetesClusterAvailable };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-kubernetes-cluster",
3
- "version": "0.0.24-next.1",
3
+ "version": "0.0.24",
4
4
  "description": "A Backstage plugin that shows details of Kubernetes clusters",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -41,11 +41,11 @@
41
41
  "types": "./dist/index.d.ts",
42
42
  "typesVersions": {
43
43
  "*": {
44
- "*": [
45
- "dist/index.d.ts"
46
- ],
47
44
  "alpha": [
48
45
  "dist/alpha.d.ts"
46
+ ],
47
+ "package.json": [
48
+ "package.json"
49
49
  ]
50
50
  }
51
51
  },
@@ -62,13 +62,13 @@
62
62
  "test": "backstage-cli package test"
63
63
  },
64
64
  "dependencies": {
65
- "@backstage/catalog-model": "1.7.3",
66
- "@backstage/core-components": "0.17.1-next.0",
67
- "@backstage/core-plugin-api": "1.10.5",
68
- "@backstage/plugin-catalog-react": "1.16.1-next.1",
69
- "@backstage/plugin-kubernetes-common": "0.9.4",
70
- "@backstage/plugin-kubernetes-react": "0.5.6-next.0",
71
- "@backstage/plugin-permission-react": "0.4.32",
65
+ "@backstage/catalog-model": "^1.7.3",
66
+ "@backstage/core-components": "^0.17.1",
67
+ "@backstage/core-plugin-api": "^1.10.6",
68
+ "@backstage/plugin-catalog-react": "^1.17.0",
69
+ "@backstage/plugin-kubernetes-common": "^0.9.4",
70
+ "@backstage/plugin-kubernetes-react": "^0.5.6",
71
+ "@backstage/plugin-permission-react": "^0.4.33",
72
72
  "@kubernetes-models/apimachinery": "^2.0.0",
73
73
  "@kubernetes-models/base": "^5.0.0",
74
74
  "@material-ui/core": "^4.12.2",
@@ -81,8 +81,8 @@
81
81
  "react-use": "^17.2.4"
82
82
  },
83
83
  "devDependencies": {
84
- "@backstage/cli": "0.32.0-next.1",
85
- "@backstage/test-utils": "1.7.6",
84
+ "@backstage/cli": "^0.32.0",
85
+ "@backstage/test-utils": "^1.7.7",
86
86
  "@testing-library/dom": "^10.0.0",
87
87
  "@testing-library/jest-dom": "^6.0.0",
88
88
  "@testing-library/react": "^16.0.0",