@backstage-community/plugin-opencost 0.6.0 → 0.7.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 (29) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/AllocationChart/RangeChart.esm.js +39 -34
  3. package/dist/components/AllocationChart/RangeChart.esm.js.map +1 -1
  4. package/dist/components/AllocationChart/SummaryChart.esm.js +12 -12
  5. package/dist/components/AllocationChart/SummaryChart.esm.js.map +1 -1
  6. package/dist/components/AllocationChart/index.esm.js +6 -5
  7. package/dist/components/AllocationChart/index.esm.js.map +1 -1
  8. package/dist/components/AllocationReport.esm.js +96 -64
  9. package/dist/components/AllocationReport.esm.js.map +1 -1
  10. package/dist/components/Controls/Download.esm.js +4 -3
  11. package/dist/components/Controls/Download.esm.js.map +1 -1
  12. package/dist/components/Controls/Edit.esm.js +50 -35
  13. package/dist/components/Controls/Edit.esm.js.map +1 -1
  14. package/dist/components/Controls/index.esm.js +23 -19
  15. package/dist/components/Controls/index.esm.js.map +1 -1
  16. package/dist/components/OpenCostPage/OpenCostPage.esm.js +12 -9
  17. package/dist/components/OpenCostPage/OpenCostPage.esm.js.map +1 -1
  18. package/dist/components/OpenCostReport/OpenCostReport.esm.js +63 -48
  19. package/dist/components/OpenCostReport/OpenCostReport.esm.js.map +1 -1
  20. package/dist/components/Page.esm.js +2 -2
  21. package/dist/components/Page.esm.js.map +1 -1
  22. package/dist/components/SelectWindow.esm.js +103 -90
  23. package/dist/components/SelectWindow.esm.js.map +1 -1
  24. package/dist/components/Subtitle.esm.js +13 -8
  25. package/dist/components/Subtitle.esm.js.map +1 -1
  26. package/dist/components/Warnings.esm.js +5 -2
  27. package/dist/components/Warnings.esm.js.map +1 -1
  28. package/dist/index.d.ts +2 -3
  29. package/package.json +12 -6
@@ -1 +1 @@
1
- {"version":3,"file":"Download.esm.js","sources":["../../../src/components/Controls/Download.jsx"],"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 { get, forEach, reverse, round, sortBy } from 'lodash';\nimport ExportIcon from '@material-ui/icons/GetApp';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nconst columns = [\n {\n head: 'Name',\n prop: 'name',\n currency: false,\n },\n {\n head: 'CPU',\n prop: 'cpuCost',\n currency: true,\n },\n {\n head: 'GPU',\n prop: 'gpuCost',\n currency: true,\n },\n {\n head: 'RAM',\n prop: 'ramCost',\n currency: true,\n },\n {\n head: 'PV',\n prop: 'pvCost',\n currency: true,\n },\n {\n head: 'Network',\n prop: 'networkCost',\n currency: true,\n },\n {\n head: 'Shared',\n prop: 'sharedCost',\n currency: true,\n },\n {\n head: 'Total',\n prop: 'totalCost',\n currency: true,\n },\n];\n\nconst toCSVLine = datum => {\n const cols = [];\n\n forEach(columns, c => {\n if (c.currency) {\n cols.push(round(get(datum, c.prop, 0.0), 2));\n } else {\n cols.push(`\"${get(datum, c.prop, '')}\"`);\n }\n });\n\n return cols.join(',');\n};\n\nconst DownloadControl = ({ cumulativeData, title }) => {\n // downloadReport downloads a CSV of the cumulative allocation data\n function downloadReport() {\n // Build CSV\n const head = columns.map(c => c.head).join(',');\n const body = reverse(sortBy(cumulativeData, 'totalCost'))\n .map(toCSVLine)\n .join('\\r\\n');\n const csv = `${head}\\r\\n${body}`;\n\n // Create download link\n const a = document.createElement('a');\n a.href = URL.createObjectURL(new Blob([csv], { type: 'text/csv' }));\n const filename = title.toLocaleLowerCase('en-US').replace(/\\s/gi, '-');\n a.setAttribute('download', `${filename}-${Date.now()}.csv`);\n\n // Click the link\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n\n return (\n <Tooltip title=\"Download CSV\">\n <IconButton onClick={downloadReport}>\n <ExportIcon />\n </IconButton>\n </Tooltip>\n );\n};\n\nexport default React.memo(DownloadControl);\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,OAAU,GAAA;AAAA,EACd;AAAA,IACE,IAAM,EAAA,MAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,KAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,KAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,KAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,IAAA;AAAA,IACN,IAAM,EAAA,QAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,SAAA;AAAA,IACN,IAAM,EAAA,aAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,QAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,OAAA;AAAA,IACN,IAAM,EAAA,WAAA;AAAA,IACN,QAAU,EAAA;AAAA;AAEd,CAAA;AAEA,MAAM,YAAY,CAAS,KAAA,KAAA;AACzB,EAAA,MAAM,OAAO,EAAC;AAEd,EAAA,OAAA,CAAQ,SAAS,CAAK,CAAA,KAAA;AACpB,IAAA,IAAI,EAAE,QAAU,EAAA;AACd,MAA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AC,CAAA;AAC3B,IAAA,CAAA,CAAE,KAAM,EAAA;AACR,IAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA;AAAA;AAG7B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,KAAA,EAAM,cACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAS,cACnB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,IAAA,CACd,CACF,CAAA;AAEJ,CAAA;AAEA,wBAAe,KAAA,CAAM,KAAK,eAAe,CAAA;;;;"}
1
+ {"version":3,"file":"Download.esm.js","sources":["../../../src/components/Controls/Download.jsx"],"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 { memo } from 'react';\nimport { get, forEach, reverse, round, sortBy } from 'lodash';\nimport ExportIcon from '@material-ui/icons/GetApp';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nconst columns = [\n {\n head: 'Name',\n prop: 'name',\n currency: false,\n },\n {\n head: 'CPU',\n prop: 'cpuCost',\n currency: true,\n },\n {\n head: 'GPU',\n prop: 'gpuCost',\n currency: true,\n },\n {\n head: 'RAM',\n prop: 'ramCost',\n currency: true,\n },\n {\n head: 'PV',\n prop: 'pvCost',\n currency: true,\n },\n {\n head: 'Network',\n prop: 'networkCost',\n currency: true,\n },\n {\n head: 'Shared',\n prop: 'sharedCost',\n currency: true,\n },\n {\n head: 'Total',\n prop: 'totalCost',\n currency: true,\n },\n];\n\nconst toCSVLine = datum => {\n const cols = [];\n\n forEach(columns, c => {\n if (c.currency) {\n cols.push(round(get(datum, c.prop, 0.0), 2));\n } else {\n cols.push(`\"${get(datum, c.prop, '')}\"`);\n }\n });\n\n return cols.join(',');\n};\n\nconst DownloadControl = ({ cumulativeData, title }) => {\n // downloadReport downloads a CSV of the cumulative allocation data\n function downloadReport() {\n // Build CSV\n const head = columns.map(c => c.head).join(',');\n const body = reverse(sortBy(cumulativeData, 'totalCost'))\n .map(toCSVLine)\n .join('\\r\\n');\n const csv = `${head}\\r\\n${body}`;\n\n // Create download link\n const a = document.createElement('a');\n a.href = URL.createObjectURL(new Blob([csv], { type: 'text/csv' }));\n const filename = title.toLocaleLowerCase('en-US').replace(/\\s/gi, '-');\n a.setAttribute('download', `${filename}-${Date.now()}.csv`);\n\n // Click the link\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n\n return (\n <Tooltip title=\"Download CSV\">\n <IconButton onClick={downloadReport}>\n <ExportIcon />\n </IconButton>\n </Tooltip>\n );\n};\n\nexport default memo(DownloadControl);\n"],"names":[],"mappings":";;;;;;;AAqBA,MAAM,OAAU,GAAA;AAAA,EACd;AAAA,IACE,IAAM,EAAA,MAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,KAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,KAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,KAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACZ;AAAA,EACA;AAAA,IACE,IAAM,EAAA,IAAA;AAAA,IACN,IAAM,EAAA,QAAA;AAAA,IACN,QAAU,EAAA;AAAA,GAC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AAA;AAG9B,IAAM,MAAA,CAAA,GAAI,QAAS,CAAA,aAAA,CAAc,GAAG,CAAA;AACpC,IAAA,CAAA,CAAE,IAAO,GAAA,GAAA,CAAI,eAAgB,CAAA,IAAI,IAAK,CAAA,CAAC,GAAG,CAAA,EAAG,EAAE,IAAA,EAAM,UAAW,EAAC,CAAC,CAAA;AAClE,IAAA,MAAM,WAAW,KAAM,CAAA,iBAAA,CAAkB,OAAO,CAAE,CAAA,OAAA,CAAQ,QAAQ,GAAG,CAAA;AACrE,IAAE,CAAA,CAAA,YAAA,CAAa,YAAY,CAAG,EAAA,QAAQ,IAAI,IAAK,CAAA,GAAA,EAAK,CAAM,IAAA,CAAA,CAAA;AAG1D,IAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA;AAC3B,IAAA,CAAA,CAAE,KAAM,EAAA;AACR,IAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA;AAAA;AAG7B,EACE,uBAAA,GAAA,CAAC,OAAQ,EAAA,EAAA,KAAA,EAAM,cACb,EAAA,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAS,cACnB,EAAA,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,CAAA,EACd,CACF,EAAA,CAAA;AAEJ,CAAA;AAEA,wBAAe,KAAK,eAAe,CAAA;;;;"}
@@ -1,9 +1,10 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { makeStyles } from '@material-ui/core/styles';
2
3
  import FormControl from '@material-ui/core/FormControl';
