diff --git a/src/dashboard/src/components/dashboard/Dashboard.tsx b/src/dashboard/src/components/dashboard/Dashboard.tsx index 0d038c2a..1f450942 100644 --- a/src/dashboard/src/components/dashboard/Dashboard.tsx +++ b/src/dashboard/src/components/dashboard/Dashboard.tsx @@ -173,6 +173,34 @@ export const Dashboard = () => { [download], ); + const renderStorageTrendsChart = React.useCallback( + (isLarge: boolean | undefined) => ( + { + handleExport({ + tenantId: dashboardTenant?.id, + organizationId: dashboardOrganization?.id, + operatingSystemItemId: dashboardOperatingSystemItem?.id, + serviceNowKey: dashboardServerItem?.serviceNowKey, + startDate: startDate, + endDate: endDate, + }); + }} + /> + ), + [ + dashboardServerItem, + dashboardServerItems, + dashboardTenant, + dashboardOrganization, + dashboardOperatingSystemItem, + handleExport, + ] + ); + return ( <> 1} /> @@ -254,31 +282,20 @@ export const Dashboard = () => { )} {/* Multiple Organizations */} {showAllOrganizations && ( - { - handleExport({ tenantId: dashboardTenant?.id }); - }} - /> + <> + { + handleExport({ tenantId: dashboardTenant?.id }); + }} + /> + {renderStorageTrendsChart(false)} + )} - { - handleExport({ - tenantId: dashboardTenant?.id, - organizationId: dashboardOrganization?.id, - operatingSystemItemId: dashboardOperatingSystemItem?.id, - serviceNowKey: dashboardServerItem?.serviceNowKey, - startDate: startDate, - endDate: endDate, - }); - }} - /> + {!showAllOrganizations && renderStorageTrendsChart(true)} {showAllocationByStorageVolume && (