@backstage-community/plugin-xcmetrics 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.
- package/CHANGELOG.md +12 -0
- package/dist/components/Accordion/Accordion.esm.js +19 -15
- package/dist/components/Accordion/Accordion.esm.js.map +1 -1
- package/dist/components/BuildDetails/BuildDetails.esm.js +93 -62
- package/dist/components/BuildDetails/BuildDetails.esm.js.map +1 -1
- package/dist/components/BuildList/BuildList.esm.js +40 -36
- package/dist/components/BuildList/BuildList.esm.js.map +1 -1
- package/dist/components/BuildListFilter/BuildListFilter.esm.js +73 -64
- package/dist/components/BuildListFilter/BuildListFilter.esm.js.map +1 -1
- package/dist/components/BuildTableColumns.esm.js +4 -4
- package/dist/components/BuildTableColumns.esm.js.map +1 -1
- package/dist/components/BuildTimeline/BuildTimeline.esm.js +26 -14
- package/dist/components/BuildTimeline/BuildTimeline.esm.js.map +1 -1
- package/dist/components/DataValue/DataValue.esm.js +6 -3
- package/dist/components/DataValue/DataValue.esm.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.esm.js +14 -11
- package/dist/components/DatePicker/DatePicker.esm.js.map +1 -1
- package/dist/components/Overview/Overview.esm.js +27 -18
- package/dist/components/Overview/Overview.esm.js.map +1 -1
- package/dist/components/OverviewTrends/OverviewTrends.esm.js +86 -67
- package/dist/components/OverviewTrends/OverviewTrends.esm.js.map +1 -1
- package/dist/components/PreformattedText/PreformattedText.esm.js +43 -31
- package/dist/components/PreformattedText/PreformattedText.esm.js.map +1 -1
- package/dist/components/StatusCell/StatusCell.esm.js +29 -16
- package/dist/components/StatusCell/StatusCell.esm.js.map +1 -1
- package/dist/components/StatusIcon/StatusIcon.esm.js +5 -5
- package/dist/components/StatusIcon/StatusIcon.esm.js.map +1 -1
- package/dist/components/StatusMatrix/StatusMatrix.esm.js +19 -17
- package/dist/components/StatusMatrix/StatusMatrix.esm.js.map +1 -1
- package/dist/components/Trend/Trend.esm.js +13 -10
- package/dist/components/Trend/Trend.esm.js.map +1 -1
- package/dist/components/XcmetricsLayout/XcmetricsLayout.esm.js +10 -4
- package/dist/components/XcmetricsLayout/XcmetricsLayout.esm.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/package.json +13 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildListFilter.esm.js","sources":["../../../src/components/BuildListFilter/BuildListFilter.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":"BuildListFilter.esm.js","sources":["../../../src/components/BuildListFilter/BuildListFilter.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 { useEffect, useState } from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport Grid from '@material-ui/core/Grid';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FilterList from '@material-ui/icons/FilterList';\nimport { InfoCard, Select } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { BuildFilters, BuildStatus, xcmetricsApiRef } from '../../api';\nimport { DatePicker } from '../DatePicker';\n\nconst toSelectItems = (strings: string[]) => {\n return strings.map(str => ({ label: str, value: str }));\n};\n\nconst useStyles = makeStyles(theme => ({\n filtersContent: {\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n}));\n\ntype FilterOption<T> = T | 'all';\n\ninterface FiltersProps {\n initialValues: BuildFilters;\n onFilterChange: (filters: BuildFilters) => void;\n}\n\nexport const BuildListFilter = ({\n onFilterChange,\n initialValues,\n}: FiltersProps) => {\n const client = useApi(xcmetricsApiRef);\n const classes = useStyles();\n const [open, setOpen] = useState(false);\n const [values, setValues] = useState(initialValues);\n\n useEffect(() => onFilterChange(values), [onFilterChange, values]);\n\n const numFilters = Object.keys(values).reduce((sum, key) => {\n const filtersKey = key as keyof BuildFilters;\n return sum + Number(values[filtersKey] !== initialValues[filtersKey]);\n }, 0);\n\n const title = (\n <>\n <IconButton\n onClick={() => setOpen(!open)}\n aria-label={`${open ? 'hide' : 'show'} filters`}\n >\n <FilterList />\n </IconButton>\n Filters ({numFilters})\n {!!numFilters && (\n <Button color=\"primary\" onClick={() => setValues(initialValues)}>\n Clear all\n </Button>\n )}\n </>\n );\n\n const statusItems: { label: string; value: FilterOption<BuildStatus> }[] = [\n { label: 'All', value: 'all' },\n { label: 'Succeeded', value: 'succeeded' },\n { label: 'Failed', value: 'failed' },\n { label: 'Stopped', value: 'stopped' },\n ];\n\n const { value: projects, loading } = useAsync(async () => {\n return client.getProjects();\n }, []);\n\n const content = (\n <Grid\n container\n spacing={3}\n direction=\"row\"\n className={classes.filtersContent}\n >\n <Grid item sm={6} md={4} lg={2}>\n <DatePicker\n label=\"From\"\n value={values.from}\n onDateChange={date => setValues({ ...values, from: date })}\n />\n </Grid>\n <Grid item sm={6} md={4} lg={2}>\n <DatePicker\n label=\"To\"\n value={values.to}\n onDateChange={date => setValues({ ...values, to: date })}\n />\n </Grid>\n <Grid item sm={6} md={4} lg={2}>\n <Select\n label=\"Status\"\n items={statusItems}\n selected={!values.buildStatus ? 'all' : values.buildStatus}\n onChange={selection => {\n const buildStatus =\n selection === 'all' ? undefined : (selection as BuildStatus);\n setValues({ ...values, buildStatus });\n }}\n />\n </Grid>\n <Grid item sm={6} md={4} lg={2}>\n {loading ? (\n <Select\n label=\"Project\"\n placeholder=\"Loading..\"\n items={[]}\n onChange={() => undefined}\n />\n ) : (\n <Select\n label=\"Project\"\n items={toSelectItems(['All'].concat(projects ?? []))}\n selected={values.project ? values.project : 'All'}\n onChange={selection =>\n setValues({\n ...values,\n project:\n selection === 'All' ? undefined : (selection as string),\n })\n }\n />\n )}\n </Grid>\n </Grid>\n );\n\n return (\n <InfoCard\n title={title}\n titleTypographyProps={{ variant: 'h6' }}\n divider={open}\n noPadding\n variant=\"gridItem\"\n >\n {open && content}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,aAAA,GAAgB,CAAC,OAAsB,KAAA;AAC3C,EAAO,OAAA,OAAA,CAAQ,IAAI,CAAQ,GAAA,MAAA,EAAE,OAAO,GAAK,EAAA,KAAA,EAAO,KAAM,CAAA,CAAA;AACxD,CAAA;AAEA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,cAAgB,EAAA;AAAA,IACd,SAAS,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,GAAG;AAAA;AAEvC,CAAE,CAAA,CAAA;AASK,MAAM,kBAAkB,CAAC;AAAA,EAC9B,cAAA;AAAA,EACA;AACF,CAAoB,KAAA;AAClB,EAAM,MAAA,MAAA,GAAS,OAAO,eAAe,CAAA;AACrC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,aAAa,CAAA;AAElD,EAAA,SAAA,CAAU,MAAM,cAAe,CAAA,M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A;AAAA,MACT,OAAQ,EAAA,UAAA;AAAA,MAEP,QAAQ,EAAA,IAAA,IAAA;AAAA;AAAA,GACX;AAEJ;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import Chip from '@material-ui/core/Chip';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { formatTime, formatDuration } from '../utils/format.esm.js';
|
|
4
4
|
import { StatusIcon } from './StatusIcon/StatusIcon.esm.js';
|
|
5
5
|
|
|
6
6
|
const baseColumns = [
|
|
7
7
|
{
|
|
8
8
|
field: "buildStatus",
|
|
9
|
-
render: (data) => /* @__PURE__ */
|
|
9
|
+
render: (data) => /* @__PURE__ */ jsx(StatusIcon, { buildStatus: data.buildStatus })
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
title: "Project",
|
|
@@ -34,7 +34,7 @@ const baseColumns = [
|
|
|
34
34
|
];
|
|
35
35
|
const isCi = {
|
|
36
36
|
field: "isCI",
|
|
37
|
-
render: (data) => data.isCi && /* @__PURE__ */
|
|
37
|
+
render: (data) => data.isCi && /* @__PURE__ */ jsx(Chip, { label: "CI", size: "small" }),
|
|
38
38
|
width: "10",
|
|
39
39
|
sorting: false
|
|
40
40
|
};
|
|
@@ -52,7 +52,7 @@ const buildPageColumns = [
|
|
|
52
52
|
{
|
|
53
53
|
title: "Category",
|
|
54
54
|
field: "category",
|
|
55
|
-
render: (data) => /* @__PURE__ */
|
|
55
|
+
render: (data) => /* @__PURE__ */ jsx(Chip, { label: data.category, size: "small" })
|
|
56
56
|
},
|
|
57
57
|
isCi
|
|
58
58
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildTableColumns.esm.js","sources":["../../src/components/BuildTableColumns.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 Chip from '@material-ui/core/Chip';\nimport
|
|
1
|
+
{"version":3,"file":"BuildTableColumns.esm.js","sources":["../../src/components/BuildTableColumns.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 Chip from '@material-ui/core/Chip';\nimport { TableColumn } from '@backstage/core-components';\nimport { Build } from '../api';\nimport { formatTime, formatDuration } from '../utils';\nimport { StatusIcon } from './StatusIcon';\n\nconst baseColumns: TableColumn<Build>[] = [\n {\n field: 'buildStatus',\n render: data => <StatusIcon buildStatus={data.buildStatus} />,\n },\n {\n title: 'Project',\n field: 'projectName',\n },\n {\n title: 'Schema',\n field: 'schema',\n },\n {\n title: 'Started',\n field: 'startedAt',\n render: data => formatTime(data.startTimestamp),\n cellStyle: { whiteSpace: 'nowrap' },\n },\n {\n title: 'Duration',\n field: 'duration',\n render: data => formatDuration(data.duration),\n },\n {\n title: 'User',\n field: 'userid',\n },\n];\n\nconst isCi: TableColumn<Build> = {\n field: 'isCI',\n render: data => data.isCi && <Chip label=\"CI\" size=\"small\" />,\n width: '10',\n sorting: false,\n};\n\nexport const overviewColumns: TableColumn<Build>[] = [...baseColumns, isCi];\n\nexport const buildPageColumns: TableColumn<Build>[] = [\n ...baseColumns,\n {\n title: 'Host',\n field: 'machineName',\n },\n {\n title: 'Warnings',\n field: 'warningCount',\n },\n {\n title: 'Category',\n field: 'category',\n render: data => <Chip label={data.category} size=\"small\" />,\n },\n isCi,\n];\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,WAAoC,GAAA;AAAA,EACxC;AAAA,IACE,KAAO,EAAA,aAAA;AAAA,IACP,QAAQ,CAAQ,IAAA,qBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,WAAA,EAAa,KAAK,WAAa,EAAA;AAAA,GAC7D;AAAA,EACA;AAAA,IACE,KAAO,EAAA,SAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,QAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,SAAA;AAAA,IACP,KAAO,EAAA,WAAA;AAAA,IACP,MAAQ,EAAA,CAAA,IAAA,KAAQ,UAAW,CAAA,IAAA,CAAK,cAAc,CAAA;AAAA,IAC9C,SAAA,EAAW,EAAE,UAAA,EAAY,QAAS;AAAA,GACpC;AAAA,EACA;AAAA,IACE,KAAO,EAAA,UAAA;AAAA,IACP,KAAO,EAAA,UAAA;AAAA,IACP,MAAQ,EAAA,CAAA,IAAA,KAAQ,cAAe,CAAA,IAAA,CAAK,QAAQ;AAAA,GAC9C;AAAA,EACA;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA;AAAA;AAEX,CAAA;AAEA,MAAM,IAA2B,GAAA;AAAA,EAC/B,KAAO,EAAA,MAAA;AAAA,EACP,MAAA,EAAQ,UAAQ,IAAK,CAAA,IAAA,wBAAS,IAAK,EAAA,EAAA,KAAA,EAAM,IAAK,EAAA,IAAA,EAAK,OAAQ,EAAA,CAAA;AAAA,EAC3D,KAAO,EAAA,IAAA;AAAA,EACP,OAAS,EAAA;AACX,CAAA;AAEO,MAAM,eAAwC,GAAA,CAAC,GAAG,WAAA,EAAa,IAAI;AAEnE,MAAM,gBAAyC,GAAA;AAAA,EACpD,GAAG,WAAA;AAAA,EACH;AAAA,IACE,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,UAAA;AAAA,IACP,KAAO,EAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,UAAA;AAAA,IACP,KAAO,EAAA,UAAA;AAAA,IACP,MAAA,EAAQ,0BAAS,GAAA,CAAA,IAAA,EAAA,EAAK,OAAO,IAAK,CAAA,QAAA,EAAU,MAAK,OAAQ,EAAA;AAAA,GAC3D;AAAA,EACA;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { makeStyles, createStyles, useTheme } from '@material-ui/core/styles';
|
|
2
3
|
import Typography from '@material-ui/core/Typography';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { ResponsiveContainer, BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Legend, Bar } from 'recharts';
|
|
5
5
|
import { formatSecondsInterval, formatPercentage } from '../../utils/format.esm.js';
|
|
6
6
|
|
|
@@ -19,7 +19,11 @@ const TargetToolTip = ({ active, payload, label }) => {
|
|
|
19
19
|
if (active && payload && payload.length === 2) {
|
|
20
20
|
const buildTime = payload[0].value[1] - payload[0].value[0];
|
|
21
21
|
const compileTime = payload[1].value[1] - payload[1].value[0];
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: classes.toolTip, children: [
|
|
23
|
+
`${label}: ${formatSecondsInterval(payload[0].value)}`,
|
|
24
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
25
|
+
buildTime > 0 && `Compile time: ${formatPercentage(compileTime / buildTime)}`
|
|
26
|
+
] });
|
|
23
27
|
}
|
|
24
28
|
return null;
|
|
25
29
|
};
|
|
@@ -43,23 +47,31 @@ const BuildTimeline = ({
|
|
|
43
47
|
width
|
|
44
48
|
}) => {
|
|
45
49
|
const theme = useTheme();
|
|
46
|
-
if (!targets.length) return /* @__PURE__ */
|
|
50
|
+
if (!targets.length) return /* @__PURE__ */ jsx(Typography, { paragraph: true, children: "No Targets" });
|
|
47
51
|
const data = getTimelineData(targets);
|
|
48
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
49
53
|
ResponsiveContainer,
|
|
50
54
|
{
|
|
51
55
|
height,
|
|
52
56
|
width,
|
|
53
|
-
minHeight: EMPTY_HEIGHT + targets.length * 5
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
minHeight: EMPTY_HEIGHT + targets.length * 5,
|
|
58
|
+
children: /* @__PURE__ */ jsxs(BarChart, { layout: "vertical", data, maxBarSize: 10, barGap: 0, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "2 2" }),
|
|
60
|
+
/* @__PURE__ */ jsx(XAxis, { type: "number", domain: [0, "dataMax"] }),
|
|
61
|
+
/* @__PURE__ */ jsx(YAxis, { type: "category", dataKey: "name", padding: { top: 0, bottom: 0 } }),
|
|
62
|
+
/* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(TargetToolTip, {}) }),
|
|
63
|
+
/* @__PURE__ */ jsx(Legend, {}),
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
Bar,
|
|
66
|
+
{
|
|
67
|
+
dataKey: "buildTime",
|
|
68
|
+
fill: theme.palette.grey[400],
|
|
69
|
+
minPointSize: 1
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(Bar, { dataKey: "compileTime", fill: theme.palette.primary.main })
|
|
73
|
+
] })
|
|
74
|
+
}
|
|
63
75
|
);
|
|
64
76
|
};
|
|
65
77
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildTimeline.esm.js","sources":["../../../src/components/BuildTimeline/BuildTimeline.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 { createStyles, makeStyles, useTheme } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport
|
|
1
|
+
{"version":3,"file":"BuildTimeline.esm.js","sources":["../../../src/components/BuildTimeline/BuildTimeline.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 { createStyles, makeStyles, useTheme } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport {\n Bar,\n BarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\nimport { Target } from '../../api';\nimport { formatSecondsInterval, formatPercentage } from '../../utils';\n\nconst EMPTY_HEIGHT = 100;\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n toolTip: {\n backgroundColor: theme.palette.background.paper,\n opacity: 0.8,\n padding: 8,\n },\n }),\n);\n\nconst TargetToolTip = ({ active, payload, label }: any) => {\n const classes = useStyles();\n\n if (active && payload && payload.length === 2) {\n const buildTime = payload[0].value[1] - payload[0].value[0];\n const compileTime = payload[1].value[1] - payload[1].value[0];\n return (\n <div className={classes.toolTip}>\n {`${label}: ${formatSecondsInterval(payload[0].value)}`}\n <br />\n {buildTime > 0 &&\n `Compile time: ${formatPercentage(compileTime / buildTime)}`}\n </div>\n );\n }\n\n return null;\n};\n\nconst getTimelineData = (targets: Target[]) => {\n const min = targets[0].startTimestampMicroseconds;\n\n return targets\n .filter(target => target.fetchedFromCache === false)\n .map(target => ({\n name: target.name,\n buildTime: [\n target.startTimestampMicroseconds - min,\n target.endTimestampMicroseconds - min,\n ],\n compileTime: [\n target.startTimestampMicroseconds - min,\n target.compilationEndTimestampMicroseconds - min,\n ],\n }));\n};\n\nexport interface BuildTimelineProps {\n targets: Target[];\n height?: number;\n width?: number;\n}\n\nexport const BuildTimeline = ({\n targets,\n height,\n width,\n}: BuildTimelineProps) => {\n const theme = useTheme();\n if (!targets.length) return <Typography paragraph>No Targets</Typography>;\n\n const data = getTimelineData(targets);\n\n return (\n <ResponsiveContainer\n height={height}\n width={width}\n minHeight={EMPTY_HEIGHT + targets.length * 5}\n >\n <BarChart layout=\"vertical\" data={data} maxBarSize={10} barGap={0}>\n <CartesianGrid strokeDasharray=\"2 2\" />\n <XAxis type=\"number\" domain={[0, 'dataMax']} />\n <YAxis type=\"category\" dataKey=\"name\" padding={{ top: 0, bottom: 0 }} />\n <Tooltip content={<TargetToolTip />} />\n <Legend />\n <Bar\n dataKey=\"buildTime\"\n fill={theme.palette.grey[400]}\n minPointSize={1}\n />\n <Bar dataKey=\"compileTime\" fill={theme.palette.primary.main} />\n </BarChart>\n </ResponsiveContainer>\n );\n};\n"],"names":[],"mappings":";;;;;;AA+BA,MAAM,YAAe,GAAA,GAAA;AAErB,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,OAAS,EAAA;AAAA,MACP,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA,KAAA;AAAA,MAC1C,OAAS,E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Ac,CAAI,EAAA,CAAA;AAAA,4BACpC,MAAO,EAAA,EAAA,CAAA;AAAA,wBACR,GAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,WAAA;AAAA,YACR,IAAM,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA;AAAA,YAC5B,YAAc,EAAA;AAAA;AAAA,SAChB;AAAA,wBACA,GAAA,CAAC,OAAI,OAAQ,EAAA,aAAA,EAAc,MAAM,KAAM,CAAA,OAAA,CAAQ,QAAQ,IAAM,EAAA;AAAA,OAC/D,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import Grid from '@material-ui/core/Grid';
|
|
2
3
|
import Typography from '@material-ui/core/Typography';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
|
|
5
5
|
const DataValue = ({ field, value }) => {
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: field }),
|
|
8
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", children: value ?? "--" })
|
|
9
|
+
] });
|
|
7
10
|
};
|
|
8
|
-
const DataValueGridItem = (props) => /* @__PURE__ */
|
|
11
|
+
const DataValueGridItem = (props) => /* @__PURE__ */ jsx(Grid, { item: true, xs: props.xs ?? 6, md: props.md ?? 6, lg: props.lg ?? 4, children: /* @__PURE__ */ jsx(DataValue, { ...props }) });
|
|
9
12
|
|
|
10
13
|
export { DataValue, DataValueGridItem };
|
|
11
14
|
//# sourceMappingURL=DataValue.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataValue.esm.js","sources":["../../../src/components/DataValue/DataValue.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 { GridSize } from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\
|
|
1
|
+
{"version":3,"file":"DataValue.esm.js","sources":["../../../src/components/DataValue/DataValue.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 { GridSize } from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\n\ninterface DataValueProps {\n field: string;\n value?: string | number | null | undefined;\n}\n\nexport const DataValue = ({ field, value }: DataValueProps) => {\n return (\n <div>\n <Typography variant=\"caption\">{field}</Typography>\n <Typography variant=\"subtitle1\">{value ?? '--'}</Typography>\n </div>\n );\n};\n\ninterface GridProps {\n xs?: GridSize;\n md?: GridSize;\n lg?: GridSize;\n}\n\nexport const DataValueGridItem = (props: DataValueProps & GridProps) => (\n <Grid item xs={props.xs ?? 6} md={props.md ?? 6} lg={props.lg ?? 4}>\n <DataValue {...props} />\n </Grid>\n);\n"],"names":[],"mappings":";;;;AAwBO,MAAM,SAAY,GAAA,CAAC,EAAE,KAAA,EAAO,OAA4B,KAAA;AAC7D,EAAA,4BACG,KACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,SAAA,EAAW,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,oBACpC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,WAAA,EAAa,mBAAS,IAAK,EAAA;AAAA,GACjD,EAAA,CAAA;AAEJ;AAQa,MAAA,iBAAA,GAAoB,CAAC,KAChC,qBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,EAAI,EAAA,KAAA,CAAM,EAAM,IAAA,CAAA,EAAG,IAAI,KAAM,CAAA,EAAA,IAAM,CAAG,EAAA,EAAA,EAAI,KAAM,CAAA,EAAA,IAAM,GAC/D,QAAC,kBAAA,GAAA,CAAA,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,CACxB,EAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { createStyles } from '@material-ui/core/styles';
|
|
3
3
|
import withStyles from '@material-ui/core/styles/withStyles';
|
|
4
4
|
import InputBase from '@material-ui/core/InputBase/InputBase';
|
|
@@ -43,16 +43,19 @@ const DatePicker = ({
|
|
|
43
43
|
...inputProps
|
|
44
44
|
}) => {
|
|
45
45
|
const classes = useStyles();
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
return /* @__PURE__ */ jsxs("div", { className: classes.root, children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Typography, { variant: "button", children: label }),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
BootstrapInput,
|
|
50
|
+
{
|
|
51
|
+
inputProps: { "aria-label": label },
|
|
52
|
+
type: "date",
|
|
53
|
+
fullWidth: true,
|
|
54
|
+
onChange: (event) => onDateChange?.(event.target.value),
|
|
55
|
+
...inputProps
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] });
|
|
56
59
|
};
|
|
57
60
|
|
|
58
61
|
export { DatePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.esm.js","sources":["../../../src/components/DatePicker/DatePicker.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":"DatePicker.esm.js","sources":["../../../src/components/DatePicker/DatePicker.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 { createStyles } from '@material-ui/core/styles';\nimport { InputProps } from '@material-ui/core/Input';\nimport withStyles from '@material-ui/core/styles/withStyles';\nimport { Theme } from '@material-ui/core/styles/createTheme';\nimport InputBase from '@material-ui/core/InputBase/InputBase';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport Typography from '@material-ui/core/Typography/Typography';\n\nconst BootstrapInput = withStyles((theme: Theme) =>\n createStyles({\n root: {\n margin: theme.spacing(1, 0),\n maxWidth: 300,\n 'label + &': {\n marginTop: theme.spacing(3),\n },\n },\n input: {\n borderRadius: 4,\n position: 'relative',\n backgroundColor: theme.palette.background.paper,\n border: '1px solid #ced4da',\n fontSize: 16,\n padding: '10px 26px 10px 12px',\n transition: theme.transitions.create(['border-color', 'box-shadow']),\n fontFamily: 'Helvetica Neue',\n height: 25,\n '&:focus': {\n background: theme.palette.background.paper,\n borderRadius: 4,\n },\n },\n }),\n)(InputBase);\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\ninterface DatePickerProps {\n label: string;\n onDateChange?: (date: string) => void;\n}\n\nexport const DatePicker = ({\n label,\n onDateChange,\n ...inputProps\n}: InputProps & DatePickerProps) => {\n const classes = useStyles();\n\n return (\n <div className={classes.root}>\n <Typography variant=\"button\">{label}</Typography>\n <BootstrapInput\n inputProps={{ 'aria-label': label }}\n type=\"date\"\n fullWidth\n onChange={event => onDateChange?.(event.target.value)}\n {...inputProps}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAwBA,MAAM,cAAiB,GAAA,UAAA;AAAA,EAAW,CAAC,UACjC,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA,MAC1B,QAAU,EAAA,GAAA;AAAA,MACV,WAAa,EAAA;AAAA,QACX,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAC5B,KACF;AAAA,IACA,KAAO,EAAA;AAAA,MACL,YAAc,EAAA,CAAA;AAAA,MACd,QAAU,EAAA,UAAA;AAAA,MACV,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA,KAAA;AAAA,MAC1C,MAAQ,EAAA,mBAAA;AAAA,MACR,QAAU,EAAA,EAAA;AAAA,MACV,OAAS,EAAA,qBAAA;AAAA,MACT,YAAY,KAAM,CAAA,WAAA,CAAY,OAAO,CAAC,cAAA,EAAgB,YAAY,CAAC,CAAA;AAAA,MACnE,UAAY,EAAA,gBAAA;AAAA,MACZ,MAAQ,EAAA,EAAA;AAAA,MACR,SAAW,EAAA;AAAA,QACT,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA,KAAA;AAAA,QACrC,YAAc,EAAA;AAAA;AAChB;AACF,GACD;AACH,CAAA,CAAE,SAAS,CAAA;AAEX,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA;AAAA;AAEnB,CAAC,CAAA;AAOM,MAAM,aAAa,CAAC;AAAA,EACzB,KAAA;AAAA,EACA,YAAA;AAAA,EACA,GAAG;AACL,CAAoC,KAAA;AAClC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,uBACG,IAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,IACtB,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,QAAA,EAAU,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,oBACpC,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,UAAA,EAAY,EAAE,YAAA,EAAc,KAAM,EAAA;AAAA,QAClC,IAAK,EAAA,MAAA;AAAA,QACL,SAAS,EAAA,IAAA;AAAA,QACT,QAAU,EAAA,CAAA,KAAA,KAAS,YAAe,GAAA,KAAA,CAAM,OAAO,KAAK,CAAA;AAAA,QACnD,GAAG;AAAA;AAAA;AACN,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Progress, EmptyState, ContentHeader, SupportButton, Table, InfoCard } from '@backstage/core-components';
|
|
3
3
|
import { useApi } from '@backstage/core-plugin-api';
|
|
4
4
|
import { xcmetricsApiRef } from '../../api/types.esm.js';
|
|
@@ -19,12 +19,12 @@ const Overview = () => {
|
|
|
19
19
|
error
|
|
20
20
|
} = useAsync(async () => client.getBuilds(), []);
|
|
21
21
|
if (loading) {
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
23
23
|
} else if (error) {
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message });
|
|
25
25
|
}
|
|
26
26
|
if (!builds || !builds.length) {
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
28
|
EmptyState,
|
|
29
29
|
{
|
|
30
30
|
missing: "data",
|
|
@@ -33,20 +33,29 @@ const Overview = () => {
|
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(ContentHeader, { title: "XCMetrics Dashboard", children: /* @__PURE__ */ jsx(SupportButton, { children: "Dashboard for XCMetrics" }) }),
|
|
38
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, direction: "row", children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 8, lg: 8, xl: 9, children: /* @__PURE__ */ jsx(
|
|
40
|
+
Table,
|
|
41
|
+
{
|
|
42
|
+
options: {
|
|
43
|
+
paging: false,
|
|
44
|
+
search: false,
|
|
45
|
+
sorting: false,
|
|
46
|
+
draggable: false
|
|
47
|
+
},
|
|
48
|
+
data: builds,
|
|
49
|
+
columns: overviewColumns,
|
|
50
|
+
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
"Latest Builds",
|
|
52
|
+
/* @__PURE__ */ jsx(StatusMatrix, {})
|
|
53
|
+
] })
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 4, lg: 4, xl: 3, children: /* @__PURE__ */ jsx(InfoCard, { children: /* @__PURE__ */ jsx(OverviewTrends, {}) }) })
|
|
57
|
+
] })
|
|
58
|
+
] });
|
|
50
59
|
};
|
|
51
60
|
|
|
52
61
|
export { Overview };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overview.esm.js","sources":["../../../src/components/Overview/Overview.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":"Overview.esm.js","sources":["../../../src/components/Overview/Overview.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 {\n ContentHeader,\n SupportButton,\n Progress,\n Table,\n EmptyState,\n InfoCard,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { xcmetricsApiRef } from '../../api';\nimport useAsync from 'react-use/esm/useAsync';\nimport Alert from '@material-ui/lab/Alert';\nimport { StatusMatrix } from '../StatusMatrix';\nimport Grid from '@material-ui/core/Grid';\nimport { OverviewTrends } from '../OverviewTrends';\nimport { overviewColumns } from '../BuildTableColumns';\n\nexport const Overview = () => {\n const client = useApi(xcmetricsApiRef);\n const {\n value: builds,\n loading,\n error,\n } = useAsync(async () => client.getBuilds(), []);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!builds || !builds.length) {\n return (\n <EmptyState\n missing=\"data\"\n title=\"No builds to show\"\n description=\"There are no builds in XCMetrics yet\"\n />\n );\n }\n\n return (\n <>\n <ContentHeader title=\"XCMetrics Dashboard\">\n <SupportButton>Dashboard for XCMetrics</SupportButton>\n </ContentHeader>\n <Grid container spacing={3} direction=\"row\">\n <Grid item xs={12} md={8} lg={8} xl={9}>\n <Table\n options={{\n paging: false,\n search: false,\n sorting: false,\n draggable: false,\n }}\n data={builds}\n columns={overviewColumns}\n title={\n <>\n Latest Builds\n <StatusMatrix />\n </>\n }\n />\n </Grid>\n <Grid item xs={12} md={4} lg={4} xl={3}>\n <InfoCard>\n <OverviewTrends />\n </InfoCard>\n </Grid>\n </Grid>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgCO,MAAM,WAAW,MAAM;AAC5B,EAAM,MAAA,MAAA,GAAS,OAAO,eAAe,CAAA;AACrC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,MACE,QAAS,CAAA,YAAY,OAAO,SAAU,EAAA,EAAG,EAAE,CAAA;AAE/C,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2BAAQ,QAAS,EAAA,EAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAA,uBAAQ,GAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAS,gBAAM,OAAQ,EAAA,CAAA;AAAA;AAGhD,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,GAAA,CAAC,YACC,QAAC,kBAAA,GAAA,CAAA,cAAA,EAAA,EAAe,GAClB,CACF,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import Grid from '@material-ui/core/Grid';
|
|
2
3
|
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
3
|
-
import
|
|
4
|
+
import { useState } from 'react';
|
|
4
5
|
import { Progress, Select } from '@backstage/core-components';
|
|
5
6
|
import { Trend } from '../Trend/Trend.esm.js';
|
|
6
7
|
import Alert from '@material-ui/lab/Alert';
|
|
@@ -44,7 +45,7 @@ const OverviewTrends = () => {
|
|
|
44
45
|
[days]
|
|
45
46
|
);
|
|
46
47
|
if (buildCountsResult.loading && buildTimesResult.loading) {
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
48
49
|
}
|
|
49
50
|
const sumBuilds = sumField((b) => b.builds, buildCountsResult.value);
|
|
50
51
|
const sumErrors = sumField((b) => b.errors, buildCountsResult.value);
|
|
@@ -58,74 +59,92 @@ const OverviewTrends = () => {
|
|
|
58
59
|
(b) => b.durationP95
|
|
59
60
|
);
|
|
60
61
|
const totalBuildTime = sumField((t) => t.totalDuration, buildTimesResult.value);
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
selected: days,
|
|
65
|
-
items: DAYS_SELECT_ITEMS,
|
|
66
|
-
label: "Trends for",
|
|
67
|
-
onChange: (selection) => setDays(selection)
|
|
68
|
-
}
|
|
69
|
-
), buildCountsResult.error && /* @__PURE__ */ React.createElement(Alert, { severity: "error", className: classes.spacingVertical }, /* @__PURE__ */ React.createElement(AlertTitle, null, "Failed to fetch build counts"), buildCountsResult?.error?.message), buildTimesResult.error && /* @__PURE__ */ React.createElement(Alert, { severity: "error", className: classes.spacingVertical }, /* @__PURE__ */ React.createElement(AlertTitle, null, "Failed to fetch build times"), buildTimesResult?.error?.message), (!buildCountsResult.error || !buildTimesResult.error) && /* @__PURE__ */ React.createElement("div", { className: classes.spacingVertical }, /* @__PURE__ */ React.createElement(
|
|
70
|
-
Trend,
|
|
71
|
-
{
|
|
72
|
-
title: "Build Time",
|
|
73
|
-
color: theme.palette.secondary.main,
|
|
74
|
-
data: getValues((e) => e.durationP50, buildTimesResult.value)
|
|
75
|
-
}
|
|
76
|
-
), /* @__PURE__ */ React.createElement(
|
|
77
|
-
Trend,
|
|
78
|
-
{
|
|
79
|
-
title: "Error Rate",
|
|
80
|
-
color: theme.palette.status.warning,
|
|
81
|
-
data: getErrorRatios(buildCountsResult.value)
|
|
82
|
-
}
|
|
83
|
-
), /* @__PURE__ */ React.createElement(
|
|
84
|
-
Trend,
|
|
85
|
-
{
|
|
86
|
-
title: "Build Count",
|
|
87
|
-
color: theme.palette.primary.main,
|
|
88
|
-
data: getValues((e) => e.builds, buildCountsResult.value)
|
|
89
|
-
}
|
|
90
|
-
), /* @__PURE__ */ React.createElement(
|
|
91
|
-
Grid,
|
|
92
|
-
{
|
|
93
|
-
container: true,
|
|
94
|
-
spacing: 3,
|
|
95
|
-
direction: "row",
|
|
96
|
-
className: classes.spacingTop
|
|
97
|
-
},
|
|
98
|
-
/* @__PURE__ */ React.createElement(DataValueGridItem, { field: "Build Count", value: sumBuilds }),
|
|
99
|
-
/* @__PURE__ */ React.createElement(DataValueGridItem, { field: "Error Count", value: sumErrors }),
|
|
100
|
-
/* @__PURE__ */ React.createElement(
|
|
101
|
-
DataValueGridItem,
|
|
62
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
Select,
|
|
102
65
|
{
|
|
103
|
-
|
|
104
|
-
|
|
66
|
+
selected: days,
|
|
67
|
+
items: DAYS_SELECT_ITEMS,
|
|
68
|
+
label: "Trends for",
|
|
69
|
+
onChange: (selection) => setDays(selection)
|
|
105
70
|
}
|
|
106
71
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
72
|
+
buildCountsResult.error && /* @__PURE__ */ jsxs(Alert, { severity: "error", className: classes.spacingVertical, children: [
|
|
73
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Failed to fetch build counts" }),
|
|
74
|
+
buildCountsResult?.error?.message
|
|
75
|
+
] }),
|
|
76
|
+
buildTimesResult.error && /* @__PURE__ */ jsxs(Alert, { severity: "error", className: classes.spacingVertical, children: [
|
|
77
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Failed to fetch build times" }),
|
|
78
|
+
buildTimesResult?.error?.message
|
|
79
|
+
] }),
|
|
80
|
+
(!buildCountsResult.error || !buildTimesResult.error) && /* @__PURE__ */ jsxs("div", { className: classes.spacingVertical, children: [
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Trend,
|
|
83
|
+
{
|
|
84
|
+
title: "Build Time",
|
|
85
|
+
color: theme.palette.secondary.main,
|
|
86
|
+
data: getValues((e) => e.durationP50, buildTimesResult.value)
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Trend,
|
|
91
|
+
{
|
|
92
|
+
title: "Error Rate",
|
|
93
|
+
color: theme.palette.status.warning,
|
|
94
|
+
data: getErrorRatios(buildCountsResult.value)
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
Trend,
|
|
99
|
+
{
|
|
100
|
+
title: "Build Count",
|
|
101
|
+
color: theme.palette.primary.main,
|
|
102
|
+
data: getValues((e) => e.builds, buildCountsResult.value)
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ jsxs(
|
|
106
|
+
Grid,
|
|
107
|
+
{
|
|
108
|
+
container: true,
|
|
109
|
+
spacing: 3,
|
|
110
|
+
direction: "row",
|
|
111
|
+
className: classes.spacingTop,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(DataValueGridItem, { field: "Build Count", value: sumBuilds }),
|
|
114
|
+
/* @__PURE__ */ jsx(DataValueGridItem, { field: "Error Count", value: sumErrors }),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
DataValueGridItem,
|
|
117
|
+
{
|
|
118
|
+
field: "Error Rate",
|
|
119
|
+
value: errorRate && formatPercentage(errorRate)
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
DataValueGridItem,
|
|
124
|
+
{
|
|
125
|
+
field: "Avg. Build Time (P50)",
|
|
126
|
+
value: averageBuildDurationP50
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
DataValueGridItem,
|
|
131
|
+
{
|
|
132
|
+
field: "Avg. Build Time (P95)",
|
|
133
|
+
value: averageBuildDurationP95
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ jsx(
|
|
137
|
+
DataValueGridItem,
|
|
138
|
+
{
|
|
139
|
+
field: "Total Build Time",
|
|
140
|
+
value: totalBuildTime && formatDuration(totalBuildTime)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] })
|
|
147
|
+
] });
|
|
129
148
|
};
|
|
130
149
|
|
|
131
150
|
export { OverviewTrends };
|