3
4
  import InputLabel from '@material-ui/core/InputLabel';
4
5
  import MenuItem from '@material-ui/core/MenuItem';
5
6
  import Select from '@material-ui/core/Select';
6
- import React from 'react';
7
+ import { memo } from 'react';
7
8
  import SelectWindow from '../SelectWindow.esm.js';
8
9
 
9
10
  const useStyles = makeStyles({
@@ -30,42 +31,56 @@ function EditControl({
30
31
  setCurrency
31
32
  }) {
32
33
  const classes = useStyles();
33
- return /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement(
34
- SelectWindow,
35
- {
36
- windowOptions,
37
- window,
38
- setWindow
39
- }
40
- ), /* @__PURE__ */ React.createElement(FormControl, { className: classes.formControl }, /* @__PURE__ */ React.createElement(InputLabel, { id: "aggregation-select-label" }, "Breakdown"), /* @__PURE__ */ React.createElement(
41
- Select,
42
- {
43
- id: "aggregation-select",
44
- value: aggregateBy,
45
- onChange: (e) => {
46
- setAggregateBy(e.target.value);
34
+ return /* @__PURE__ */ jsxs("div", { className: classes.wrapper, children: [
35
+ /* @__PURE__ */ jsx(
36
+ SelectWindow,
37
+ {
38
+ windowOptions,
39
+ window,
40
+ setWindow
47
41
  }
48
- },
49
- aggregationOptions.map((opt) => /* @__PURE__ */ React.createElement(MenuItem, { key: opt.value, value: opt.value }, opt.name))
50
- )), /* @__PURE__ */ React.createElement(FormControl, { className: classes.formControl }, /* @__PURE__ */ React.createElement(InputLabel, { id: "accumulate-label" }, "Resolution"), /* @__PURE__ */ React.createElement(
51
- Select,
52
- {
53
- id: "accumulate",
54
- value: accumulate,
55
- onChange: (e) => setAccumulate(e.target.value)
56
- },
57
- accumulateOptions.map((opt) => /* @__PURE__ */ React.createElement(MenuItem, { key: opt.value, value: opt.value }, opt.name))
58
- )), /* @__PURE__ */ React.createElement(FormControl, { className: classes.formControl }, /* @__PURE__ */ React.createElement(InputLabel, { id: "currency-label" }, "Currency"), /* @__PURE__ */ React.createElement(
59
- Select,
60
- {
61
- id: "currency",
62
- value: currency,
63
- onChange: (e) => setCurrency(e.target.value)
64
- },
65
- currencyOptions?.map((currencyVal) => /* @__PURE__ */ React.createElement(MenuItem, { key: currencyVal, value: currencyVal }, currencyVal))
66
- )));
42
+ ),
43
+ /* @__PURE__ */ jsxs(FormControl, { className: classes.formControl, children: [
44
+ /* @__PURE__ */ jsx(InputLabel, { id: "aggregation-select-label", children: "Breakdown" }),
45
+ /* @__PURE__ */ jsx(
46
+ Select,
47
+ {
48
+ id: "aggregation-select",
49
+ value: aggregateBy,
50
+ onChange: (e) => {
51
+ setAggregateBy(e.target.value);
52
+ },
53
+ children: aggregationOptions.map((opt) => /* @__PURE__ */ jsx(MenuItem, { value: opt.value, children: opt.name }, opt.value))
54
+ }
55
+ )
56
+ ] }),
57
+ /* @__PURE__ */ jsxs(FormControl, { className: classes.formControl, children: [
58
+ /* @__PURE__ */ jsx(InputLabel, { id: "accumulate-label", children: "Resolution" }),
59
+ /* @__PURE__ */ jsx(
60
+ Select,
61
+ {
62
+ id: "accumulate",
63
+ value: accumulate,
64
+ onChange: (e) => setAccumulate(e.target.value),
65
+ children: accumulateOptions.map((opt) => /* @__PURE__ */ jsx(MenuItem, { value: opt.value, children: opt.name }, opt.value))
66
+ }
67
+ )
68
+ ] }),
69
+ /* @__PURE__ */ jsxs(FormControl, { className: classes.formControl, children: [
70
+ /* @__PURE__ */ jsx(InputLabel, { id: "currency-label", children: "Currency" }),
71
+ /* @__PURE__ */ jsx(
72
+ Select,
73
+ {
74
+ id: "currency",
75
+ value: currency,
76
+ onChange: (e) => setCurrency(e.target.value),
77
+ children: currencyOptions?.map((currencyVal) => /* @__PURE__ */ jsx(MenuItem, { value: currencyVal, children: currencyVal }, currencyVal))
78
+ }
79
+ )
80
+ ] })
81
+ ] });
67
82
  }
68
- var EditControl$1 = React.memo(EditControl);
83
+ var EditControl$1 = memo(EditControl);
69
84
 
70
85
  export { EditControl$1 as default };
71
86
  //# sourceMappingURL=Edit.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.esm.js","sources":["../../../src/components/Controls/Edit.jsx"],"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 { makeStyles } from '@material-ui/core/styles';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\n\nimport React from 'react';\n\nimport SelectWindow from '../SelectWindow';\n\nconst useStyles = makeStyles({\n wrapper: {\n display: 'inline-flex',\n },\n formControl: {\n margin: 8,\n minWidth: 120,\n },\n});\n\nfunction EditControl({\n windowOptions,\n window,\n setWindow,\n aggregationOptions,\n aggregateBy,\n setAggregateBy,\n accumulateOptions,\n accumulate,\n setAccumulate,\n currencyOptions,\n currency,\n setCurrency,\n}) {\n const classes = useStyles();\n return (\n <div className={classes.wrapper}>\n <SelectWindow\n windowOptions={windowOptions}\n window={window}\n setWindow={setWindow}\n />\n <FormControl className={classes.formControl}>\n <InputLabel id=\"aggregation-select-label\">Breakdown</InputLabel>\n <Select\n id=\"aggregation-select\"\n value={aggregateBy}\n onChange={e => {\n setAggregateBy(e.target.value);\n }}\n >\n {aggregationOptions.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl className={classes.formControl}>\n <InputLabel id=\"accumulate-label\">Resolution</InputLabel>\n <Select\n id=\"accumulate\"\n value={accumulate}\n onChange={e => setAccumulate(e.target.value)}\n >\n {accumulateOptions.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl className={classes.formControl}>\n <InputLabel id=\"currency-label\">Currency</InputLabel>\n <Select\n id=\"currency\"\n value={currency}\n onChange={e => setCurrency(e.target.value)}\n >\n {currencyOptions?.map(currencyVal => (\n <MenuItem key={currencyVal} value={currencyVal}>\n {currencyVal}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </div>\n );\n}\n\nexport default React.memo(EditControl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,CACD;AAAA,GAEL,CACF,CAAA;AAEJ;AAEA,oBAAe,KAAA,CAAM,KAAK,WAAW,CAAA;;;;"}
1
+ {"version":3,"file":"Edit.esm.js","sources":["../../../src/components/Controls/Edit.jsx"],"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 { makeStyles } from '@material-ui/core/styles';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\n\nimport { memo } from 'react';\n\nimport SelectWindow from '../SelectWindow';\n\nconst useStyles = makeStyles({\n wrapper: {\n display: 'inline-flex',\n },\n formControl: {\n margin: 8,\n minWidth: 120,\n },\n});\n\nfunction EditControl({\n windowOptions,\n window,\n setWindow,\n aggregationOptions,\n aggregateBy,\n setAggregateBy,\n accumulateOptions,\n accumulate,\n setAccumulate,\n currencyOptions,\n currency,\n setCurrency,\n}) {\n const classes = useStyles();\n return (\n <div className={classes.wrapper}>\n <SelectWindow\n windowOptions={windowOptions}\n window={window}\n setWindow={setWindow}\n />\n <FormControl className={classes.formControl}>\n <InputLabel id=\"aggregation-select-label\">Breakdown</InputLabel>\n <Select\n id=\"aggregation-select\"\n value={aggregateBy}\n onChange={e => {\n setAggregateBy(e.target.value);\n }}\n >\n {aggregationOptions.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl className={classes.formControl}>\n <InputLabel id=\"accumulate-label\">Resolution</InputLabel>\n <Select\n id=\"accumulate\"\n value={accumulate}\n onChange={e => setAccumulate(e.target.value)}\n >\n {accumulateOptions.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl className={classes.formControl}>\n <InputLabel id=\"currency-label\">Currency</InputLabel>\n <Select\n id=\"currency\"\n value={currency}\n onChange={e => setCurrency(e.target.value)}\n >\n {currencyOptions?.map(currencyVal => (\n <MenuItem key={currencyVal} value={currencyVal}>\n {currencyVal}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </div>\n );\n}\n\nexport default memo(EditControl);\n"],"names":[],"mappings":";;;;;;;;;AAyBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,OAAS,EAAA;AAAA,IACP,OAAS,EAAA;AAAA,GACX;AAAA,EACA,WAAa,EAAA;AAAA,IACX,MAAQ,EAAA,CAAA;AAAA,IACR,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAED,SAAS,WAAY,CAAA;AAAA,EACnB,aAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,uBACG,IAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,OACtB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,aAAA;AAAA,QACA,MAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,oBACC,IAAA,CAAA,WAAA,EAAA,EAAY,SAAW,EAAA,OAAA,CAAQ,WAC9B,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,EAAG,EAAA,0BAA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EAAA,EAAW,EAAG,EAAA,gBAAA,EAAiB,QAAQ,EAAA,UAAA,EAAA,CAAA;AAAA,sBACxC,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,EAAG,EAAA,UAAA;AAAA,UACH,KAAO,EAAA,QAAA;AAAA,UACP,QAAU,EAAA,CAAA,CAAA,KAAK,WAAY,CAAA,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,UAExC,QAAA,EAAA,eAAA,EAAiB,IAAI,CACpB,WAAA,qBAAA,GAAA,CAAC,YAA2B,KAAO,EAAA,WAAA,EAChC,QADY,EAAA,WAAA,EAAA,EAAA,WAEf,CACD;AAAA;AAAA;AACH,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;AAEA,oBAAe,KAAK,WAAW,CAAA;;;;"}
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { memo } from 'react';
2
3
  import DownloadControl from './Download.esm.js';
3
4
  import EditControl from './Edit.esm.js';
4
5
 
@@ -18,25 +19,28 @@ const Controls = ({
18
19
  currencyOptions,
19
20
  setCurrency
20
21
  }) => {
21
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
22
- EditControl,
23
- {
24
- windowOptions,
25
- window,
26
- setWindow,
27
- aggregationOptions,
28
- aggregateBy,
29
- setAggregateBy,
30
- accumulateOptions,
31
- accumulate,
32
- setAccumulate,
33
- currency,
34
- currencyOptions,
35
- setCurrency
36
- }
37
- ), /* @__PURE__ */ React.createElement(DownloadControl, { cumulativeData, title }));
22
+ return /* @__PURE__ */ jsxs("div", { children: [
23
+ /* @__PURE__ */ jsx(
24
+ EditControl,
25
+ {
26
+ windowOptions,
27
+ window,
28
+ setWindow,
29
+ aggregationOptions,
30
+ aggregateBy,
31
+ setAggregateBy,
32
+ accumulateOptions,
33
+ accumulate,
34
+ setAccumulate,
35
+ currency,
36
+ currencyOptions,
37
+ setCurrency
38
+ }
39
+ ),
40
+ /* @__PURE__ */ jsx(DownloadControl, { cumulativeData, title })
41
+ ] });
38
42
  };
