@axis-backstage/plugin-statuspage 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 +100 -0
- package/dist/api/StatuspageApi.esm.js.map +1 -1
- package/dist/api/StatuspageClient.esm.js.map +1 -1
- package/dist/components/ComponentGroupCard.esm.js.map +1 -1
- package/dist/components/ComponentGroupStatusChips.esm.js.map +1 -1
- package/dist/components/ComponentGroupsList.esm.js.map +1 -1
- package/dist/components/ComponentsTable.esm.js.map +1 -1
- package/dist/components/StatusChip.esm.js.map +1 -1
- package/dist/components/StatuspageComponent.esm.js.map +1 -1
- package/dist/components/StatuspageEntityCard.esm.js.map +1 -1
- package/dist/hooks/useComponents.esm.js.map +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/package.json +16 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# @axis-backstage/plugin-statuspage
|
|
2
|
+
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ede8341: Updated to Backstage v1.36.1.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [ede8341]
|
|
12
|
+
- @axis-backstage/plugin-statuspage-common@0.6.0
|
|
13
|
+
|
|
14
|
+
## 0.6.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 6fd284d: Updated to Backstage v1.30.1.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [6fd284d]
|
|
23
|
+
- @axis-backstage/plugin-statuspage-common@0.5.0
|
|
24
|
+
|
|
25
|
+
## 0.5.1
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- 6d21448: Fix circular dependencies
|
|
30
|
+
|
|
31
|
+
## 0.5.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- 0b948ea: Generate pluginIds for plugins and bumping @backstage/cli
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [0b948ea]
|
|
40
|
+
- @axis-backstage/plugin-statuspage-common@0.4.0
|
|
41
|
+
|
|
42
|
+
## 0.4.0
|
|
43
|
+
|
|
44
|
+
### Minor Changes
|
|
45
|
+
|
|
46
|
+
- 916589b: Bumped Backstage to v.27.7 and removed the TechRadar plugin since it was not used and caused problems with the new version.
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [916589b]
|
|
51
|
+
- @axis-backstage/plugin-statuspage-common@0.3.0
|
|
52
|
+
|
|
53
|
+
## 0.3.4
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- 0535af4: Bumped backstage dependencies to match 1.26.0
|
|
58
|
+
- Updated dependencies [0535af4]
|
|
59
|
+
- @axis-backstage/plugin-statuspage-common@0.2.1
|
|
60
|
+
|
|
61
|
+
## 0.3.3
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- ae965c0: Fix broken workspace dependencies
|
|
66
|
+
|
|
67
|
+
## 0.3.2
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- 60b6270: Fix broken release
|
|
72
|
+
|
|
73
|
+
## 0.3.1
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- 73b296f: Better README and small UI-fixes
|
|
78
|
+
|
|
79
|
+
## 0.3.0
|
|
80
|
+
|
|
81
|
+
### Minor Changes
|
|
82
|
+
|
|
83
|
+
- 32683b9: StatuspageEntityCard was route mounted incorrectly, which broke the component in certain cases.
|
|
84
|
+
|
|
85
|
+
## 0.2.1
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- 050e48d: Replace all Mui Grid v1 with v2
|
|
90
|
+
|
|
91
|
+
## 0.2.0
|
|
92
|
+
|
|
93
|
+
### Minor Changes
|
|
94
|
+
|
|
95
|
+
- b445aaa: Initial Release of the Statuspage Plugin
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- Updated dependencies [b445aaa]
|
|
100
|
+
- @axis-backstage/plugin-statuspage-common@0.2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatuspageApi.esm.js","sources":["../../src/api/StatuspageApi.ts"],"sourcesContent":["import { createApiRef } from '@backstage/core-plugin-api';\n\nimport type {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\n/**\n * The definition for the statuspage api.\n *\n * @public\n */\nexport type StatuspageApi = {\n getComponents(name: string): Promise<Component[]>;\n getComponentGroups(name: string): Promise<ComponentGroup[]>;\n getLink(name: string): Promise<{ url: string }>;\n};\n\n/**\n * The apiref for the statuspage plugin.\n *\n * @public\n */\nexport const statuspageApiRef = createApiRef<StatuspageApi>({\n id: 'plugin.statuspage',\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,mBAAmB,YAA4B,CAAA;AAAA,EAC1D,EAAI,EAAA
|
|
1
|
+
{"version":3,"file":"StatuspageApi.esm.js","sources":["../../src/api/StatuspageApi.ts"],"sourcesContent":["import { createApiRef } from '@backstage/core-plugin-api';\n\nimport type {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\n/**\n * The definition for the statuspage api.\n *\n * @public\n */\nexport type StatuspageApi = {\n getComponents(name: string): Promise<Component[]>;\n getComponentGroups(name: string): Promise<ComponentGroup[]>;\n getLink(name: string): Promise<{ url: string }>;\n};\n\n/**\n * The apiref for the statuspage plugin.\n *\n * @public\n */\nexport const statuspageApiRef = createApiRef<StatuspageApi>({\n id: 'plugin.statuspage',\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,mBAAmB,YAA4B,CAAA;AAAA,EAC1D,EAAI,EAAA;AACN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatuspageClient.esm.js","sources":["../../src/api/StatuspageClient.ts"],"sourcesContent":["import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { StatuspageApi } from './StatuspageApi';\nimport {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\n/**\n * The client implementation for the frontend api.\n *\n * @public\n */\nexport class StatuspageClient implements StatuspageApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n /**\n * Fetches link for a statuspage\n *\n * @param name - name of the statuspage instance (from config)\n * @returns the url\n */\n async getLink(name: string): Promise<{ url: string }> {\n const baseUrl = await this.discoveryApi.getBaseUrl('statuspage');\n const response = await this.fetchApi.fetch(\n `${baseUrl}/fetch-link/${encodeURIComponent(name)}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n if (response.ok) {\n const data = await response.json();\n return data;\n }\n throw new Error(\n `Failed to get statuspage link for ${name} with status code ${response.status}`,\n );\n }\n\n /**\n * Returns the components for a statuspage instance\n *\n * @param name - the name of statuspage instance (from config)\n * @returns the components\n */\n async getComponents(name: string): Promise<Component[]> {\n const baseUrl = await this.discoveryApi.getBaseUrl('statuspage');\n const data = await this.fetchApi.fetch(\n `${baseUrl}/fetch-components/${encodeURIComponent(name)}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n\n if (data.ok) return data.json();\n throw new Error(`Failed to get statuspage components for ${name}`);\n }\n\n /**\n * Returns the component groups for a statuspage instance\n *\n * @param name - the name of the statuspage instance (from config)\n * @returns the component groups\n */\n async getComponentGroups(name: string): Promise<ComponentGroup[]> {\n const baseUrl = await this.discoveryApi.getBaseUrl('statuspage');\n const data = await this.fetchApi.fetch(\n `${baseUrl}/fetch-component-groups/${encodeURIComponent(name)}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n\n if (data.ok) return data.json();\n throw new Error(`Failed to get statuspage component groups for ${name}`);\n }\n}\n"],"names":[],"mappings":"AAYO,MAAM,gBAA0C,CAAA;AAAA,EACpC,YAAA
|
|
1
|
+
{"version":3,"file":"StatuspageClient.esm.js","sources":["../../src/api/StatuspageClient.ts"],"sourcesContent":["import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { StatuspageApi } from './StatuspageApi';\nimport {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\n/**\n * The client implementation for the frontend api.\n *\n * @public\n */\nexport class StatuspageClient implements StatuspageApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n /**\n * Fetches link for a statuspage\n *\n * @param name - name of the statuspage instance (from config)\n * @returns the url\n */\n async getLink(name: string): Promise<{ url: string }> {\n const baseUrl = await this.discoveryApi.getBaseUrl('statuspage');\n const response = await this.fetchApi.fetch(\n `${baseUrl}/fetch-link/${encodeURIComponent(name)}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n if (response.ok) {\n const data = await response.json();\n return data;\n }\n throw new Error(\n `Failed to get statuspage link for ${name} with status code ${response.status}`,\n );\n }\n\n /**\n * Returns the components for a statuspage instance\n *\n * @param name - the name of statuspage instance (from config)\n * @returns the components\n */\n async getComponents(name: string): Promise<Component[]> {\n const baseUrl = await this.discoveryApi.getBaseUrl('statuspage');\n const data = await this.fetchApi.fetch(\n `${baseUrl}/fetch-components/${encodeURIComponent(name)}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n\n if (data.ok) return data.json();\n throw new Error(`Failed to get statuspage components for ${name}`);\n }\n\n /**\n * Returns the component groups for a statuspage instance\n *\n * @param name - the name of the statuspage instance (from config)\n * @returns the component groups\n */\n async getComponentGroups(name: string): Promise<ComponentGroup[]> {\n const baseUrl = await this.discoveryApi.getBaseUrl('statuspage');\n const data = await this.fetchApi.fetch(\n `${baseUrl}/fetch-component-groups/${encodeURIComponent(name)}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n },\n );\n\n if (data.ok) return data.json();\n throw new Error(`Failed to get statuspage component groups for ${name}`);\n }\n}\n"],"names":[],"mappings":"AAYO,MAAM,gBAA0C,CAAA;AAAA,EACpC,YAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAA6D,EAAA;AACvE,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAQ,CAAA,QAAA;AAAA;AAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,QAAQ,IAAwC,EAAA;AACpD,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAW,YAAY,CAAA;AAC/D,IAAM,MAAA,QAAA,GAAW,MAAM,IAAA,CAAK,QAAS,CAAA,KAAA;AAAA,MACnC,CAAG,EAAA,OAAO,CAAe,YAAA,EAAA,kBAAA,CAAmB,IAAI,CAAC,CAAA,CAAA;AAAA,MACjD;AAAA,QACE,MAAQ,EAAA,KAAA;AAAA,QACR,OAAS,EAAA;AAAA,UACP,cAAgB,EAAA;AAAA;AAClB;AACF,KACF;AACA,IAAA,IAAI,SAAS,EAAI,EAAA;AACf,MAAM,MAAA,IAAA,GAAO,MAAM,QAAA,CAAS,IAAK,EAAA;AACjC,MAAO,OAAA,IAAA;AAAA;AAET,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAqC,kCAAA,EAAA,IAAI,CAAqB,kBAAA,EAAA,QAAA,CAAS,MAAM,CAAA;AAAA,KAC/E;AAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,cAAc,IAAoC,EAAA;AACtD,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAW,YAAY,CAAA;AAC/D,IAAM,MAAA,IAAA,GAAO,MAAM,IAAA,CAAK,QAAS,CAAA,KAAA;AAAA,MAC/B,CAAG,EAAA,OAAO,CAAqB,kBAAA,EAAA,kBAAA,CAAmB,IAAI,CAAC,CAAA,CAAA;AAAA,MACvD;AAAA,QACE,MAAQ,EAAA,KAAA;AAAA,QACR,OAAS,EAAA;AAAA,UACP,cAAgB,EAAA;AAAA;AAClB;AACF,KACF;AAEA,IAAA,IAAI,IAAK,CAAA,EAAA,EAAW,OAAA,IAAA,CAAK,IAAK,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAA2C,wCAAA,EAAA,IAAI,CAAE,CAAA,CAAA;AAAA;AACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,mBAAmB,IAAyC,EAAA;AAChE,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAW,YAAY,CAAA;AAC/D,IAAM,MAAA,IAAA,GAAO,MAAM,IAAA,CAAK,QAAS,CAAA,KAAA;AAAA,MAC/B,CAAG,EAAA,OAAO,CAA2B,wBAAA,EAAA,kBAAA,CAAmB,IAAI,CAAC,CAAA,CAAA;AAAA,MAC7D;AAAA,QACE,MAAQ,EAAA,KAAA;AAAA,QACR,OAAS,EAAA;AAAA,UACP,cAAgB,EAAA;AAAA;AAClB;AACF,KACF;AAEA,IAAA,IAAI,IAAK,CAAA,EAAA,EAAW,OAAA,IAAA,CAAK,IAAK,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiD,8CAAA,EAAA,IAAI,CAAE,CAAA,CAAA;AAAA;AAE3E;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGroupCard.esm.js","sources":["../../src/components/ComponentGroupCard.tsx"],"sourcesContent":["import React from 'react';\nimport Accordion from '@mui/material/Accordion';\nimport AccordionDetails from '@mui/material/AccordionDetails';\nimport AccordionSummary from '@mui/material/AccordionSummary';\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\nimport { ComponentsTable } from './ComponentsTable';\nimport { ComponentGroupStatusChips } from './ComponentGroupStatusChips';\nimport type {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\nexport type ComponentGroupProps = {\n components: Component[];\n componentGroup: ComponentGroup;\n expanded?: boolean;\n};\n\nconst DenseAccordion = styled(Accordion)({\n margin: '2px',\n borderRadius: '2px',\n});\n\nconst DenseAccordionSummary = styled(AccordionSummary)({\n '&.Mui-expanded': {\n minHeight: '48px !important',\n },\n});\n\nexport const ComponentGroupCard = ({\n components,\n componentGroup,\n expanded = false,\n}: ComponentGroupProps) => {\n return (\n <DenseAccordion key={componentGroup.id} defaultExpanded={expanded}>\n <DenseAccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant=\"subtitle1\">{componentGroup.name}</Typography>\n <ComponentGroupStatusChips components={components} />\n </DenseAccordionSummary>\n <AccordionDetails>\n <ComponentsTable components={components} />\n </AccordionDetails>\n </DenseAccordion>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAoBA,MAAM,cAAA,GAAiB,MAAO,CAAA,SAAS,CAAE,CAAA;AAAA,EACvC,MAAQ,EAAA,KAAA;AAAA,EACR,YAAc,EAAA
|
|
1
|
+
{"version":3,"file":"ComponentGroupCard.esm.js","sources":["../../src/components/ComponentGroupCard.tsx"],"sourcesContent":["import React from 'react';\nimport Accordion from '@mui/material/Accordion';\nimport AccordionDetails from '@mui/material/AccordionDetails';\nimport AccordionSummary from '@mui/material/AccordionSummary';\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\nimport { ComponentsTable } from './ComponentsTable';\nimport { ComponentGroupStatusChips } from './ComponentGroupStatusChips';\nimport type {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\nexport type ComponentGroupProps = {\n components: Component[];\n componentGroup: ComponentGroup;\n expanded?: boolean;\n};\n\nconst DenseAccordion = styled(Accordion)({\n margin: '2px',\n borderRadius: '2px',\n});\n\nconst DenseAccordionSummary = styled(AccordionSummary)({\n '&.Mui-expanded': {\n minHeight: '48px !important',\n },\n});\n\nexport const ComponentGroupCard = ({\n components,\n componentGroup,\n expanded = false,\n}: ComponentGroupProps) => {\n return (\n <DenseAccordion key={componentGroup.id} defaultExpanded={expanded}>\n <DenseAccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography variant=\"subtitle1\">{componentGroup.name}</Typography>\n <ComponentGroupStatusChips components={components} />\n </DenseAccordionSummary>\n <AccordionDetails>\n <ComponentsTable components={components} />\n </AccordionDetails>\n </DenseAccordion>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAoBA,MAAM,cAAA,GAAiB,MAAO,CAAA,SAAS,CAAE,CAAA;AAAA,EACvC,MAAQ,EAAA,KAAA;AAAA,EACR,YAAc,EAAA;AAChB,CAAC,CAAA;AAED,MAAM,qBAAA,GAAwB,MAAO,CAAA,gBAAgB,CAAE,CAAA;AAAA,EACrD,gBAAkB,EAAA;AAAA,IAChB,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA;AAEM,MAAM,qBAAqB,CAAC;AAAA,EACjC,UAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAW,GAAA;AACb,CAA2B,KAAA;AACzB,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,EAAe,GAAK,EAAA,cAAA,CAAe,EAAI,EAAA,eAAA,EAAiB,QACvD,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,qBAAsB,EAAA,EAAA,UAAA,kBAAa,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA,IAAe,qBAChD,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,WAAA,EAAA,EAAa,cAAe,CAAA,IAAK,CACrD,kBAAA,KAAA,CAAA,aAAA,CAAC,6BAA0B,UAAwB,EAAA,CACrD,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,EAAA,UAAA,EAAwB,CAC3C,CACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGroupStatusChips.esm.js","sources":["../../src/components/ComponentGroupStatusChips.tsx"],"sourcesContent":["import React from 'react';\nimport Grid from '@mui/material/Unstable_Grid2';\nimport { ComponentsTableProps } from './ComponentsTable';\nimport { StatusChip } from './StatusChip';\n\nexport const ComponentGroupStatusChips = ({\n components,\n}: ComponentsTableProps) => (\n <>\n {components.some(component => component.status !== 'operational') ? (\n components\n .filter(component => component.status !== 'operational')\n .map(component => (\n <Grid padding={0} alignSelf=\"center\" key={component.id}>\n <StatusChip status={component.status} />\n </Grid>\n ))\n ) : (\n <Grid padding={0} alignSelf=\"center\">\n <StatusChip status=\"operational\" />\n </Grid>\n )}\n </>\n);\n"],"names":[],"mappings":";;;;AAKO,MAAM,4BAA4B,CAAC;AAAA,EACxC
|
|
1
|
+
{"version":3,"file":"ComponentGroupStatusChips.esm.js","sources":["../../src/components/ComponentGroupStatusChips.tsx"],"sourcesContent":["import React from 'react';\nimport Grid from '@mui/material/Unstable_Grid2';\nimport { ComponentsTableProps } from './ComponentsTable';\nimport { StatusChip } from './StatusChip';\n\nexport const ComponentGroupStatusChips = ({\n components,\n}: ComponentsTableProps) => (\n <>\n {components.some(component => component.status !== 'operational') ? (\n components\n .filter(component => component.status !== 'operational')\n .map(component => (\n <Grid padding={0} alignSelf=\"center\" key={component.id}>\n <StatusChip status={component.status} />\n </Grid>\n ))\n ) : (\n <Grid padding={0} alignSelf=\"center\">\n <StatusChip status=\"operational\" />\n </Grid>\n )}\n </>\n);\n"],"names":[],"mappings":";;;;AAKO,MAAM,4BAA4B,CAAC;AAAA,EACxC;AACF,CACE,qBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,WAAW,IAAK,CAAA,CAAA,SAAA,KAAa,UAAU,MAAW,KAAA,aAAa,IAC9D,UACG,CAAA,MAAA,CAAO,eAAa,SAAU,CAAA,MAAA,KAAW,aAAa,CACtD,CAAA,GAAA,CAAI,+BACF,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,SAAS,CAAG,EAAA,SAAA,EAAU,UAAS,GAAK,EAAA,SAAA,CAAU,sBACjD,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,QAAQ,SAAU,CAAA,MAAA,EAAQ,CACxC,CACD,CAAA,uCAEF,IAAK,EAAA,EAAA,OAAA,EAAS,GAAG,SAAU,EAAA,QAAA,EAAA,sCACzB,UAAW,EAAA,EAAA,MAAA,EAAO,aAAc,EAAA,CACnC,CAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGroupsList.esm.js","sources":["../../src/components/ComponentGroupsList.tsx"],"sourcesContent":["import React from 'react';\nimport Stack from '@mui/material/Stack';\nimport { ComponentGroupCard } from './ComponentGroupCard';\nimport type {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\nexport type ComponentGroupListProps = {\n components: Component[];\n componentGroups: ComponentGroup[];\n expanded?: boolean;\n};\n\nexport const ComponentGroupsList = ({\n components,\n componentGroups,\n expanded,\n}: ComponentGroupListProps) => {\n return (\n <Stack paddingTop=\"10px\">\n {componentGroups.map(componentGroup => (\n <ComponentGroupCard\n key={componentGroup.id}\n componentGroup={componentGroup}\n components={components.filter(c => c.group_id === componentGroup.id)}\n expanded={expanded}\n />\n ))}\n </Stack>\n );\n};\n"],"names":[],"mappings":";;;;AAcO,MAAM,sBAAsB,CAAC;AAAA,EAClC,UAAA;AAAA,EACA,eAAA;AAAA,EACA
|
|
1
|
+
{"version":3,"file":"ComponentGroupsList.esm.js","sources":["../../src/components/ComponentGroupsList.tsx"],"sourcesContent":["import React from 'react';\nimport Stack from '@mui/material/Stack';\nimport { ComponentGroupCard } from './ComponentGroupCard';\nimport type {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\nexport type ComponentGroupListProps = {\n components: Component[];\n componentGroups: ComponentGroup[];\n expanded?: boolean;\n};\n\nexport const ComponentGroupsList = ({\n components,\n componentGroups,\n expanded,\n}: ComponentGroupListProps) => {\n return (\n <Stack paddingTop=\"10px\">\n {componentGroups.map(componentGroup => (\n <ComponentGroupCard\n key={componentGroup.id}\n componentGroup={componentGroup}\n components={components.filter(c => c.group_id === componentGroup.id)}\n expanded={expanded}\n />\n ))}\n </Stack>\n );\n};\n"],"names":[],"mappings":";;;;AAcO,MAAM,sBAAsB,CAAC;AAAA,EAClC,UAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAA+B,KAAA;AAC7B,EAAA,2CACG,KAAM,EAAA,EAAA,UAAA,EAAW,MACf,EAAA,EAAA,eAAA,CAAgB,IAAI,CACnB,cAAA,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAK,cAAe,CAAA,EAAA;AAAA,MACpB,cAAA;AAAA,MACA,YAAY,UAAW,CAAA,MAAA,CAAO,OAAK,CAAE,CAAA,QAAA,KAAa,eAAe,EAAE,CAAA;AAAA,MACnE;AAAA;AAAA,GAEH,CACH,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentsTable.esm.js","sources":["../../src/components/ComponentsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport type { Component } from '@axis-backstage/plugin-statuspage-common';\nimport { StatusChip } from './StatusChip';\n\nexport type ComponentsTableProps = {\n components: Component[];\n};\n\nexport const ComponentsTable = ({ components }: ComponentsTableProps) => {\n // Columns definition\n const columns: TableColumn[] = [\n { title: 'System', field: 'name', id: 'id' },\n {\n title: 'Status',\n field: 'status',\n render: (rowData: any) => <StatusChip status={rowData.status} />,\n align: 'right',\n },\n ];\n\n return (\n <Table\n options={{\n search: false,\n paging: false,\n header: false,\n padding: 'dense',\n toolbar: false,\n }}\n columns={columns}\n data={components.map(({ name, status, id }) => ({ name, status, id }))}\n />\n );\n};\n"],"names":[],"mappings":";;;;AASO,MAAM,eAAkB,GAAA,CAAC,EAAE,UAAA,EAAuC,KAAA;AAEvE,EAAA,MAAM,OAAyB,GAAA;AAAA,IAC7B,EAAE,KAAO,EAAA,QAAA,EAAU,KAAO,EAAA,MAAA,EAAQ,IAAI,IAAK,EAAA;AAAA,IAC3C;AAAA,MACE,KAAO,EAAA,QAAA;AAAA,MACP,KAAO,EAAA,QAAA;AAAA,MACP,QAAQ,CAAC,OAAA,yCAAkB,UAAW,EAAA,EAAA,MAAA,EAAQ,QAAQ,MAAQ,EAAA,CAAA;AAAA,MAC9D,KAAO,EAAA
|
|
1
|
+
{"version":3,"file":"ComponentsTable.esm.js","sources":["../../src/components/ComponentsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table, TableColumn } from '@backstage/core-components';\nimport type { Component } from '@axis-backstage/plugin-statuspage-common';\nimport { StatusChip } from './StatusChip';\n\nexport type ComponentsTableProps = {\n components: Component[];\n};\n\nexport const ComponentsTable = ({ components }: ComponentsTableProps) => {\n // Columns definition\n const columns: TableColumn[] = [\n { title: 'System', field: 'name', id: 'id' },\n {\n title: 'Status',\n field: 'status',\n render: (rowData: any) => <StatusChip status={rowData.status} />,\n align: 'right',\n },\n ];\n\n return (\n <Table\n options={{\n search: false,\n paging: false,\n header: false,\n padding: 'dense',\n toolbar: false,\n }}\n columns={columns}\n data={components.map(({ name, status, id }) => ({ name, status, id }))}\n />\n );\n};\n"],"names":[],"mappings":";;;;AASO,MAAM,eAAkB,GAAA,CAAC,EAAE,UAAA,EAAuC,KAAA;AAEvE,EAAA,MAAM,OAAyB,GAAA;AAAA,IAC7B,EAAE,KAAO,EAAA,QAAA,EAAU,KAAO,EAAA,MAAA,EAAQ,IAAI,IAAK,EAAA;AAAA,IAC3C;AAAA,MACE,KAAO,EAAA,QAAA;AAAA,MACP,KAAO,EAAA,QAAA;AAAA,MACP,QAAQ,CAAC,OAAA,yCAAkB,UAAW,EAAA,EAAA,MAAA,EAAQ,QAAQ,MAAQ,EAAA,CAAA;AAAA,MAC9D,KAAO,EAAA;AAAA;AACT,GACF;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,KAAA;AAAA,QACR,MAAQ,EAAA,KAAA;AAAA,QACR,MAAQ,EAAA,KAAA;AAAA,QACR,OAAS,EAAA,OAAA;AAAA,QACT,OAAS,EAAA;AAAA,OACX;AAAA,MACA,OAAA;AAAA,MACA,IAAM,EAAA,UAAA,CAAW,GAAI,CAAA,CAAC,EAAE,IAAA,EAAM,MAAQ,EAAA,EAAA,EAAU,MAAA,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAK,CAAA;AAAA;AAAA,GACvE;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusChip.esm.js","sources":["../../src/components/StatusChip.tsx"],"sourcesContent":["import React from 'react';\nimport Chip from '@mui/material/Chip';\nimport type { ComponentStatus } from '@axis-backstage/plugin-statuspage-common';\n\n/**\n * Maps statuspage component statuses to MUI colors.\n *\n */\nconst statusColorMap: { [key in ComponentStatus]: string } = {\n under_maintenance: 'info',\n operational: 'success',\n degraded_performance: 'warning',\n partial_outage: 'warning',\n major_outage: 'error',\n};\n\ntype StatusChipProps = {\n status: ComponentStatus;\n};\n\nconst formatStatusString = (status: string): string =>\n status\n .split('_')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\nexport const StatusChip = ({ status }: StatusChipProps) => (\n <Chip\n sx={{ margin: '0 8px' }}\n size=\"small\"\n label={formatStatusString(status)}\n color={statusColorMap[status] || ('default' as any)}\n />\n);\n"],"names":[],"mappings":";;;AAQA,MAAM,cAAuD,GAAA;AAAA,EAC3D,iBAAmB,EAAA,MAAA;AAAA,EACnB,WAAa,EAAA,SAAA;AAAA,EACb,oBAAsB,EAAA,SAAA;AAAA,EACtB,cAAgB,EAAA,SAAA;AAAA,EAChB,YAAc,EAAA
|
|
1
|
+
{"version":3,"file":"StatusChip.esm.js","sources":["../../src/components/StatusChip.tsx"],"sourcesContent":["import React from 'react';\nimport Chip from '@mui/material/Chip';\nimport type { ComponentStatus } from '@axis-backstage/plugin-statuspage-common';\n\n/**\n * Maps statuspage component statuses to MUI colors.\n *\n */\nconst statusColorMap: { [key in ComponentStatus]: string } = {\n under_maintenance: 'info',\n operational: 'success',\n degraded_performance: 'warning',\n partial_outage: 'warning',\n major_outage: 'error',\n};\n\ntype StatusChipProps = {\n status: ComponentStatus;\n};\n\nconst formatStatusString = (status: string): string =>\n status\n .split('_')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\nexport const StatusChip = ({ status }: StatusChipProps) => (\n <Chip\n sx={{ margin: '0 8px' }}\n size=\"small\"\n label={formatStatusString(status)}\n color={statusColorMap[status] || ('default' as any)}\n />\n);\n"],"names":[],"mappings":";;;AAQA,MAAM,cAAuD,GAAA;AAAA,EAC3D,iBAAmB,EAAA,MAAA;AAAA,EACnB,WAAa,EAAA,SAAA;AAAA,EACb,oBAAsB,EAAA,SAAA;AAAA,EACtB,cAAgB,EAAA,SAAA;AAAA,EAChB,YAAc,EAAA;AAChB,CAAA;AAMA,MAAM,kBAAA,GAAqB,CAAC,MAC1B,KAAA,MAAA,CACG,MAAM,GAAG,CAAA,CACT,GAAI,CAAA,CAAA,IAAA,KAAQ,IAAK,CAAA,MAAA,CAAO,CAAC,CAAE,CAAA,WAAA,EAAgB,GAAA,IAAA,CAAK,KAAM,CAAA,CAAC,EAAE,WAAY,EAAC,CACtE,CAAA,IAAA,CAAK,GAAG,CAAA;AAEN,MAAM,UAAa,GAAA,CAAC,EAAE,MAAA,EAC3B,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,IAAA;AAAA,EAAA;AAAA,IACC,EAAA,EAAI,EAAE,MAAA,EAAQ,OAAQ,EAAA;AAAA,IACtB,IAAK,EAAA,OAAA;AAAA,IACL,KAAA,EAAO,mBAAmB,MAAM,CAAA;AAAA,IAChC,KAAA,EAAO,cAAe,CAAA,MAAM,CAAM,IAAA;AAAA;AACpC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatuspageComponent.esm.js","sources":["../../src/components/StatuspageComponent.tsx"],"sourcesContent":["import React from 'react';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { ComponentGroupsList } from './ComponentGroupsList';\nimport IconButton from '@mui/material/IconButton';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport { useComponents } from '../hooks/useComponents';\n\n/**\n * StatuspageComponent props.\n *\n * @public\n */\nexport type StatuspageProps = {\n name: string;\n};\n\n/**\n * Visualizes a full statuspage.\n *\n * @param name - instance name from app config.\n * @public\n */\nexport const StatuspageComponent = ({ name }: StatuspageProps) => {\n const { loading, error, value } = useComponents(name);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const linkAction = value?.url && (\n <IconButton\n aria-label=\"Go to our statuspage\"\n role=\"button\"\n title=\"Go to statuspage(.io)\"\n href={value?.url}\n target=\"_blank\"\n >\n <OpenInNewIcon />\n </IconButton>\n );\n\n return (\n <InfoCard title=\"Status of our services\" action={linkAction}>\n <ComponentGroupsList\n components={value?.components || []}\n componentGroups={value?.componentGroups || []}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,mBAAsB,GAAA,CAAC,EAAE,IAAA,EAA4B,KAAA;AAChE,EAAA,MAAM,EAAE,OAAS,EAAA,KAAA,EAAO,KAAM,EAAA,GAAI,cAAc,IAAI,CAAA
|
|
1
|
+
{"version":3,"file":"StatuspageComponent.esm.js","sources":["../../src/components/StatuspageComponent.tsx"],"sourcesContent":["import React from 'react';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { ComponentGroupsList } from './ComponentGroupsList';\nimport IconButton from '@mui/material/IconButton';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport { useComponents } from '../hooks/useComponents';\n\n/**\n * StatuspageComponent props.\n *\n * @public\n */\nexport type StatuspageProps = {\n name: string;\n};\n\n/**\n * Visualizes a full statuspage.\n *\n * @param name - instance name from app config.\n * @public\n */\nexport const StatuspageComponent = ({ name }: StatuspageProps) => {\n const { loading, error, value } = useComponents(name);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const linkAction = value?.url && (\n <IconButton\n aria-label=\"Go to our statuspage\"\n role=\"button\"\n title=\"Go to statuspage(.io)\"\n href={value?.url}\n target=\"_blank\"\n >\n <OpenInNewIcon />\n </IconButton>\n );\n\n return (\n <InfoCard title=\"Status of our services\" action={linkAction}>\n <ComponentGroupsList\n components={value?.components || []}\n componentGroups={value?.componentGroups || []}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,mBAAsB,GAAA,CAAC,EAAE,IAAA,EAA4B,KAAA;AAChE,EAAA,MAAM,EAAE,OAAS,EAAA,KAAA,EAAO,KAAM,EAAA,GAAI,cAAc,IAAI,CAAA;AAEpD,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA;AAAA;AAEnB,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA;AAAA;AAG3C,EAAM,MAAA,UAAA,GAAa,OAAO,GACxB,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,sBAAA;AAAA,MACX,IAAK,EAAA,QAAA;AAAA,MACL,KAAM,EAAA,uBAAA;AAAA,MACN,MAAM,KAAO,EAAA,GAAA;AAAA,MACb,MAAO,EAAA;AAAA,KAAA;AAAA,wCAEN,aAAc,EAAA,IAAA;AAAA,GACjB;AAGF,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,KAAM,EAAA,wBAAA,EAAyB,QAAQ,UAC/C,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,UAAA,EAAY,KAAO,EAAA,UAAA,IAAc,EAAC;AAAA,MAClC,eAAA,EAAiB,KAAO,EAAA,eAAA,IAAmB;AAAC;AAAA,GAEhD,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatuspageEntityCard.esm.js","sources":["../../src/components/StatuspageEntityCard.tsx"],"sourcesContent":["import React from 'react';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { ComponentsTable } from './ComponentsTable';\nimport { ComponentGroupsList } from './ComponentGroupsList';\nimport IconButton from '@mui/material/IconButton';\nimport Typography from '@mui/material/Typography';\nimport { STATUSPAGE_ANNOTATION } from '@axis-backstage/plugin-statuspage-common';\nimport { useComponents } from '../hooks/useComponents';\n\n/**\n * Statuspage card intended for the EntityPage. Allows embedding of specific\n * statuspage components and component groups.\n *\n * @public\n */\nexport const StatuspageEntityCard = () => {\n const { entity } = useEntity();\n const [name, wantedComponentsStr] =\n entity.metadata.annotations?.[STATUSPAGE_ANNOTATION]?.split(':')!;\n const wantedComponents = wantedComponentsStr?.split(',').map(it => it.trim());\n\n const { loading, error, value } = useComponents(name);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const linkAction = value?.url && (\n <IconButton\n aria-label=\"Go to our statuspage\"\n role=\"button\"\n title=\"Go to statuspage(.io)\"\n href={value?.url}\n target=\"_blank\"\n >\n <OpenInNewIcon />\n </IconButton>\n );\n\n const fullStatuspage = !wantedComponents;\n const filteredComponents =\n value?.components.filter(\n c => !fullStatuspage && !c.group && wantedComponents.includes(c.id),\n ) || [];\n const filteredComponentGroups =\n value?.componentGroups.filter(\n c => fullStatuspage || wantedComponents.includes(c.id),\n ) || [];\n const noComponents =\n (!filteredComponents || filteredComponentGroups.length === 0) &&\n filteredComponents &&\n filteredComponents.length === 0;\n\n if (noComponents) {\n return (\n <InfoCard title=\"Service Status\" action={linkAction}>\n <Typography variant=\"body2\" color=\"#FF5555\">\n The specified statuspage.io components could not be found. Check your\n annotation.\n </Typography>\n </InfoCard>\n );\n }\n return (\n <InfoCard title=\"Service Status\" action={linkAction}>\n {filteredComponents && filteredComponents.length > 0 && (\n <ComponentsTable components={filteredComponents} />\n )}\n {filteredComponentGroups && filteredComponentGroups.length > 0 && (\n <ComponentGroupsList\n components={value?.components || []}\n componentGroups={filteredComponentGroups}\n expanded={!fullStatuspage}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAqBO,MAAM,uBAAuB,MAAM;AACxC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA
|
|
1
|
+
{"version":3,"file":"StatuspageEntityCard.esm.js","sources":["../../src/components/StatuspageEntityCard.tsx"],"sourcesContent":["import React from 'react';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { ComponentsTable } from './ComponentsTable';\nimport { ComponentGroupsList } from './ComponentGroupsList';\nimport IconButton from '@mui/material/IconButton';\nimport Typography from '@mui/material/Typography';\nimport { STATUSPAGE_ANNOTATION } from '@axis-backstage/plugin-statuspage-common';\nimport { useComponents } from '../hooks/useComponents';\n\n/**\n * Statuspage card intended for the EntityPage. Allows embedding of specific\n * statuspage components and component groups.\n *\n * @public\n */\nexport const StatuspageEntityCard = () => {\n const { entity } = useEntity();\n const [name, wantedComponentsStr] =\n entity.metadata.annotations?.[STATUSPAGE_ANNOTATION]?.split(':')!;\n const wantedComponents = wantedComponentsStr?.split(',').map(it => it.trim());\n\n const { loading, error, value } = useComponents(name);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const linkAction = value?.url && (\n <IconButton\n aria-label=\"Go to our statuspage\"\n role=\"button\"\n title=\"Go to statuspage(.io)\"\n href={value?.url}\n target=\"_blank\"\n >\n <OpenInNewIcon />\n </IconButton>\n );\n\n const fullStatuspage = !wantedComponents;\n const filteredComponents =\n value?.components.filter(\n c => !fullStatuspage && !c.group && wantedComponents.includes(c.id),\n ) || [];\n const filteredComponentGroups =\n value?.componentGroups.filter(\n c => fullStatuspage || wantedComponents.includes(c.id),\n ) || [];\n const noComponents =\n (!filteredComponents || filteredComponentGroups.length === 0) &&\n filteredComponents &&\n filteredComponents.length === 0;\n\n if (noComponents) {\n return (\n <InfoCard title=\"Service Status\" action={linkAction}>\n <Typography variant=\"body2\" color=\"#FF5555\">\n The specified statuspage.io components could not be found. Check your\n annotation.\n </Typography>\n </InfoCard>\n );\n }\n return (\n <InfoCard title=\"Service Status\" action={linkAction}>\n {filteredComponents && filteredComponents.length > 0 && (\n <ComponentsTable components={filteredComponents} />\n )}\n {filteredComponentGroups && filteredComponentGroups.length > 0 && (\n <ComponentGroupsList\n components={value?.components || []}\n componentGroups={filteredComponentGroups}\n expanded={!fullStatuspage}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAqBO,MAAM,uBAAuB,MAAM;AACxC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,CAAC,IAAM,EAAA,mBAAmB,CAC9B,GAAA,MAAA,CAAO,SAAS,WAAc,GAAA,qBAAqB,CAAG,EAAA,KAAA,CAAM,GAAG,CAAA;AACjE,EAAM,MAAA,gBAAA,GAAmB,qBAAqB,KAAM,CAAA,GAAG,EAAE,GAAI,CAAA,CAAA,EAAA,KAAM,EAAG,CAAA,IAAA,EAAM,CAAA;AAE5E,EAAA,MAAM,EAAE,OAAS,EAAA,KAAA,EAAO,KAAM,EAAA,GAAI,cAAc,IAAI,CAAA;AAEpD,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA;AAAA;AAEnB,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA;AAAA;AAG3C,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA;AAAA;AAEnB,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA;AAAA;AAG3C,EAAM,MAAA,UAAA,GAAa,OAAO,GACxB,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,sBAAA;AAAA,MACX,IAAK,EAAA,QAAA;AAAA,MACL,KAAM,EAAA,uBAAA;AAAA,MACN,MAAM,KAAO,EAAA,GAAA;AAAA,MACb,MAAO,EAAA;AAAA,KAAA;AAAA,wCAEN,aAAc,EAAA,IAAA;AAAA,GACjB;AAGF,EAAA,MAAM,iBAAiB,CAAC,gBAAA;AACxB,EAAM,MAAA,kBAAA,GACJ,OAAO,UAAW,CAAA,MAAA;AAAA,IAChB,CAAA,CAAA,KAAK,CAAC,cAAkB,IAAA,CAAC,EAAE,KAAS,IAAA,gBAAA,CAAiB,QAAS,CAAA,CAAA,CAAE,EAAE;AAAA,OAC/D,EAAC;AACR,EAAM,MAAA,uBAAA,GACJ,OAAO,eAAgB,CAAA,MAAA;AAAA,IACrB,CAAK,CAAA,KAAA,cAAA,IAAkB,gBAAiB,CAAA,QAAA,CAAS,EAAE,EAAE;AAAA,OAClD,EAAC;AACR,EAAM,MAAA,YAAA,GAAA,CACH,CAAC,kBAAsB,IAAA,uBAAA,CAAwB,WAAW,CAC3D,KAAA,kBAAA,IACA,mBAAmB,MAAW,KAAA,CAAA;AAEhC,EAAA,IAAI,YAAc,EAAA;AAChB,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,KAAM,EAAA,gBAAA,EAAiB,MAAQ,EAAA,UAAA,EAAA,kBACtC,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAQ,KAAM,EAAA,SAAA,EAAA,EAAU,mFAG5C,CACF,CAAA;AAAA;AAGJ,EAAA,2CACG,QAAS,EAAA,EAAA,KAAA,EAAM,kBAAiB,MAAQ,EAAA,UAAA,EAAA,EACtC,sBAAsB,kBAAmB,CAAA,MAAA,GAAS,CACjD,oBAAA,KAAA,CAAA,aAAA,CAAC,mBAAgB,UAAY,EAAA,kBAAA,EAAoB,GAElD,uBAA2B,IAAA,uBAAA,CAAwB,SAAS,CAC3D,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,UAAA,EAAY,KAAO,EAAA,UAAA,IAAc,EAAC;AAAA,MAClC,eAAiB,EAAA,uBAAA;AAAA,MACjB,UAAU,CAAC;AAAA;AAAA,GAGjB,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponents.esm.js","sources":["../../src/hooks/useComponents.ts"],"sourcesContent":["import { useApi } from '@backstage/core-plugin-api';\nimport { statuspageApiRef } from '../api/StatuspageApi';\nimport useAsync from 'react-use/lib/useAsync';\nimport {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\nexport const useComponents = (name: string) => {\n const statuspageApi = useApi(statuspageApiRef);\n\n return useAsync(async (): Promise<{\n components: Component[];\n componentGroups: ComponentGroup[];\n url?: string;\n }> => {\n const components = await statuspageApi.getComponents(name);\n const componentGroups = await statuspageApi.getComponentGroups(name);\n const { url } = await statuspageApi.getLink(name);\n return {\n components,\n componentGroups,\n url,\n };\n }, [name]);\n};\n"],"names":[],"mappings":";;;;AAQa,MAAA,aAAA,GAAgB,CAAC,IAAiB,KAAA;AAC7C,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA
|
|
1
|
+
{"version":3,"file":"useComponents.esm.js","sources":["../../src/hooks/useComponents.ts"],"sourcesContent":["import { useApi } from '@backstage/core-plugin-api';\nimport { statuspageApiRef } from '../api/StatuspageApi';\nimport useAsync from 'react-use/lib/useAsync';\nimport {\n Component,\n ComponentGroup,\n} from '@axis-backstage/plugin-statuspage-common';\n\nexport const useComponents = (name: string) => {\n const statuspageApi = useApi(statuspageApiRef);\n\n return useAsync(async (): Promise<{\n components: Component[];\n componentGroups: ComponentGroup[];\n url?: string;\n }> => {\n const components = await statuspageApi.getComponents(name);\n const componentGroups = await statuspageApi.getComponentGroups(name);\n const { url } = await statuspageApi.getLink(name);\n return {\n components,\n componentGroups,\n url,\n };\n }, [name]);\n};\n"],"names":[],"mappings":";;;;AAQa,MAAA,aAAA,GAAgB,CAAC,IAAiB,KAAA;AAC7C,EAAM,MAAA,aAAA,GAAgB,OAAO,gBAAgB,CAAA;AAE7C,EAAA,OAAO,SAAS,YAIV;AACJ,IAAA,MAAM,UAAa,GAAA,MAAM,aAAc,CAAA,aAAA,CAAc,IAAI,CAAA;AACzD,IAAA,MAAM,eAAkB,GAAA,MAAM,aAAc,CAAA,kBAAA,CAAmB,IAAI,CAAA;AACnE,IAAA,MAAM,EAAE,GAAI,EAAA,GAAI,MAAM,aAAA,CAAc,QAAQ,IAAI,CAAA;AAChD,IAAO,OAAA;AAAA,MACL,UAAA;AAAA,MACA,eAAA;AAAA,MACA;AAAA,KACF;AAAA,GACF,EAAG,CAAC,IAAI,CAAC,CAAA;AACX;;;;"}
|
package/dist/plugin.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createPlugin, createApiFactory,
|
|
1
|
+
import { createPlugin, createApiFactory, fetchApiRef, discoveryApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
2
|
import { STATUSPAGE_ANNOTATION } from '@axis-backstage/plugin-statuspage-common';
|
|
3
3
|
import { rootRouteRef } from './routes.esm.js';
|
|
4
4
|
import { statuspageApiRef } from './api/StatuspageApi.esm.js';
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["import {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { STATUSPAGE_ANNOTATION } from '@axis-backstage/plugin-statuspage-common';\nimport { Entity } from '@backstage/catalog-model';\n\nimport { rootRouteRef } from './routes';\nimport { statuspageApiRef } from './api/StatuspageApi';\nimport { StatuspageClient } from './api/StatuspageClient';\n\n/**\n * Checks availability of a statuspage component\n *\n * @public\n */\nexport const isStatuspageAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[STATUSPAGE_ANNOTATION]);\n\n/**\n * Create the plugin.\n *\n * @public\n */\nexport const statuspagePlugin = createPlugin({\n id: 'statuspage',\n apis: [\n createApiFactory({\n api: statuspageApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new StatuspageClient({ discoveryApi, fetchApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * Routable extension for StatuspageComponent.\n *\n * @public\n */\nexport const StatuspagePage = statuspagePlugin.provide(\n createRoutableExtension({\n name: 'StatuspagePage',\n component: () =>\n import('./components/StatuspageComponent').then(\n m => m.StatuspageComponent,\n ),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;;AAoBa,MAAA,qBAAA,GAAwB,CAAC,MACpC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["import {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { STATUSPAGE_ANNOTATION } from '@axis-backstage/plugin-statuspage-common';\nimport { Entity } from '@backstage/catalog-model';\n\nimport { rootRouteRef } from './routes';\nimport { statuspageApiRef } from './api/StatuspageApi';\nimport { StatuspageClient } from './api/StatuspageClient';\n\n/**\n * Checks availability of a statuspage component\n *\n * @public\n */\nexport const isStatuspageAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[STATUSPAGE_ANNOTATION]);\n\n/**\n * Create the plugin.\n *\n * @public\n */\nexport const statuspagePlugin = createPlugin({\n id: 'statuspage',\n apis: [\n createApiFactory({\n api: statuspageApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new StatuspageClient({ discoveryApi, fetchApi }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * Routable extension for StatuspageComponent.\n *\n * @public\n */\nexport const StatuspagePage = statuspagePlugin.provide(\n createRoutableExtension({\n name: 'StatuspagePage',\n component: () =>\n import('./components/StatuspageComponent').then(\n m => m.StatuspageComponent,\n ),\n mountPoint: rootRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;;;AAoBa,MAAA,qBAAA,GAAwB,CAAC,MACpC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,qBAAqB,CAAC;AAOvD,MAAM,mBAAmB,YAAa,CAAA;AAAA,EAC3C,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,gBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,gBAAiB,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,KAClD;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA;AAEV,CAAC;AAOM,MAAM,iBAAiB,gBAAiB,CAAA,OAAA;AAAA,EAC7C,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,yCAAkC,CAAE,CAAA,IAAA;AAAA,MACzC,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA;AAAA,GACb;AACH;;;;"}
|
package/dist/routes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["import { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'statuspage',\n});\n"],"names":[],"mappings":";;AAEO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["import { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'statuspage',\n});\n"],"names":[],"mappings":";;AAEO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA;AACN,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axis-backstage/plugin-statuspage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"postpack": "backstage-cli package postpack"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@axis-backstage/plugin-statuspage-common": "^0.
|
|
34
|
-
"@backstage/catalog-model": "^1.
|
|
35
|
-
"@backstage/core-components": "^0.
|
|
36
|
-
"@backstage/core-plugin-api": "^1.
|
|
37
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
33
|
+
"@axis-backstage/plugin-statuspage-common": "^0.6.0",
|
|
34
|
+
"@backstage/catalog-model": "^1.7.3",
|
|
35
|
+
"@backstage/core-components": "^0.16.4",
|
|
36
|
+
"@backstage/core-plugin-api": "^1.10.4",
|
|
37
|
+
"@backstage/plugin-catalog-react": "^1.15.2",
|
|
38
38
|
"@mui/icons-material": "^5.15.7",
|
|
39
39
|
"@mui/material": "^5.15.7",
|
|
40
40
|
"react-use": "^17.2.4"
|
|
@@ -43,13 +43,20 @@
|
|
|
43
43
|
"react": "^17.0.0 || ^18.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@backstage/cli": "^0.
|
|
47
|
-
"@backstage/dev-utils": "^1.
|
|
46
|
+
"@backstage/cli": "^0.30.0",
|
|
47
|
+
"@backstage/dev-utils": "^1.1.7",
|
|
48
48
|
"@testing-library/jest-dom": "^5.10.1"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"dist"
|
|
52
52
|
],
|
|
53
|
+
"typesVersions": {
|
|
54
|
+
"*": {
|
|
55
|
+
"index": [
|
|
56
|
+
"dist/index.d.ts"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
53
60
|
"module": "./dist/index.esm.js",
|
|
54
61
|
"directory": "_release/package"
|
|
55
|
-
}
|
|
62
|
+
}
|