@terasky/backstage-plugin-vcf-automation 1.1.0 → 1.2.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/dist/api/VcfAutomationClient.esm.js +36 -0
- package/dist/api/VcfAutomationClient.esm.js.map +1 -1
- package/dist/components/VCFAutomationCCINamespaceDetails.esm.js +166 -0
- package/dist/components/VCFAutomationCCINamespaceDetails.esm.js.map +1 -0
- package/dist/components/VCFAutomationCCINamespaceOverview.esm.js +159 -0
- package/dist/components/VCFAutomationCCINamespaceOverview.esm.js.map +1 -0
- package/dist/components/VCFAutomationCCIResourceDetails.esm.js +359 -0
- package/dist/components/VCFAutomationCCIResourceDetails.esm.js.map +1 -0
- package/dist/components/VCFAutomationCCIResourceOverview.esm.js +265 -0
- package/dist/components/VCFAutomationCCIResourceOverview.esm.js.map +1 -0
- package/dist/components/VCFAutomationProjectDetails.esm.js +25 -8
- package/dist/components/VCFAutomationProjectDetails.esm.js.map +1 -1
- package/dist/components/VCFAutomationProjectOverview.esm.js +17 -6
- package/dist/components/VCFAutomationProjectOverview.esm.js.map +1 -1
- package/dist/index.d.ts +104 -18
- package/dist/index.esm.js +4 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +28 -0
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +13 -11
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
4
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
5
|
+
import { vcfAutomationApiRef } from '../api/VcfAutomationClient.esm.js';
|
|
6
|
+
import { InfoCard, Progress, ResponseErrorPanel, StructuredMetadataTable, CodeSnippet, StatusPending, StatusError, StatusOK } from '@backstage/core-components';
|
|
7
|
+
import { Typography, Grid, Box, Chip, Accordion, AccordionSummary, AccordionDetails } from '@material-ui/core';
|
|
8
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
9
|
+
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
|
10
|
+
import yaml from 'js-yaml';
|
|
11
|
+
import useAsync from 'react-use/lib/useAsync';
|
|
12
|
+
|
|
13
|
+
const useStyles = makeStyles((theme) => ({
|
|
14
|
+
statusChip: {
|
|
15
|
+
marginRight: theme.spacing(1),
|
|
16
|
+
marginBottom: theme.spacing(0.5)
|
|
17
|
+
},
|
|
18
|
+
sectionTitle: {
|
|
19
|
+
marginBottom: theme.spacing(2)
|
|
20
|
+
},
|
|
21
|
+
conditionChip: {
|
|
22
|
+
margin: theme.spacing(0.25)
|
|
23
|
+
},
|
|
24
|
+
yamlContainer: {
|
|
25
|
+
"& .MuiAccordionSummary-root": {
|
|
26
|
+
minHeight: 48
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
dependencyChip: {
|
|
30
|
+
margin: theme.spacing(0.25),
|
|
31
|
+
cursor: "pointer"
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
const VCFAutomationCCIResourceOverview = () => {
|
|
35
|
+
const classes = useStyles();
|
|
36
|
+
const { entity } = useEntity();
|
|
37
|
+
const api = useApi(vcfAutomationApiRef);
|
|
38
|
+
const deploymentId = entity.spec?.system;
|
|
39
|
+
const resourceId = entity.metadata.name;
|
|
40
|
+
const instanceName = entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-instance"];
|
|
41
|
+
const annotationData = useMemo(() => {
|
|
42
|
+
const resourceProperties = entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-resource-properties"];
|
|
43
|
+
const resourceManifest = entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-cci-resource-manifest"];
|
|
44
|
+
const resourceObject = entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-cci-resource-object"];
|
|
45
|
+
const resourceContext2 = entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-cci-resource-context"];
|
|
46
|
+
return {
|
|
47
|
+
resourceData: resourceProperties && resourceProperties !== "{}" ? JSON.parse(resourceProperties) : null,
|
|
48
|
+
manifest: resourceManifest && resourceManifest !== "{}" ? JSON.parse(resourceManifest) : null,
|
|
49
|
+
objectData: resourceObject && resourceObject !== "{}" ? JSON.parse(resourceObject) : null,
|
|
50
|
+
resourceContext: resourceContext2 || ""
|
|
51
|
+
};
|
|
52
|
+
}, [
|
|
53
|
+
entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-resource-properties"],
|
|
54
|
+
entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-cci-resource-manifest"],
|
|
55
|
+
entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-cci-resource-object"],
|
|
56
|
+
entity.metadata.annotations?.["terasky.backstage.io/vcf-automation-cci-resource-context"]
|
|
57
|
+
]);
|
|
58
|
+
const needsApiCall = !annotationData.resourceData || !annotationData.manifest || !annotationData.objectData;
|
|
59
|
+
const { value: apiResourceData, loading, error } = useAsync(async () => {
|
|
60
|
+
if (!needsApiCall || !deploymentId || !resourceId) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const response = await api.getDeploymentResources(deploymentId, instanceName);
|
|
65
|
+
let resources = null;
|
|
66
|
+
if (response) {
|
|
67
|
+
if (Array.isArray(response)) {
|
|
68
|
+
resources = response;
|
|
69
|
+
} else if (response.content && Array.isArray(response.content)) {
|
|
70
|
+
resources = response.content;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (resources) {
|
|
74
|
+
return resources.find((r) => r.id === resourceId);
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
} catch (apiError) {
|
|
78
|
+
console.error("Failed to fetch resource data:", apiError);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}, [needsApiCall, deploymentId, resourceId, instanceName]);
|
|
82
|
+
const resourceData = annotationData.resourceData || apiResourceData;
|
|
83
|
+
const manifest = annotationData.manifest || apiResourceData?.properties?.manifest;
|
|
84
|
+
const objectData = annotationData.objectData || apiResourceData?.properties?.object;
|
|
85
|
+
const resourceContext = annotationData.resourceContext || apiResourceData?.properties?.context;
|
|
86
|
+
if (loading) {
|
|
87
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "CCI Supervisor Resource", children: /* @__PURE__ */ jsx(Progress, {}) });
|
|
88
|
+
}
|
|
89
|
+
if (error) {
|
|
90
|
+
return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
|
|
91
|
+
}
|
|
92
|
+
if (!resourceData) {
|
|
93
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "CCI Supervisor Resource", children: /* @__PURE__ */ jsx(Typography, { children: "No resource data available." }) });
|
|
94
|
+
}
|
|
95
|
+
const renderStatusIcon = (conditionStatus) => {
|
|
96
|
+
switch (conditionStatus.toLowerCase()) {
|
|
97
|
+
case "true":
|
|
98
|
+
return /* @__PURE__ */ jsx(StatusOK, {});
|
|
99
|
+
case "false":
|
|
100
|
+
return /* @__PURE__ */ jsx(StatusError, {});
|
|
101
|
+
default:
|
|
102
|
+
return /* @__PURE__ */ jsx(StatusPending, {});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const reorderKubernetesResource = (data) => {
|
|
106
|
+
if (!data || typeof data !== "object") {
|
|
107
|
+
return data;
|
|
108
|
+
}
|
|
109
|
+
const orderedFields = ["apiVersion", "kind", "metadata", "spec", "status", "data"];
|
|
110
|
+
const reordered = {};
|
|
111
|
+
orderedFields.forEach((field) => {
|
|
112
|
+
if (data[field] !== void 0) {
|
|
113
|
+
reordered[field] = data[field];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.keys(data).forEach((field) => {
|
|
117
|
+
if (!orderedFields.includes(field)) {
|
|
118
|
+
reordered[field] = data[field];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return reordered;
|
|
122
|
+
};
|
|
123
|
+
const formatYaml = (data) => {
|
|
124
|
+
try {
|
|
125
|
+
const reorderedData = reorderKubernetesResource(data);
|
|
126
|
+
return yaml.dump(reorderedData, {
|
|
127
|
+
indent: 2,
|
|
128
|
+
lineWidth: -1,
|
|
129
|
+
noRefs: true,
|
|
130
|
+
sortKeys: false
|
|
131
|
+
});
|
|
132
|
+
} catch (error2) {
|
|
133
|
+
return JSON.stringify(data, null, 2);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const basicInfo = {
|
|
137
|
+
"Resource Name": resourceData.id || "Unknown",
|
|
138
|
+
"Context": resourceContext || "Unknown",
|
|
139
|
+
"Resource Link": resourceData.resourceLink || "Not available",
|
|
140
|
+
"Count": resourceData.count?.toString() || "N/A",
|
|
141
|
+
"Count Index": resourceData.countIndex?.toString() || "N/A",
|
|
142
|
+
"Existing": resourceData.existing ? "Yes" : "No"
|
|
143
|
+
};
|
|
144
|
+
const getObjectStatus = () => {
|
|
145
|
+
if (!objectData?.status) return null;
|
|
146
|
+
const status = objectData.status;
|
|
147
|
+
const statusInfo = {};
|
|
148
|
+
if (status.powerState) statusInfo["Power State"] = status.powerState;
|
|
149
|
+
if (status.phase) statusInfo["Phase"] = status.phase;
|
|
150
|
+
if (status.primaryIP4) statusInfo["Primary IP"] = status.primaryIP4;
|
|
151
|
+
if (status.host) statusInfo["Host"] = status.host;
|
|
152
|
+
if (status.zone) statusInfo["Zone"] = status.zone;
|
|
153
|
+
if (status.uniqueID) statusInfo["Unique ID"] = status.uniqueID;
|
|
154
|
+
if (status.instanceUUID) statusInfo["Instance UUID"] = status.instanceUUID;
|
|
155
|
+
if (status.biosUUID) statusInfo["BIOS UUID"] = status.biosUUID;
|
|
156
|
+
return Object.keys(statusInfo).length > 0 ? statusInfo : null;
|
|
157
|
+
};
|
|
158
|
+
const objectStatus = getObjectStatus();
|
|
159
|
+
return /* @__PURE__ */ jsx(InfoCard, { title: "CCI Supervisor Resource Overview", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, children: [
|
|
160
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
161
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", className: classes.sectionTitle, children: "Basic Information" }),
|
|
162
|
+
/* @__PURE__ */ jsx(StructuredMetadataTable, { metadata: basicInfo })
|
|
163
|
+
] }),
|
|
164
|
+
entity.spec?.dependsOn && Array.isArray(entity.spec.dependsOn) && entity.spec.dependsOn.length > 0 && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
165
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", className: classes.sectionTitle, children: "Dependencies" }),
|
|
166
|
+
/* @__PURE__ */ jsx(Box, { children: entity.spec.dependsOn.filter((dep) => typeof dep === "string").map((dep, index) => /* @__PURE__ */ jsx(
|
|
167
|
+
Chip,
|
|
168
|
+
{
|
|
169
|
+
label: dep,
|
|
170
|
+
size: "small",
|
|
171
|
+
className: classes.dependencyChip,
|
|
172
|
+
color: "primary",
|
|
173
|
+
variant: "outlined"
|
|
174
|
+
},
|
|
175
|
+
index
|
|
176
|
+
)) })
|
|
177
|
+
] }),
|
|
178
|
+
resourceData.wait?.conditions && resourceData.wait.conditions.length > 0 && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
179
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", className: classes.sectionTitle, children: "Wait Conditions" }),
|
|
180
|
+
/* @__PURE__ */ jsx(Box, { children: resourceData.wait.conditions.map((condition, index) => /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", mb: 1, children: [
|
|
181
|
+
renderStatusIcon(condition.status),
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
Chip,
|
|
184
|
+
{
|
|
185
|
+
label: `${condition.type}: ${condition.status}`,
|
|
186
|
+
size: "small",
|
|
187
|
+
className: classes.conditionChip,
|
|
188
|
+
color: condition.status === "True" ? "primary" : "default"
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
] }, index)) })
|
|
192
|
+
] }),
|
|
193
|
+
objectData?.status?.conditions && objectData.status.conditions.length > 0 && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
194
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", className: classes.sectionTitle, children: "Resource Conditions" }),
|
|
195
|
+
/* @__PURE__ */ jsx(Box, { children: objectData.status.conditions.map((condition, index) => /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", mb: 1, children: [
|
|
196
|
+
renderStatusIcon(condition.status),
|
|
197
|
+
/* @__PURE__ */ jsx(
|
|
198
|
+
Chip,
|
|
199
|
+
{
|
|
200
|
+
label: `${condition.type}: ${condition.status}`,
|
|
201
|
+
size: "small",
|
|
202
|
+
className: classes.conditionChip,
|
|
203
|
+
color: condition.status === "True" ? "primary" : "default"
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", style: { marginLeft: 8 }, children: condition.lastTransitionTime })
|
|
207
|
+
] }, index)) })
|
|
208
|
+
] }),
|
|
209
|
+
objectStatus && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
210
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", className: classes.sectionTitle, children: "Resource Status" }),
|
|
211
|
+
/* @__PURE__ */ jsx(StructuredMetadataTable, { metadata: objectStatus })
|
|
212
|
+
] }),
|
|
213
|
+
manifest && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Accordion, { className: classes.yamlContainer, children: [
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
AccordionSummary,
|
|
216
|
+
{
|
|
217
|
+
expandIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
|
|
218
|
+
"aria-controls": "manifest-content",
|
|
219
|
+
id: "manifest-header",
|
|
220
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Resource Manifest" })
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
/* @__PURE__ */ jsx(AccordionDetails, { children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsx(
|
|
224
|
+
CodeSnippet,
|
|
225
|
+
{
|
|
226
|
+
text: formatYaml(manifest),
|
|
227
|
+
language: "yaml",
|
|
228
|
+
showLineNumbers: true,
|
|
229
|
+
customStyle: {
|
|
230
|
+
fontSize: "12px",
|
|
231
|
+
maxHeight: "500px",
|
|
232
|
+
overflow: "auto"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
) }) })
|
|
236
|
+
] }) }),
|
|
237
|
+
objectData && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Accordion, { className: classes.yamlContainer, children: [
|
|
238
|
+
/* @__PURE__ */ jsx(
|
|
239
|
+
AccordionSummary,
|
|
240
|
+
{
|
|
241
|
+
expandIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
|
|
242
|
+
"aria-controls": "object-content",
|
|
243
|
+
id: "object-header",
|
|
244
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Kubernetes Object" })
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ jsx(AccordionDetails, { children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsx(
|
|
248
|
+
CodeSnippet,
|
|
249
|
+
{
|
|
250
|
+
text: formatYaml(objectData),
|
|
251
|
+
language: "yaml",
|
|
252
|
+
showLineNumbers: true,
|
|
253
|
+
customStyle: {
|
|
254
|
+
fontSize: "12px",
|
|
255
|
+
maxHeight: "500px",
|
|
256
|
+
overflow: "auto"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
) }) })
|
|
260
|
+
] }) })
|
|
261
|
+
] }) });
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export { VCFAutomationCCIResourceOverview };
|
|
265
|
+
//# sourceMappingURL=VCFAutomationCCIResourceOverview.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VCFAutomationCCIResourceOverview.esm.js","sources":["../../src/components/VCFAutomationCCIResourceOverview.tsx"],"sourcesContent":["import { useMemo } 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 StructuredMetadataTable,\n CodeSnippet,\n StatusOK,\n StatusError,\n StatusPending,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { Grid, Typography, Chip, Box, Accordion, AccordionSummary, AccordionDetails } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport yaml from 'js-yaml';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles(theme => ({\n statusChip: {\n marginRight: theme.spacing(1),\n marginBottom: theme.spacing(0.5),\n },\n sectionTitle: {\n marginBottom: theme.spacing(2),\n },\n conditionChip: {\n margin: theme.spacing(0.25),\n },\n yamlContainer: {\n '& .MuiAccordionSummary-root': {\n minHeight: 48,\n },\n },\n dependencyChip: {\n margin: theme.spacing(0.25),\n cursor: 'pointer',\n },\n}));\n\nexport const VCFAutomationCCIResourceOverview = () => {\n const classes = useStyles();\n const { entity } = useEntity();\n const api = useApi(vcfAutomationApiRef);\n\n // Extract stable values from entity\n const deploymentId = entity.spec?.system as string;\n const resourceId = entity.metadata.name;\n const instanceName = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-instance'];\n\n // Parse annotation data once using useMemo\n const annotationData = useMemo(() => {\n const resourceProperties = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-resource-properties'];\n const resourceManifest = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-cci-resource-manifest'];\n const resourceObject = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-cci-resource-object'];\n const resourceContext = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-cci-resource-context'];\n \n return {\n resourceData: resourceProperties && resourceProperties !== '{}' ? JSON.parse(resourceProperties) : null,\n manifest: resourceManifest && resourceManifest !== '{}' ? JSON.parse(resourceManifest) : null,\n objectData: resourceObject && resourceObject !== '{}' ? JSON.parse(resourceObject) : null,\n resourceContext: resourceContext || '',\n };\n }, [\n entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-resource-properties'],\n entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-cci-resource-manifest'],\n entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-cci-resource-object'],\n entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-cci-resource-context'],\n ]);\n\n // Check if we need to make API call\n const needsApiCall = !annotationData.resourceData || !annotationData.manifest || !annotationData.objectData;\n\n // Fallback API call if annotation data is missing or empty\n const { value: apiResourceData, loading, error } = useAsync(async () => {\n if (!needsApiCall || !deploymentId || !resourceId) {\n return null;\n }\n\n try {\n // Fetch detailed resource data from the backend\n const response = await api.getDeploymentResources(deploymentId, instanceName);\n let resources = null;\n if (response) {\n // Handle both direct array and paginated response with content wrapper\n if (Array.isArray(response)) {\n resources = response;\n } else if (response.content && Array.isArray(response.content)) {\n resources = response.content;\n }\n }\n if (resources) {\n return resources.find((r: any) => r.id === resourceId);\n }\n return null;\n } catch (apiError) {\n console.error('Failed to fetch resource data:', apiError);\n return null;\n }\n }, [needsApiCall, deploymentId, resourceId, instanceName]);\n\n // Determine final data to use\n const resourceData = annotationData.resourceData || apiResourceData;\n const manifest = annotationData.manifest || apiResourceData?.properties?.manifest;\n const objectData = annotationData.objectData || apiResourceData?.properties?.object;\n const resourceContext = annotationData.resourceContext || apiResourceData?.properties?.context;\n\n if (loading) {\n return (\n <InfoCard title=\"CCI Supervisor Resource\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!resourceData) {\n return (\n <InfoCard title=\"CCI Supervisor Resource\">\n <Typography>No resource data available.</Typography>\n </InfoCard>\n );\n }\n\n const renderStatusIcon = (conditionStatus: string) => {\n switch (conditionStatus.toLowerCase()) {\n case 'true':\n return <StatusOK />;\n case 'false':\n return <StatusError />;\n default:\n return <StatusPending />;\n }\n };\n\n const reorderKubernetesResource = (data: any) => {\n if (!data || typeof data !== 'object') {\n return data;\n }\n\n // Standard Kubernetes resource field order\n const orderedFields = ['apiVersion', 'kind', 'metadata', 'spec', 'status', 'data'];\n const reordered: any = {};\n\n // Add fields in the correct order\n orderedFields.forEach(field => {\n if (data[field] !== undefined) {\n reordered[field] = data[field];\n }\n });\n\n // Add any remaining fields that weren't in our standard list\n Object.keys(data).forEach(field => {\n if (!orderedFields.includes(field)) {\n reordered[field] = data[field];\n }\n });\n\n return reordered;\n };\n\n const formatYaml = (data: any) => {\n try {\n const reorderedData = reorderKubernetesResource(data);\n return yaml.dump(reorderedData, { \n indent: 2, \n lineWidth: -1,\n noRefs: true,\n sortKeys: false \n });\n } catch (error) {\n return JSON.stringify(data, null, 2);\n }\n };\n\n const basicInfo = {\n 'Resource Name': resourceData.id || 'Unknown',\n 'Context': resourceContext || 'Unknown',\n 'Resource Link': resourceData.resourceLink || 'Not available',\n 'Count': resourceData.count?.toString() || 'N/A',\n 'Count Index': resourceData.countIndex?.toString() || 'N/A',\n 'Existing': resourceData.existing ? 'Yes' : 'No',\n };\n\n const getObjectStatus = () => {\n if (!objectData?.status) return null;\n \n const status = objectData.status;\n const statusInfo: any = {};\n \n if (status.powerState) statusInfo['Power State'] = status.powerState;\n if (status.phase) statusInfo['Phase'] = status.phase;\n if (status.primaryIP4) statusInfo['Primary IP'] = status.primaryIP4;\n if (status.host) statusInfo['Host'] = status.host;\n if (status.zone) statusInfo['Zone'] = status.zone;\n if (status.uniqueID) statusInfo['Unique ID'] = status.uniqueID;\n if (status.instanceUUID) statusInfo['Instance UUID'] = status.instanceUUID;\n if (status.biosUUID) statusInfo['BIOS UUID'] = status.biosUUID;\n \n return Object.keys(statusInfo).length > 0 ? statusInfo : null;\n };\n\n const objectStatus = getObjectStatus();\n\n return (\n <InfoCard title=\"CCI Supervisor Resource Overview\">\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <Typography variant=\"h6\" className={classes.sectionTitle}>\n Basic Information\n </Typography>\n <StructuredMetadataTable metadata={basicInfo} />\n </Grid>\n\n {entity.spec?.dependsOn && Array.isArray(entity.spec.dependsOn) && entity.spec.dependsOn.length > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"h6\" className={classes.sectionTitle}>\n Dependencies\n </Typography>\n <Box>\n {entity.spec.dependsOn\n .filter((dep): dep is string => typeof dep === 'string')\n .map((dep: string, index: number) => (\n <Chip\n key={index}\n label={dep}\n size=\"small\"\n className={classes.dependencyChip}\n color=\"primary\"\n variant=\"outlined\"\n />\n ))}\n </Box>\n </Grid>\n )}\n\n {resourceData.wait?.conditions && resourceData.wait.conditions.length > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"h6\" className={classes.sectionTitle}>\n Wait Conditions\n </Typography>\n <Box>\n {resourceData.wait.conditions.map((condition: any, index: number) => (\n <Box key={index} display=\"flex\" alignItems=\"center\" mb={1}>\n {renderStatusIcon(condition.status)}\n <Chip\n label={`${condition.type}: ${condition.status}`}\n size=\"small\"\n className={classes.conditionChip}\n color={condition.status === 'True' ? 'primary' : 'default'}\n />\n </Box>\n ))}\n </Box>\n </Grid>\n )}\n\n {objectData?.status?.conditions && objectData.status.conditions.length > 0 && (\n <Grid item xs={12}>\n <Typography variant=\"h6\" className={classes.sectionTitle}>\n Resource Conditions\n </Typography>\n <Box>\n {objectData.status.conditions.map((condition: any, index: number) => (\n <Box key={index} display=\"flex\" alignItems=\"center\" mb={1}>\n {renderStatusIcon(condition.status)}\n <Chip\n label={`${condition.type}: ${condition.status}`}\n size=\"small\"\n className={classes.conditionChip}\n color={condition.status === 'True' ? 'primary' : 'default'}\n />\n <Typography variant=\"caption\" style={{ marginLeft: 8 }}>\n {condition.lastTransitionTime}\n </Typography>\n </Box>\n ))}\n </Box>\n </Grid>\n )}\n\n {objectStatus && (\n <Grid item xs={12}>\n <Typography variant=\"h6\" className={classes.sectionTitle}>\n Resource Status\n </Typography>\n <StructuredMetadataTable metadata={objectStatus} />\n </Grid>\n )}\n\n {manifest && (\n <Grid item xs={12}>\n <Accordion className={classes.yamlContainer}>\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls=\"manifest-content\"\n id=\"manifest-header\"\n >\n <Typography variant=\"h6\">Resource Manifest</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Box width=\"100%\">\n <CodeSnippet\n text={formatYaml(manifest)}\n language=\"yaml\"\n showLineNumbers\n customStyle={{ \n fontSize: '12px',\n maxHeight: '500px',\n overflow: 'auto'\n }}\n />\n </Box>\n </AccordionDetails>\n </Accordion>\n </Grid>\n )}\n\n {objectData && (\n <Grid item xs={12}>\n <Accordion className={classes.yamlContainer}>\n <AccordionSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls=\"object-content\"\n id=\"object-header\"\n >\n <Typography variant=\"h6\">Kubernetes Object</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Box width=\"100%\">\n <CodeSnippet\n text={formatYaml(objectData)}\n language=\"yaml\"\n showLineNumbers\n customStyle={{ \n fontSize: '12px',\n maxHeight: '500px',\n overflow: 'auto'\n }}\n />\n </Box>\n </AccordionDetails>\n </Accordion>\n </Grid>\n )}\n </Grid>\n </InfoCard>\n );\n};"],"names":["resourceContext","error"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,UAAY,EAAA;AAAA,IACV,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC5B,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,GAAG;AAAA,GACjC;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC/B;AAAA,EACA,aAAe,EAAA;AAAA,IACb,MAAA,E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Ac,EAAA,gBAAA;AAAA,UACd,EAAG,EAAA,eAAA;AAAA,UAEH,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,IAAA,EAAK,QAAiB,EAAA,mBAAA,EAAA;AAAA;AAAA,OAC5C;AAAA,sBACC,GAAA,CAAA,gBAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,GAAA,EAAA,EAAI,OAAM,MACT,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAM,WAAW,UAAU,CAAA;AAAA,UAC3B,QAAS,EAAA,MAAA;AAAA,UACT,eAAe,EAAA,IAAA;AAAA,UACf,WAAa,EAAA;AAAA,YACX,QAAU,EAAA,MAAA;AAAA,YACV,SAAW,EAAA,OAAA;AAAA,YACX,QAAU,EAAA;AAAA;AACZ;AAAA,SAEJ,CACF,EAAA;AAAA,KAAA,EACF,CACF,EAAA;AAAA,GAAA,EAEJ,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -91,7 +91,7 @@ const VCFAutomationProjectDetails = () => {
|
|
|
91
91
|
"Project Name": projectData.name,
|
|
92
92
|
"Project ID": projectData.id,
|
|
93
93
|
Description: projectData.description,
|
|
94
|
-
"Organization ID": projectData.organizationId,
|
|
94
|
+
"Organization ID": projectData.organizationId || projectData.orgId,
|
|
95
95
|
"Operation Timeout": `${projectData.operationTimeout} seconds`,
|
|
96
96
|
"Machine Naming Template": projectData.machineNamingTemplate || "N/A",
|
|
97
97
|
"Shared Resources": projectData.sharedResources ? "Yes" : "No"
|
|
@@ -127,12 +127,14 @@ const VCFAutomationProjectDetails = () => {
|
|
|
127
127
|
}
|
|
128
128
|
) }) }),
|
|
129
129
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Members", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, children: [
|
|
130
|
-
renderMemberTable(projectData.administrators, "Administrators"),
|
|
131
|
-
renderMemberTable(projectData.members, "Members"),
|
|
132
|
-
renderMemberTable(projectData.viewers, "Viewers"),
|
|
133
|
-
renderMemberTable(projectData.supervisors, "Supervisors")
|
|
130
|
+
renderMemberTable(projectData.administrators || [], "Administrators"),
|
|
131
|
+
renderMemberTable(projectData.members || [], "Members"),
|
|
132
|
+
renderMemberTable(projectData.viewers || [], "Viewers"),
|
|
133
|
+
renderMemberTable(projectData.supervisors || [], "Supervisors"),
|
|
134
|
+
projectData.users && projectData.users.length > 0 && renderMemberTable(projectData.users, "Users"),
|
|
135
|
+
projectData.auditors && projectData.auditors.length > 0 && renderMemberTable(projectData.auditors, "Auditors")
|
|
134
136
|
] }) }) }),
|
|
135
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Zones", children: /* @__PURE__ */ jsx(
|
|
137
|
+
projectData.zones && projectData.zones.length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Project Zones", children: /* @__PURE__ */ jsx(
|
|
136
138
|
Table,
|
|
137
139
|
{
|
|
138
140
|
columns: [
|
|
@@ -166,17 +168,32 @@ const VCFAutomationProjectDetails = () => {
|
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
) }) }),
|
|
169
|
-
Object.keys(projectData.constraints).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Constraints", children: /* @__PURE__ */ jsx(
|
|
171
|
+
projectData.constraints && Object.keys(projectData.constraints).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Constraints", children: /* @__PURE__ */ jsx(
|
|
170
172
|
StructuredMetadataTable,
|
|
171
173
|
{
|
|
172
174
|
metadata: projectData.constraints
|
|
173
175
|
}
|
|
174
176
|
) }) }),
|
|
175
|
-
Object.keys(projectData.customProperties).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Custom Properties", children: /* @__PURE__ */ jsx(
|
|
177
|
+
projectData.customProperties && Object.keys(projectData.customProperties).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Custom Properties", children: /* @__PURE__ */ jsx(
|
|
176
178
|
StructuredMetadataTable,
|
|
177
179
|
{
|
|
178
180
|
metadata: projectData.customProperties
|
|
179
181
|
}
|
|
182
|
+
) }) }),
|
|
183
|
+
projectData.properties && Object.keys(projectData.properties).length > 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Properties", children: /* @__PURE__ */ jsx(
|
|
184
|
+
StructuredMetadataTable,
|
|
185
|
+
{
|
|
186
|
+
metadata: projectData.properties
|
|
187
|
+
}
|
|
188
|
+
) }) }),
|
|
189
|
+
projectData.orgId && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(InfoCard, { title: "Organization Information", children: /* @__PURE__ */ jsx(
|
|
190
|
+
StructuredMetadataTable,
|
|
191
|
+
{
|
|
192
|
+
metadata: {
|
|
193
|
+
"Organization ID": projectData.orgId,
|
|
194
|
+
"Operation Timeout": projectData.operationTimeout ? `${projectData.operationTimeout} minutes` : "Not configured"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
180
197
|
) }) })
|
|
181
198
|
] });
|
|
182
199
|
};
|
|
@@ -1 +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 const instanceName = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-instance'];\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, instanceName);\n }, [projectId, allowed, instanceName]);\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;AAClC,EAAA,MAAM,YAAe,GAAA,MAAA,CAAO,QAAS,C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A;AAAA,YACE,KAAO,EAAA,cAAA;AAAA,YACP,KAAO,EAAA,SAAA;AAAA,YACP,MAAA,EAAQ,CAAC,GAAwB,KAAA,CAAA,EAAG,IAAI,kBAAkB,CAAA,CAAA,EAAI,GAAI,CAAA,cAAA,IAAkB,QAAG,CAAA;AAAA;AACzF,SACF;AAAA,QACA,MAAM,WAAY,CAAA,KAAA;AAAA,QAClB,OAAS,EAAA;AAAA,UACP,MAAQ,EAAA,IAAA;AAAA,UACR,MAAQ,EAAA;AAAA;AACV;AAAA,OAEJ,CACF,EAAA,CAAA;AAAA,IAEC,OAAO,IAAK,CAAA,WAAA,CAAY,WAAW,CAAA,CAAE,SAAS,CAC7C,oBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,EAAI,EAAA,EAAA,EACb,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EAAS,OAAM,aACd,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;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;;;;"}
|
|
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 const instanceName = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-instance'];\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, instanceName);\n }, [projectId, allowed, instanceName]);\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 || projectData.orgId,\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 {projectData.users && projectData.users.length > 0 && renderMemberTable(projectData.users, 'Users')}\n {projectData.auditors && projectData.auditors.length > 0 && renderMemberTable(projectData.auditors, 'Auditors')}\n </Grid>\n </InfoCard>\n </Grid>\n\n {projectData.zones && projectData.zones.length > 0 && (\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\n {projectData.constraints && 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 {projectData.customProperties && 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\n {projectData.properties && Object.keys(projectData.properties).length > 0 && (\n <Grid item xs={12}>\n <InfoCard title=\"Properties\">\n <StructuredMetadataTable\n metadata={projectData.properties}\n />\n </InfoCard>\n </Grid>\n )}\n\n {projectData.orgId && (\n <Grid item xs={12}>\n <InfoCard title=\"Organization Information\">\n <StructuredMetadataTable\n metadata={{\n 'Organization ID': projectData.orgId,\n 'Operation Timeout': projectData.operationTimeout ? `${projectData.operationTimeout} minutes` : 'Not configured',\n }}\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;AAClC,EAAA,MAAM,YAAe,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,8CAA8C,CAAA;AAEjG,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,IAAA,OAAO,MAAM,gBAAA,CAAiB,iBAAkB,CAAA,SAAA,EAAW,YAAY,CAAA;AAAA,GACtE,EAAA,CAAC,SAAW,EAAA,OAAA,EAAS,YAAY,CAAC,CAAA;AAErC,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;AAGnC,IAAM,MAAA,OAAA,GAAU,MAAM,UAAA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AA,CAAC,QAAS,EAAA,EAAA,KAAA,EAAM,0BACd,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,QAAU,EAAA;AAAA,UACR,mBAAmB,WAAY,CAAA,KAAA;AAAA,UAC/B,qBAAqB,WAAY,CAAA,gBAAA,GAAmB,CAAG,EAAA,WAAA,CAAY,gBAAgB,CAAa,QAAA,CAAA,GAAA;AAAA;AAClG;AAAA,OAEJ,CACF,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -46,15 +46,15 @@ const VCFAutomationProjectOverview = () => {
|
|
|
46
46
|
] }),
|
|
47
47
|
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
48
48
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Administrators" }),
|
|
49
|
-
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, children: project.administrators.map((admin) => /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
49
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 1, children: project.administrators && project.administrators.length > 0 ? project.administrators.map((admin, index) => /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
50
50
|
Chip,
|
|
51
51
|
{
|
|
52
|
-
label: `${admin.email} (${admin.type})
|
|
52
|
+
label: admin.email ? `${admin.email} (${admin.type || "User"})` : admin.toString(),
|
|
53
53
|
size: "small"
|
|
54
54
|
}
|
|
55
|
-
) }, `${admin.email}-${admin.type}`)) })
|
|
55
|
+
) }, admin.email ? `${admin.email}-${admin.type}` : `admin-${index}`)) : /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: "No administrators configured" }) }) })
|
|
56
56
|
] }),
|
|
57
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
57
|
+
project.zones && project.zones.length > 0 && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
58
58
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Resource Allocation" }),
|
|
59
59
|
project.zones.map((zone) => /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
60
60
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
@@ -95,13 +95,24 @@ const VCFAutomationProjectOverview = () => {
|
|
|
95
95
|
] })
|
|
96
96
|
] }, zone.id))
|
|
97
97
|
] }),
|
|
98
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
98
|
+
project.sharedResources !== void 0 && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
99
99
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Shared Resources" }),
|
|
100
100
|
/* @__PURE__ */ jsx(Typography, { children: project.sharedResources ? "Yes" : "No" })
|
|
101
101
|
] }),
|
|
102
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
102
|
+
project.placementPolicy && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
103
103
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Placement Policy" }),
|
|
104
104
|
/* @__PURE__ */ jsx(Typography, { children: project.placementPolicy })
|
|
105
|
+
] }),
|
|
106
|
+
project.orgId && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Organization ID" }),
|
|
108
|
+
/* @__PURE__ */ jsx(Typography, { children: project.orgId })
|
|
109
|
+
] }),
|
|
110
|
+
project.operationTimeout !== void 0 && /* @__PURE__ */ jsxs(Grid, { item: true, xs: 6, children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Operation Timeout" }),
|
|
112
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
113
|
+
project.operationTimeout,
|
|
114
|
+
" minutes"
|
|
115
|
+
] })
|
|
105
116
|
] })
|
|
106
117
|
] }) });
|
|
107
118
|
};
|
|
@@ -1 +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 const instanceName = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-instance'];\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, instanceName);\n }, [projectId, hasViewPermission, instanceName]);\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;AAClC,EAAA,MAAM,YAAe,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,8CAA8C,CAAA;AAEjG,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,IAAA,OAAO,MAAM,GAAA,CAAI,iBAAkB,CAAA,SAAA,EAAW,YAAY,CAAA;AAAA,GACz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AAA,CAAQ,eAAgB,EAAA;AAAA,KACvC,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
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 const instanceName = entity.metadata.annotations?.['terasky.backstage.io/vcf-automation-instance'];\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, instanceName);\n }, [projectId, hasViewPermission, instanceName]);\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 && project.administrators.length > 0 ? (\n project.administrators.map((admin: any, index: number) => (\n <Grid item key={admin.email ? `${admin.email}-${admin.type}` : `admin-${index}`}>\n <Chip\n label={admin.email ? `${admin.email} (${admin.type || 'User'})` : admin.toString()}\n size=\"small\"\n />\n </Grid>\n ))\n ) : (\n <Grid item>\n <Typography variant=\"body2\" color=\"textSecondary\">\n No administrators configured\n </Typography>\n </Grid>\n )}\n </Grid>\n </Grid>\n {project.zones && project.zones.length > 0 && (\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 )}\n {project.sharedResources !== undefined && (\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Shared Resources</Typography>\n <Typography>{project.sharedResources ? 'Yes' : 'No'}</Typography>\n </Grid>\n )}\n {project.placementPolicy && (\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Placement Policy</Typography>\n <Typography>{project.placementPolicy}</Typography>\n </Grid>\n )}\n {project.orgId && (\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Organization ID</Typography>\n <Typography>{project.orgId}</Typography>\n </Grid>\n )}\n {project.operationTimeout !== undefined && (\n <Grid item xs={6}>\n <Typography variant=\"subtitle2\">Operation Timeout</Typography>\n <Typography>{project.operationTimeout} minutes</Typography>\n </Grid>\n )}\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;AAClC,EAAA,MAAM,YAAe,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,8CAA8C,CAAA;AAEj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