39
- var Controls$1 = React.memo(Controls);
43
+ var Controls$1 = memo(Controls);
40
44
 
41
45
  export { Controls$1 as default };
42
46
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/components/Controls/index.jsx"],"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 DownloadControl from './Download';\nimport EditControl from './Edit';\n\nconst Controls = ({\n windowOptions,\n window,\n setWindow,\n aggregationOptions,\n aggregateBy,\n setAggregateBy,\n accumulateOptions,\n accumulate,\n setAccumulate,\n title,\n cumulativeData,\n currency,\n currencyOptions,\n setCurrency,\n}) => {\n return (\n <div>\n <EditControl\n windowOptions={windowOptions}\n window={window}\n setWindow={setWindow}\n aggregationOptions={aggregationOptions}\n aggregateBy={aggregateBy}\n setAggregateBy={setAggregateBy}\n accumulateOptions={accumulateOptions}\n accumulate={accumulate}\n setAccumulate={setAccumulate}\n currency={currency}\n currencyOptions={currencyOptions}\n setCurrency={setCurrency}\n />\n <DownloadControl cumulativeData={cumulativeData} title={title} />\n </div>\n );\n};\n\nexport default React.memo(Controls);\n"],"names":[],"mappings":";;;;AAmBA,MAAM,WAAW,CAAC;AAAA,EAChB,aAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,KAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,2CACG,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,kBAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,iBAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,QAAA;AAAA,MACA,eAAA;AAAA,MACA;AAAA;AAAA,GAEF,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,EAAA,cAAA,EAAgC,OAAc,CACjE,CAAA;AAEJ,CAAA;AAEA,iBAAe,KAAA,CAAM,KAAK,QAAQ,CAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/components/Controls/index.jsx"],"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 { memo } from 'react';\nimport DownloadControl from './Download';\nimport EditControl from './Edit';\n\nconst Controls = ({\n windowOptions,\n window,\n setWindow,\n aggregationOptions,\n aggregateBy,\n setAggregateBy,\n accumulateOptions,\n accumulate,\n setAccumulate,\n title,\n cumulativeData,\n currency,\n currencyOptions,\n setCurrency,\n}) => {\n return (\n <div>\n <EditControl\n windowOptions={windowOptions}\n window={window}\n setWindow={setWindow}\n aggregationOptions={aggregationOptions}\n aggregateBy={aggregateBy}\n setAggregateBy={setAggregateBy}\n accumulateOptions={accumulateOptions}\n accumulate={accumulate}\n setAccumulate={setAccumulate}\n currency={currency}\n currencyOptions={currencyOptions}\n setCurrency={setCurrency}\n />\n <DownloadControl cumulativeData={cumulativeData} title={title} />\n </div>\n );\n};\n\nexport default memo(Controls);\n"],"names":[],"mappings":";;;;;AAmBA,MAAM,WAAW,CAAC;AAAA,EAChB,aAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,KAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAA,4BACG,KACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,aAAA;AAAA,QACA,MAAA;AAAA,QACA,SAAA;AAAA,QACA,kBAAA;AAAA,QACA,WAAA;AAAA,QACA,cAAA;AAAA,QACA,iBAAA;AAAA,QACA,UAAA;AAAA,QACA,aAAA;AAAA,QACA,QAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,oBACA,GAAA,CAAC,eAAgB,EAAA,EAAA,cAAA,EAAgC,KAAc,EAAA;AAAA,GACjE,EAAA,CAAA;AAEJ,CAAA;AAEA,iBAAe,KAAK,QAAQ,CAAA;;;;"}
@@ -1,17 +1,20 @@
1
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import Grid from '@material-ui/core/Grid';
3
3
  import { Page, Header, Content } from '@backstage/core-components';
