@backstage-community/plugin-newrelic-dashboard 0.7.1 → 0.8.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.
- package/CHANGELOG.md +6 -0
- package/dist/Router.esm.js +14 -11
- package/dist/Router.esm.js.map +1 -1
- package/dist/components/NewRelicDashboard/DashboardEntityList.esm.js +15 -8
- package/dist/components/NewRelicDashboard/DashboardEntityList.esm.js.map +1 -1
- package/dist/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.esm.js +25 -23
- package/dist/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.esm.js.map +1 -1
- package/dist/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.esm.js +45 -41
- package/dist/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.esm.js.map +1 -1
- package/dist/components/NewRelicDashboard/NewRelicDashboard.esm.js +12 -9
- package/dist/components/NewRelicDashboard/NewRelicDashboard.esm.js.map +1 -1
- package/dist/index.d.ts +6 -7
- package/package.json +14 -7
package/CHANGELOG.md
CHANGED
package/dist/Router.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
import { NewRelicDashboard } from './components/NewRelicDashboard/NewRelicDashboard.esm.js';
|
|
4
4
|
import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
|
|
@@ -8,17 +8,20 @@ const isNewRelicDashboardAvailable = (entity) => Boolean(entity?.metadata?.annot
|
|
|
8
8
|
const Router = () => {
|
|
9
9
|
const { entity } = useEntity();
|
|
10
10
|
if (isNewRelicDashboardAvailable(entity)) {
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsx(NewRelicDashboard, {});
|
|
12
12
|
}
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(MissingAnnotationEmptyState, { annotation: NEWRELIC_GUID_ANNOTATION }),
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
Button,
|
|
17
|
+
{
|
|
18
|
+
variant: "contained",
|
|
19
|
+
color: "primary",
|
|
20
|
+
href: "https://github.com/backstage/backstage/tree/master/plugins/newrelic-dashboard",
|
|
21
|
+
children: "Read New Relic Dashboard Plugin Docs"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] });
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export { Router, isNewRelicDashboardAvailable };
|
package/dist/Router.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport
|
|
1
|
+
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport Button from '@material-ui/core/Button';\nimport { NewRelicDashboard } from './components/NewRelicDashboard';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport { NEWRELIC_GUID_ANNOTATION } from './constants';\n\n/** @public */\nexport const isNewRelicDashboardAvailable = (entity: Entity) =>\n Boolean(entity?.metadata?.annotations?.[NEWRELIC_GUID_ANNOTATION]);\n\nexport const Router = () => {\n const { entity } = useEntity();\n\n if (isNewRelicDashboardAvailable(entity)) {\n return <NewRelicDashboard />;\n }\n\n return (\n <>\n <MissingAnnotationEmptyState annotation={NEWRELIC_GUID_ANNOTATION} />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://github.com/backstage/backstage/tree/master/plugins/newrelic-dashboard\"\n >\n Read New Relic Dashboard Plugin Docs\n </Button>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;AAyBa,MAAA,4BAAA,GAA+B,CAAC,MAC3C,KAAA,OAAA,CAAQ,QAAQ,QAAU,EAAA,WAAA,GAAc,wBAAwB,CAAC;AAE5D,MAAM,SAAS,MAAM;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAI,IAAA,4BAAA,CAA6B,MAAM,CAAG,EAAA;AACxC,IAAA,2BAAQ,iBAAkB,EAAA,EAAA,CAAA;AAAA;AAG5B,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,2BAAA,EAAA,EAA4B,YAAY,wBAA0B,EAAA,CAAA;AAAA,oBACnE,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,WAAA;AAAA,QACR,KAAM,EAAA,SAAA;AAAA,QACN,IAAK,EAAA,+EAAA;AAAA,QACN,QAAA,EAAA;AAAA;AAAA;AAED,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import Box from '@material-ui/core/Box';
|
|
3
3
|
import makeStyles from '@material-ui/core/styles/makeStyles';
|
|
4
4
|
import Typography from '@material-ui/core/Typography';
|
|
@@ -32,16 +32,23 @@ const DashboardEntityList = () => {
|
|
|
32
32
|
return dashboardObject;
|
|
33
33
|
}, [entity.metadata.annotations?.[NEWRELIC_GUID_ANNOTATION]]);
|
|
34
34
|
if (loading) {
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
36
36
|
}
|
|
37
37
|
if (error) {
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { title: error.name, defaultExpanded: true, error });
|
|
39
39
|
}
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
return /* @__PURE__ */ jsxs(InfoCard, { title: "New Relic Dashboard Pages", variant: "gridItem", children: [
|
|
41
|
+
value?.getDashboardEntity === void 0 && "Unauthorized Request , please check API Key",
|
|
42
|
+
value?.getDashboardEntity !== void 0 && value?.getDashboardEntity?.data.actor.entitySearch.results?.entities?.length <= 0 && /* @__PURE__ */ jsx(Fragment, { children: "No Dashboard Pages found with the specified Dashboard GUID" }),
|
|
43
|
+
value?.getDashboardEntity?.data.actor.entitySearch.results.entities?.map(
|
|
44
|
+
(entityResult, index) => {
|
|
45
|
+
return /* @__PURE__ */ jsxs(Box, { style: { margin: "10px" }, display: "flex", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Box, { mr: 1, className: classes.svgIcon, children: /* @__PURE__ */ jsx(Typography, { component: "div", children: /* @__PURE__ */ jsx(DesktopMac, {}) }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(Box, { flexGrow: "1", children: /* @__PURE__ */ jsx(Link, { to: entityResult.permalink, children: entityResult.name }) })
|
|
48
|
+
] }, index);
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] });
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export { DashboardEntityList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardEntityList.esm.js","sources":["../../../src/components/NewRelicDashboard/DashboardEntityList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"DashboardEntityList.esm.js","sources":["../../../src/components/NewRelicDashboard/DashboardEntityList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport Typography from '@material-ui/core/Typography';\nimport { newRelicDashboardApiRef } from '../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n Progress,\n InfoCard,\n Link,\n ErrorPanel,\n} from '@backstage/core-components';\nimport DesktopMac from '@material-ui/icons/DesktopMac';\nimport { DashboardEntitySummary } from '../../api/NewRelicDashboardApi';\nimport { ResultEntity } from '../../types/DashboardEntity';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { NEWRELIC_GUID_ANNOTATION } from '../../constants';\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\nexport const DashboardEntityList = () => {\n const { entity } = useEntity();\n const classes = useStyles();\n const newRelicDashboardAPI = useApi(newRelicDashboardApiRef);\n const { value, loading, error } = useAsync(async (): Promise<\n DashboardEntitySummary | undefined\n > => {\n const dashboardObject: Promise<DashboardEntitySummary | undefined> =\n newRelicDashboardAPI.getDashboardEntity(\n String(entity.metadata.annotations?.[NEWRELIC_GUID_ANNOTATION]),\n );\n return dashboardObject;\n }, [entity.metadata.annotations?.[NEWRELIC_GUID_ANNOTATION]]);\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel title={error.name} defaultExpanded error={error} />;\n }\n return (\n <InfoCard title=\"New Relic Dashboard Pages\" variant=\"gridItem\">\n {value?.getDashboardEntity === undefined &&\n 'Unauthorized Request , please check API Key'}\n {value?.getDashboardEntity !== undefined &&\n value?.getDashboardEntity?.data.actor.entitySearch.results?.entities\n ?.length <= 0 && (\n <>No Dashboard Pages found with the specified Dashboard GUID</>\n )}\n {value?.getDashboardEntity?.data.actor.entitySearch.results.entities?.map(\n (entityResult: ResultEntity, index: number) => {\n return (\n <Box style={{ margin: '10px' }} display=\"flex\" key={index}>\n <Box mr={1} className={classes.svgIcon}>\n <Typography component=\"div\">\n <DesktopMac />\n </Typography>\n </Box>\n <Box flexGrow=\"1\">\n <Link to={entityResult.permalink}>{entityResult.name}</Link>\n </Box>\n </Box>\n );\n },\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,OAAS,EAAA;AAAA,IACP,OAAS,EAAA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AoB,EAAA,IAAA,CAAK,KAAM,CAAA,YAAA,CAAa,QAAQ,QAAU,EAAA,GAAA;AAAA,MACpE,CAAC,cAA4B,KAAkB,KAAA;AAC7C,QACE,uBAAA,IAAA,CAAC,OAAI,KAAO,EAAA,EAAE,QAAQ,MAAO,EAAA,EAAG,SAAQ,MACtC,EAAA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,SAAA,EAAW,OAAQ,CAAA,OAAA,EAC7B,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,KAAA,EACpB,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,GACd,CACF,EAAA,CAAA;AAAA,0BACA,GAAA,CAAC,GAAI,EAAA,EAAA,QAAA,EAAS,GACZ,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,EAAA,EAAI,YAAa,CAAA,SAAA,EAAY,QAAa,EAAA,YAAA,CAAA,IAAA,EAAK,CACvD,EAAA;AAAA,SAAA,EAAA,EARkD,KASpD,CAAA;AAAA;AAEJ;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Box from '@material-ui/core/Box';
|
|
3
3
|
import makeStyles from '@material-ui/core/styles/makeStyles';
|
|
4
4
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
@@ -43,21 +43,21 @@ const DashboardSnapshot = (props) => {
|
|
|
43
43
|
return dashboardObject;
|
|
44
44
|
}, [guid, storageSnapshot.value]);
|
|
45
45
|
if (loading) {
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
47
47
|
}
|
|
48
48
|
if (error) {
|
|
49
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { title: error.name, defaultExpanded: true, error });
|
|
50
50
|
}
|
|
51
51
|
const url = value?.getDashboardSnapshot?.data?.dashboardCreateSnapshotUrl?.replace(
|
|
52
52
|
/\pdf$/i,
|
|
53
53
|
"png"
|
|
54
54
|
);
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
56
|
InfoCard,
|
|
57
57
|
{
|
|
58
58
|
variant: "gridItem",
|
|
59
59
|
title: name,
|
|
60
|
-
action: /* @__PURE__ */
|
|
60
|
+
action: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
61
61
|
Select,
|
|
62
62
|
{
|
|
63
63
|
className: classes.cardSelect,
|
|
@@ -65,24 +65,26 @@ const DashboardSnapshot = (props) => {
|
|
|
65
65
|
value: storageSnapshot.value,
|
|
66
66
|
onChange: (event) => {
|
|
67
67
|
setStorageValue(Number(event.target.value));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 36e5, children: "1 Hour" }),
|
|
71
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 432e5, children: "12 Hours" }),
|
|
72
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 864e5, children: "1 Day" }),
|
|
73
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 2592e5, children: "3 Days" }),
|
|
74
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 6048e5, children: "1 Week" }),
|
|
75
|
+
/* @__PURE__ */ jsx(MenuItem, { value: 2592e6, children: "1 Month" })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) }),
|
|
79
|
+
children: /* @__PURE__ */ jsx(Box, { display: "flex", children: /* @__PURE__ */ jsx(Box, { flexGrow: "1", children: /* @__PURE__ */ jsx(Link, { to: permalink, children: url ? /* @__PURE__ */ jsx(
|
|
80
|
+
"img",
|
|
81
|
+
{
|
|
82
|
+
alt: `${name} Dashboard`,
|
|
83
|
+
className: classes.img,
|
|
84
|
+
src: url
|
|
85
|
+
}
|
|
86
|
+
) : "Dashboard loading... , click here to open if it did not render correctly" }) }) })
|
|
87
|
+
}
|
|
86
88
|
);
|
|
87
89
|
};
|
|
88
90
|
|
package/dist/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardSnapshot.esm.js","sources":["../../../../src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"DashboardSnapshot.esm.js","sources":["../../../../src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { useApi, storageApiRef } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n InfoCard,\n Progress,\n ErrorPanel,\n Link,\n} from '@backstage/core-components';\nimport { newRelicDashboardApiRef } from '../../../api';\nimport { DashboardSnapshotSummary } from '../../../api/NewRelicDashboardApi';\nimport useObservable from 'react-use/esm/useObservable';\n\nconst useStyles = makeStyles(\n theme => ({\n cardSelect: {\n margin: theme.spacing(2, 1, 0, 0),\n },\n img: {\n width: '100%',\n height: 'auto',\n border: `solid 1px ${theme.palette.common.black}`,\n },\n }),\n { name: 'BackstageNewRelicDashboardSnapshot' },\n);\n\n/**\n * @public\n */\nexport const DashboardSnapshot = (props: {\n guid: string;\n name: string;\n permalink: string;\n}) => {\n const classes = useStyles();\n const { guid, name, permalink } = props;\n const newRelicDashboardAPI = useApi(newRelicDashboardApiRef);\n const storageApi = useApi(storageApiRef).forBucket('newrelic-dashboard');\n const setStorageValue = (value: number) => {\n storageApi.set(guid, value);\n };\n const storageSnapshot = useObservable(\n storageApi.observe$<number>(guid),\n storageApi.snapshot(guid),\n );\n\n const { value, loading, error } = useAsync(async (): Promise<\n DashboardSnapshotSummary | undefined\n > => {\n const dashboardObject: Promise<DashboardSnapshotSummary | undefined> =\n newRelicDashboardAPI.getDashboardSnapshot(\n guid,\n storageSnapshot.value || 2592000000,\n );\n return dashboardObject;\n }, [guid, storageSnapshot.value]);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel title={error.name} defaultExpanded error={error} />;\n }\n\n const url =\n value?.getDashboardSnapshot?.data?.dashboardCreateSnapshotUrl?.replace(\n /\\pdf$/i,\n 'png',\n );\n\n return (\n <InfoCard\n variant=\"gridItem\"\n title={name}\n action={\n <div>\n <Select\n className={classes.cardSelect}\n defaultValue={2592000000}\n value={storageSnapshot.value}\n onChange={event => {\n setStorageValue(Number(event.target.value));\n }}\n >\n <MenuItem value={3600000}>1 Hour</MenuItem>\n <MenuItem value={43200000}>12 Hours</MenuItem>\n <MenuItem value={86400000}>1 Day</MenuItem>\n <MenuItem value={259200000}>3 Days</MenuItem>\n <MenuItem value={604800000}>1 Week</MenuItem>\n <MenuItem value={2592000000}>1 Month</MenuItem>\n </Select>\n </div>\n }\n >\n <Box display=\"flex\">\n <Box flexGrow=\"1\">\n <Link to={permalink}>\n {url ? (\n <img\n alt={`${name} Dashboard`}\n className={classes.img}\n src={url}\n />\n ) : (\n 'Dashboard loading... , click here to open if it did not render correctly'\n )}\n </Link>\n </Box>\n </Box>\n </InfoCard>\n );\n};\n"],"names":["value"],"mappings":";;;;;;;;;;;;AAgCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,UAAY,EAAA;AAAA,MACV,QAAQ,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC;AAAA,KAClC;AAAA,IACA,GAAK,EAAA;AAAA,MACH,KAAO,EAAA,MAAA;AAAA,MACP,MAAQ,EAAA,MAAA;AAAA,MACR,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA;AACjD,GACF,CAAA;AAAA,EACA,EAAE,MAAM,oCAAqC;AAC/C,CAAA;AAKa,MAAA,iBAAA,GAAoB,CAAC,KAI5B,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,MAAM,EAAE,IAAA,EAAM,IAAM,EAAA,SAAA,EAAc,GAAA,KAAA;AAClC,EAAM,MAAA,oBAAA,GAAuB,OAAO,uBAAuB,CAAA;AAC3D,EAAA,MAAM,UAAa,GAAA,MAAA,CAAO,aAAa,CAAA,CAAE,UAAU,oBAAoB,CAAA;AACvE,EAAM,MAAA,eAAA,GAAkB,CAACA,M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4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import Tab from '@material-ui/core/Tab';
|
|
3
4
|
import Tabs from '@material-ui/core/Tabs';
|
|
4
5
|
import makeStyles from '@material-ui/core/styles/makeStyles';
|
|
@@ -21,7 +22,7 @@ const tabPanelStyles = makeStyles(
|
|
|
21
22
|
function TabPanel(props) {
|
|
22
23
|
const { children, value1, index, ...other } = props;
|
|
23
24
|
const classes = tabPanelStyles(tabPanelStyles);
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
25
26
|
"div",
|
|
26
27
|
{
|
|
27
28
|
className: classes.tabPanel,
|
|
@@ -29,9 +30,9 @@ function TabPanel(props) {
|
|
|
29
30
|
hidden: value1 !== index,
|
|
30
31
|
id: `simple-tabpanel-${index}`,
|
|
31
32
|
"aria-labelledby": `simple-tab-${index}`,
|
|
32
|
-
...other
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
...other,
|
|
34
|
+
children
|
|
35
|
+
}
|
|
35
36
|
);
|
|
36
37
|
}
|
|
37
38
|
function a11yProps(index) {
|
|
@@ -79,51 +80,54 @@ const DashboardSnapshotList = (props) => {
|
|
|
79
80
|
setValue1(newValue);
|
|
80
81
|
};
|
|
81
82
|
if (loading) {
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
83
84
|
}
|
|
84
85
|
if (error) {
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { title: error.name, defaultExpanded: true, error });
|
|
86
87
|
}
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Tabs,
|
|
91
|
+
{
|
|
92
|
+
selectionFollowsFocus: true,
|
|
93
|
+
indicatorColor: "primary",
|
|
94
|
+
textColor: "inherit",
|
|
95
|
+
variant: "scrollable",
|
|
96
|
+
scrollButtons: "auto",
|
|
97
|
+
"aria-label": "scrollable auto tabs example",
|
|
98
|
+
onChange: handleChange,
|
|
99
|
+
value: value1,
|
|
100
|
+
children: value?.getDashboardEntity?.data?.actor.entitySearch.results.entities?.map(
|
|
101
|
+
(Entity, index) => {
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
Tab,
|
|
104
|
+
{
|
|
105
|
+
label: Entity.name,
|
|
106
|
+
className: styles.defaultTab,
|
|
107
|
+
classes: {
|
|
108
|
+
selected: styles.selected,
|
|
109
|
+
root: styles.tabRoot
|
|
110
|
+
},
|
|
111
|
+
...a11yProps(index)
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
),
|
|
99
118
|
value?.getDashboardEntity?.data?.actor.entitySearch.results.entities?.map(
|
|
100
119
|
(Entity, index) => {
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
|
|
120
|
+
return /* @__PURE__ */ jsx(TabPanel, { value1, index, children: /* @__PURE__ */ jsx(
|
|
121
|
+
DashboardSnapshot,
|
|
103
122
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
selected: styles.selected,
|
|
108
|
-
root: styles.tabRoot
|
|
109
|
-
},
|
|
110
|
-
...a11yProps(index)
|
|
123
|
+
name: Entity.name,
|
|
124
|
+
permalink: Entity.permalink,
|
|
125
|
+
guid: Entity.guid
|
|
111
126
|
}
|
|
112
|
-
);
|
|
127
|
+
) });
|
|
113
128
|
}
|
|
114
129
|
)
|
|
115
|
-
)
|
|
116
|
-
(Entity, index) => {
|
|
117
|
-
return /* @__PURE__ */ React.createElement(TabPanel, { value1, index }, /* @__PURE__ */ React.createElement(
|
|
118
|
-
DashboardSnapshot,
|
|
119
|
-
{
|
|
120
|
-
name: Entity.name,
|
|
121
|
-
permalink: Entity.permalink,
|
|
122
|
-
guid: Entity.guid
|
|
123
|
-
}
|
|
124
|
-
));
|
|
125
|
-
}
|
|
126
|
-
));
|
|
130
|
+
] });
|
|
127
131
|
};
|
|
128
132
|
|
|
129
133
|
export { DashboardSnapshotList };
|
package/dist/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardSnapshotList.esm.js","sources":["../../../../src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"DashboardSnapshotList.esm.js","sources":["../../../../src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { ReactNode, ChangeEvent } from 'react';\n\nimport { useState } from 'react';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport Box from '@material-ui/core/Box';\nimport { newRelicDashboardApiRef } from '../../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Progress, ErrorPanel } from '@backstage/core-components';\nimport { DashboardSnapshot } from './DashboardSnapshot';\nimport { DashboardEntitySummary } from '../../../api/NewRelicDashboardApi';\nimport { ResultEntity } from '../../../types/DashboardEntity';\n\ninterface TabPanelProps {\n children?: ReactNode;\n index: number;\n value1: number;\n}\n\nconst tabPanelStyles = makeStyles(\n theme => ({\n tabPanel: {\n marginTop: theme.spacing(0.5),\n },\n }),\n { name: 'BackstageNewRelicDashboardTabPanel' },\n);\n\nfunction TabPanel(props: TabPanelProps) {\n const { children, value1, index, ...other } = props;\n const classes = tabPanelStyles(tabPanelStyles);\n\n return (\n <div\n className={classes.tabPanel}\n role=\"tabpanel\"\n hidden={value1 !== index}\n id={`simple-tabpanel-${index}`}\n aria-labelledby={`simple-tab-${index}`}\n {...other}\n >\n {children}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `simple-tab-${index}`,\n 'aria-controls': `simple-tabpanel-${index}`,\n };\n}\n\nconst useStyles = makeStyles(\n theme => ({\n tabsWrapper: {\n gridArea: 'pageSubheader',\n backgroundColor: theme.palette.background.paper,\n paddingLeft: theme.spacing(3),\n },\n defaultTab: {\n padding: theme.spacing(3, 3),\n ...theme.typography.caption,\n textTransform: 'uppercase',\n fontWeight: 'bold',\n color: theme.palette.text.secondary,\n },\n selected: {\n color: theme.palette.text.primary,\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n color: theme.palette.text.primary,\n },\n },\n }),\n { name: 'DashboardHeaderTabs' },\n);\n\nexport const DashboardSnapshotList = (props: { guid: string }) => {\n const { guid } = props;\n const styles = useStyles();\n const newRelicDashboardAPI = useApi(newRelicDashboardApiRef);\n const { value, loading, error } = useAsync(async (): Promise<\n DashboardEntitySummary | undefined\n > => {\n const dashboardObject: Promise<DashboardEntitySummary | undefined> =\n newRelicDashboardAPI.getDashboardEntity(guid);\n return dashboardObject;\n }, [guid]);\n const [value1, setValue1] = useState<number>(0);\n const handleChange = ({}: ChangeEvent<{}>, newValue: number) => {\n setValue1(newValue);\n };\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel title={error.name} defaultExpanded error={error} />;\n }\n return (\n <Box>\n <Tabs\n selectionFollowsFocus\n indicatorColor=\"primary\"\n textColor=\"inherit\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label=\"scrollable auto tabs example\"\n onChange={handleChange}\n value={value1}\n >\n {value?.getDashboardEntity?.data?.actor.entitySearch.results.entities?.map(\n (Entity: ResultEntity, index: number) => {\n return (\n <Tab\n label={Entity.name}\n className={styles.defaultTab}\n classes={{\n selected: styles.selected,\n root: styles.tabRoot,\n }}\n {...a11yProps(index)}\n />\n );\n },\n )}\n </Tabs>\n {value?.getDashboardEntity?.data?.actor.entitySearch.results.entities?.map(\n (Entity: ResultEntity, index: number) => {\n return (\n <TabPanel value1={value1} index={index}>\n <DashboardSnapshot\n name={Entity.name}\n permalink={Entity.permalink}\n guid={Entity.guid}\n />\n </TabPanel>\n );\n },\n )}\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoCA,MAAM,cAAiB,GAAA,UAAA;AAAA,EACrB,CAAU,KAAA,MAAA;AAAA,IACR,QAAU,EAAA;AAAA,MACR,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,GAAG;AAAA;AAC9B,GACF,CAAA;AAAA,EACA,EAAE,MAAM,oCAAqC;AAC/C,CAAA;AAEA,SAAS,SAAS,KAAsB,EAAA;AACtC,EAAA,MAAM,EAAE,QAAU,EAAA,MAAA,EAAQ,KAAO,EAAA,GAAG,OAAU,GAAA,KAAA;AAC9C,EAAM,MAAA,OA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U,EAAA,YAAA;AAAA,QACV,KAAO,EAAA,MAAA;AAAA,QAEN,iBAAO,kBAAoB,EAAA,IAAA,EAAM,KAAM,CAAA,YAAA,CAAa,QAAQ,QAAU,EAAA,GAAA;AAAA,UACrE,CAAC,QAAsB,KAAkB,KAAA;AACvC,YACE,uBAAA,GAAA;AAAA,cAAC,GAAA;AAAA,cAAA;AAAA,gBACC,OAAO,MAAO,CAAA,IAAA;AAAA,gBACd,WAAW,MAAO,CAAA,UAAA;AAAA,gBAClB,OAAS,EAAA;AAAA,kBACP,UAAU,MAAO,CAAA,QAAA;AAAA,kBACjB,MAAM,MAAO,CAAA;AAAA,iBACf;AAAA,gBACC,GAAG,UAAU,KAAK;AAAA;AAAA,aACrB;AAAA;AAEJ;AACF;AAAA,KACF;AAAA,IACC,OAAO,kBAAoB,EAAA,IAAA,EAAM,KAAM,CAAA,YAAA,CAAa,QAAQ,QAAU,EAAA,GAAA;AAAA,MACrE,CAAC,QAAsB,KAAkB,KAAA;AACvC,QACE,uBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,MAAA,EAAgB,KACxB,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,iBAAA;AAAA,UAAA;AAAA,YACC,MAAM,MAAO,CAAA,IAAA;AAAA,YACb,WAAW,MAAO,CAAA,SAAA;AAAA,YAClB,MAAM,MAAO,CAAA;AAAA;AAAA,SAEjB,EAAA,CAAA;AAAA;AAEJ;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import { Page, Content } from '@backstage/core-components';
|
|
4
4
|
import { DashboardEntityList } from './DashboardEntityList.esm.js';
|
|
@@ -9,14 +9,17 @@ import { NEWRELIC_GUID_ANNOTATION } from '../../constants.esm.js';
|
|
|
9
9
|
|
|
10
10
|
const NewRelicDashboard = () => {
|
|
11
11
|
const { entity } = useEntity();
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
return /* @__PURE__ */ jsx(Page, { themeId: "home", children: /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 6, direction: "row", alignItems: "stretch", children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DashboardEntityList, {}) }),
|
|
14
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
15
|
+
DashboardSnapshotList,
|
|
16
|
+
{
|
|
17
|
+
guid: String(
|
|
18
|
+
entity.metadata.annotations?.[NEWRELIC_GUID_ANNOTATION]
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
) })
|
|
22
|
+
] }) }) });
|
|
20
23
|
};
|
|
21
24
|
|
|
22
25
|
export { NewRelicDashboard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewRelicDashboard.esm.js","sources":["../../../src/components/NewRelicDashboard/NewRelicDashboard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"NewRelicDashboard.esm.js","sources":["../../../src/components/NewRelicDashboard/NewRelicDashboard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Grid from '@material-ui/core/Grid';\nimport { Page, Content } from '@backstage/core-components';\nimport { DashboardEntityList } from './DashboardEntityList';\nimport { DashboardSnapshotList } from './DashboardSnapshotList';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { NEWRELIC_GUID_ANNOTATION } from '../../constants';\n\nexport const NewRelicDashboard = () => {\n const { entity } = useEntity();\n return (\n <Page themeId=\"home\">\n <Content>\n <Grid container spacing={6} direction=\"row\" alignItems=\"stretch\">\n <Grid item xs={12}>\n <DashboardEntityList />\n </Grid>\n <Grid item xs={12}>\n <DashboardSnapshotList\n guid={String(\n entity.metadata.annotations?.[NEWRELIC_GUID_ANNOTATION],\n )}\n />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAsBO,MAAM,oBAAoB,MAAM;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAA,uBACG,GAAA,CAAA,IAAA,EAAA,EAAK,OAAQ,EAAA,MAAA,EACZ,8BAAC,OACC,EAAA,EAAA,QAAA,kBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,SAAA,EAAS,MAAC,OAAS,EAAA,CAAA,EAAG,SAAU,EAAA,KAAA,EAAM,YAAW,SACrD,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA,CAAC,uBAAoB,CACvB,EAAA,CAAA;AAAA,oBACC,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,qBAAA;AAAA,MAAA;AAAA,QACC,IAAM,EAAA,MAAA;AAAA,UACJ,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,wBAAwB;AAAA;AACxD;AAAA,KAEJ,EAAA;AAAA,GAAA,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as react from 'react';
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
4
3
|
import { Entity } from '@backstage/catalog-model';
|
|
5
4
|
|
|
@@ -8,9 +7,9 @@ declare const newRelicDashboardPlugin: _backstage_core_plugin_api.BackstagePlugi
|
|
|
8
7
|
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
9
8
|
}, {}, {}>;
|
|
10
9
|
/** @public */
|
|
11
|
-
declare const EntityNewRelicDashboardContent: () =>
|
|
10
|
+
declare const EntityNewRelicDashboardContent: () => react_jsx_runtime.JSX.Element;
|
|
12
11
|
/** @public */
|
|
13
|
-
declare const EntityNewRelicDashboardCard: () =>
|
|
12
|
+
declare const EntityNewRelicDashboardCard: () => react_jsx_runtime.JSX.Element;
|
|
14
13
|
/**
|
|
15
14
|
* Render dashboard snapshots from Newrelic in backstage. Use dashboards which have the tag `isDashboardPage: true`
|
|
16
15
|
*
|
|
@@ -23,7 +22,7 @@ declare const DashboardSnapshot: (props: {
|
|
|
23
22
|
guid: string;
|
|
24
23
|
name: string;
|
|
25
24
|
permalink: string;
|
|
26
|
-
}) =>
|
|
25
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
27
26
|
/**
|
|
28
27
|
* Render dashboard snapshots from Newrelic in backstage. Use dashboards which have the tag `isDashboardPage: true`
|
|
29
28
|
*
|
|
@@ -36,7 +35,7 @@ declare const DashboardSnapshotComponent: (props: {
|
|
|
36
35
|
guid: string;
|
|
37
36
|
name: string;
|
|
38
37
|
permalink: string;
|
|
39
|
-
}) =>
|
|
38
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
40
39
|
/**
|
|
41
40
|
* Render a dashboard snapshots list from Newrelic in backstage. Use dashboards which have the tag `isDashboardPage: true`
|
|
42
41
|
*
|
|
@@ -47,7 +46,7 @@ declare const DashboardSnapshotComponent: (props: {
|
|
|
47
46
|
*/
|
|
48
47
|
declare const DashboardSnapshotList: (props: {
|
|
49
48
|
guid: string;
|
|
50
|
-
}) =>
|
|
49
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
51
50
|
|
|
52
51
|
/** @public */
|
|
53
52
|
declare const isNewRelicDashboardAvailable: (entity: Entity) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-newrelic-dashboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "newrelic-dashboard",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@backstage/catalog-model": "^1.7.3",
|
|
40
|
-
"@backstage/core-components": "^0.17.
|
|
41
|
-
"@backstage/core-plugin-api": "^1.10.
|
|
40
|
+
"@backstage/core-components": "^0.17.1",
|
|
41
|
+
"@backstage/core-plugin-api": "^1.10.6",
|
|
42
42
|
"@backstage/errors": "^1.2.7",
|
|
43
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
43
|
+
"@backstage/plugin-catalog-react": "^1.17.0",
|
|
44
44
|
"@material-ui/core": "^4.12.2",
|
|
45
45
|
"@material-ui/icons": "^4.9.1",
|
|
46
46
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
47
47
|
"react-use": "^17.2.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@backstage/cli": "^0.
|
|
51
|
-
"@backstage/dev-utils": "^1.1.
|
|
52
|
-
"@backstage/test-utils": "^1.7.
|
|
50
|
+
"@backstage/cli": "^0.32.0",
|
|
51
|
+
"@backstage/dev-utils": "^1.1.9",
|
|
52
|
+
"@backstage/test-utils": "^1.7.7",
|
|
53
53
|
"@testing-library/dom": "^10.0.0",
|
|
54
54
|
"@testing-library/jest-dom": "^6.0.0",
|
|
55
55
|
"@testing-library/react": "^15.0.0",
|
|
@@ -63,5 +63,12 @@
|
|
|
63
63
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
64
64
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
65
65
|
},
|
|
66
|
+
"typesVersions": {
|
|
67
|
+
"*": {
|
|
68
|
+
"package.json": [
|
|
69
|
+
"package.json"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
66
73
|
"module": "./dist/index.esm.js"
|
|
67
74
|
}
|