@openshift-migration-advisor/shared-components 0.24.0 → 0.25.0-1701f64050d7
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 +31 -0
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/forms/RadioButtonFormGroup.d.ts.map +1 -1
- package/dist/forms/RadioButtonFormGroup.js +2 -2
- package/dist/report/ChartDownloadButton.d.ts +11 -0
- package/dist/report/ChartDownloadButton.d.ts.map +1 -0
- package/dist/report/ChartDownloadButton.js +24 -0
- package/dist/report/ChartExportProvider.d.ts +23 -0
- package/dist/report/ChartExportProvider.d.ts.map +1 -0
- package/dist/report/ChartExportProvider.js +222 -0
- package/dist/report/ChartExportSurface.d.ts +12 -0
- package/dist/report/ChartExportSurface.d.ts.map +1 -0
- package/dist/report/ChartExportSurface.js +32 -0
- package/dist/report/ErrorTable.d.ts +18 -0
- package/dist/report/ErrorTable.d.ts.map +1 -0
- package/dist/report/ErrorTable.js +20 -0
- package/dist/report/FeatureStatusBadge.d.ts +7 -0
- package/dist/report/FeatureStatusBadge.d.ts.map +1 -0
- package/dist/report/FeatureStatusBadge.js +13 -0
- package/dist/report/HostPowerStates.d.ts +8 -0
- package/dist/report/HostPowerStates.d.ts.map +1 -0
- package/dist/report/HostPowerStates.js +11 -0
- package/dist/report/HostsOverview.d.ts +13 -0
- package/dist/report/HostsOverview.d.ts.map +1 -0
- package/dist/report/HostsOverview.js +84 -0
- package/dist/report/InfrastructureSummary.d.ts +7 -0
- package/dist/report/InfrastructureSummary.d.ts.map +1 -0
- package/dist/report/InfrastructureSummary.js +9 -0
- package/dist/report/NetworkOverview.d.ts +31 -0
- package/dist/report/NetworkOverview.d.ts.map +1 -0
- package/dist/report/NetworkOverview.js +201 -0
- package/dist/report/OSDistribution.d.ts +0 -2
- package/dist/report/OSDistribution.d.ts.map +1 -1
- package/dist/report/OSDistribution.js +10 -15
- package/dist/report/OsSupportTiersHelpPopover.d.ts.map +1 -1
- package/dist/report/OsSupportTiersHelpPopover.js +2 -31
- package/dist/report/OsUpgradeNotice.d.ts.map +1 -1
- package/dist/report/OsUpgradeNotice.js +1 -5
- package/dist/report/OsUpgradeRecommendationPopover.d.ts +0 -1
- package/dist/report/OsUpgradeRecommendationPopover.d.ts.map +1 -1
- package/dist/report/OsUpgradeRecommendationPopover.js +4 -3
- package/dist/report/PowerStateCard.d.ts +16 -0
- package/dist/report/PowerStateCard.d.ts.map +1 -0
- package/dist/report/PowerStateCard.js +9 -0
- package/dist/report/ReportExportMenu.d.ts +19 -0
- package/dist/report/ReportExportMenu.d.ts.map +1 -0
- package/dist/report/ReportExportMenu.js +31 -0
- package/dist/report/ReportTable.d.ts +14 -0
- package/dist/report/ReportTable.d.ts.map +1 -0
- package/dist/report/ReportTable.js +23 -0
- package/dist/report/SupportTierBadge.d.ts +0 -1
- package/dist/report/SupportTierBadge.d.ts.map +1 -1
- package/dist/report/SupportTierBadge.js +1 -19
- package/dist/report/VCenterClusterDetails.d.ts +9 -0
- package/dist/report/VCenterClusterDetails.d.ts.map +1 -0
- package/dist/report/VCenterClusterDetails.js +31 -0
- package/dist/report/VmPowerStates.d.ts +8 -0
- package/dist/report/VmPowerStates.d.ts.map +1 -0
- package/dist/report/VmPowerStates.js +11 -0
- package/dist/report/WarningsTable.d.ts +9 -0
- package/dist/report/WarningsTable.d.ts.map +1 -0
- package/dist/report/WarningsTable.js +20 -0
- package/dist/report/captureChartElement.d.ts +8 -0
- package/dist/report/captureChartElement.d.ts.map +1 -0
- package/dist/report/captureChartElement.js +284 -0
- package/dist/report/chartExport.d.ts +73 -0
- package/dist/report/chartExport.d.ts.map +1 -0
- package/dist/report/chartExport.js +162 -0
- package/dist/report/chartExportContext.d.ts +32 -0
- package/dist/report/chartExportContext.d.ts.map +1 -0
- package/dist/report/chartExportContext.js +36 -0
- package/dist/report/chartExportFilenames.d.ts +4 -0
- package/dist/report/chartExportFilenames.d.ts.map +1 -0
- package/dist/report/chartExportFilenames.js +16 -0
- package/dist/report/constants.d.ts +4 -0
- package/dist/report/constants.d.ts.map +1 -1
- package/dist/report/constants.js +4 -0
- package/dist/report/dashboardStyles.d.ts +0 -4
- package/dist/report/dashboardStyles.d.ts.map +1 -1
- package/dist/report/dashboardStyles.js +0 -19
- package/dist/report/htmlExport.d.ts +9 -0
- package/dist/report/htmlExport.d.ts.map +1 -0
- package/dist/report/htmlExport.js +65 -0
- package/dist/report/index.d.ts +28 -0
- package/dist/report/index.d.ts.map +1 -1
- package/dist/report/index.js +26 -0
- package/dist/report/infrastructureSummaryModel.d.ts +82 -0
- package/dist/report/infrastructureSummaryModel.d.ts.map +1 -0
- package/dist/report/infrastructureSummaryModel.js +139 -0
- package/dist/report/pdfExport.d.ts +3 -0
- package/dist/report/pdfExport.d.ts.map +1 -0
- package/dist/report/pdfExport.js +131 -0
- package/dist/report/pdfPage.d.ts +15 -0
- package/dist/report/pdfPage.d.ts.map +1 -0
- package/dist/report/pdfPage.js +44 -0
- package/dist/report/powerStates.d.ts +11 -0
- package/dist/report/powerStates.d.ts.map +1 -0
- package/dist/report/powerStates.js +113 -0
- package/dist/report/reportExportOptions.d.ts +17 -0
- package/dist/report/reportExportOptions.d.ts.map +1 -0
- package/dist/report/reportExportOptions.js +31 -0
- package/dist/report/zipChartPngs.d.ts +3 -0
- package/dist/report/zipChartPngs.d.ts.map +1 -0
- package/dist/report/zipChartPngs.js +8 -0
- package/package.json +7 -2
- package/src/charts/index.ts +1 -0
- package/src/forms/RadioButtonFormGroup.tsx +10 -3
- package/src/report/ChartDownloadButton.tsx +59 -0
- package/src/report/ChartExportProvider.tsx +392 -0
- package/src/report/ChartExportSurface.tsx +60 -0
- package/src/report/ErrorTable.tsx +85 -0
- package/src/report/FeatureStatusBadge.tsx +30 -0
- package/src/report/HostPowerStates.tsx +38 -0
- package/src/report/HostsOverview.tsx +185 -0
- package/src/report/InfrastructureSummary.tsx +73 -0
- package/src/report/NetworkOverview.tsx +405 -0
- package/src/report/OSDistribution.tsx +96 -99
- package/src/report/OsSupportTiersHelpPopover.tsx +32 -62
- package/src/report/OsUpgradeNotice.tsx +1 -7
- package/src/report/OsUpgradeRecommendationPopover.tsx +3 -4
- package/src/report/PowerStateCard.tsx +86 -0
- package/src/report/ReportExportMenu.tsx +119 -0
- package/src/report/ReportTable.tsx +81 -0
- package/src/report/SupportTierBadge.tsx +12 -38
- package/src/report/VCenterClusterDetails.tsx +233 -0
- package/src/report/VmPowerStates.tsx +38 -0
- package/src/report/WarningsTable.tsx +75 -0
- package/src/report/__tests__/ChartExportProvider.test.tsx +542 -0
- package/src/report/__tests__/HostPowerStates.test.tsx +47 -0
- package/src/report/__tests__/HostsOverview.test.tsx +145 -0
- package/src/report/__tests__/InfrastructureSummary.test.tsx +126 -0
- package/src/report/__tests__/NetworkOverview.test.tsx +269 -0
- package/src/report/__tests__/OSDistribution.test.tsx +10 -11
- package/src/report/__tests__/captureChartElement.test.ts +132 -0
- package/src/report/__tests__/chartExportPackagers.test.ts +282 -0
- package/src/report/__tests__/infrastructureSummaryModel.test.ts +224 -0
- package/src/report/__tests__/powerStates.test.ts +70 -0
- package/src/report/captureChartElement.ts +368 -0
- package/src/report/chartExport.ts +255 -0
- package/src/report/chartExportContext.tsx +92 -0
- package/src/report/chartExportFilenames.ts +21 -0
- package/src/report/constants.ts +4 -0
- package/src/report/dashboardStyles.ts +0 -23
- package/src/report/htmlExport.ts +83 -0
- package/src/report/index.ts +154 -0
- package/src/report/infrastructureSummaryModel.ts +281 -0
- package/src/report/pdfExport.ts +233 -0
- package/src/report/pdfPage.ts +83 -0
- package/src/report/powerStates.ts +169 -0
- package/src/report/reportExportOptions.ts +53 -0
- package/src/report/zipChartPngs.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartExportContext.d.ts","sourceRoot":"","sources":["../../src/report/chartExportContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAIj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,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD,GAAG,WAAW,CAAC,WAAW,CAAC,CA8B3B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useState, } from "react";
|
|
2
|
+
import { chartPngFilename, } from "./chartExport.js";
|
|
3
|
+
export const ChartExportRegistryContext = createContext(null);
|
|
4
|
+
export const ChartExportApiContext = createContext(null);
|
|
5
|
+
export function useChartExport() {
|
|
6
|
+
return useContext(ChartExportApiContext);
|
|
7
|
+
}
|
|
8
|
+
export function useRegisterChart({ id, title, filename, exportViews, activeExportViewId, setExportView, }) {
|
|
9
|
+
const registry = useContext(ChartExportRegistryContext);
|
|
10
|
+
const [element, setElement] = useState(null);
|
|
11
|
+
const resolvedFilename = filename ?? chartPngFilename(title, id);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!registry || !element) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
return registry.register({
|
|
17
|
+
id,
|
|
18
|
+
title,
|
|
19
|
+
filename: resolvedFilename,
|
|
20
|
+
element,
|
|
21
|
+
exportViews,
|
|
22
|
+
activeExportViewId,
|
|
23
|
+
setExportView,
|
|
24
|
+
});
|
|
25
|
+
}, [
|
|
26
|
+
activeExportViewId,
|
|
27
|
+
element,
|
|
28
|
+
exportViews,
|
|
29
|
+
id,
|
|
30
|
+
registry,
|
|
31
|
+
resolvedFilename,
|
|
32
|
+
setExportView,
|
|
33
|
+
title,
|
|
34
|
+
]);
|
|
35
|
+
return setElement;
|
|
36
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getDatedChartExportBasename(date?: Date): string;
|
|
2
|
+
export declare function getChartExportFilename(format: "pdf" | "html" | "zip", date?: Date): string;
|
|
3
|
+
export declare function getChartZipFilename(date?: Date): string;
|
|
4
|
+
//# sourceMappingURL=chartExportFilenames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartExportFilenames.d.ts","sourceRoot":"","sources":["../../src/report/chartExportFilenames.ts"],"names":[],"mappings":"AAAA,wBAAgB,2BAA2B,CAAC,IAAI,OAAa,GAAG,MAAM,CAKrE;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,EAC9B,IAAI,OAAa,GAChB,MAAM,CAMR;AAED,wBAAgB,mBAAmB,CAAC,IAAI,OAAa,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function getDatedChartExportBasename(date = new Date()) {
|
|
2
|
+
const year = date.getFullYear();
|
|
3
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
4
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
5
|
+
return `migration-export-${year}-${month}-${day}`;
|
|
6
|
+
}
|
|
7
|
+
export function getChartExportFilename(format, date = new Date()) {
|
|
8
|
+
const base = getDatedChartExportBasename(date);
|
|
9
|
+
if (format === "zip") {
|
|
10
|
+
return `${base}-charts.zip`;
|
|
11
|
+
}
|
|
12
|
+
return `${base}.${format}`;
|
|
13
|
+
}
|
|
14
|
+
export function getChartZipFilename(date = new Date()) {
|
|
15
|
+
return getChartExportFilename("zip", date);
|
|
16
|
+
}
|
|
@@ -19,5 +19,9 @@ export declare const REPORT_CARD_EMPTY_STATE_TITLES: {
|
|
|
19
19
|
readonly operatingSystems: "Operating system data not collected";
|
|
20
20
|
readonly migrationStatus: "Migration status data not collected";
|
|
21
21
|
readonly issuesBreakdown: "Issues breakdown data not collected";
|
|
22
|
+
readonly errors: "Error data not collected";
|
|
23
|
+
readonly warnings: "Warning data not collected";
|
|
24
|
+
readonly hostPowerStates: "Host power state data not collected";
|
|
25
|
+
readonly vmPowerStates: "VM power state data not collected";
|
|
22
26
|
};
|
|
23
27
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/report/constants.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,WAA6B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,WAA+B,CAAC;AAE9D,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/report/constants.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,WAA6B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,WAA+B,CAAC;AAE9D,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;CAkBjC,CAAC"}
|
package/dist/report/constants.js
CHANGED
|
@@ -20,4 +20,8 @@ export const REPORT_CARD_EMPTY_STATE_TITLES = {
|
|
|
20
20
|
operatingSystems: "Operating system data not collected",
|
|
21
21
|
migrationStatus: "Migration status data not collected",
|
|
22
22
|
issuesBreakdown: "Issues breakdown data not collected",
|
|
23
|
+
errors: "Error data not collected",
|
|
24
|
+
warnings: "Warning data not collected",
|
|
25
|
+
hostPowerStates: "Host power state data not collected",
|
|
26
|
+
vmPowerStates: "VM power state data not collected",
|
|
23
27
|
};
|
|
@@ -5,12 +5,8 @@ export declare const dashboardStyles: {
|
|
|
5
5
|
equalHeight: string;
|
|
6
6
|
cardBodyScrollable: string;
|
|
7
7
|
card: string;
|
|
8
|
-
cardPrint: string;
|
|
9
8
|
storageCardOverflowHidden: string;
|
|
10
|
-
storageCardOverflowVisible: string;
|
|
11
9
|
storageChartWrapper: string;
|
|
12
|
-
storageExportSectionMargin: string;
|
|
13
|
-
storageExportSectionTitle: string;
|
|
14
10
|
storageFlexFullWidth: string;
|
|
15
11
|
storageMenuToggleMinWidth: string;
|
|
16
12
|
storageNoDataContainer: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboardStyles.d.ts","sourceRoot":"","sources":["../../src/report/dashboardStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"dashboardStyles.d.ts","sourceRoot":"","sources":["../../src/report/dashboardStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAkF3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAM/B,CAAC"}
|
|
@@ -39,20 +39,9 @@ export const dashboardStyles = {
|
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
justify-content: space-between;
|
|
41
41
|
overflow: hidden !important;
|
|
42
|
-
`,
|
|
43
|
-
cardPrint: css `
|
|
44
|
-
border: 1px solid #d2d2d2 !important;
|
|
45
|
-
border-radius: 10px;
|
|
46
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
47
|
-
min-height: unset;
|
|
48
|
-
max-height: unset;
|
|
49
|
-
page-break-inside: avoid;
|
|
50
42
|
`,
|
|
51
43
|
storageCardOverflowHidden: css `
|
|
52
44
|
overflow: hidden;
|
|
53
|
-
`,
|
|
54
|
-
storageCardOverflowVisible: css `
|
|
55
|
-
overflow: visible;
|
|
56
45
|
`,
|
|
57
46
|
storageChartWrapper: css `
|
|
58
47
|
display: flex;
|
|
@@ -60,14 +49,6 @@ export const dashboardStyles = {
|
|
|
60
49
|
align-items: center;
|
|
61
50
|
width: 100%;
|
|
62
51
|
padding: 20px 0;
|
|
63
|
-
`,
|
|
64
|
-
storageExportSectionMargin: css `
|
|
65
|
-
margin-bottom: 24px;
|
|
66
|
-
`,
|
|
67
|
-
storageExportSectionTitle: css `
|
|
68
|
-
font-size: 14px;
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
margin-bottom: 12px;
|
|
71
52
|
`,
|
|
72
53
|
storageFlexFullWidth: css `
|
|
73
54
|
width: 100%;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ChartCaptureSource } from "./chartExport.js";
|
|
2
|
+
export interface HtmlReportImage {
|
|
3
|
+
name: string;
|
|
4
|
+
dataUrl: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function escapeHtml(value: string): string;
|
|
7
|
+
export declare function buildHtmlReport(documentTitle: string, images: HtmlReportImage[], generatedAt?: Date): string;
|
|
8
|
+
export declare function buildHtmlFromCharts(charts: ChartCaptureSource[], documentTitle: string): Promise<Blob>;
|
|
9
|
+
//# sourceMappingURL=htmlExport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmlExport.d.ts","sourceRoot":"","sources":["../../src/report/htmlExport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,kBAAkB,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,eAAe,EAAE,EACzB,WAAW,OAAa,GACvB,MAAM,CAwCR;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,kBAAkB,EAAE,EAC5B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { releaseCanvas } from "./chartExport.js";
|
|
2
|
+
export function escapeHtml(value) {
|
|
3
|
+
return value
|
|
4
|
+
.replace(/&/g, "&")
|
|
5
|
+
.replace(/</g, "<")
|
|
6
|
+
.replace(/>/g, ">")
|
|
7
|
+
.replace(/"/g, """)
|
|
8
|
+
.replace(/'/g, "'");
|
|
9
|
+
}
|
|
10
|
+
export function buildHtmlReport(documentTitle, images, generatedAt = new Date()) {
|
|
11
|
+
const sections = images
|
|
12
|
+
.map((image) => `
|
|
13
|
+
<section>
|
|
14
|
+
<h2>${escapeHtml(image.name)}</h2>
|
|
15
|
+
<img src="${image.dataUrl}" alt="${escapeHtml(image.name)}" />
|
|
16
|
+
</section>`)
|
|
17
|
+
.join("\n");
|
|
18
|
+
return `<!DOCTYPE html>
|
|
19
|
+
<html lang="en">
|
|
20
|
+
<head>
|
|
21
|
+
<meta charset="utf-8" />
|
|
22
|
+
<title>${escapeHtml(documentTitle)}</title>
|
|
23
|
+
<style>
|
|
24
|
+
body {
|
|
25
|
+
font-family: RedHatText, Helvetica, Arial, sans-serif;
|
|
26
|
+
margin: 32px auto;
|
|
27
|
+
max-width: 1100px;
|
|
28
|
+
background: #fff;
|
|
29
|
+
color: #151515;
|
|
30
|
+
}
|
|
31
|
+
h1 { font-size: 28px; margin-bottom: 8px; }
|
|
32
|
+
h2 { font-size: 18px; margin: 32px 0 12px; }
|
|
33
|
+
.meta { color: #6a6e73; margin-bottom: 24px; }
|
|
34
|
+
img {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: auto;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
</head>
|
|
40
|
+
<body>
|
|
41
|
+
<h1>${escapeHtml(documentTitle)}</h1>
|
|
42
|
+
<p class="meta">Generated ${escapeHtml(generatedAt.toLocaleString())}</p>
|
|
43
|
+
${sections}
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
export async function buildHtmlFromCharts(charts, documentTitle) {
|
|
49
|
+
const images = [];
|
|
50
|
+
for (const chart of charts) {
|
|
51
|
+
const canvas = await chart.capture();
|
|
52
|
+
try {
|
|
53
|
+
images.push({
|
|
54
|
+
name: chart.title,
|
|
55
|
+
dataUrl: canvas.toDataURL("image/png"),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
releaseCanvas(canvas);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return new Blob([buildHtmlReport(documentTitle, images)], {
|
|
63
|
+
type: "text/html;charset=utf-8",
|
|
64
|
+
});
|
|
65
|
+
}
|
package/dist/report/index.d.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
export { CARD_EMPTY_STATE_DESCRIPTION, CardEmptyState, type CardEmptyStateProps, } from "./CardEmptyState.js";
|
|
2
|
+
export { ChartDownloadButton, ChartHeaderActions, } from "./ChartDownloadButton.js";
|
|
3
|
+
export { type BuildChartDocument, type BuildPdfDocument, type CaptureChartElement, ChartExportProvider, type ChartExportProviderProps, type EncodeChartPng, type ZipChartFiles, } from "./ChartExportProvider.js";
|
|
4
|
+
export { ChartExportSurface } from "./ChartExportSurface.js";
|
|
5
|
+
export { captureChartElement } from "./captureChartElement.js";
|
|
6
|
+
export { CHART_EXPORT_CAPTURING_ATTR, CHART_EXPORT_HIDE_ATTR, CHART_EXPORT_SCROLL_ATTR, type ChartCaptureSource, type ChartExportFile, type ChartExportMeta, type ChartExportView, canvasToBlob, chartExportHideProps, chartExportRootStyle, chartExportScrollProps, chartExportViewsFromLabels, chartPngFilename, downloadBlob, type PdfTextPage, type PdfTextPageItem, type RegisteredChart, releaseCanvas, restoreChartExportViews, shouldIgnoreChartExportElement, slugifyExportName, sortRegisteredChartsByDocumentOrder, toBulkChartCaptureSources, } from "./chartExport.js";
|
|
7
|
+
export { type ChartExportApi, type ChartExportFormat, useChartExport, useRegisterChart, } from "./chartExportContext.js";
|
|
8
|
+
export { getChartExportFilename, getChartZipFilename, getDatedChartExportBasename, } from "./chartExportFilenames.js";
|
|
2
9
|
export { chartColorFailure, chartColorSuccess, REPORT_CARD_EMPTY_STATE_TITLES, } from "./constants.js";
|
|
3
10
|
export { DashboardEmptyStateBase, type DashboardEmptyStateBaseProps, } from "./DashboardEmptyStateBase.js";
|
|
4
11
|
export { dashboardStyles, tableFullWidthStyle } from "./dashboardStyles.js";
|
|
5
12
|
export { EmptySearchResults, type EmptySearchResultsProps, } from "./EmptySearchResults.js";
|
|
13
|
+
export { ErrorTable, type ErrorTableProps, type MigrationIssueLike, } from "./ErrorTable.js";
|
|
14
|
+
export { FeatureStatusBadge, type FeatureStatusBadgeProps, } from "./FeatureStatusBadge.js";
|
|
15
|
+
export { HostPowerStates, type HostPowerStatesProps, } from "./HostPowerStates.js";
|
|
16
|
+
export { type HostLike, HostsOverview, type HostsOverviewProps, } from "./HostsOverview.js";
|
|
17
|
+
export { buildHtmlFromCharts, buildHtmlReport, escapeHtml, type HtmlReportImage, } from "./htmlExport.js";
|
|
18
|
+
export { InfrastructureSummary, type InfrastructureSummaryProps, } from "./InfrastructureSummary.js";
|
|
19
|
+
export type { ClusterDetailRow, ClusterDetailsModel, FeatureStatus, HostCapability, InfrastructureSummaryModel, InventoryCluster, InventoryDatastore, InventoryHost, InventoryInfra, InventoryNetwork, InventoryVms, NetworkLabel, } from "./infrastructureSummaryModel.js";
|
|
20
|
+
export { booleanToFeatureStatus, buildClusterDetailRows, buildClusterDetails, buildInfrastructureSummary, countVCenters, formatVSphereVersion, hostCapabilityStatus, visibleNetworks, vsanStatus, } from "./infrastructureSummaryModel.js";
|
|
21
|
+
export { type NetworkInfraLike, type NetworkLike, NetworkOverview, type NetworkOverviewProps, type NicCountHistogram, type NicCountSummary, } from "./NetworkOverview.js";
|
|
6
22
|
export { OSBarChart, OSDistribution } from "./OSDistribution.js";
|
|
7
23
|
export { OsSupportTiersHelpPopover } from "./OsSupportTiersHelpPopover.js";
|
|
8
24
|
export { OsUpgradeNotice } from "./OsUpgradeNotice.js";
|
|
@@ -10,6 +26,18 @@ export { OsNameCell, OsUpgradeRecommendationPopover, } from "./OsUpgradeRecommen
|
|
|
10
26
|
export type { OSDistributionEntry, SupportTierBadgeStyle, } from "./osSupportTier.js";
|
|
11
27
|
export { getSupportTierBadgeColor, getSupportTierBadgeInlineStyle, getSupportTierDefinition, getSupportTierLegendLabel, getSupportTierSortOrder, hasOsUpgradeNotice, ORDERED_SUPPORT_TIERS, resolveSupportTier, SUPPORT_TIER_BADGE_COLORS, SUPPORT_TIER_BADGE_INLINE_STYLES, SUPPORT_TIER_DEFINITIONS, SUPPORT_TIER_LABELS, SUPPORT_TIER_LEARN_MORE_URL, SupportTier, } from "./osSupportTier.js";
|
|
12
28
|
export { default as PopoverIcon } from "./PopoverIcon.js";
|
|
29
|
+
export { PowerStateCard, type PowerStateCardProps, } from "./PowerStateCard.js";
|
|
30
|
+
export { buildPdfFromCharts } from "./pdfExport.js";
|
|
31
|
+
export { type PdfExportSegment, sliceCanvas, splitSegmentForPageHeight, } from "./pdfPage.js";
|
|
32
|
+
export type { PowerStateChartModel } from "./powerStates.js";
|
|
33
|
+
export { buildHostPowerStateChart, buildVmPowerStateChart, HOST_POWER_COLORS, VM_POWER_COLORS, } from "./powerStates.js";
|
|
34
|
+
export { ExportReportButton, type ExportReportButtonProps, ReportExportMenu, type ReportExportMenuProps, } from "./ReportExportMenu.js";
|
|
35
|
+
export { ReportTable, type ReportTableProps } from "./ReportTable.js";
|
|
36
|
+
export { type ReportExportOption, type StandardReportExportHandlers, standardReportExportOptions, } from "./reportExportOptions.js";
|
|
13
37
|
export { SupportTierBadge } from "./SupportTierBadge.js";
|
|
14
38
|
export { ALL_TIERS_FILTER, type OsBarChartViewModel, type OsTableRow, useOsBarChartViewModel, } from "./useOsBarChartViewModel.js";
|
|
39
|
+
export { VCenterClusterDetails, type VCenterClusterDetailsProps, } from "./VCenterClusterDetails.js";
|
|
40
|
+
export { VmPowerStates, type VmPowerStatesProps, } from "./VmPowerStates.js";
|
|
41
|
+
export { WarningsTable, type WarningsTableProps, } from "./WarningsTable.js";
|
|
42
|
+
export { zipChartPngs } from "./zipChartPngs.js";
|
|
15
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OA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AAC;AAC5B,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/report/index.js
CHANGED
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
export { CARD_EMPTY_STATE_DESCRIPTION, CardEmptyState, } from "./CardEmptyState.js";
|
|
2
|
+
export { ChartDownloadButton, ChartHeaderActions, } from "./ChartDownloadButton.js";
|
|
3
|
+
export { ChartExportProvider, } from "./ChartExportProvider.js";
|
|
4
|
+
export { ChartExportSurface } from "./ChartExportSurface.js";
|
|
5
|
+
export { captureChartElement } from "./captureChartElement.js";
|
|
6
|
+
export { CHART_EXPORT_CAPTURING_ATTR, CHART_EXPORT_HIDE_ATTR, CHART_EXPORT_SCROLL_ATTR, canvasToBlob, chartExportHideProps, chartExportRootStyle, chartExportScrollProps, chartExportViewsFromLabels, chartPngFilename, downloadBlob, releaseCanvas, restoreChartExportViews, shouldIgnoreChartExportElement, slugifyExportName, sortRegisteredChartsByDocumentOrder, toBulkChartCaptureSources, } from "./chartExport.js";
|
|
7
|
+
export { useChartExport, useRegisterChart, } from "./chartExportContext.js";
|
|
8
|
+
export { getChartExportFilename, getChartZipFilename, getDatedChartExportBasename, } from "./chartExportFilenames.js";
|
|
2
9
|
export { chartColorFailure, chartColorSuccess, REPORT_CARD_EMPTY_STATE_TITLES, } from "./constants.js";
|
|
3
10
|
export { DashboardEmptyStateBase, } from "./DashboardEmptyStateBase.js";
|
|
4
11
|
export { dashboardStyles, tableFullWidthStyle } from "./dashboardStyles.js";
|
|
5
12
|
export { EmptySearchResults, } from "./EmptySearchResults.js";
|
|
13
|
+
export { ErrorTable, } from "./ErrorTable.js";
|
|
14
|
+
export { FeatureStatusBadge, } from "./FeatureStatusBadge.js";
|
|
15
|
+
export { HostPowerStates, } from "./HostPowerStates.js";
|
|
16
|
+
export { HostsOverview, } from "./HostsOverview.js";
|
|
17
|
+
export { buildHtmlFromCharts, buildHtmlReport, escapeHtml, } from "./htmlExport.js";
|
|
18
|
+
export { InfrastructureSummary, } from "./InfrastructureSummary.js";
|
|
19
|
+
export { booleanToFeatureStatus, buildClusterDetailRows, buildClusterDetails, buildInfrastructureSummary, countVCenters, formatVSphereVersion, hostCapabilityStatus, visibleNetworks, vsanStatus, } from "./infrastructureSummaryModel.js";
|
|
20
|
+
export { NetworkOverview, } from "./NetworkOverview.js";
|
|
6
21
|
export { OSBarChart, OSDistribution } from "./OSDistribution.js";
|
|
7
22
|
export { OsSupportTiersHelpPopover } from "./OsSupportTiersHelpPopover.js";
|
|
8
23
|
export { OsUpgradeNotice } from "./OsUpgradeNotice.js";
|
|
9
24
|
export { OsNameCell, OsUpgradeRecommendationPopover, } from "./OsUpgradeRecommendationPopover.js";
|
|
10
25
|
export { getSupportTierBadgeColor, getSupportTierBadgeInlineStyle, getSupportTierDefinition, getSupportTierLegendLabel, getSupportTierSortOrder, hasOsUpgradeNotice, ORDERED_SUPPORT_TIERS, resolveSupportTier, SUPPORT_TIER_BADGE_COLORS, SUPPORT_TIER_BADGE_INLINE_STYLES, SUPPORT_TIER_DEFINITIONS, SUPPORT_TIER_LABELS, SUPPORT_TIER_LEARN_MORE_URL, SupportTier, } from "./osSupportTier.js";
|
|
11
26
|
export { default as PopoverIcon } from "./PopoverIcon.js";
|
|
27
|
+
export { PowerStateCard, } from "./PowerStateCard.js";
|
|
28
|
+
export { buildPdfFromCharts } from "./pdfExport.js";
|
|
29
|
+
export { sliceCanvas, splitSegmentForPageHeight, } from "./pdfPage.js";
|
|
30
|
+
export { buildHostPowerStateChart, buildVmPowerStateChart, HOST_POWER_COLORS, VM_POWER_COLORS, } from "./powerStates.js";
|
|
31
|
+
export { ExportReportButton, ReportExportMenu, } from "./ReportExportMenu.js";
|
|
32
|
+
export { ReportTable } from "./ReportTable.js";
|
|
33
|
+
export { standardReportExportOptions, } from "./reportExportOptions.js";
|
|
12
34
|
export { SupportTierBadge } from "./SupportTierBadge.js";
|
|
13
35
|
export { ALL_TIERS_FILTER, useOsBarChartViewModel, } from "./useOsBarChartViewModel.js";
|
|
36
|
+
export { VCenterClusterDetails, } from "./VCenterClusterDetails.js";
|
|
37
|
+
export { VmPowerStates, } from "./VmPowerStates.js";
|
|
38
|
+
export { WarningsTable, } from "./WarningsTable.js";
|
|
39
|
+
export { zipChartPngs } from "./zipChartPngs.js";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type FeatureStatus = "enabled" | "disabled" | "unknown";
|
|
2
|
+
export type HostCapability = "vmotionSupported" | "storageVmotionSupported";
|
|
3
|
+
export type InventoryHost = {
|
|
4
|
+
vmotionSupported?: boolean;
|
|
5
|
+
storageVmotionSupported?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type InventoryDatastore = {
|
|
8
|
+
type?: string;
|
|
9
|
+
};
|
|
10
|
+
export type InventoryNetwork = {
|
|
11
|
+
name: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
vlanId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type InventoryInfra = {
|
|
16
|
+
totalHosts?: number;
|
|
17
|
+
totalDatacenters?: number;
|
|
18
|
+
hosts?: InventoryHost[];
|
|
19
|
+
clustersPerDatacenter?: number[];
|
|
20
|
+
networks?: InventoryNetwork[];
|
|
21
|
+
datastores?: InventoryDatastore[];
|
|
22
|
+
};
|
|
23
|
+
export type InventoryVms = {
|
|
24
|
+
total?: number;
|
|
25
|
+
diskTypes?: Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
export type InventoryCluster = {
|
|
28
|
+
infra?: InventoryInfra;
|
|
29
|
+
vms?: InventoryVms;
|
|
30
|
+
vcenter?: {
|
|
31
|
+
id?: string;
|
|
32
|
+
};
|
|
33
|
+
clusterFeatures?: {
|
|
34
|
+
drsEnabled?: boolean;
|
|
35
|
+
haEnabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type InfrastructureSummaryModel = {
|
|
39
|
+
vmwareVersion: string;
|
|
40
|
+
datacenters: number | undefined;
|
|
41
|
+
vCenters: number | undefined;
|
|
42
|
+
esxiHosts: number | undefined;
|
|
43
|
+
};
|
|
44
|
+
export type NetworkLabel = {
|
|
45
|
+
name: string;
|
|
46
|
+
vlanId?: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
export type ClusterDetailRow = {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
hosts: number;
|
|
53
|
+
vms: number;
|
|
54
|
+
vmotion: FeatureStatus;
|
|
55
|
+
drs: FeatureStatus;
|
|
56
|
+
vsan: FeatureStatus;
|
|
57
|
+
};
|
|
58
|
+
export type ClusterDetailsModel = {
|
|
59
|
+
hosts: number;
|
|
60
|
+
vms: number;
|
|
61
|
+
networksDetected: number;
|
|
62
|
+
vmotion: FeatureStatus;
|
|
63
|
+
drs: FeatureStatus;
|
|
64
|
+
ha: FeatureStatus;
|
|
65
|
+
vsan: FeatureStatus;
|
|
66
|
+
networks: NetworkLabel[];
|
|
67
|
+
};
|
|
68
|
+
export declare const formatVSphereVersion: (version?: string) => string;
|
|
69
|
+
export declare const booleanToFeatureStatus: (value: boolean | undefined) => FeatureStatus;
|
|
70
|
+
export declare const hostCapabilityStatus: (hosts: InventoryHost[] | undefined, capability: HostCapability) => FeatureStatus;
|
|
71
|
+
export declare const vsanStatus: (infra?: InventoryInfra, vms?: InventoryVms) => FeatureStatus;
|
|
72
|
+
export declare const countVCenters: (clusters?: Record<string, InventoryCluster>, vcenterId?: string) => number | undefined;
|
|
73
|
+
export declare const visibleNetworks: (infra?: InventoryInfra) => NetworkLabel[];
|
|
74
|
+
export declare const buildInfrastructureSummary: ({ infra, vcenterVersion, vcenterId, clusters, }: {
|
|
75
|
+
infra?: InventoryInfra;
|
|
76
|
+
vcenterVersion?: string;
|
|
77
|
+
vcenterId?: string;
|
|
78
|
+
clusters?: Record<string, InventoryCluster>;
|
|
79
|
+
}) => InfrastructureSummaryModel;
|
|
80
|
+
export declare const buildClusterDetailRows: (clusters?: Record<string, InventoryCluster>) => ClusterDetailRow[];
|
|
81
|
+
export declare const buildClusterDetails: (cluster?: InventoryCluster) => ClusterDetailsModel | undefined;
|
|
82
|
+
//# sourceMappingURL=infrastructureSummaryModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infrastructureSummaryModel.d.ts","sourceRoot":"","sources":["../../src/report/infrastructureSummaryModel.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,yBAAyB,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF,MAA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vD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,OAAO,OAAO,GAAG,SAAS,KACzB,aAQF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,aAAa,EAAE,GAAG,SAAS,EAClC,YAAY,cAAc,KACzB,aAcF,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,QAAQ,cAAc,EACtB,MAAM,YAAY,KACjB,aAiBF,CAAC;AAsBF,eAAO,MAAM,aAAa,GACxB,WAAW,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC3C,YAAY,MAAM,KACjB,MAAM,GAAG,SAWX,CAAC;AAWF,eAAO,MAAM,eAAe,GAAI,QAAQ,cAAc,KAAG,YAAY,EAK7C,CAAC;AAEzB,eAAO,MAAM,0BAA0B,GAAI,iDAKxC;IACD,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC7C,KAAG,0BAKF,CAAC;AAuBH,eAAO,MAAM,sBAAsB,GACjC,WAAW,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAC1C,gBAAgB,EAoBlB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,UAAU,gBAAgB,KACzB,mBAAmB,GAAG,SAkBxB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const VSAN_TYPE_PATTERN = /vsan/i;
|
|
2
|
+
export const formatVSphereVersion = (version) => {
|
|
3
|
+
if (!version?.trim()) {
|
|
4
|
+
return "—";
|
|
5
|
+
}
|
|
6
|
+
const withoutPrefix = version.trim().replace(/^vSphere\s+/i, "");
|
|
7
|
+
const parts = withoutPrefix.split(".");
|
|
8
|
+
while (parts.length > 3 && parts[parts.length - 1] === "0") {
|
|
9
|
+
parts.pop();
|
|
10
|
+
}
|
|
11
|
+
return `vSphere ${parts.join(".")}`;
|
|
12
|
+
};
|
|
13
|
+
export const booleanToFeatureStatus = (value) => {
|
|
14
|
+
if (value === true) {
|
|
15
|
+
return "enabled";
|
|
16
|
+
}
|
|
17
|
+
if (value === false) {
|
|
18
|
+
return "disabled";
|
|
19
|
+
}
|
|
20
|
+
return "unknown";
|
|
21
|
+
};
|
|
22
|
+
export const hostCapabilityStatus = (hosts, capability) => {
|
|
23
|
+
if (!hosts || hosts.length === 0) {
|
|
24
|
+
return "unknown";
|
|
25
|
+
}
|
|
26
|
+
const known = hosts
|
|
27
|
+
.map((host) => host[capability])
|
|
28
|
+
.filter((value) => typeof value === "boolean");
|
|
29
|
+
if (known.length === 0) {
|
|
30
|
+
return "unknown";
|
|
31
|
+
}
|
|
32
|
+
return known.some(Boolean) ? "enabled" : "disabled";
|
|
33
|
+
};
|
|
34
|
+
export const vsanStatus = (infra, vms) => {
|
|
35
|
+
const datastoreMatch = infra?.datastores?.some((datastore) => VSAN_TYPE_PATTERN.test(datastore.type ?? ""));
|
|
36
|
+
const diskTypeMatch = Object.keys(vms?.diskTypes ?? {}).some((type) => VSAN_TYPE_PATTERN.test(type));
|
|
37
|
+
if (datastoreMatch || diskTypeMatch) {
|
|
38
|
+
return "enabled";
|
|
39
|
+
}
|
|
40
|
+
if (infra?.datastores || vms?.diskTypes) {
|
|
41
|
+
return "disabled";
|
|
42
|
+
}
|
|
43
|
+
return "unknown";
|
|
44
|
+
};
|
|
45
|
+
const hostCount = (infra) => {
|
|
46
|
+
if (typeof infra?.totalHosts === "number") {
|
|
47
|
+
return infra.totalHosts;
|
|
48
|
+
}
|
|
49
|
+
if (infra?.hosts) {
|
|
50
|
+
return infra.hosts.length;
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
};
|
|
54
|
+
const datacenterCount = (infra) => {
|
|
55
|
+
if (typeof infra?.totalDatacenters === "number") {
|
|
56
|
+
return infra.totalDatacenters;
|
|
57
|
+
}
|
|
58
|
+
if (infra?.clustersPerDatacenter && infra.clustersPerDatacenter.length > 0) {
|
|
59
|
+
return infra.clustersPerDatacenter.length;
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
};
|
|
63
|
+
export const countVCenters = (clusters, vcenterId) => {
|
|
64
|
+
const ids = new Set();
|
|
65
|
+
if (vcenterId) {
|
|
66
|
+
ids.add(vcenterId);
|
|
67
|
+
}
|
|
68
|
+
for (const cluster of Object.values(clusters ?? {})) {
|
|
69
|
+
if (cluster.vcenter?.id) {
|
|
70
|
+
ids.add(cluster.vcenter.id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return ids.size > 0 ? ids.size : undefined;
|
|
74
|
+
};
|
|
75
|
+
const toNetworkLabel = (network) => {
|
|
76
|
+
const vlanId = network.vlanId?.trim();
|
|
77
|
+
return {
|
|
78
|
+
name: network.name,
|
|
79
|
+
vlanId: vlanId || undefined,
|
|
80
|
+
displayName: vlanId ? `${network.name} (VLAN ${vlanId})` : network.name,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export const visibleNetworks = (infra) => (infra?.networks ?? [])
|
|
84
|
+
.filter((network) => Boolean(network.name?.trim()) && network.type !== "dvswitch")
|
|
85
|
+
.map(toNetworkLabel);
|
|
86
|
+
export const buildInfrastructureSummary = ({ infra, vcenterVersion, vcenterId, clusters, }) => ({
|
|
87
|
+
vmwareVersion: formatVSphereVersion(vcenterVersion),
|
|
88
|
+
datacenters: datacenterCount(infra),
|
|
89
|
+
vCenters: countVCenters(clusters, vcenterId),
|
|
90
|
+
esxiHosts: hostCount(infra),
|
|
91
|
+
});
|
|
92
|
+
const clusterFeatureStatus = (cluster) => ({
|
|
93
|
+
vmotion: hostCapabilityStatus(cluster.infra?.hosts, "vmotionSupported"),
|
|
94
|
+
drs: booleanToFeatureStatus(cluster.clusterFeatures?.drsEnabled),
|
|
95
|
+
ha: booleanToFeatureStatus(cluster.clusterFeatures?.haEnabled),
|
|
96
|
+
vsan: vsanStatus(cluster.infra, cluster.vms),
|
|
97
|
+
});
|
|
98
|
+
const compareClustersByVmCount = (a, b, clusters) => {
|
|
99
|
+
const vmsA = clusters[a]?.vms?.total ?? 0;
|
|
100
|
+
const vmsB = clusters[b]?.vms?.total ?? 0;
|
|
101
|
+
return vmsB - vmsA || a.localeCompare(b);
|
|
102
|
+
};
|
|
103
|
+
export const buildClusterDetailRows = (clusters) => {
|
|
104
|
+
if (!clusters) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
return Object.keys(clusters)
|
|
108
|
+
.sort((a, b) => compareClustersByVmCount(a, b, clusters))
|
|
109
|
+
.map((id) => {
|
|
110
|
+
const cluster = clusters[id];
|
|
111
|
+
const features = clusterFeatureStatus(cluster);
|
|
112
|
+
return {
|
|
113
|
+
id,
|
|
114
|
+
name: id,
|
|
115
|
+
hosts: hostCount(cluster.infra) ?? 0,
|
|
116
|
+
vms: cluster.vms?.total ?? 0,
|
|
117
|
+
vmotion: features.vmotion,
|
|
118
|
+
drs: features.drs,
|
|
119
|
+
vsan: features.vsan,
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
export const buildClusterDetails = (cluster) => {
|
|
124
|
+
if (!cluster) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
const networks = visibleNetworks(cluster.infra);
|
|
128
|
+
const features = clusterFeatureStatus(cluster);
|
|
129
|
+
return {
|
|
130
|
+
hosts: hostCount(cluster.infra) ?? 0,
|
|
131
|
+
vms: cluster.vms?.total ?? 0,
|
|
132
|
+
networksDetected: networks.length,
|
|
133
|
+
vmotion: features.vmotion,
|
|
134
|
+
drs: features.drs,
|
|
135
|
+
ha: features.ha,
|
|
136
|
+
vsan: features.vsan,
|
|
137
|
+
networks,
|
|
138
|
+
};
|
|
139
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdfExport.d.ts","sourceRoot":"","sources":["../../src/report/pdfExport.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAC;AAQ1B,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,kBAAkB,EAAE,EAC5B,aAAa,EAAE,MAAM,EACrB,UAAU,GAAE,WAAW,EAAO,GAC7B,OAAO,CAAC,IAAI,CAAC,CA2Df"}
|