4
4
  import { OpenCostReport } from '../OpenCostReport/OpenCostReport.esm.js';
5
5
  import logo from '../../images/pig.png';
6
6
 
7
- const OpenCostPage = () => /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(
8
- Header,
9
- {
10
- title: "OpenCost",
11
- subtitle: "Open source Kubernetes cloud cost monitoring"
12
- },
13
- /* @__PURE__ */ React.createElement("a", { href: "https://opencost.io" }, /* @__PURE__ */ React.createElement("img", { width: 68, height: 64, src: logo, alt: "OpenCost" }))
14
- ), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(OpenCostReport, null)))));
7
+ const OpenCostPage = () => /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
8
+ /* @__PURE__ */ jsx(
9
+ Header,
10
+ {
11
+ title: "OpenCost",
12
+ subtitle: "Open source Kubernetes cloud cost monitoring",
13
+ children: /* @__PURE__ */ jsx("a", { href: "https://opencost.io", children: /* @__PURE__ */ jsx("img", { width: 68, height: 64, src: logo, alt: "OpenCost" }) })
14
+ }
15
+ ),
16
+ /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(Grid, { container: true, spacing: 3, direction: "column", children: /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(OpenCostReport, {}) }) }) })
17
+ ] });
15
18
 
16
19
  export { OpenCostPage };
17
20
  //# sourceMappingURL=OpenCostPage.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenCostPage.esm.js","sources":["../../../src/components/OpenCostPage/OpenCostPage.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 Grid from '@material-ui/core/Grid';\nimport { Header, Page, Content } from '@backstage/core-components';\nimport { OpenCostReport } from '../OpenCostReport';\nimport logo from '../../images/pig.png';\n\nexport const OpenCostPage = () => (\n <Page themeId=\"tool\">\n <Header\n title=\"OpenCost\"\n subtitle=\"Open source Kubernetes cloud cost monitoring\"\n >\n <a href=\"https://opencost.io\">\n <img width={68} height={64} src={logo} alt=\"OpenCost\" />\n </a>\n </Header>\n <Content>\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <OpenCostReport />\n </Grid>\n </Grid>\n </Content>\n </Page>\n);\n"],"names":[],"mappings":";;;;;;AAqBO,MAAM,YAAe,GAAA,sBACzB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,MAAA;AAAA,EAAA;AAAA,IACC,KAAM,EAAA,UAAA;AAAA,IACN,QAAS,EAAA;AAAA,GAAA;AAAA,kBAER,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAE,IAAK,EAAA,qBAAA,EAAA,sCACL,KAAI,EAAA,EAAA,KAAA,EAAO,EAAI,EAAA,MAAA,EAAQ,EAAI,EAAA,GAAA,EAAK,IAAM,EAAA,GAAA,EAAI,YAAW,CACxD;AACF,CAAA,sCACC,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAC,SAAS,CAAG,EAAA,SAAA,EAAU,4BACnC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IACR,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,oBAAe,CAClB,CACF,CACF,CACF;;;;"}
