ArafatKhan2198 commented on code in PR #9994:
URL: https://github.com/apache/ozone/pull/9994#discussion_r3121941420
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/containers/containers.tsx:
##########
@@ -175,6 +178,99 @@ const Containers: React.FC<{}> = () => {
5: mismatchedReplicaContainerData
}
+ // Mapping tab keys to the backend state parameter for CSV export
+ const tabToExportState: Record<string, string> = {
+ '1': 'MISSING',
+ '2': 'UNDER_REPLICATED',
+ '3': 'OVER_REPLICATED',
+ '4': 'MIS_REPLICATED',
+ '5': 'REPLICA_MISMATCH'
+ };
+
+ // Human-readable labels for the export tooltip
+ const tabToLabel: Record<string, string> = {
+ '1': 'Missing',
+ '2': 'Under-Replicated',
+ '3': 'Over-Replicated',
+ '4': 'Mis-Replicated',
+ '5': 'Mismatched Replicas'
+ };
+
+ const handleExportCsv = useCallback(async () => {
+ const state = tabToExportState[selectedTab];
+ const label = tabToLabel[selectedTab];
+
+ if (exportLimit > 0 && exportLimit <= 500000) {
+ const exportUrl =
`/api/v1/containers/unhealthy/export?state=${state}&limit=${exportLimit}`;
+ window.open(exportUrl, '_blank');
Review Comment:
Fixed! Removed window.open entirely. All exports now use fetch() + Blob +
programmatic <a> click, which is consistent across all browsers and not
affected by popup blockers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]