@backstage/plugin-devtools 0.1.13-next.1 → 0.1.14-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha/plugin.esm.js +40 -0
  4. package/dist/alpha/plugin.esm.js.map +1 -0
  5. package/dist/alpha.esm.js +1 -39
  6. package/dist/alpha.esm.js.map +1 -1
  7. package/dist/api/DevToolsApi.esm.js +8 -0
  8. package/dist/api/DevToolsApi.esm.js.map +1 -0
  9. package/dist/{esm/routes-DecpDktH.esm.js → api/DevToolsClient.esm.js} +2 -11
  10. package/dist/api/DevToolsClient.esm.js.map +1 -0
  11. package/dist/components/Content/ConfigContent/ConfigContent.esm.js +56 -0
  12. package/dist/components/Content/ConfigContent/ConfigContent.esm.js.map +1 -0
  13. package/dist/components/Content/ExternalDependenciesContent/ExternalDependenciesContent.esm.js +84 -0
  14. package/dist/components/Content/ExternalDependenciesContent/ExternalDependenciesContent.esm.js.map +1 -0
  15. package/dist/components/Content/InfoContent/BackstageLogoIcon.esm.js +7 -0
  16. package/dist/components/Content/InfoContent/BackstageLogoIcon.esm.js.map +1 -0
  17. package/dist/components/Content/InfoContent/InfoContent.esm.js +107 -0
  18. package/dist/components/Content/InfoContent/InfoContent.esm.js.map +1 -0
  19. package/dist/components/Content/InfoContent/InfoDependenciesTable.esm.js +38 -0
  20. package/dist/components/Content/InfoContent/InfoDependenciesTable.esm.js.map +1 -0
  21. package/dist/components/DefaultDevToolsPage/DefaultDevToolsPage.esm.js +11 -0
  22. package/dist/components/DefaultDevToolsPage/DefaultDevToolsPage.esm.js.map +1 -0
  23. package/dist/components/DevToolsLayout/DevToolsLayout.esm.js +26 -0
  24. package/dist/components/DevToolsLayout/DevToolsLayout.esm.js.map +1 -0
  25. package/dist/components/DevToolsPage/DevToolsPage.esm.js +11 -0
  26. package/dist/components/DevToolsPage/DevToolsPage.esm.js.map +1 -0
  27. package/dist/components/DevToolsPage/index.esm.js +2 -0
  28. package/dist/components/DevToolsPage/index.esm.js.map +1 -0
  29. package/dist/hooks/useConfig.esm.js +19 -0
  30. package/dist/hooks/useConfig.esm.js.map +1 -0
  31. package/dist/hooks/useExternalDependencies.esm.js +19 -0
  32. package/dist/hooks/useExternalDependencies.esm.js.map +1 -0
  33. package/dist/hooks/useInfo.esm.js +19 -0
  34. package/dist/hooks/useInfo.esm.js.map +1 -0
  35. package/dist/index.esm.js +5 -132
  36. package/dist/index.esm.js.map +1 -1
  37. package/dist/plugin.esm.js +31 -0
  38. package/dist/plugin.esm.js.map +1 -0
  39. package/dist/routes.esm.js +8 -0
  40. package/dist/routes.esm.js.map +1 -0
  41. package/package.json +8 -8
  42. package/dist/esm/DevToolsLayout-DSYudEJZ.esm.js +0 -226
  43. package/dist/esm/DevToolsLayout-DSYudEJZ.esm.js.map +0 -1
  44. package/dist/esm/index-DFeYEXKU.esm.js +0 -38
  45. package/dist/esm/index-DFeYEXKU.esm.js.map +0 -1
  46. package/dist/esm/routes-DecpDktH.esm.js.map +0 -1
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { useOutlet } from 'react-router-dom';
3
+ import { DefaultDevToolsPage } from '../DefaultDevToolsPage/DefaultDevToolsPage.esm.js';
4
+
5
+ const DevToolsPage = () => {
6
+ const outlet = useOutlet();
7
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, outlet || /* @__PURE__ */ React.createElement(DefaultDevToolsPage, null));
8
+ };
9
+
10
+ export { DevToolsPage };
11
+ //# sourceMappingURL=DevToolsPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevToolsPage.esm.js","sources":["../../../src/components/DevToolsPage/DevToolsPage.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 { useOutlet } from 'react-router-dom';\nimport { DefaultDevToolsPage } from '../DefaultDevToolsPage';\n\nexport const DevToolsPage = () => {\n const outlet = useOutlet();\n\n return <>{outlet || <DefaultDevToolsPage />}</>;\n};\n"],"names":[],"mappings":";;;;AAoBO,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,uBAAU,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,oBAAW,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CAAG,CAAA,CAAA;AAC9C;;;;"}
@@ -0,0 +1,2 @@
1
+ export { DevToolsPage } from './DevToolsPage.esm.js';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { devToolsApiRef } from '../api/DevToolsApi.esm.js';
2
+ import '@backstage/errors';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import useAsync from 'react-use/esm/useAsync';
5
+
6
+ function useConfig() {
7
+ const api = useApi(devToolsApiRef);
8
+ const { value, loading, error } = useAsync(() => {
9
+ return api.getConfig();
10
+ }, [api]);
11
+ return {
12
+ configInfo: value,
13
+ loading,
14
+ error
15
+ };
16
+ }
17
+
18
+ export { useConfig };
19
+ //# sourceMappingURL=useConfig.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConfig.esm.js","sources":["../../src/hooks/useConfig.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ConfigInfo } from '@backstage/plugin-devtools-common';\n\nexport function useConfig(): {\n configInfo?: ConfigInfo;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getConfig();\n }, [api]);\n\n return {\n configInfo: value,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AAqBO,SAAS,SAId,GAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,cAAc,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,OAAO,IAAI,SAAU,EAAA,CAAA;AAAA,GACvB,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,UAAY,EAAA,KAAA;AAAA,IACZ,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,19 @@
1
+ import { devToolsApiRef } from '../api/DevToolsApi.esm.js';
2
+ import '@backstage/errors';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import useAsync from 'react-use/esm/useAsync';
5
+
6
+ function useExternalDependencies() {
7
+ const api = useApi(devToolsApiRef);
8
+ const { value, loading, error } = useAsync(() => {
9
+ return api.getExternalDependencies();
10
+ }, [api]);
11
+ return {
12
+ externalDependencies: value,
13
+ loading,
14
+ error
15
+ };
16
+ }
17
+
18
+ export { useExternalDependencies };
19
+ //# sourceMappingURL=useExternalDependencies.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExternalDependencies.esm.js","sources":["../../src/hooks/useExternalDependencies.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\n\nexport function useExternalDependencies(): {\n externalDependencies?: ExternalDependency[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getExternalDependencies();\n }, [api]);\n\n return {\n externalDependencies: value,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AAqBO,SAAS,uBAId,GAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,cAAc,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,OAAO,IAAI,uBAAwB,EAAA,CAAA;AAAA,GACrC,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,oBAAsB,EAAA,KAAA;AAAA,IACtB,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,19 @@
1
+ import { devToolsApiRef } from '../api/DevToolsApi.esm.js';
2
+ import '@backstage/errors';
3
+ import { useApi } from '@backstage/core-plugin-api';
4
+ import useAsync from 'react-use/esm/useAsync';
5
+
6
+ function useInfo() {
7
+ const api = useApi(devToolsApiRef);
8
+ const { value, loading, error } = useAsync(() => {
9
+ return api.getInfo();
10
+ }, [api]);
11
+ return {
12
+ about: value,
13
+ loading,
14
+ error
15
+ };
16
+ }
17
+
18
+ export { useInfo };
19
+ //# sourceMappingURL=useInfo.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInfo.esm.js","sources":["../../src/hooks/useInfo.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { DevToolsInfo } from '@backstage/plugin-devtools-common';\n\nexport function useInfo(): {\n about?: DevToolsInfo;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getInfo();\n }, [api]);\n\n return {\n about: value,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AAqBO,SAAS,OAId,GAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,cAAc,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,OAAO,IAAI,OAAQ,EAAA,CAAA;AAAA,GACrB,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,KAAO,EAAA,KAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,133 +1,6 @@
1
- import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, useApi } from '@backstage/core-plugin-api';
2
- import { d as devToolsApiRef, D as DevToolsClient, r as rootRouteRef } from './esm/routes-DecpDktH.esm.js';
3
- export { C as ConfigContent, D as DevToolsLayout, I as InfoContent } from './esm/DevToolsLayout-DSYudEJZ.esm.js';
4
- import { Progress, Table, StatusWarning, StatusError, StatusOK } from '@backstage/core-components';
5
- import Box from '@material-ui/core/Box';
6
- import Grid from '@material-ui/core/Grid';
7
- import Paper from '@material-ui/core/Paper';
8
- import Typography from '@material-ui/core/Typography';
9
- import { makeStyles, createStyles } from '@material-ui/core/styles';
10
- import Alert from '@material-ui/lab/Alert';
11
- import React from 'react';
12
- import '@backstage/errors';
13
- import useAsync from 'react-use/esm/useAsync';
14
- import 'react-json-view';
15
- import '@material-ui/core/Avatar';
16
- import '@material-ui/core/Divider';
17
- import '@material-ui/core/List';
18
- import '@material-ui/core/ListItem';
19
- import '@material-ui/core/ListItemAvatar';
20
- import '@material-ui/core/ListItemText';
21
- import '@material-ui/core/Button';
22
- import '@material-ui/icons/Description';
23
- import '@material-ui/icons/Memory';
24
- import '@material-ui/icons/DeveloperBoard';
25
- import '@material-ui/core/SvgIcon';
26
- import '@material-ui/icons/FileCopy';
27
-
28
- const devToolsPlugin = createPlugin({
29
- id: "devtools",
30
- apis: [
31
- createApiFactory({
32
- api: devToolsApiRef,
33
- deps: {
34
- discoveryApi: discoveryApiRef,
35
- fetchApi: fetchApiRef
36
- },
37
- factory: ({ discoveryApi, fetchApi }) => new DevToolsClient({ discoveryApi, fetchApi })
38
- })
39
- ],
40
- routes: {
41
- root: rootRouteRef
42
- }
43
- });
44
- const DevToolsPage = devToolsPlugin.provide(
45
- createRoutableExtension({
46
- name: "DevToolsPage",
47
- component: () => import('./esm/index-DFeYEXKU.esm.js').then((m) => m.DevToolsPage),
48
- mountPoint: rootRouteRef
49
- })
50
- );
51
-
52
- function useExternalDependencies() {
53
- const api = useApi(devToolsApiRef);
54
- const { value, loading, error } = useAsync(() => {
55
- return api.getExternalDependencies();
56
- }, [api]);
57
- return {
58
- externalDependencies: value,
59
- loading,
60
- error
61
- };
62
- }
63
-
64
- const useStyles = makeStyles(
65
- (theme) => createStyles({
66
- paperStyle: {
67
- padding: theme.spacing(2)
68
- }
69
- })
70
- );
71
- const getExternalDependencyStatus = (result) => {
72
- switch (result == null ? void 0 : result.status) {
73
- case "Healthy":
74
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusOK, null), " ", result.status);
75
- case "Unhealthy":
76
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusError, null), " ", `${result.status}`);
77
- case void 0:
78
- default:
79
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusWarning, null), " Unknown");
80
- }
81
- };
82
- const columns = [
83
- {
84
- title: "Name",
85
- width: "auto",
86
- field: "name"
87
- },
88
- {
89
- title: "Target",
90
- width: "auto",
91
- field: "target"
92
- },
93
- {
94
- title: "Type",
95
- width: "auto",
96
- field: "type"
97
- },
98
- {
99
- title: "Status",
100
- width: "auto",
101
- render: (row) => /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, getExternalDependencyStatus(row))), /* @__PURE__ */ React.createElement(Grid, { item: true }, row.error && /* @__PURE__ */ React.createElement(Typography, null, row.error)))
102
- }
103
- ];
104
- const ExternalDependenciesContent = () => {
105
- const classes = useStyles();
106
- const { externalDependencies, loading, error } = useExternalDependencies();
107
- if (loading) {
108
- return /* @__PURE__ */ React.createElement(Progress, null);
109
- } else if (error) {
110
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.message);
111
- }
112
- if (!externalDependencies || externalDependencies.length === 0) {
113
- return /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Paper, { className: classes.paperStyle }, /* @__PURE__ */ React.createElement(Typography, null, "No external dependencies found")));
114
- }
115
- return /* @__PURE__ */ React.createElement(
116
- Table,
117
- {
118
- title: "Status",
119
- options: {
120
- paging: true,
121
- pageSize: 20,
122
- pageSizeOptions: [20, 50, 100],
123
- loadingType: "linear",
124
- showEmptyDataSourceMessage: !loading
125
- },
126
- columns,
127
- data: externalDependencies || []
128
- }
129
- );
130
- };
131
-
132
- export { DevToolsPage, ExternalDependenciesContent, devToolsPlugin };
1
+ export { DevToolsPage, devToolsPlugin } from './plugin.esm.js';
2
+ export { ConfigContent } from './components/Content/ConfigContent/ConfigContent.esm.js';
3
+ export { InfoContent } from './components/Content/InfoContent/InfoContent.esm.js';
4
+ export { ExternalDependenciesContent } from './components/Content/ExternalDependenciesContent/ExternalDependenciesContent.esm.js';
5
+ export { DevToolsLayout } from './components/DevToolsLayout/DevToolsLayout.esm.js';
133
6
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/plugin.ts","../src/hooks/useExternalDependencies.ts","../src/components/Content/ExternalDependenciesContent/ExternalDependenciesContent.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport { devToolsApiRef, DevToolsClient } from './api';\n\nimport { rootRouteRef } from './routes';\n\n/** @public */\nexport const devToolsPlugin = createPlugin({\n id: 'devtools',\n apis: [\n createApiFactory({\n api: devToolsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new DevToolsClient({ discoveryApi, fetchApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/** @public */\nexport const DevToolsPage = devToolsPlugin.provide(\n createRoutableExtension({\n name: 'DevToolsPage',\n component: () =>\n import('./components/DevToolsPage').then(m => m.DevToolsPage),\n mountPoint: rootRouteRef,\n }),\n);\n","/*\n * Copyright 2022 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 { devToolsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\n\nexport function useExternalDependencies(): {\n externalDependencies?: ExternalDependency[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(devToolsApiRef);\n const { value, loading, error } = useAsync(() => {\n return api.getExternalDependencies();\n }, [api]);\n\n return {\n externalDependencies: value,\n loading,\n error,\n };\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Progress,\n StatusError,\n StatusOK,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { ExternalDependency } from '@backstage/plugin-devtools-common';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport { useExternalDependencies } from '../../../hooks';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n paperStyle: {\n padding: theme.spacing(2),\n },\n }),\n);\n\nexport const getExternalDependencyStatus = (\n result: Partial<ExternalDependency> | undefined,\n) => {\n switch (result?.status) {\n case 'Healthy':\n return (\n <Typography component=\"span\">\n <StatusOK /> {result.status}\n </Typography>\n );\n case 'Unhealthy':\n return (\n <Typography component=\"span\">\n <StatusError /> {`${result.status}`}\n </Typography>\n );\n case undefined:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nconst columns: TableColumn[] = [\n {\n title: 'Name',\n width: 'auto',\n field: 'name',\n },\n {\n title: 'Target',\n width: 'auto',\n field: 'target',\n },\n {\n title: 'Type',\n width: 'auto',\n field: 'type',\n },\n {\n title: 'Status',\n width: 'auto',\n render: (row: Partial<ExternalDependency>) => (\n <Grid container direction=\"column\">\n <Grid item>\n <Typography variant=\"button\">\n {getExternalDependencyStatus(row)}\n </Typography>\n </Grid>\n <Grid item>{row.error && <Typography>{row.error}</Typography>}</Grid>\n </Grid>\n ),\n },\n];\n\n/** @public */\nexport const ExternalDependenciesContent = () => {\n const classes = useStyles();\n const { externalDependencies, loading, error } = useExternalDependencies();\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!externalDependencies || externalDependencies.length === 0) {\n return (\n <Box>\n <Paper className={classes.paperStyle}>\n <Typography>No external dependencies found</Typography>\n </Paper>\n </Box>\n );\n }\n\n return (\n <Table\n title=\"Status\"\n options={{\n paging: true,\n pageSize: 20,\n pageSizeOptions: [20, 50, 100],\n loadingType: 'linear',\n showEmptyDataSourceMessage: !loading,\n }}\n columns={columns}\n data={externalDependencies || []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,iBAAiB,YAAa,CAAA;AAAA,EACzC,EAAI,EAAA,UAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,cAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,cAAe,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,CAAA;AAAA,KAChD,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,GACR;AACF,CAAC,EAAA;AAGM,MAAM,eAAe,cAAe,CAAA,OAAA;AAAA,EACzC,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,cAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,6BAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY,CAAA;AAAA,IAC9D,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH;;ACjCO,SAAS,uBAId,GAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,cAAc,CAAA,CAAA;AACjC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,OAAO,IAAI,uBAAwB,EAAA,CAAA;AAAA,GACrC,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,oBAAsB,EAAA,KAAA;AAAA,IACtB,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;ACFA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,UAAY,EAAA;AAAA,MACV,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,KAC1B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAEa,MAAA,2BAAA,GAA8B,CACzC,MACG,KAAA;AACH,EAAA,QAAQ,iCAAQ,MAAQ;AAAA,IACtB,KAAK,SAAA;AACH,MACE,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,SAAU,EAAA,MAAA,EAAA,sCACnB,QAAS,EAAA,IAAA,CAAA,EAAE,GAAE,EAAA,MAAA,CAAO,MACvB,CAAA,CAAA;AAAA,IAEJ,KAAK,WAAA;AACH,MACE,uBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MACpB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,IAAA,CAAA,EAAE,GAAE,EAAA,CAAA,EAAG,MAAO,CAAA,MAAM,CACnC,CAAA,CAAA,CAAA;AAAA,IAEJ,KAAK,KAAA,CAAA,CAAA;AAAA,IACL;AACE,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,GAAE,UACnB,CAAA,CAAA;AAAA,GAEN;AACF,CAAA,CAAA;AAEA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,QAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA,QAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,QAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,MAAQ,EAAA,CAAC,GACP,qBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAC,SAAU,EAAA,QAAA,EAAA,kBACvB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAA,sCACP,UAAW,EAAA,EAAA,OAAA,EAAQ,QACjB,EAAA,EAAA,2BAAA,CAA4B,GAAG,CAClC,CACF,CAAA,sCACC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAE,EAAA,EAAA,GAAA,CAAI,yBAAU,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAA,EAAY,GAAI,CAAA,KAAM,CAAc,CAChE,CAAA;AAAA,GAEJ;AACF,CAAA,CAAA;AAGO,MAAM,8BAA8B,MAAM;AAC/C,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,EAAE,oBAAA,EAAsB,OAAS,EAAA,KAAA,KAAU,uBAAwB,EAAA,CAAA;AAEzE,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAA,EAAS,MAAM,OAAQ,CAAA,CAAA;AAAA,GAChD;AAEA,EAAA,IAAI,CAAC,oBAAA,IAAwB,oBAAqB,CAAA,MAAA,KAAW,CAAG,EAAA;AAC9D,IACE,uBAAA,KAAA,CAAA,aAAA,CAAC,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,UAAA,EAAA,kBACvB,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAA,EAAW,gCAA8B,CAC5C,CACF,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,QAAA;AAAA,MACN,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,EAAA;AAAA,QACV,eAAiB,EAAA,CAAC,EAAI,EAAA,EAAA,EAAI,GAAG,CAAA;AAAA,QAC7B,WAAa,EAAA,QAAA;AAAA,QACb,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,OAAA;AAAA,MACA,IAAA,EAAM,wBAAwB,EAAC;AAAA,KAAA;AAAA,GACjC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,31 @@
1
+ import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
2
+ import { devToolsApiRef } from './api/DevToolsApi.esm.js';
3
+ import { DevToolsClient } from './api/DevToolsClient.esm.js';
4
+ import { rootRouteRef } from './routes.esm.js';
5
+
6
+ const devToolsPlugin = createPlugin({
7
+ id: "devtools",
8
+ apis: [
9
+ createApiFactory({
10
+ api: devToolsApiRef,
11
+ deps: {
12
+ discoveryApi: discoveryApiRef,
13
+ fetchApi: fetchApiRef
14
+ },
15
+ factory: ({ discoveryApi, fetchApi }) => new DevToolsClient({ discoveryApi, fetchApi })
16
+ })
17
+ ],
18
+ routes: {
19
+ root: rootRouteRef
20
+ }
21
+ });
22
+ const DevToolsPage = devToolsPlugin.provide(
23
+ createRoutableExtension({
24
+ name: "DevToolsPage",
25
+ component: () => import('./components/DevToolsPage/index.esm.js').then((m) => m.DevToolsPage),
26
+ mountPoint: rootRouteRef
27
+ })
28
+ );
29
+
30
+ export { DevToolsPage, devToolsPlugin };
31
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport { devToolsApiRef, DevToolsClient } from './api';\n\nimport { rootRouteRef } from './routes';\n\n/** @public */\nexport const devToolsPlugin = createPlugin({\n id: 'devtools',\n apis: [\n createApiFactory({\n api: devToolsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new DevToolsClient({ discoveryApi, fetchApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/** @public */\nexport const DevToolsPage = devToolsPlugin.provide(\n createRoutableExtension({\n name: 'DevToolsPage',\n component: () =>\n import('./components/DevToolsPage').then(m => m.DevToolsPage),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,iBAAiB,YAAa,CAAA;AAAA,EACzC,EAAI,EAAA,UAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,cAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,cAAe,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,CAAA;AAAA,KAChD,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,GACR;AACF,CAAC,EAAA;AAGM,MAAM,eAAe,cAAe,CAAA,OAAA;AAAA,EACzC,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,cAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,wCAA2B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,YAAY,CAAA;AAAA,IAC9D,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH;;;;"}
@@ -0,0 +1,8 @@
1
+ import { createRouteRef } from '@backstage/core-plugin-api';
2
+
3
+ const rootRouteRef = createRouteRef({
4
+ id: "devtools"
5
+ });
6
+
7
+ export { rootRouteRef };
8
+ //# sourceMappingURL=routes.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'devtools',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,UAAA;AACN,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-devtools",
3
- "version": "0.1.13-next.1",
3
+ "version": "0.1.14-next.0",
4
4
  "main": "./dist/index.esm.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -40,13 +40,13 @@
40
40
  "postpack": "backstage-cli package postpack"
41
41
  },
42
42
  "dependencies": {
43
- "@backstage/core-compat-api": "^0.2.4-next.1",
44
- "@backstage/core-components": "^0.14.4-next.0",
45
- "@backstage/core-plugin-api": "^1.9.1",
43
+ "@backstage/core-compat-api": "^0.2.5-next.0",
44
+ "@backstage/core-components": "^0.14.5-next.0",
45
+ "@backstage/core-plugin-api": "^1.9.2",
46
46
  "@backstage/errors": "^1.2.4",
47
- "@backstage/frontend-plugin-api": "^0.6.4-next.1",
47
+ "@backstage/frontend-plugin-api": "^0.6.5-next.0",
48
48
  "@backstage/plugin-devtools-common": "^0.1.9",
49
- "@backstage/plugin-permission-react": "^0.4.21",
49
+ "@backstage/plugin-permission-react": "^0.4.22",
50
50
  "@material-ui/core": "^4.9.13",
51
51
  "@material-ui/icons": "^4.9.1",
52
52
  "@material-ui/lab": "^4.0.0-alpha.57",
@@ -60,8 +60,8 @@
60
60
  "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@backstage/cli": "^0.26.3-next.1",
64
- "@backstage/dev-utils": "^1.0.31-next.1",
63
+ "@backstage/cli": "^0.26.5-next.0",
64
+ "@backstage/dev-utils": "^1.0.32-next.0",
65
65
  "@testing-library/jest-dom": "^6.0.0"
66
66
  },
67
67
  "files": [
@@ -1,226 +0,0 @@
1
- import { Progress, WarningPanel, Table, Page, Header, RoutedTabs } from '@backstage/core-components';
2
- import Box from '@material-ui/core/Box';
3
- import Paper from '@material-ui/core/Paper';
4
- import Typography from '@material-ui/core/Typography';
5
- import { makeStyles, createStyles, useTheme } from '@material-ui/core/styles';
6
- import Alert from '@material-ui/lab/Alert';
7
- import React from 'react';
8
- import ReactJson from 'react-json-view';
9
- import { d as devToolsApiRef } from './routes-DecpDktH.esm.js';
10
- import '@backstage/errors';
11
- import { useApi, attachComponentData, useElementFilter } from '@backstage/core-plugin-api';
12
- import useAsync from 'react-use/esm/useAsync';
13
- import Avatar from '@material-ui/core/Avatar';
14
- import Divider from '@material-ui/core/Divider';
15
- import List from '@material-ui/core/List';
16
- import ListItem from '@material-ui/core/ListItem';
17
- import ListItemAvatar from '@material-ui/core/ListItemAvatar';
18
- import ListItemText from '@material-ui/core/ListItemText';
19
- import Button from '@material-ui/core/Button';
20
- import DescriptionIcon from '@material-ui/icons/Description';
21
- import MemoryIcon from '@material-ui/icons/Memory';
22
- import DeveloperBoardIcon from '@material-ui/icons/DeveloperBoard';
23
- import SvgIcon from '@material-ui/core/SvgIcon';
24
- import FileCopyIcon from '@material-ui/icons/FileCopy';
25
-
26
- function useConfig() {
27
- const api = useApi(devToolsApiRef);
28
- const { value, loading, error } = useAsync(() => {
29
- return api.getConfig();
30
- }, [api]);
31
- return {
32
- configInfo: value,
33
- loading,
34
- error
35
- };
36
- }
37
-
38
- function useInfo() {
39
- const api = useApi(devToolsApiRef);
40
- const { value, loading, error } = useAsync(() => {
41
- return api.getInfo();
42
- }, [api]);
43
- return {
44
- about: value,
45
- loading,
46
- error
47
- };
48
- }
49
-
50
- const useStyles$1 = makeStyles(
51
- (theme) => createStyles({
52
- warningStyle: {
53
- paddingBottom: theme.spacing(2)
54
- },
55
- paperStyle: {
56
- padding: theme.spacing(2)
57
- }
58
- })
59
- );
60
- const WarningContent = ({ error }) => {
61
- if (!error.messages) {
62
- return /* @__PURE__ */ React.createElement(Typography, null, error.message);
63
- }
64
- const messages = error.messages;
65
- return /* @__PURE__ */ React.createElement(Box, null, messages.map((message) => /* @__PURE__ */ React.createElement(Typography, null, message)));
66
- };
67
- const ConfigContent = () => {
68
- const classes = useStyles$1();
69
- const theme = useTheme();
70
- const { configInfo, loading, error } = useConfig();
71
- if (loading) {
72
- return /* @__PURE__ */ React.createElement(Progress, null);
73
- } else if (error) {
74
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.message);
75
- }
76
- if (!configInfo) {
77
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Unable to load config data");
78
- }
79
- return /* @__PURE__ */ React.createElement(Box, null, configInfo && configInfo.error && /* @__PURE__ */ React.createElement(Box, { className: classes.warningStyle }, /* @__PURE__ */ React.createElement(WarningPanel, { title: "Config validation failed" }, /* @__PURE__ */ React.createElement(WarningContent, { error: configInfo.error }))), /* @__PURE__ */ React.createElement(Paper, { className: classes.paperStyle }, /* @__PURE__ */ React.createElement(
80
- ReactJson,
81
- {
82
- src: configInfo.config,
83
- name: "config",
84
- enableClipboard: false,
85
- theme: theme.palette.type === "dark" ? "chalk" : "rjv-default"
86
- }
87
- )));
88
- };
89
-
90
- const columns = [
91
- {
92
- title: "Name",
93
- width: "auto",
94
- field: "name",
95
- defaultSort: "asc"
96
- },
97
- {
98
- title: "Versions",
99
- width: "auto",
100
- field: "versions"
101
- }
102
- ];
103
- const InfoDependenciesTable = ({
104
- infoDependencies
105
- }) => {
106
- return /* @__PURE__ */ React.createElement(
107
- Table,
108
- {
109
- title: "Package Dependencies",
110
- options: {
111
- paging: true,
112
- pageSize: 15,
113
- pageSizeOptions: [15, 30, 100],
114
- loadingType: "linear",
115
- padding: "dense"
116
- },
117
- columns,
118
- data: infoDependencies || []
119
- }
120
- );
121
- };
122
-
123
- const BackstageLogoIcon = (props) => /* @__PURE__ */ React.createElement(SvgIcon, { ...props, viewBox: "0 0 337.46 428.5" }, /* @__PURE__ */ React.createElement("path", { d: "M303 166.05a80.69 80.69 0 0013.45-10.37c.79-.77 1.55-1.53 2.3-2.3a83.12 83.12 0 007.93-9.38 63.69 63.69 0 006.32-10.77 48.58 48.58 0 004.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56 0 78.3 115.23 0 190.25l108.6 65.91a111.59 111.59 0 0057.76 16.41c24.92 0 48.8-8.8 66.42-25.69 19.16-18.36 25.52-42.12 13.7-61.87a49.22 49.22 0 00-6.8-8.87 89.17 89.17 0 0019.32 2.15h.15a85.08 85.08 0 0031-5.79 80.88 80.88 0 0012.85-6.45zm-100.55 59.81c-19.32 18.51-50.4 21.23-75.7 5.9l-75.14-45.61 67.45-64.64 76.41 46.38c27.53 16.69 26.02 39.72 6.98 57.97zm8.93-82.22l-70.65-42.89L205.14 39l69.37 42.1c25.94 15.72 29.31 37 10.55 55a60.69 60.69 0 01-73.68 7.54zm29.86 190c-19.57 18.75-46.17 29.09-74.88 29.09a123.73 123.73 0 01-64.1-18.2L0 282.52v24.67l108.6 65.91a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.81 66.42-25.69 12.88-12.34 20-27.13 19.68-41.49v-1.79a87.27 87.27 0 01-11.22 13.13zm0-39c-19.57 18.75-46.17 29.08-74.88 29.08a123.81 123.81 0 01-64.1-18.19L0 243.53v24.68l108.6 65.91a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.81 66.42-25.69 12.88-12.34 20-27.13 19.68-41.5v-1.78a87.27 87.27 0 01-11.22 13.13zm0-39c-19.57 18.76-46.17 29.09-74.88 29.09a123.81 123.81 0 01-64.1-18.19L0 204.55v24.68l108.6 65.91a111.59 111.59 0 0057.76 16.41c24.92 0 48.8-8.8 66.42-25.68 12.88-12.35 20-27.13 19.68-41.5v-1.82a86.09 86.09 0 01-11.22 13.16zm83.7 25.74a94.15 94.15 0 01-60.2 25.86V334a81.6 81.6 0 0051.74-22.37c14-13.38 21.14-28.11 21-42.64v-2.19a94.92 94.92 0 01-12.54 14.65zm-83.7 91.21c-19.57 18.76-46.17 29.09-74.88 29.09a123.73 123.73 0 01-64.1-18.2L0 321.5v24.68l108.6 65.9a111.6 111.6 0 0057.76 16.42c24.92 0 48.8-8.8 66.42-25.69 12.88-12.34 20-27.13 19.68-41.49v-1.79a86.29 86.29 0 01-11.22 13.13zM327 162.45c-.68.69-1.35 1.38-2.05 2.06a94.37 94.37 0 01-10.64 8.65 91.35 91.35 0 01-11.6 7 94.53 94.53 0 01-26.24 8.71 97.69 97.69 0 01-14.16 1.57c.5 1.61.9 3.25 1.25 4.9a53.27 53.27 0 011.14 12V217h.05a84.41 84.41 0 0025.35-5.55 81 81 0 0026.39-16.82c.8-.77 1.5-1.56 2.26-2.34a82.08 82.08 0 007.93-9.38 63.76 63.76 0 006.32-10.74 48.55 48.55 0 004.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08 1.54-2.25 3.09a96.73 96.73 0 01-8.26 9.36zm0 77.92c-.69.7-1.31 1.41-2 2.1a94.2 94.2 0 01-60.2 25.86V295a81.6 81.6 0 0051.74-22.37 73.51 73.51 0 0016.46-22.5 48.56 48.56 0 004.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74 1.07-1.46 2.15-2.27 3.21a95.68 95.68 0 01-8.24 9.37zm0-39c-.69.7-1.31 1.41-2 2.1a93.18 93.18 0 01-10.63 8.65 91.63 91.63 0 01-11.63 7 95.47 95.47 0 01-37.94 10.18V256a81.65 81.65 0 0051.74-22.37c.8-.77 1.5-1.56 2.26-2.34a82.08 82.08 0 007.93-9.38 63.76 63.76 0 006.27-10.76 48.56 48.56 0 004.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74 1.08-1.46 2.16-2.27 3.22a95.68 95.68 0 01-8.24 9.37z" }));
124
-
125
- const useStyles = makeStyles(
126
- (theme) => createStyles({
127
- paperStyle: {
128
- display: "flex",
129
- marginBottom: theme.spacing(2)
130
- },
131
- flexContainer: {
132
- display: "flex",
133
- flexDirection: "row",
134
- padding: 0
135
- },
136
- copyButton: {
137
- float: "left",
138
- margin: theme.spacing(2)
139
- }
140
- })
141
- );
142
- const copyToClipboard = ({ about }) => {
143
- if (about) {
144
- let formatted = `OS: ${about.operatingSystem}
145
- Resources: ${about.resourceUtilization}
146
- node: ${about.nodeJsVersion}
147
- backstage: ${about.backstageVersion}
148
- Dependencies:
149
- `;
150
- const deps = about.dependencies;
151
- for (const key in deps) {
152
- if (Object.prototype.hasOwnProperty.call(deps, key)) {
153
- formatted = `${formatted} ${deps[key].name}: ${deps[key].versions}
154
- `;
155
- }
156
- }
157
- window.navigator.clipboard.writeText(formatted);
158
- }
159
- };
160
- const InfoContent = () => {
161
- const classes = useStyles();
162
- const { about, loading, error } = useInfo();
163
- if (loading) {
164
- return /* @__PURE__ */ React.createElement(Progress, null);
165
- } else if (error) {
166
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.message);
167
- }
168
- return /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Paper, { className: classes.paperStyle }, /* @__PURE__ */ React.createElement(List, { className: classes.flexContainer }, /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemAvatar, null, /* @__PURE__ */ React.createElement(Avatar, null, /* @__PURE__ */ React.createElement(DeveloperBoardIcon, null))), /* @__PURE__ */ React.createElement(
169
- ListItemText,
170
- {
171
- primary: "Operating System",
172
- secondary: about == null ? void 0 : about.operatingSystem
173
- }
174
- )), /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemAvatar, null, /* @__PURE__ */ React.createElement(Avatar, null, /* @__PURE__ */ React.createElement(MemoryIcon, null))), /* @__PURE__ */ React.createElement(
175
- ListItemText,
176
- {
177
- primary: "Resource utilization",
178
- secondary: about == null ? void 0 : about.resourceUtilization
179
- }
180
- )), /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemAvatar, null, /* @__PURE__ */ React.createElement(Avatar, null, /* @__PURE__ */ React.createElement(DescriptionIcon, null))), /* @__PURE__ */ React.createElement(
181
- ListItemText,
182
- {
183
- primary: "NodeJS Version",
184
- secondary: about == null ? void 0 : about.nodeJsVersion
185
- }
186
- )), /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemAvatar, null, /* @__PURE__ */ React.createElement(Avatar, null, /* @__PURE__ */ React.createElement(BackstageLogoIcon, null))), /* @__PURE__ */ React.createElement(
187
- ListItemText,
188
- {
189
- primary: "Backstage Version",
190
- secondary: about == null ? void 0 : about.backstageVersion
191
- }
192
- ))), /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", variant: "middle", flexItem: true }), /* @__PURE__ */ React.createElement(
193
- Button,
194
- {
195
- onClick: () => {
196
- copyToClipboard({ about });
197
- },
198
- className: classes.copyButton,
199
- startIcon: /* @__PURE__ */ React.createElement(FileCopyIcon, null)
200
- },
201
- "Copy Info to Clipboard"
202
- )), /* @__PURE__ */ React.createElement(InfoDependenciesTable, { infoDependencies: about == null ? void 0 : about.dependencies }));
203
- };
204
-
205
- const dataKey = "plugin.devtools.devtoolsLayoutRoute";
206
- const Route = () => null;
207
- attachComponentData(Route, dataKey, true);
208
- attachComponentData(Route, "core.gatherMountPoints", true);
209
- const DevToolsLayout = ({
210
- children,
211
- title,
212
- subtitle
213
- }) => {
214
- const routes = useElementFilter(
215
- children,
216
- (elements) => elements.selectByComponentData({
217
- key: dataKey,
218
- withStrictError: "Child of DevToolsLayout must be an DevToolsLayout.Route"
219
- }).getElements().map((child) => child.props)
220
- );
221
- return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(Header, { title: title != null ? title : "Backstage DevTools", subtitle }), /* @__PURE__ */ React.createElement(RoutedTabs, { routes }));
222
- };
223
- DevToolsLayout.Route = Route;
224
-
225
- export { ConfigContent as C, DevToolsLayout as D, InfoContent as I };
226
- //# sourceMappingURL=DevToolsLayout-DSYudEJZ.esm.js.map