1
+ {"version":3,"file":"OpenCostPage.esm.js","sources":["../../../src/components/OpenCostPage/OpenCostPage.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 Grid from '@material-ui/core/Grid';\nimport { Header, Page, Content } from '@backstage/core-components';\nimport { OpenCostReport } from '../OpenCostReport';\nimport logo from '../../images/pig.png';\n\nexport const OpenCostPage = () => (\n <Page themeId=\"tool\">\n <Header\n title=\"OpenCost\"\n subtitle=\"Open source Kubernetes cloud cost monitoring\"\n >\n <a href=\"https://opencost.io\">\n <img width={68} height={64} src={logo} alt=\"OpenCost\" />\n </a>\n </Header>\n <Content>\n <Grid container spacing={3} direction=\"column\">\n <Grid item>\n <OpenCostReport />\n </Grid>\n </Grid>\n </Content>\n </Page>\n);\n"],"names":[],"mappings":";;;;;;AAoBO,MAAM,YAAe,GAAA,sBACzB,IAAA,CAAA,IAAA,EAAA,EAAK,SAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,UAAA;AAAA,MACN,QAAS,EAAA,8CAAA;AAAA,MAET,QAAC,kBAAA,GAAA,CAAA,GAAA,EAAA,EAAE,IAAK,EAAA,qBAAA,EACN,8BAAC,KAAI,EAAA,EAAA,KAAA,EAAO,EAAI,EAAA,MAAA,EAAQ,EAAI,EAAA,GAAA,EAAK,IAAM,EAAA,GAAA,EAAI,YAAW,CACxD,EAAA;AAAA;AAAA,GACF;AAAA,sBACC,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAC,SAAS,CAAG,EAAA,SAAA,EAAU,QACpC,EAAA,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EACR,8BAAC,cAAe,EAAA,EAAA,CAAA,EAClB,GACF,CACF,EAAA;AAAA,CACF,EAAA;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
2
3
  import CircularProgress from '@material-ui/core/CircularProgress';
3
4
  import IconButton from '@material-ui/core/IconButton';
4
5
  import Paper from '@material-ui/core/Paper';
@@ -171,53 +172,67 @@ const OpenCostReport = () => {
171
172
  setLoading(false);
172
173
  setFetch(false);
173
174
  }
174
- return /* @__PURE__ */ React.createElement(Page, { active: "reports.html" }, !loading && errors.length > 0 && /* @__PURE__ */ React.createElement("div", { style: { marginBottom: 20 } }, /* @__PURE__ */ React.createElement(Warnings, { warnings: errors })), init && /* @__PURE__ */ React.createElement(Paper, { id: "report" }, /* @__PURE__ */ React.createElement("div", { className: classes.reportHeader }, /* @__PURE__ */ React.createElement("div", { className: classes.titles }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, title), /* @__PURE__ */ React.createElement(Subtitle, { report: { window, aggregateBy, accumulate } })), /* @__PURE__ */ React.createElement(IconButton, { "aria-label": "refresh", onClick: () => setFetch(true) }, /* @__PURE__ */ React.createElement(RefreshIcon, null)), /* @__PURE__ */ React.createElement(
175
- Controls,
176
- {
177
- windowOptions,
178
- window,
179
- setWindow: (win) => {
180
- searchParams.set("window", win);
181
- routerNavigate({
182
- search: `?${searchParams.toString()}`
183
- });
184
- },
185
- aggregationOptions,
186
- aggregateBy,
187
- setAggregateBy: (agg) => {
188
- searchParams.set("agg", agg);
189
- routerNavigate({
190
- search: `?${searchParams.toString()}`
191
- });
192
- },
193
- accumulateOptions,
194
- accumulate,
195
- setAccumulate: (acc) => {
196
- searchParams.set("acc", acc);
197
- routerNavigate({
198
- search: `?${searchParams.toString()}`
199
- });
200
- },
201
- title,
202
- cumulativeData,
203
- currency,
204
- currencyOptions: currencyCodes,
205
- setCurrency: (curr) => {
206
- searchParams.set("currency", curr);
207
- routerNavigate({
208
- search: `?${searchParams.toString()}`
209
- });
210
- }
211
- }
212
- )), loading && /* @__PURE__ */ React.createElement("div", { style: { display: "flex", justifyContent: "center" } }, /* @__PURE__ */ React.createElement("div", { style: { paddingTop: 100, paddingBottom: 100 } }, /* @__PURE__ */ React.createElement(CircularProgress, null))), !loading && /* @__PURE__ */ React.createElement(
213
- AllocationReport,
214
- {
215
- allocationData,
216
- cumulativeData,
217
- totalData,
218
- currency
219
- }
220
- )));
175
+ return /* @__PURE__ */ jsxs(Page, { active: "reports.html", children: [
176
+ !loading && errors.length > 0 && /* @__PURE__ */ jsx("div", { style: { marginBottom: 20 }, children: /* @__PURE__ */ jsx(Warnings, { warnings: errors }) }),
177
+ init && /* @__PURE__ */ jsxs(Paper, { id: "report", children: [
178
+ /* @__PURE__ */ jsxs("div", { className: classes.reportHeader, children: [
179
+ /* @__PURE__ */ jsxs("div", { className: classes.titles, children: [
180
+ /* @__PURE__ */ jsx(Typography, { variant: "h5", children: title }),
181
+ /* @__PURE__ */ jsx(Subtitle, { report: { window, aggregateBy, accumulate } })
182
+ ] }),
183
+ /* @__PURE__ */ jsx(IconButton, { "aria-label": "refresh", onClick: () => setFetch(true), children: /* @__PURE__ */ jsx(RefreshIcon, {}) }),
184
+ /* @__PURE__ */ jsx(
185
+ Controls,
186
+ {
187
+ windowOptions,
188
+ window,
189
+ setWindow: (win) => {
190
+ searchParams.set("window", win);
191
+ routerNavigate({
192
+ search: `?${searchParams.toString()}`
193
+ });
194
+ },
195
+ aggregationOptions,
196
+ aggregateBy,
197
+ setAggregateBy: (agg) => {
198
+ searchParams.set("agg", agg);
199
+ routerNavigate({
200
+ search: `?${searchParams.toString()}`
201
+ });
202
+ },
203
+ accumulateOptions,
204
+ accumulate,
205
+ setAccumulate: (acc) => {
206
+ searchParams.set("acc", acc);
207
+ routerNavigate({
208
+ search: `?${searchParams.toString()}`
209
+ });
210
+ },
211
+ title,
212
+ cumulativeData,
213
+ currency,
214
+ currencyOptions: currencyCodes,
215
+ setCurrency: (curr) => {
216
+ searchParams.set("currency", curr);
217
+ routerNavigate({
218
+ search: `?${searchParams.toString()}`
219
+ });
220
+ }
221
+ }
222
+ )
223
+ ] }),
224
+ loading && /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx("div", { style: { paddingTop: 100, paddingBottom: 100 }, children: /* @__PURE__ */ jsx(CircularProgress, {}) }) }),
225
+ !loading && /* @__PURE__ */ jsx(
226
+ AllocationReport,
227
+ {
228
+ allocationData,
229
+ cumulativeData,
230
+ totalData,
231
+ currency
232
+ }
233
+ )
234
+ ] })
235
+ ] });
221
236
  };
222
237
 
223
238
  export { OpenCostReport };
