@terasky/backstage-plugin-vcf-automation 0.0.1 → 0.1.1
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/README.md +36 -0
- package/dist/api/VcfAutomationClient.esm.js +90 -0
- package/dist/api/VcfAutomationClient.esm.js.map +1 -0
- package/dist/components/VCFAutomationDeploymentDetails.esm.js +186 -0
- package/dist/components/VCFAutomationDeploymentDetails.esm.js.map +1 -0
- package/dist/components/VCFAutomationDeploymentOverview.esm.js +102 -0
- package/dist/components/VCFAutomationDeploymentOverview.esm.js.map +1 -0
- package/dist/components/VCFAutomationGenericResourceDetails.esm.js +52 -0
- package/dist/components/VCFAutomationGenericResourceDetails.esm.js.map +1 -0
- package/dist/components/VCFAutomationGenericResourceOverview.esm.js +40 -0
- package/dist/components/VCFAutomationGenericResourceOverview.esm.js.map +1 -0
- package/dist/components/VCFAutomationProjectDetails.esm.js +184 -0
- package/dist/components/VCFAutomationProjectDetails.esm.js.map +1 -0
- package/dist/components/VCFAutomationProjectOverview.esm.js +109 -0
- package/dist/components/VCFAutomationProjectOverview.esm.js.map +1 -0
- package/dist/components/VCFAutomationVSphereVMDetails.esm.js +116 -0
- package/dist/components/VCFAutomationVSphereVMDetails.esm.js.map +1 -0
- package/dist/components/VCFAutomationVSphereVMOverview.esm.js +116 -0
- package/dist/components/VCFAutomationVSphereVMOverview.esm.js.map +1 -0
- package/dist/index.d.ts +10 -11
- package/dist/index.esm.js +11 -881
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +82 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +20 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +21 -14
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useEntity, catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { ResponseErrorPanel, Progress, InfoCard, StructuredMetadataTable, Table, Link } from '@backstage/core-components';
|
|
4
|
+
import { Grid } from '@material-ui/core';
|
|
5
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
6
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
7
|
+
import { vcfAutomationApiRef } from '../api/VcfAutomationClient.esm.js';
|
|
8
|
+
import { viewProjectDetailsPermission } from '@terasky/backstage-plugin-vcf-automation-common';
|
|
9
|
+
import { usePermission } from '@backstage/plugin-permission-react';
|
|
10
|
+
|
|
11
|
+
const VCFAutomationProjectDetails = () => {
|
|
12
|
+
const { entity } = useEntity();
|
|
13
|
+
const vcfAutomationApi = useApi(vcfAutomationApiRef);
|
|
14
|
+
const catalogApi = useApi(catalogApiRef);
|
|
15
|
+
const projectId = entity.metadata.name;
|
|
16
|
+
const { allowed } = usePermission({
|
|
17
|
+
permission: viewProjectDetailsPermission
|
|
18
|
+
});
|
|
19
|
+
const { value: projectData, loading: projectLoading, error: projectError } = useAsync(async () => {
|
|
20
|
+
if (!projectId || !allowed) return void 0;
|
|
21
|
+
return await vcfAutomationApi.getProjectDetails(projectId);
|
|
22
|
+
}, [projectId, allowed]);
|
|
23
|
+
const { value: systemsData, loading: systemsLoading } = useAsync(async () => {
|
|
24
|
+
if (!projectId || !allowed) return void 0;
|
|
25
|
+
const systems = await catalogApi.getEntities({
|
|
26
|
+
filter: {
|
|
27
|
+
kind: "System",
|
|
28
|
+
"spec.domain": projectId
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const deployments = await Promise.all(
|
|
32
|
+
systems.items.map(async (system) => {
|
|
33
|
+
const vms = await catalogApi.getEntities({
|
|
34
|
+
filter: {
|
|
35
|
+
kind: "Component",
|
|
36
|
+
"spec.type": "Cloud.vSphere.Machine",
|
|
37
|
+
"spec.system": system.metadata.name
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const resources = await catalogApi.getEntities({
|
|
41
|
+
filter: {
|
|
42
|
+
kind: "Resource",
|
|
43
|
+
"spec.system": system.metadata.name
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const owner = system.spec?.owner;
|
|
47
|
+
return {
|
|
48
|
+
name: system.metadata.name,
|
|
49
|
+
title: system.metadata.title || system.metadata.name,
|
|
50
|
+
owner: typeof owner === "string" ? owner : "N/A",
|
|
51
|
+
vmCount: vms.items.length,
|
|
52
|
+
resourceCount: resources.items.length,
|
|
53
|
+
entityRef: `/catalog/${system.metadata.namespace || "default"}/system/${system.metadata.name}`
|
|
54
|
+
};
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
return deployments;
|
|
58
|
+
}, [projectId, allowed]);
|
|
59
|
+
if (projectError) {
|
|
60
|
+
return /* @__PURE__ */ jsx(ResponseErrorPanel, { error: projectError });
|
|
61
|
+
}
|
|
62
|
+
if (projectLoading || systemsLoading) {
|
|
63
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
64
|
+
}
|
|
65
|
+
if (!projectId) {
|
|
66
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "No project ID found", children: "This entity is not associated with a VCF project." });
|
|
67
|
+
}
|
|
68
|
+
if (!allowed) {
|
|
69
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "Permission Denied", children: "You don't have permission to view project details." });
|
|
70
|
+
}
|
|
71
|
+
if (!projectData) {
|
|
72
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "No Data", children: "No project details available." });
|
|
73
|
+
}
|
|
74
|
+
const renderMemberTable = (members, title) => /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, children: /* @__PURE__ */ jsx(InfoCard, { title, children: /* @__PURE__ */ jsx(
|
|
75
|
+
Table,
|
|
76
|
+
{
|
|
77
|
+
columns: [
|
|
78
|
+
{ title: "Email", field: "email" },
|
|
79
|
+
{ title: "Type", field: "type" }
|
|
80
|
+
],
|
|
81
|
+
data: members,
|
|
82
|
+
options: { search: false, paging: false }
|
|
83
|
+
}
|
|
84
|
+
) }) });
|
|
85
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Overview", children: /* @__PURE__ */ jsx(
|
|
87
|
+
StructuredMetadataTable,
|
|
88
|
+
{
|
|
89
|
+
metadata: {
|
|
90
|
+
"Project Name": projectData.name,
|
|
91
|
+
"Project ID": projectData.id,
|
|
92
|
+
Description: projectData.description,
|
|
93
|
+
"Organization ID": projectData.organizationId,
|
|
94
|
+
"Operation Timeout": `${projectData.operationTimeout} seconds`,
|
|
95
|
+
"Machine Naming Template": projectData.machineNamingTemplate || "N/A",
|
|
96
|
+
"Shared Resources": projectData.sharedResources ? "Yes" : "No"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
) }) }),
|
|
100
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Deployments", children: /* @__PURE__ */ jsx(
|
|
101
|
+
Table,
|
|
102
|
+
{
|
|
103
|
+
columns: [
|
|
104
|
+
{
|
|
105
|
+
title: "Name",
|
|
106
|
+
field: "title",
|
|
107
|
+
render: (row) => /* @__PURE__ */ jsx(Link, { to: row.entityRef, children: row.title })
|
|
108
|
+
},
|
|
109
|
+
{ title: "Owner", field: "owner" },
|
|
110
|
+
{
|
|
111
|
+
title: "VMs",
|
|
112
|
+
field: "vmCount",
|
|
113
|
+
align: "right"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
title: "Additional Resources",
|
|
117
|
+
field: "resourceCount",
|
|
118
|
+
align: "right"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
data: systemsData || [],
|
|
122
|
+
options: {
|
|
123
|
+
search: true,
|
|
124
|
+
paging: true
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
) }) }),
|
|
128
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Members", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, children: [
|
|
129
|
+
renderMemberTable(projectData.administrators, "Administrators"),
|
|
130
|
+
renderMemberTable(projectData.members, "Members"),
|
|
131
|
+
renderMemberTable(projectData.viewers, "Viewers"),
|
|
132
|
+
renderMemberTable(projectData.supervisors, "Supervisors")
|
|
133
|
+
] }) }) }),
|
|
134
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Zones", children: /* @__PURE__ */ jsx(
|
|
135
|
+
Table,
|
|
136
|
+
{
|
|
137
|
+
columns: [
|
|
138
|
+
{ title: "Zone ID", field: "zoneId" },
|
|
139
|
+
{ title: "Priority", field: "priority" },
|
|
140
|
+
{
|
|
141
|
+
title: "Instances",
|
|
142
|
+
field: "instances",
|
|
143
|
+
render: (row) => `${row.allocatedInstancesCount}/${row.maxNumberInstances || "\u221E"}`
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
title: "Memory (MB)",
|
|
147
|
+
field: "memory",
|
|
148
|
+
render: (row) => `${row.allocatedMemoryMB}/${row.memoryLimitMB || "\u221E"}`
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: "CPU",
|
|
152
|
+
field: "cpu",
|
|
153
|
+
render: (row) => `${row.allocatedCpu}/${row.cpuLimit || "\u221E"}`
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: "Storage (GB)",
|
|
157
|
+
field: "storage",
|
|
158
|
+
render: (row) => `${row.allocatedStorageGB}/${row.storageLimitGB || "\u221E"}`
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
data: projectData.zones,
|
|
162
|
+
options: {
|
|
163
|
+
search: true,
|
|
164
|
+
paging: true
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
) }) }),
|
|
168
|
+
Object.keys(projectData.constraints).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Constraints", children: /* @__PURE__ */ jsx(
|
|
169
|
+
StructuredMetadataTable,
|
|
170
|
+
{
|
|
171
|
+
metadata: projectData.constraints
|
|
172
|
+
}
|
|
173
|
+
) }) }),
|
|
174
|
+
Object.keys(projectData.customProperties).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Custom Properties", children: /* @__PURE__ */ jsx(
|
|
175
|
+
StructuredMetadataTable,
|
|
176
|
+
{
|
|
177
|
+
metadata: projectData.customProperties
|
|
178
|
+
}
|
|
179
|
+
) }) })
|
|
180
|
+
] });
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export { VCFAutomationProjectDetails };
|
|
184
|
+
//# sourceMappingURL=VCFAutomationProjectDetails.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VCFAutomationProjectDetails.esm.js","sources":["../../src/components/VCFAutomationProjectDetails.tsx"],"sourcesContent":["import { useEntity, catalogApiRef } from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n StructuredMetadataTable,\n Table,\n Link,\n} from '@backstage/core-components';\nimport { Grid } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { vcfAutomationApiRef } from '../api/VcfAutomationClient';\nimport { viewProjectDetailsPermission } from '@terasky/backstage-plugin-vcf-automation-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { VcfProjectZone } from '../types';\n\ntype ProjectMember = {\n email: string;\n type: string;\n};\n\ntype SystemDeployment = {\n name: string;\n title: string;\n owner: string;\n vmCount: number;\n resourceCount: number;\n entityRef: string;\n};\n\nexport const VCFAutomationProjectDetails = () => {\n const { entity } = useEntity();\n const vcfAutomationApi = useApi(vcfAutomationApiRef);\n const catalogApi = useApi(catalogApiRef);\n const projectId = entity.metadata.name;\n\n const { allowed } = usePermission({\n permission: viewProjectDetailsPermission,\n });\n\n const { value: projectData, loading: projectLoading, error: projectError } = useAsync(async () => {\n if (!projectId || !allowed) return undefined;\n return await vcfAutomationApi.getProjectDetails(projectId);\n }, [projectId, allowed]);\n\n const { value: systemsData, loading: systemsLoading } = useAsync(async () => {\n if (!projectId || !allowed) return undefined;\n\n // Get all systems that belong to this project's domain\n const systems = await catalogApi.getEntities({\n filter: {\n kind: 'System',\n 'spec.domain': projectId,\n },\n });\n\n const deployments = await Promise.all(\n systems.items.map(async (system) => {\n // Get VMs belonging to this system\n const vms = await catalogApi.getEntities({\n filter: {\n kind: 'Component',\n 'spec.type': 'Cloud.vSphere.Machine',\n 'spec.system': system.metadata.name,\n },\n });\n\n // Get other resources belonging to this system\n const resources = await catalogApi.getEntities({\n filter: {\n kind: 'Resource',\n 'spec.system': system.metadata.name,\n },\n });\n\n const owner = system.spec?.owner;\n return {\n name: system.metadata.name,\n title: system.metadata.title || system.metadata.name,\n owner: typeof owner === 'string' ? owner : 'N/A',\n vmCount: vms.items.length,\n resourceCount: resources.items.length,\n entityRef: `/catalog/${system.metadata.namespace || 'default'}/system/${system.metadata.name}`,\n } as SystemDeployment;\n }),\n );\n\n return deployments;\n }, [projectId, allowed]);\n\n if (projectError) {\n return <ResponseErrorPanel error={projectError} />;\n }\n\n if (projectLoading || systemsLoading) {\n return <Progress />;\n }\n\n if (!projectId) {\n return <InfoCard title=\"No project ID found\">This entity is not associated with a VCF project.</InfoCard>;\n }\n\n if (!allowed) {\n return <InfoCard title=\"Permission Denied\">You don't have permission to view project details.</InfoCard>;\n }\n\n if (!projectData) {\n return <InfoCard title=\"No Data\">No project details available.</InfoCard>;\n }\n\n const renderMemberTable = (members: ProjectMember[], title: string) => (\n <Grid item xs={12} md={6}>\n <InfoCard title={title}>\n <Table\n columns={[\n { title: 'Email', field: 'email' },\n { title: 'Type', field: 'type' },\n ]}\n data={members}\n options={{ search: false, paging: false }}\n />\n </InfoCard>\n </Grid>\n );\n\n return (\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <InfoCard title=\"Project Overview\">\n <StructuredMetadataTable\n metadata={{\n 'Project Name': projectData.name,\n 'Project ID': projectData.id,\n Description: projectData.description,\n 'Organization ID': projectData.organizationId,\n 'Operation Timeout': `${projectData.operationTimeout} seconds`,\n 'Machine Naming Template': projectData.machineNamingTemplate || 'N/A',\n 'Shared Resources': projectData.sharedResources ? 'Yes' : 'No',\n }}\n />\n </InfoCard>\n </Grid>\n\n <Grid item xs={12}>\n <InfoCard title=\"Project Deployments\">\n <Table\n columns={[\n { \n title: 'Name', \n field: 'title',\n render: (row: SystemDeployment) => (\n <Link to={row.entityRef}>{row.title}</Link>\n ),\n },\n { title: 'Owner', field: 'owner' },\n { \n title: 'VMs', \n field: 'vmCount',\n align: 'right',\n },\n { \n title: 'Additional Resources', \n field: 'resourceCount',\n align: 'right',\n },\n ]}\n data={systemsData || []}\n options={{\n search: true,\n paging: true,\n }}\n />\n </InfoCard>\n </Grid>\n\n <Grid item xs={12}>\n <InfoCard title=\"Project Members\">\n <Grid container spacing={3}>\n {renderMemberTable(projectData.administrators, 'Administrators')}\n {renderMemberTable(projectData.members, 'Members')}\n {renderMemberTable(projectData.viewers, 'Viewers')}\n {renderMemberTable(projectData.supervisors, 'Supervisors')}\n </Grid>\n </InfoCard>\n </Grid>\n\n <Grid item xs={12}>\n <InfoCard title=\"Project Zones\">\n <Table\n columns={[\n { title: 'Zone ID', field: 'zoneId' },\n { title: 'Priority', field: 'priority' },\n { \n title: 'Instances', \n field: 'instances',\n render: (row: VcfProjectZone) => `${row.allocatedInstancesCount}/${row.maxNumberInstances || '∞'}`,\n },\n { \n title: 'Memory (MB)', \n field: 'memory',\n render: (row: VcfProjectZone) => `${row.allocatedMemoryMB}/${row.memoryLimitMB || '∞'}`,\n },\n { \n title: 'CPU', \n field: 'cpu',\n render: (row: VcfProjectZone) => `${row.allocatedCpu}/${row.cpuLimit || '∞'}`,\n },\n { \n title: 'Storage (GB)', \n field: 'storage',\n render: (row: VcfProjectZone) => `${row.allocatedStorageGB}/${row.storageLimitGB || '∞'}`,\n },\n ]}\n data={projectData.zones}\n options={{\n search: true,\n paging: true,\n }}\n />\n </InfoCard>\n </Grid>\n\n {Object.keys(projectData.constraints).length > 0 && (\n <Grid item xs={12}>\n <InfoCard title=\"Constraints\">\n <StructuredMetadataTable\n metadata={projectData.constraints}\n />\n </InfoCard>\n </Grid>\n )}\n\n {Object.keys(projectData.customProperties).length > 0 && (\n <Grid item xs={12}>\n <InfoCard title=\"Custom Properties\">\n <StructuredMetadataTable\n metadata={projectData.customProperties}\n />\n </InfoCard>\n </Grid>\n )}\n </Grid>\n );\n}; "],"names":[],"mappings":";;;;;;;;;;AA+BO,MAAM,8BAA8B,MAAM;AAC/C,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,gBAAA,GAAmB,OAAO,mBAAmB,CAAA;AACnD,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAM,MAAA,SAAA,GAAY,OAAO,QAAS,CAAA,IAAA;AAElC,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,aAAc,CAAA;AAAA,IAChC,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAM,MAAA,EAAE,OAAO,WAAa,EAAA,OAAA,EAAS,gBAAgB,KAAO,EAAA,YAAA,EAAiB,GAAA,QAAA,CAAS,YAAY;AAChG,IAAA,IAAI,CAAC,SAAA,IAAa,CAAC,OAAA,EAAgB,OAAA,KAAA,CAAA;AACnC,IAAO,OAAA,MAAM,gBAAiB,CAAA,iBAAA,CAAkB,SAAS,CAAA;AAAA,GACxD,EAAA,CAAC,SAAW,EAAA,OAAO,CAAC,CAAA;AAEvB,EAAA,MAAM,EAAE,KAAO,EAAA,WAAA,EAAa,SAAS,cAAe,EAAA,GAAI,SAAS,YAAY;AAC3E,IAAA,IAAI,CAAC,SAAA,IAAa,CAAC,OAAA,EAAgB,OAAA,KAAA,CAAA;A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A;AAAA,QACC,UAAU,WAAY,CAAA;AAAA;AAAA,OAE1B,CACF,EAAA,CAAA;AAAA,IAGD,OAAO,IAAK,CAAA,WAAA,CAAY,gBAAgB,CAAA,CAAE,SAAS,CAClD,oBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,EAAI,EAAA,EAAA,EACb,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EAAS,OAAM,mBACd,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,UAAU,WAAY,CAAA;AAAA;AAAA,OAE1B,CACF,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
4
|
+
import { vcfAutomationApiRef } from '../api/VcfAutomationClient.esm.js';
|
|
5
|
+
import { InfoCard, Progress, ResponseErrorPanel } from '@backstage/core-components';
|
|
6
|
+
import { Typography, Grid, Chip } from '@material-ui/core';
|
|
7
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
8
|
+
import { usePermission } from '@backstage/plugin-permission-react';
|
|
9
|
+
import { viewProjectDetailsPermission } from '@terasky/backstage-plugin-vcf-automation-common';
|
|
10
|
+
|
|
11
|
+
const VCFAutomationProjectOverview = () => {
|
|
12
|
+
const { entity } = useEntity();
|
|
13
|
+
const api = useApi(vcfAutomationApiRef);
|
|
14
|
+
const projectId = entity.metadata.name;
|
|
15
|
+
const { allowed: hasViewPermission, loading: permissionLoading } = usePermission({
|
|
16
|
+
permission: viewProjectDetailsPermission
|
|
17
|
+
});
|
|
18
|
+
const { value: project, loading, error } = useAsync(async () => {
|
|
19
|
+
if (!projectId || !hasViewPermission) return void 0;
|
|
20
|
+
return await api.getProjectDetails(projectId);
|
|
21
|
+
}, [projectId, hasViewPermission]);
|
|
22
|
+
if (!projectId) {
|
|
23
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Project", children: /* @__PURE__ */ jsx(Typography, { children: "No project ID found for this entity." }) });
|
|
24
|
+
}
|
|
25
|
+
if (loading || permissionLoading) {
|
|
26
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Project", children: /* @__PURE__ */ jsx(Progress, {}) });
|
|
27
|
+
}
|
|
28
|
+
if (!hasViewPermission) {
|
|
29
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Project", children: /* @__PURE__ */ jsx(Typography, { children: "You don't have permission to view project details." }) });
|
|
30
|
+
}
|
|
31
|
+
if (error) {
|
|
32
|
+
return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
|
|
33
|
+
}
|
|
34
|
+
if (!project) {
|
|
35
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Project", children: /* @__PURE__ */ jsx(Typography, { children: "No project details available." }) });
|
|
36
|
+
}
|
|
37
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Project", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Name" }),
|
|
40
|
+
/* @__PURE__ */ jsx(Typography, { children: project.name })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Description" }),
|
|
44
|
+
/* @__PURE__ */ jsx(Typography, { children: project.description || "No description" })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Administrators" }),
|
|
48
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, children: project.administrators.map((admin) => /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
49
|
+
Chip,
|
|
50
|
+
{
|
|
51
|
+
label: `${admin.email} (${admin.type})`,
|
|
52
|
+
size: "small"
|
|
53
|
+
}
|
|
54
|
+
) }, `${admin.email}-${admin.type}`)) })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Resource Allocation" }),
|
|
58
|
+
project.zones.map((zone) => /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
60
|
+
"Zone: ",
|
|
61
|
+
zone.zoneId
|
|
62
|
+
] }) }),
|
|
63
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Instances" }),
|
|
65
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
66
|
+
zone.allocatedInstancesCount,
|
|
67
|
+
" / ",
|
|
68
|
+
zone.maxNumberInstances || "Unlimited"
|
|
69
|
+
] })
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Memory (MB)" }),
|
|
73
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
74
|
+
zone.allocatedMemoryMB,
|
|
75
|
+
" / ",
|
|
76
|
+
zone.memoryLimitMB || "Unlimited"
|
|
77
|
+
] })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: "CPU" }),
|
|
81
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
82
|
+
zone.allocatedCpu,
|
|
83
|
+
" / ",
|
|
84
|
+
zone.cpuLimit || "Unlimited"
|
|
85
|
+
] })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 4, children: [
|
|
88
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Storage (GB)" }),
|
|
89
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
90
|
+
zone.allocatedStorageGB,
|
|
91
|
+
" / ",
|
|
92
|
+
zone.storageLimitGB || "Unlimited"
|
|
93
|
+
] })
|
|
94
|
+
] })
|
|
95
|
+
] }, zone.id))
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Shared Resources" }),
|
|
99
|
+
/* @__PURE__ */ jsx(Typography, { children: project.sharedResources ? "Yes" : "No" })
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
102
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Placement Policy" }),
|
|
103
|
+
/* @__PURE__ */ jsx(Typography, { children: project.placementPolicy })
|
|
104
|
+
] })
|
|
105
|
+
] }) });
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { VCFAutomationProjectOverview };
|
|
109
|
+
//# sourceMappingURL=VCFAutomationProjectOverview.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VCFAutomationProjectOverview.esm.js","sources":["../../src/components/VCFAutomationProjectOverview.tsx"],"sourcesContent":["import { Key, JSXElementConstructor, ReactElement, ReactNode, ReactPortal } from 'react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { vcfAutomationApiRef } from '../api/VcfAutomationClient';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { Grid, Typography, Chip } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { viewProjectDetailsPermission } from '@terasky/backstage-plugin-vcf-automation-common';\n\nexport const VCFAutomationProjectOverview = () => {\n const { entity } = useEntity();\n const api = useApi(vcfAutomationApiRef);\n const projectId = entity.metadata.name;\n\n const { allowed: hasViewPermission, loading: permissionLoading } = usePermission({\n permission: viewProjectDetailsPermission,\n });\n\n const { value: project, loading, error } = useAsync(async () => {\n if (!projectId || !hasViewPermission) return undefined;\n return await api.getProjectDetails(projectId);\n }, [projectId, hasViewPermission]);\n\n if (!projectId) {\n return (\n <InfoCard title=\"VCF Automation Project\">\n <Typography>No project ID found for this entity.</Typography>\n </InfoCard>\n );\n }\n\n if (loading || permissionLoading) {\n return (\n <InfoCard title=\"VCF Automation Project\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (!hasViewPermission) {\n return (\n <InfoCard title=\"VCF Automation Project\">\n <Typography>You don't have permission to view project details.</Typography>\n </InfoCard>\n );\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!project) {\n return (\n <InfoCard title=\"VCF Automation Project\">\n <Typography>No project details available.</Typography>\n </InfoCard>\n );\n }\n\n return (\n <InfoCard title=\"VCF Automation Project\">\n <Grid container spacing={2}>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Name</Typography>\n <Typography>{project.name}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Description</Typography>\n <Typography>{project.description || 'No description'}</Typography>\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">Administrators</Typography>\n <Grid container spacing={1}>\n {project.administrators.map((admin: { email: any; type: any; }) => (\n <Grid item key={`${admin.email}-${admin.type}`}>\n <Chip\n label={`${admin.email} (${admin.type})`}\n size=\"small\"\n />\n </Grid>\n ))}\n </Grid>\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">Resource Allocation</Typography>\n {project.zones.map((zone: { id: Key | null | undefined; zoneId: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; allocatedInstancesCount: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; maxNumberInstances: any; allocatedMemoryMB: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; memoryLimitMB: any; allocatedCpu: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; cpuLimit: any; allocatedStorageGB: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | null | undefined; storageLimitGB: any; }) => (\n <Grid container spacing={2} key={zone.id}>\n <Grid item xs={12}>\n <Typography variant=\"body2\">Zone: {zone.zoneId}</Typography>\n </Grid>\n <Grid item xs={4}>\n <Typography variant=\"caption\">Instances</Typography>\n <Typography>\n {zone.allocatedInstancesCount} / {zone.maxNumberInstances || 'Unlimited'}\n </Typography>\n </Grid>\n <Grid item xs={4}>\n <Typography variant=\"caption\">Memory (MB)</Typography>\n <Typography>\n {zone.allocatedMemoryMB} / {zone.memoryLimitMB || 'Unlimited'}\n </Typography>\n </Grid>\n <Grid item xs={4}>\n <Typography variant=\"caption\">CPU</Typography>\n <Typography>\n {zone.allocatedCpu} / {zone.cpuLimit || 'Unlimited'}\n </Typography>\n </Grid>\n <Grid item xs={4}>\n <Typography variant=\"caption\">Storage (GB)</Typography>\n <Typography>\n {zone.allocatedStorageGB} / {zone.storageLimitGB || 'Unlimited'}\n </Typography>\n </Grid>\n </Grid>\n ))}\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Shared Resources</Typography>\n <Typography>{project.sharedResources ? 'Yes' : 'No'}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Placement Policy</Typography>\n <Typography>{project.placementPolicy}</Typography>\n </Grid>\n </Grid>\n </InfoCard>\n );\n}; "],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,+BAA+B,MAAM;AAChD,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,GAAA,GAAM,OAAO,mBAAmB,CAAA;AACtC,EAAM,MAAA,SAAA,GAAY,OAAO,QAAS,CAAA,IAAA;AAElC,EAAA,MAAM,EAAE,OAAS,EAAA,iBAAA,EAAmB,OAAS,EAAA,iBAAA,KAAsB,aAAc,CAAA;AAAA,IAC/E,UAAY,EAAA;AAAA,GACb,CAAA;AAED,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,SAAS,KAAM,EAAA,GAAI,SAAS,YAAY;AAC9D,IAAA,IAAI,CAAC,SAAA,IAAa,CAAC,iBAAA,EAA0B,OAAA,KAAA,CAAA;AAC7C,IAAO,OAAA,MAAM,GAAI,CAAA,iBAAA,CAAkB,SAAS,CAAA;AAAA,GAC3C,EAAA,CAAC,SAAW,EAAA,iBAAiB,CAAC,CAAA;AAEjC,EAAA,IAAI,CAAC,SAAW,EAAA;AACd,IAAA,2BACG,QAAS,EAAA,EAAA,KAAA,EAAM,0BACd,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,kDAAoC,CAClD,EAAA,CAAA;AAAA;AAIJ,EAAA,IAAI,WAAW,iBAAmB,EAAA;AAChC,IAAA,2BACG,QAAS,EAAA,EAAA,KAAA,EAAM,wBACd,EAAA,QAAA,kBAAA,GAAA,CAAC,YAAS,CACZ,EAAA,CAAA;AAAA;AAIJ,EAAA,IAAI,CAAC,iBAAmB,EAAA;AACtB,IAAA,2BACG,QAAS,EAAA,EAAA,KAAA,EAAM,0BACd,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,gEAAkD,CAChE,EAAA,C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B,IAAA;AAAA,WACtD,EAAA;AAAA,SACF,EAAA;AAAA,OA3B+B,EAAA,EAAA,IAAA,CAAK,EA4BtC,CACD;AAAA,KACH,EAAA,CAAA;AAAA,oBACC,IAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,WAAA,EAAY,QAAgB,EAAA,kBAAA,EAAA,CAAA;AAAA,sBAC/C,GAAA,CAAA,UAAA,EAAA,EAAY,QAAQ,EAAA,OAAA,CAAA,eAAA,GAAkB,QAAQ,IAAK,EAAA;AAAA,KACtD,EAAA,CAAA;AAAA,oBACC,IAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAI,CACb,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,WAAA,EAAY,QAAgB,EAAA,kBAAA,EAAA,CAAA;AAAA,sBAChD,GAAA,CAAC,UAAY,EAAA,EAAA,QAAA,EAAA,OAAA,CAAQ,eAAgB,EAAA;AAAA,KACvC,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { ResponseErrorPanel, Progress, InfoCard, StructuredMetadataTable } from '@backstage/core-components';
|
|
4
|
+
import { Grid } from '@material-ui/core';
|
|
5
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
6
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
7
|
+
import { vcfAutomationApiRef } from '../api/VcfAutomationClient.esm.js';
|
|
8
|
+
import { showDeploymentResourcesDataPermission } from '@terasky/backstage-plugin-vcf-automation-common';
|
|
9
|
+
import { usePermission } from '@backstage/plugin-permission-react';
|
|
10
|
+
|
|
11
|
+
const VCFAutomationVSphereVMDetails = () => {
|
|
12
|
+
const { entity } = useEntity();
|
|
13
|
+
const vcfAutomationApi = useApi(vcfAutomationApiRef);
|
|
14
|
+
const deploymentId = entity.spec?.system || "";
|
|
15
|
+
const resourceId = entity.metadata.name;
|
|
16
|
+
const { allowed } = usePermission({
|
|
17
|
+
permission: showDeploymentResourcesDataPermission
|
|
18
|
+
});
|
|
19
|
+
const { value, loading, error } = useAsync(async () => {
|
|
20
|
+
if (!resourceId || !deploymentId || !allowed) return void 0;
|
|
21
|
+
return await vcfAutomationApi.getVSphereVMDetails(deploymentId, resourceId);
|
|
22
|
+
}, [resourceId, deploymentId, allowed]);
|
|
23
|
+
if (error) {
|
|
24
|
+
return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
|
|
25
|
+
}
|
|
26
|
+
if (loading) {
|
|
27
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
28
|
+
}
|
|
29
|
+
if (!resourceId || !deploymentId) {
|
|
30
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "No resource ID found", children: "This entity is not associated with a VCF resource or deployment." });
|
|
31
|
+
}
|
|
32
|
+
if (!allowed) {
|
|
33
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "Permission Denied", children: "You don't have permission to view resource details." });
|
|
34
|
+
}
|
|
35
|
+
if (!value) {
|
|
36
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "No Data", children: "No resource details available." });
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Resource Status", children: /* @__PURE__ */ jsx(
|
|
40
|
+
StructuredMetadataTable,
|
|
41
|
+
{
|
|
42
|
+
metadata: {
|
|
43
|
+
Name: value.name,
|
|
44
|
+
Type: value.type,
|
|
45
|
+
State: value.state,
|
|
46
|
+
"Sync Status": value.syncStatus,
|
|
47
|
+
"Created At": new Date(value.createdAt).toLocaleString(),
|
|
48
|
+
Origin: value.origin,
|
|
49
|
+
"Depends On": value.dependsOn
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
) }) }),
|
|
53
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, children: /* @__PURE__ */ jsx(InfoCard, { title: "VM Properties", children: /* @__PURE__ */ jsx(
|
|
54
|
+
StructuredMetadataTable,
|
|
55
|
+
{
|
|
56
|
+
metadata: {
|
|
57
|
+
"Power State": value.properties.powerState,
|
|
58
|
+
Zone: value.properties.zone,
|
|
59
|
+
Environment: value.properties.environmentName,
|
|
60
|
+
"Host Type": value.properties.computeHostType,
|
|
61
|
+
"Memory (GB)": value.properties.memoryGB,
|
|
62
|
+
"CPU Count": value.properties.cpuCount,
|
|
63
|
+
"Total Memory (MB)": value.properties.totalMemoryMB,
|
|
64
|
+
"OS Type": value.properties.osType,
|
|
65
|
+
Region: value.properties.region,
|
|
66
|
+
"Host Name": value.properties.hostName,
|
|
67
|
+
"Data Center": value.properties.datacenter,
|
|
68
|
+
"Datastore": value.properties.datastoreName
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
) }) }),
|
|
72
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, children: /* @__PURE__ */ jsx(InfoCard, { title: "Storage Configuration", children: /* @__PURE__ */ jsx(
|
|
73
|
+
StructuredMetadataTable,
|
|
74
|
+
{
|
|
75
|
+
metadata: {
|
|
76
|
+
"Primary Disk": {
|
|
77
|
+
Name: value.properties.storage?.disks[0]?.name || "N/A",
|
|
78
|
+
"Capacity (GB)": value.properties.storage?.disks[0]?.capacityGb || "N/A",
|
|
79
|
+
Type: value.properties.storage?.disks[0]?.type || "N/A",
|
|
80
|
+
"Provisioning": value.properties.storage?.disks[0]?.provisioningType || "N/A"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
) }) }),
|
|
85
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, children: /* @__PURE__ */ jsx(InfoCard, { title: "Network Configuration", children: /* @__PURE__ */ jsx(
|
|
86
|
+
StructuredMetadataTable,
|
|
87
|
+
{
|
|
88
|
+
metadata: {
|
|
89
|
+
"Primary Network": value.properties.networks?.[0] ? {
|
|
90
|
+
Name: value.properties.networks[0].name,
|
|
91
|
+
Address: value.properties.networks[0].address,
|
|
92
|
+
"MAC Address": value.properties.networks[0].mac_address,
|
|
93
|
+
Assignment: value.properties.networks[0].assignment,
|
|
94
|
+
"IPv6 Addresses": value.properties.networks[0].ipv6Addresses || []
|
|
95
|
+
} : "No network configuration available"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
) }) }),
|
|
99
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, children: /* @__PURE__ */ jsx(InfoCard, { title: "Expense Information", children: /* @__PURE__ */ jsx(
|
|
100
|
+
StructuredMetadataTable,
|
|
101
|
+
{
|
|
102
|
+
metadata: {
|
|
103
|
+
"Total Expense": `$${value.expense.totalExpense.toFixed(2)}`,
|
|
104
|
+
"Compute Expense": `$${value.expense.computeExpense.toFixed(2)}`,
|
|
105
|
+
"Storage Expense": `$${value.expense.storageExpense.toFixed(2)}`,
|
|
106
|
+
"Additional Expense": `$${value.expense.additionalExpense.toFixed(2)}`,
|
|
107
|
+
"Currency": value.expense.unit,
|
|
108
|
+
"Last Updated": new Date(value.expense.lastUpdatedTime).toLocaleString()
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
) }) })
|
|
112
|
+
] });
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { VCFAutomationVSphereVMDetails };
|
|
116
|
+
//# sourceMappingURL=VCFAutomationVSphereVMDetails.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VCFAutomationVSphereVMDetails.esm.js","sources":["../../src/components/VCFAutomationVSphereVMDetails.tsx"],"sourcesContent":["import { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n StructuredMetadataTable,\n} from '@backstage/core-components';\nimport { Grid } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { vcfAutomationApiRef } from '../api/VcfAutomationClient';\nimport { showDeploymentResourcesDataPermission } from '@terasky/backstage-plugin-vcf-automation-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nexport const VCFAutomationVSphereVMDetails = () => {\n const { entity } = useEntity();\n const vcfAutomationApi = useApi(vcfAutomationApiRef);\n const deploymentId = entity.spec?.system || '';\n const resourceId = entity.metadata.name;\n\n const { allowed } = usePermission({\n permission: showDeploymentResourcesDataPermission,\n });\n\n const { value, loading, error } = useAsync(async () => {\n if (!resourceId || !deploymentId || !allowed) return undefined;\n return await vcfAutomationApi.getVSphereVMDetails(deploymentId as string, resourceId);\n }, [resourceId, deploymentId, allowed]);\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!resourceId || !deploymentId) {\n return <InfoCard title=\"No resource ID found\">This entity is not associated with a VCF resource or deployment.</InfoCard>;\n }\n\n if (!allowed) {\n return <InfoCard title=\"Permission Denied\">You don't have permission to view resource details.</InfoCard>;\n }\n\n if (!value) {\n return <InfoCard title=\"No Data\">No resource details available.</InfoCard>;\n }\n\n return (\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <InfoCard title=\"Resource Status\">\n <StructuredMetadataTable\n metadata={{\n Name: value.name,\n Type: value.type,\n State: value.state,\n 'Sync Status': value.syncStatus,\n 'Created At': new Date(value.createdAt).toLocaleString(),\n Origin: value.origin,\n 'Depends On': value.dependsOn,\n }}\n />\n </InfoCard>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"VM Properties\">\n <StructuredMetadataTable\n metadata={{\n 'Power State': value.properties.powerState,\n Zone: value.properties.zone,\n Environment: value.properties.environmentName,\n 'Host Type': value.properties.computeHostType,\n 'Memory (GB)': value.properties.memoryGB,\n 'CPU Count': value.properties.cpuCount,\n 'Total Memory (MB)': value.properties.totalMemoryMB,\n 'OS Type': value.properties.osType,\n Region: value.properties.region,\n 'Host Name': value.properties.hostName,\n 'Data Center': value.properties.datacenter,\n 'Datastore': value.properties.datastoreName,\n }}\n />\n </InfoCard>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"Storage Configuration\">\n <StructuredMetadataTable\n metadata={{\n 'Primary Disk': {\n Name: value.properties.storage?.disks[0]?.name || 'N/A',\n 'Capacity (GB)': value.properties.storage?.disks[0]?.capacityGb || 'N/A',\n Type: value.properties.storage?.disks[0]?.type || 'N/A',\n 'Provisioning': value.properties.storage?.disks[0]?.provisioningType || 'N/A',\n },\n }}\n />\n </InfoCard>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"Network Configuration\">\n <StructuredMetadataTable\n metadata={{\n 'Primary Network': value.properties.networks?.[0] ? {\n Name: value.properties.networks[0].name,\n Address: value.properties.networks[0].address,\n 'MAC Address': value.properties.networks[0].mac_address,\n Assignment: value.properties.networks[0].assignment,\n 'IPv6 Addresses': value.properties.networks[0].ipv6Addresses || [],\n } : 'No network configuration available',\n }}\n />\n </InfoCard>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"Expense Information\">\n <StructuredMetadataTable\n metadata={{\n 'Total Expense': `$${value.expense.totalExpense.toFixed(2)}`,\n 'Compute Expense': `$${value.expense.computeExpense.toFixed(2)}`,\n 'Storage Expense': `$${value.expense.storageExpense.toFixed(2)}`,\n 'Additional Expense': `$${value.expense.additionalExpense.toFixed(2)}`,\n 'Currency': value.expense.unit,\n 'Last Updated': new Date(value.expense.lastUpdatedTime).toLocaleString(),\n }}\n />\n </InfoCard>\n </Grid>\n </Grid>\n );\n}; "],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,gCAAgC,MAAM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AAA,CAAM,QAAQ,iBAAkB,CAAA,OAAA,CAAQ,CAAC,CAAC,CAAA,CAAA;AAAA,UACpE,UAAA,EAAY,MAAM,OAAQ,CAAA,IAAA;AAAA,UAC1B,gBAAgB,IAAI,IAAA,CAAK,MAAM,OAAQ,CAAA,eAAe,EAAE,cAAe;AAAA;AACzE;AAAA,OAEJ,CACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
4
|
+
import { vcfAutomationApiRef } from '../api/VcfAutomationClient.esm.js';
|
|
5
|
+
import { InfoCard, Progress, ResponseErrorPanel, StatusPending, StatusError, StatusOK } from '@backstage/core-components';
|
|
6
|
+
import { makeStyles, Typography, Grid } from '@material-ui/core';
|
|
7
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
8
|
+
import { usePermission } from '@backstage/plugin-permission-react';
|
|
9
|
+
import { showDeploymentResourcesDataPermission } from '@terasky/backstage-plugin-vcf-automation-common';
|
|
10
|
+
|
|
11
|
+
const useStyles = makeStyles((theme) => ({
|
|
12
|
+
statusText: {
|
|
13
|
+
fontWeight: "bold",
|
|
14
|
+
"&.success": {
|
|
15
|
+
color: theme.palette.success.main
|
|
16
|
+
},
|
|
17
|
+
"&.error": {
|
|
18
|
+
color: theme.palette.error.main
|
|
19
|
+
},
|
|
20
|
+
"&.pending": {
|
|
21
|
+
color: theme.palette.warning.main
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
const VCFAutomationVSphereVMOverview = () => {
|
|
26
|
+
const { entity } = useEntity();
|
|
27
|
+
const api = useApi(vcfAutomationApiRef);
|
|
28
|
+
const classes = useStyles();
|
|
29
|
+
const deploymentId = entity.spec?.system || "";
|
|
30
|
+
const resourceId = entity.metadata.name;
|
|
31
|
+
const { allowed: hasViewPermission, loading: permissionLoading } = usePermission({
|
|
32
|
+
permission: showDeploymentResourcesDataPermission
|
|
33
|
+
});
|
|
34
|
+
const { value: resource, loading, error } = useAsync(async () => {
|
|
35
|
+
if (!resourceId || !deploymentId || !hasViewPermission) return void 0;
|
|
36
|
+
return await api.getVSphereVMDetails(deploymentId, resourceId);
|
|
37
|
+
}, [resourceId, deploymentId, hasViewPermission]);
|
|
38
|
+
if (!resourceId || !deploymentId) {
|
|
39
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Resource", children: /* @__PURE__ */ jsx(Typography, { children: "No resource ID or deployment ID found for this entity." }) });
|
|
40
|
+
}
|
|
41
|
+
if (loading || permissionLoading) {
|
|
42
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Resource", children: /* @__PURE__ */ jsx(Progress, {}) });
|
|
43
|
+
}
|
|
44
|
+
if (!hasViewPermission) {
|
|
45
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Resource", children: /* @__PURE__ */ jsx(Typography, { children: "You don't have permission to view resource details." }) });
|
|
46
|
+
}
|
|
47
|
+
if (error) {
|
|
48
|
+
return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
|
|
49
|
+
}
|
|
50
|
+
if (!resource) {
|
|
51
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Resource", children: /* @__PURE__ */ jsx(Typography, { children: "No resource details available." }) });
|
|
52
|
+
}
|
|
53
|
+
const getStatusComponent = (state) => {
|
|
54
|
+
switch (state.toUpperCase()) {
|
|
55
|
+
case "SUCCESS":
|
|
56
|
+
case "OK":
|
|
57
|
+
return /* @__PURE__ */ jsx(StatusOK, {});
|
|
58
|
+
case "ERROR":
|
|
59
|
+
case "FAILED":
|
|
60
|
+
return /* @__PURE__ */ jsx(StatusError, {});
|
|
61
|
+
default:
|
|
62
|
+
return /* @__PURE__ */ jsx(StatusPending, {});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "VCF Automation Resource", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
66
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
67
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Name" }),
|
|
68
|
+
/* @__PURE__ */ jsx(Typography, { children: resource.name })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Type" }),
|
|
72
|
+
/* @__PURE__ */ jsx(Typography, { children: resource.type })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
75
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "State" }),
|
|
76
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, alignItems: "center", children: [
|
|
77
|
+
getStatusComponent(resource.state),
|
|
78
|
+
/* @__PURE__ */ jsx(Typography, { className: `${classes.statusText} ${resource.state.toLowerCase()}`, children: resource.state })
|
|
79
|
+
] })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
82
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Sync Status" }),
|
|
83
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, alignItems: "center", children: [
|
|
84
|
+
getStatusComponent(resource.syncStatus),
|
|
85
|
+
/* @__PURE__ */ jsx(Typography, { className: `${classes.statusText} ${resource.syncStatus.toLowerCase()}`, children: resource.syncStatus })
|
|
86
|
+
] })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
89
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Created At" }),
|
|
90
|
+
/* @__PURE__ */ jsx(Typography, { children: new Date(resource.createdAt).toLocaleString() })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
93
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Region" }),
|
|
94
|
+
/* @__PURE__ */ jsx(Typography, { children: resource.properties?.region || "N/A" })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Resource Metrics" }),
|
|
98
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
99
|
+
`CPU: ${resource.properties?.cpuCount || "N/A"} cores, `,
|
|
100
|
+
`Memory: ${resource.properties?.memoryGB || "N/A"} GB, `,
|
|
101
|
+
`Storage: ${resource.properties?.storage?.disks?.[0]?.capacityGb || "N/A"} GB`
|
|
102
|
+
] })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
105
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Expense Information" }),
|
|
106
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
107
|
+
`Total: $${resource.expense?.totalExpense?.toFixed(2) || "N/A"}, `,
|
|
108
|
+
`Compute: $${resource.expense?.computeExpense?.toFixed(2) || "N/A"}, `,
|
|
109
|
+
`Storage: $${resource.expense?.storageExpense?.toFixed(2) || "N/A"}`
|
|
110
|
+
] })
|
|
111
|
+
] })
|
|
112
|
+
] }) });
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { VCFAutomationVSphereVMOverview };
|
|
116
|
+
//# sourceMappingURL=VCFAutomationVSphereVMOverview.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VCFAutomationVSphereVMOverview.esm.js","sources":["../../src/components/VCFAutomationVSphereVMOverview.tsx"],"sourcesContent":["import { useEntity } from '@backstage/plugin-catalog-react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { vcfAutomationApiRef } from '../api/VcfAutomationClient';\nimport {\n InfoCard,\n Progress,\n ResponseErrorPanel,\n StatusOK,\n StatusError,\n StatusPending,\n} from '@backstage/core-components';\nimport { Grid, Typography, makeStyles } from '@material-ui/core';\nimport useAsync from 'react-use/lib/useAsync';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { showDeploymentResourcesDataPermission } from '@terasky/backstage-plugin-vcf-automation-common';\n\nconst useStyles = makeStyles(theme => ({\n statusText: {\n fontWeight: 'bold',\n '&.success': {\n color: theme.palette.success.main,\n },\n '&.error': {\n color: theme.palette.error.main,\n },\n '&.pending': {\n color: theme.palette.warning.main,\n },\n },\n}));\n\nexport const VCFAutomationVSphereVMOverview = () => {\n const { entity } = useEntity();\n const api = useApi(vcfAutomationApiRef);\n const classes = useStyles();\n const deploymentId = entity.spec?.system || '';\n const resourceId = entity.metadata.name;\n\n const { allowed: hasViewPermission, loading: permissionLoading } = usePermission({\n permission: showDeploymentResourcesDataPermission,\n });\n\n const { value: resource, loading, error } = useAsync(async () => {\n if (!resourceId || !deploymentId || !hasViewPermission) return undefined;\n return await api.getVSphereVMDetails(deploymentId as string, resourceId);\n }, [resourceId, deploymentId, hasViewPermission]);\n\n if (!resourceId || !deploymentId) {\n return (\n <InfoCard title=\"VCF Automation Resource\">\n <Typography>No resource ID or deployment ID found for this entity.</Typography>\n </InfoCard>\n );\n }\n\n if (loading || permissionLoading) {\n return (\n <InfoCard title=\"VCF Automation Resource\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (!hasViewPermission) {\n return (\n <InfoCard title=\"VCF Automation Resource\">\n <Typography>You don't have permission to view resource details.</Typography>\n </InfoCard>\n );\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!resource) {\n return (\n <InfoCard title=\"VCF Automation Resource\">\n <Typography>No resource details available.</Typography>\n </InfoCard>\n );\n }\n\n const getStatusComponent = (state: string) => {\n switch (state.toUpperCase()) {\n case 'SUCCESS':\n case 'OK':\n return <StatusOK />;\n case 'ERROR':\n case 'FAILED':\n return <StatusError />;\n default:\n return <StatusPending />;\n }\n };\n\n return (\n <InfoCard title=\"VCF Automation Resource\">\n <Grid container spacing={2}>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Name</Typography>\n <Typography>{resource.name}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Type</Typography>\n <Typography>{resource.type}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">State</Typography>\n <Grid container spacing={1} alignItems=\"center\">\n {getStatusComponent(resource.state)}\n <Typography className={`${classes.statusText} ${resource.state.toLowerCase()}`}>\n {resource.state}\n </Typography>\n </Grid>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Sync Status</Typography>\n <Grid container spacing={1} alignItems=\"center\">\n {getStatusComponent(resource.syncStatus)}\n <Typography className={`${classes.statusText} ${resource.syncStatus.toLowerCase()}`}>\n {resource.syncStatus}\n </Typography>\n </Grid>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Created At</Typography>\n <Typography>{new Date(resource.createdAt).toLocaleString()}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Region</Typography>\n <Typography>{resource.properties?.region || 'N/A'}</Typography>\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">Resource Metrics</Typography>\n <Typography>\n {`CPU: ${resource.properties?.cpuCount || 'N/A'} cores, `}\n {`Memory: ${resource.properties?.memoryGB || 'N/A'} GB, `}\n {`Storage: ${resource.properties?.storage?.disks?.[0]?.capacityGb || 'N/A'} GB`}\n </Typography>\n </Grid>\n <Grid item xs={12}>\n <Typography variant=\"subtitle2\">Expense Information</Typography>\n <Typography>\n {`Total: $${resource.expense?.totalExpense?.toFixed(2) || 'N/A'}, `}\n {`Compute: $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