@@ -1 +1 @@
1
- {"version":3,"file":"OpenCostReport.esm.js","sources":["../../../src/components/OpenCostReport/OpenCostReport.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 */\n// code ported from https://github.com/opencost/opencost/blob/develop/ui/src/Reports.js\n\nimport React, { useEffect, useState } from 'react';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport RefreshIcon from '@material-ui/icons/Refresh';\nimport Typography from '@material-ui/core/Typography';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { find, get, sortBy, toArray } from 'lodash';\nimport { makeStyles } from '@material-ui/core/styles';\nimport AllocationReport from '../AllocationReport';\nimport AllocationService from '../../services/allocation';\nimport Controls from '../Controls';\nimport Page from '../Page';\nimport Subtitle from '../Subtitle';\nimport Warnings from '../Warnings';\nimport {\n checkCustomWindow,\n cumulativeToTotals,\n rangeToCumulative,\n toVerboseTimeRange,\n} from '../../util';\nimport { currencyCodes } from '../../constants/currencyCodes';\nimport { useApi, configApiRef, fetchApiRef } from '@backstage/core-plugin-api';\n\nconst windowOptions = [\n { name: 'Today', value: 'today' },\n { name: 'Yesterday', value: 'yesterday' },\n { name: 'Week-to-date', value: 'week' },\n { name: 'Month-to-date', value: 'month' },\n { name: 'Last week', value: 'lastweek' },\n { name: 'Last month', value: 'lastmonth' },\n { name: 'Last 7 days', value: '6d' },\n { name: 'Last 30 days', value: '29d' },\n { name: 'Last 60 days', value: '59d' },\n { name: 'Last 90 days', value: '89d' },\n];\n\nconst aggregationOptions = [\n { name: 'Cluster', value: 'cluster' },\n { name: 'Node', value: 'node' },\n { name: 'Namespace', value: 'namespace' },\n { name: 'Controller kind', value: 'controllerKind' },\n { name: 'Controller', value: 'controller' },\n { name: 'Service', value: 'service' },\n { name: 'Pod', value: 'pod' },\n { name: 'Container', value: 'container' },\n];\n\nconst accumulateOptions = [\n { name: 'Entire window', value: true },\n { name: 'Daily', value: false },\n];\n\nconst useStyles = makeStyles({\n reportHeader: {\n display: 'flex',\n flexFlow: 'row',\n padding: 24,\n },\n titles: {\n flexGrow: 1,\n },\n});\n\n// generateTitle generates a string title from a report object\n// @ts-ignore: implicitly has an 'any' type\nfunction generateTitle({ window, aggregateBy, accumulate }) {\n let windowName = get(find(windowOptions, { value: window }), 'name', '');\n if (windowName === '') {\n if (checkCustomWindow(window)) {\n windowName = toVerboseTimeRange(window);\n } else {\n /* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n console.warn(`unknown window: ${window}`);\n }\n }\n\n const aggregationName = get(\n find(aggregationOptions, { value: aggregateBy }),\n 'name',\n '',\n ).toLocaleLowerCase('en-US');\n if (aggregationName === '') {\n /* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n console.warn(`unknown aggregation: ${aggregateBy}`);\n }\n\n let str = `${windowName} by ${aggregationName}`;\n\n if (!accumulate) {\n str = `${str} daily`;\n }\n\n return str;\n}\n\nexport const OpenCostReport = () => {\n const classes = useStyles();\n // Allocation data state\n const [allocationData, setAllocationData] = useState([]);\n const [cumulativeData, setCumulativeData] = useState({});\n const [totalData, setTotalData] = useState({});\n\n // When allocation data changes, create a cumulative version of it\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const cumulative = rangeToCumulative(allocationData, aggregateBy);\n setCumulativeData(toArray(cumulative));\n setTotalData(cumulativeToTotals(cumulative));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [allocationData]);\n\n // Form state, which controls form elements, but not the report itself. On\n // certain actions, the form state may flow into the report state.\n const [window, setWindow] = useState(windowOptions[0].value);\n const [aggregateBy, setAggregateBy] = useState(aggregationOptions[0].value);\n const [accumulate, setAccumulate] = useState(accumulateOptions[0].value);\n const [currency, setCurrency] = useState('USD');\n\n // Report state, including current report and saved options\n const [title, setTitle] = useState('Last 7 days by namespace daily');\n\n // When parameters changes, fetch data. This should be the\n // only mechanism used to fetch data. Also generate a sensible title from the paramters.\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n setFetch(true);\n setTitle(generateTitle({ window, aggregateBy, accumulate }));\n }, [window, aggregateBy, accumulate]);\n\n // page and settings state\n const [init, setInit] = useState(false);\n const [fetch, setFetch] = useState(false);\n const [loading, setLoading] = useState(true);\n const [errors, setErrors] = useState([]);\n\n // Initialize once, then fetch report each time setFetch(true) is called\n useEffect(() => {\n if (!init) {\n initialize();\n }\n if (init && fetch) {\n fetchData();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [init, fetch]);\n\n // parse any context information from the URL\n const routerLocation = useLocation();\n const searchParams = new URLSearchParams(routerLocation.search);\n const routerNavigate = useNavigate();\n useEffect(() => {\n setWindow(searchParams.get('window') || '6d');\n setAggregateBy(searchParams.get('agg') || 'namespace');\n setAccumulate(searchParams.get('acc') === 'true' || false);\n setCurrency(searchParams.get('currency') || 'USD');\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [routerLocation]);\n\n async function initialize() {\n setInit(true);\n }\n\n const configApi = useApi(configApiRef);\n const baseUrl = configApi.getConfig('opencost').getString('baseUrl');\n\n const fetchApi = useApi(fetchApiRef);\n\n async function fetchData() {\n setLoading(true);\n setErrors([]);\n\n try {\n const resp = await AllocationService.fetchAllocation(\n fetchApi,\n baseUrl,\n window,\n aggregateBy,\n { accumulate },\n );\n if (resp.data && resp.data.length > 0) {\n const allocationRange = resp.data;\n for (const i in allocationRange) {\n if (Object.hasOwn(allocationRange, i)) {\n // update cluster aggregations to use clusterName/clusterId names\n allocationRange[i] = sortBy(allocationRange[i], a => a.totalCost);\n }\n }\n setAllocationData(allocationRange);\n } else {\n setAllocationData([]);\n }\n } catch (err) {\n if (err.message.indexOf('404') === 0) {\n setErrors([\n // @ts-ignore: not assignable to type 'never'\n {\n primary: 'Failed to load report data',\n secondary:\n 'Please update OpenCost to the latest version, then open an Issue on GitHub if problems persist.',\n },\n ]);\n } else {\n let secondary =\n 'Please open an OpenCost issue with a bug report if problems persist.';\n if (err.message.length > 0) {\n secondary = err.message;\n }\n setErrors([\n // @ts-ignore: not assignable to type 'never'\n {\n primary: 'Failed to load report data',\n secondary: secondary,\n },\n ]);\n }\n setAllocationData([]);\n }\n\n setLoading(false);\n setFetch(false);\n }\n return (\n <Page active=\"reports.html\">\n {!loading && errors.length > 0 && (\n <div style={{ marginBottom: 20 }}>\n <Warnings warnings={errors} />\n </div>\n )}\n {init && (\n <Paper id=\"report\">\n <div className={classes.reportHeader}>\n <div className={classes.titles}>\n <Typography variant=\"h5\">{title}</Typography>\n <Subtitle report={{ window, aggregateBy, accumulate }} />\n </div>\n\n <IconButton aria-label=\"refresh\" onClick={() => setFetch(true)}>\n <RefreshIcon />\n </IconButton>\n\n <Controls\n windowOptions={windowOptions}\n window={window}\n // @ts-ignore: implicitly has an 'any' type\n setWindow={win => {\n searchParams.set('window', win);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n aggregationOptions={aggregationOptions}\n aggregateBy={aggregateBy}\n // @ts-ignore: implicitly has an 'any' type\n setAggregateBy={agg => {\n searchParams.set('agg', agg);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n accumulateOptions={accumulateOptions}\n accumulate={accumulate}\n // @ts-ignore: implicitly has an 'any' type\n setAccumulate={acc => {\n searchParams.set('acc', acc);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n title={title}\n cumulativeData={cumulativeData}\n currency={currency}\n currencyOptions={currencyCodes}\n // @ts-ignore: implicitly has an 'any' type\n setCurrency={curr => {\n searchParams.set('currency', curr);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n />\n </div>\n\n {loading && (\n <div style={{ display: 'flex', justifyContent: 'center' }}>\n <div style={{ paddingTop: 100, paddingBottom: 100 }}>\n <CircularProgress />\n </div>\n </div>\n )}\n {!loading && (\n <AllocationReport\n allocationData={allocationData}\n cumulativeData={cumulativeData}\n totalData={totalData}\n currency={currency}\n />\n )}\n </Paper>\n )}\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAyCA,MAAM,aAAgB,GAAA;AAAA,EACpB,EAAE,IAAA,EAAM,OAAS,EAAA,KAAA,EAAO,OAAQ,EAAA;AAAA,EAChC,EAAE,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACxC,EAAE,IAAA,EAAM,cAAgB,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EACtC,EAAE,IAAA,EAAM,eAAiB,EAAA,KAAA,EAAO,OAAQ,EAAA;AAAA,EACxC,EAAE,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,UAAW,EAAA;AAAA,EACvC,EAAE,IAAA,EAAM,YAAc,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACzC,EAAE,IAAA,EAAM,aAAe,EAAA,KAAA,EAAO,IAAK,EAAA;AAAA,EACnC,EAAE,IAAA,EAAM,cAAgB,EAAA,KAAA,EAAO,KAAM,EAAA;AAAA,EACrC,EAAE,IAAA,EAAM,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right 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// code ported from https://github.com/opencost/opencost/blob/develop/ui/src/Reports.js\n\nimport { useEffect, useState } from 'react';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport IconButton from '@material-ui/core/IconButton';\nimport Paper from '@material-ui/core/Paper';\nimport RefreshIcon from '@material-ui/icons/Refresh';\nimport Typography from '@material-ui/core/Typography';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { find, get, sortBy, toArray } from 'lodash';\nimport { makeStyles } from '@material-ui/core/styles';\nimport AllocationReport from '../AllocationReport';\nimport AllocationService from '../../services/allocation';\nimport Controls from '../Controls';\nimport Page from '../Page';\nimport Subtitle from '../Subtitle';\nimport Warnings from '../Warnings';\nimport {\n checkCustomWindow,\n cumulativeToTotals,\n rangeToCumulative,\n toVerboseTimeRange,\n} from '../../util';\nimport { currencyCodes } from '../../constants/currencyCodes';\nimport { useApi, configApiRef, fetchApiRef } from '@backstage/core-plugin-api';\n\nconst windowOptions = [\n { name: 'Today', value: 'today' },\n { name: 'Yesterday', value: 'yesterday' },\n { name: 'Week-to-date', value: 'week' },\n { name: 'Month-to-date', value: 'month' },\n { name: 'Last week', value: 'lastweek' },\n { name: 'Last month', value: 'lastmonth' },\n { name: 'Last 7 days', value: '6d' },\n { name: 'Last 30 days', value: '29d' },\n { name: 'Last 60 days', value: '59d' },\n { name: 'Last 90 days', value: '89d' },\n];\n\nconst aggregationOptions = [\n { name: 'Cluster', value: 'cluster' },\n { name: 'Node', value: 'node' },\n { name: 'Namespace', value: 'namespace' },\n { name: 'Controller kind', value: 'controllerKind' },\n { name: 'Controller', value: 'controller' },\n { name: 'Service', value: 'service' },\n { name: 'Pod', value: 'pod' },\n { name: 'Container', value: 'container' },\n];\n\nconst accumulateOptions = [\n { name: 'Entire window', value: true },\n { name: 'Daily', value: false },\n];\n\nconst useStyles = makeStyles({\n reportHeader: {\n display: 'flex',\n flexFlow: 'row',\n padding: 24,\n },\n titles: {\n flexGrow: 1,\n },\n});\n\n// generateTitle generates a string title from a report object\n// @ts-ignore: implicitly has an 'any' type\nfunction generateTitle({ window, aggregateBy, accumulate }) {\n let windowName = get(find(windowOptions, { value: window }), 'name', '');\n if (windowName === '') {\n if (checkCustomWindow(window)) {\n windowName = toVerboseTimeRange(window);\n } else {\n /* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n console.warn(`unknown window: ${window}`);\n }\n }\n\n const aggregationName = get(\n find(aggregationOptions, { value: aggregateBy }),\n 'name',\n '',\n ).toLocaleLowerCase('en-US');\n if (aggregationName === '') {\n /* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n console.warn(`unknown aggregation: ${aggregateBy}`);\n }\n\n let str = `${windowName} by ${aggregationName}`;\n\n if (!accumulate) {\n str = `${str} daily`;\n }\n\n return str;\n}\n\nexport const OpenCostReport = () => {\n const classes = useStyles();\n // Allocation data state\n const [allocationData, setAllocationData] = useState([]);\n const [cumulativeData, setCumulativeData] = useState({});\n const [totalData, setTotalData] = useState({});\n\n // When allocation data changes, create a cumulative version of it\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n const cumulative = rangeToCumulative(allocationData, aggregateBy);\n setCumulativeData(toArray(cumulative));\n setTotalData(cumulativeToTotals(cumulative));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [allocationData]);\n\n // Form state, which controls form elements, but not the report itself. On\n // certain actions, the form state may flow into the report state.\n const [window, setWindow] = useState(windowOptions[0].value);\n const [aggregateBy, setAggregateBy] = useState(aggregationOptions[0].value);\n const [accumulate, setAccumulate] = useState(accumulateOptions[0].value);\n const [currency, setCurrency] = useState('USD');\n\n // Report state, including current report and saved options\n const [title, setTitle] = useState('Last 7 days by namespace daily');\n\n // When parameters changes, fetch data. This should be the\n // only mechanism used to fetch data. Also generate a sensible title from the paramters.\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n setFetch(true);\n setTitle(generateTitle({ window, aggregateBy, accumulate }));\n }, [window, aggregateBy, accumulate]);\n\n // page and settings state\n const [init, setInit] = useState(false);\n const [fetch, setFetch] = useState(false);\n const [loading, setLoading] = useState(true);\n const [errors, setErrors] = useState([]);\n\n // Initialize once, then fetch report each time setFetch(true) is called\n useEffect(() => {\n if (!init) {\n initialize();\n }\n if (init && fetch) {\n fetchData();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [init, fetch]);\n\n // parse any context information from the URL\n const routerLocation = useLocation();\n const searchParams = new URLSearchParams(routerLocation.search);\n const routerNavigate = useNavigate();\n useEffect(() => {\n setWindow(searchParams.get('window') || '6d');\n setAggregateBy(searchParams.get('agg') || 'namespace');\n setAccumulate(searchParams.get('acc') === 'true' || false);\n setCurrency(searchParams.get('currency') || 'USD');\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [routerLocation]);\n\n async function initialize() {\n setInit(true);\n }\n\n const configApi = useApi(configApiRef);\n const baseUrl = configApi.getConfig('opencost').getString('baseUrl');\n\n const fetchApi = useApi(fetchApiRef);\n\n async function fetchData() {\n setLoading(true);\n setErrors([]);\n\n try {\n const resp = await AllocationService.fetchAllocation(\n fetchApi,\n baseUrl,\n window,\n aggregateBy,\n { accumulate },\n );\n if (resp.data && resp.data.length > 0) {\n const allocationRange = resp.data;\n for (const i in allocationRange) {\n if (Object.hasOwn(allocationRange, i)) {\n // update cluster aggregations to use clusterName/clusterId names\n allocationRange[i] = sortBy(allocationRange[i], a => a.totalCost);\n }\n }\n setAllocationData(allocationRange);\n } else {\n setAllocationData([]);\n }\n } catch (err) {\n if (err.message.indexOf('404') === 0) {\n setErrors([\n // @ts-ignore: not assignable to type 'never'\n {\n primary: 'Failed to load report data',\n secondary:\n 'Please update OpenCost to the latest version, then open an Issue on GitHub if problems persist.',\n },\n ]);\n } else {\n let secondary =\n 'Please open an OpenCost issue with a bug report if problems persist.';\n if (err.message.length > 0) {\n secondary = err.message;\n }\n setErrors([\n // @ts-ignore: not assignable to type 'never'\n {\n primary: 'Failed to load report data',\n secondary: secondary,\n },\n ]);\n }\n setAllocationData([]);\n }\n\n setLoading(false);\n setFetch(false);\n }\n return (\n <Page active=\"reports.html\">\n {!loading && errors.length > 0 && (\n <div style={{ marginBottom: 20 }}>\n <Warnings warnings={errors} />\n </div>\n )}\n {init && (\n <Paper id=\"report\">\n <div className={classes.reportHeader}>\n <div className={classes.titles}>\n <Typography variant=\"h5\">{title}</Typography>\n <Subtitle report={{ window, aggregateBy, accumulate }} />\n </div>\n\n <IconButton aria-label=\"refresh\" onClick={() => setFetch(true)}>\n <RefreshIcon />\n </IconButton>\n\n <Controls\n windowOptions={windowOptions}\n window={window}\n // @ts-ignore: implicitly has an 'any' type\n setWindow={win => {\n searchParams.set('window', win);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n aggregationOptions={aggregationOptions}\n aggregateBy={aggregateBy}\n // @ts-ignore: implicitly has an 'any' type\n setAggregateBy={agg => {\n searchParams.set('agg', agg);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n accumulateOptions={accumulateOptions}\n accumulate={accumulate}\n // @ts-ignore: implicitly has an 'any' type\n setAccumulate={acc => {\n searchParams.set('acc', acc);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n title={title}\n cumulativeData={cumulativeData}\n currency={currency}\n currencyOptions={currencyCodes}\n // @ts-ignore: implicitly has an 'any' type\n setCurrency={curr => {\n searchParams.set('currency', curr);\n routerNavigate({\n search: `?${searchParams.toString()}`,\n });\n }}\n />\n </div>\n\n {loading && (\n <div style={{ display: 'flex', justifyContent: 'center' }}>\n <div style={{ paddingTop: 100, paddingBottom: 100 }}>\n <CircularProgress />\n </div>\n </div>\n )}\n {!loading && (\n <AllocationReport\n allocationData={allocationData}\n cumulativeData={cumulativeData}\n totalData={totalData}\n currency={currency}\n />\n )}\n </Paper>\n )}\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,aAAgB,GAAA;AAAA,EACpB,EAAE,IAAA,EAAM,OAAS,EAAA,KAAA,EAAO,OAAQ,EAAA;AAAA,EAChC,EAAE,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACxC,EAAE,IAAA,EAAM,cAAgB,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EACtC,EAAE,IAAA,EAAM,eAAiB,EAAA,KAAA,EAAO,OAAQ,EAAA;AAAA,EACxC,EAAE,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,UAAW,EAAA;AAAA,EACvC,EAAE,IAAA,EAAM,YAAc,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACzC,EAAE,IAAA,EAAM,aAAe,EAAA,KAAA,EAAO,IAAK,EAAA;AAAA,EACnC,EAAE,IAAA,EAAM,cAAgB,EAAA,KAAA,EAAO,KAAM,EAAA;AAAA,EACrC,EAAE,IAAA,EAAM,cAAgB,EAAA,KAAA,EAAO,KAAM,EAAA;AAAA,EACrC,EAAE,IAAA,EAAM,cAAgB,EAAA,KAAA,EAAO,KAAM;AACvC,CAAA;AAEA,MAAM,kBAAqB,GAAA;AAAA,EACzB,EAAE,IAAA,EAAM,SAAW,EAAA,KAAA,EAAO,SAAU,EAAA;AAAA,EACpC,EAAE,IAAA,EAAM,MAAQ,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EAC9B,EAAE,IAAA,EAAM,WAAa,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACxC,EAAE,IAAA,EAAM,iBAAmB,EAAA,KAAA,EAAO,gBAAiB,EAAA;AAAA,EACnD,EAAE,IAAA,EAAM,YAA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AA,GAAA,CAAI,YAAY,IAAI,CAAA;AACjC,cAAe,cAAA,CAAA;AAAA,gBACb,MAAQ,EAAA,CAAA,CAAA,EAAI,YAAa,CAAA,QAAA,EAAU,CAAA;AAAA,eACpC,CAAA;AAAA;AACH;AAAA;AACF,OACF,EAAA,CAAA;AAAA,MAEC,OAAA,wBACE,KAAI,EAAA,EAAA,KAAA,EAAO,EAAE,OAAS,EAAA,MAAA,EAAQ,cAAgB,EAAA,QAAA,EAC7C,EAAA,QAAA,kBAAA,GAAA,CAAC,SAAI,KAAO,EAAA,EAAE,YAAY,GAAK,EAAA,aAAA,EAAe,KAC5C,EAAA,QAAA,kBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,CAAA,EACpB,CACF,EAAA,CAAA;AAAA,MAED,CAAC,OACA,oBAAA,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,cAAA;AAAA,UACA,cAAA;AAAA,UACA,SAAA;AAAA,UACA;AAAA;AAAA;AACF,KAEJ,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { makeStyles } from '@material-ui/core/styles';
2
- import React from 'react';
3
3
 
4
4
  const useStyles = makeStyles({
5
5
  wrapper: {
@@ -17,7 +17,7 @@ const useStyles = makeStyles({
17
17
  });
18
18
  const Page = (props) => {
19
19
  const classes = useStyles();
20
- return /* @__PURE__ */ React.createElement("div", { className: classes.flexGrow }, /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.flexGrow }, props.children)));
20
+ return /* @__PURE__ */ jsx("div", { className: classes.flexGrow, children: /* @__PURE__ */ jsx("div", { className: classes.wrapper, children: /* @__PURE__ */ jsx("div", { className: classes.flexGrow, children: props.children }) }) });
21
21
  };
22
22
 
23
23
  export { Page as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Page.esm.js","sources":["../../src/components/Page.jsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\n\nconst useStyles = makeStyles({\n wrapper: {\n display: 'flex',\n flexFlow: 'column',\n flexGrow: 1,\n margin: '20px 30px 0 30px',\n minWidth: 800,\n },\n flexGrow: {\n display: 'flex',\n flexFlow: 'column',\n flexGrow: 1,\n },\n});\n\nconst Page = props => {\n const classes = useStyles();\n\n return (\n <div className={classes.flexGrow}>\n <div className={classes.wrapper}>\n <div className={classes.flexGrow}>{props.children}</div>\n </div>\n </div>\n );\n};\n\nexport default Page;\n"],"names":[],"mappings":";;;AAmBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,OAAS,EAAA;AAAA,IACP,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,QAAA;AAAA,IACV,QAAU,EAAA,CAAA;AAAA,IACV,MAAQ,EAAA,kBAAA;AAAA,IACR,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,QAAA;AAAA,IACV,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAED,MAAM,OAAO,CAAS,KAAA,KAAA;AACpB,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,2CACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,QACtB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,SAAW,EAAA,OAAA,CAAQ,OACtB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,SAAW,EAAA,OAAA,CAAQ,YAAW,KAAM,CAAA,QAAS,CACpD,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Page.esm.js","sources":["../../src/components/Page.jsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles({\n wrapper: {\n display: 'flex',\n flexFlow: 'column',\n flexGrow: 1,\n margin: '20px 30px 0 30px',\n minWidth: 800,\n },\n flexGrow: {\n display: 'flex',\n flexFlow: 'column',\n flexGrow: 1,\n },\n});\n\nconst Page = props => {\n const classes = useStyles();\n\n return (\n <div className={classes.flexGrow}>\n <div className={classes.wrapper}>\n <div className={classes.flexGrow}>{props.children}</div>\n </div>\n </div>\n );\n};\n\nexport default Page;\n"],"names":[],"mappings":";;;AAkBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,OAAS,EAAA;AAAA,IACP,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,QAAA;AAAA,IACV,QAAU,EAAA,CAAA;AAAA,IACV,MAAQ,EAAA,kBAAA;AAAA,IACR,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,QAAA;AAAA,IACV,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAED,MAAM,OAAO,CAAS,KAAA,KAAA;AACpB,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,2BACG,KAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,QACtB,EAAA,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAW,EAAA,OAAA,CAAQ,OACtB,EAAA,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAW,EAAA,OAAA,CAAQ,UAAW,QAAM,EAAA,KAAA,CAAA,QAAA,EAAS,GACpD,CACF,EAAA,CAAA;AAEJ;;;;"}