From 67b7016b86852f35884e71b377c2ea96a932dd5a Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Mon, 24 Mar 2025 09:13:46 -0700 Subject: [PATCH 1/8] set filename --- .../destination-pages-pane/destination-pages-pane.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web-console/src/views/workbench-view/destination-pages-pane/destination-pages-pane.tsx b/web-console/src/views/workbench-view/destination-pages-pane/destination-pages-pane.tsx index 0ffa3125985f..60d97313676f 100644 --- a/web-console/src/views/workbench-view/destination-pages-pane/destination-pages-pane.tsx +++ b/web-console/src/views/workbench-view/destination-pages-pane/destination-pages-pane.tsx @@ -77,6 +77,7 @@ export const DestinationPagesPane = React.memo(function DestinationPagesPane( const destination = execution.destination; const pages = execution.destinationPages; if (!pages) return null; + const numPages = pages.length; const id = Api.encodePath(execution.id); const numTotalRows = destination?.numTotalRows; @@ -85,11 +86,11 @@ export const DestinationPagesPane = React.memo(function DestinationPagesPane( return UrlBaser.base( `/druid/v2/sql/statements/${id}/results?${ pageIndex < 0 ? '' : `page=${pageIndex}&` - }resultFormat=${desiredResultFormat}`, + }resultFormat=${desiredResultFormat}&filename=${getPageFilename(pageIndex)}`, ); } - function getPageFilename(pageIndex: number, numPages: number) { + function getPageFilename(pageIndex: number) { const numPagesString = String(numPages); const pageNumberString = String(pageIndex + 1).padStart(numPagesString.length, '0'); return `${id}_page_${pageNumberString}_of_${numPagesString}.${desiredExtension}`; @@ -101,7 +102,6 @@ export const DestinationPagesPane = React.memo(function DestinationPagesPane( await wait(100); } - const numPages = pages.length; return (

@@ -184,7 +184,6 @@ export const DestinationPagesPane = React.memo(function DestinationPagesPane( text="Download" minimal href={getResultUrl(value)} - download={getPageFilename(value, numPages)} /> ), }, From eda52ad9953019ab8b3d622ef682a7398dfceba9 Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Mon, 24 Mar 2025 09:34:59 -0700 Subject: [PATCH 2/8] update download button --- .../execution-summary-panel.tsx | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/web-console/src/views/workbench-view/execution-summary-panel/execution-summary-panel.tsx b/web-console/src/views/workbench-view/execution-summary-panel/execution-summary-panel.tsx index fa8bdceef018..9f3c1060fd0a 100644 --- a/web-console/src/views/workbench-view/execution-summary-panel/execution-summary-panel.tsx +++ b/web-console/src/views/workbench-view/execution-summary-panel/execution-summary-panel.tsx @@ -16,7 +16,15 @@ * limitations under the License. */ -import { Button, ButtonGroup, Menu, MenuItem, Popover, Position } from '@blueprintjs/core'; +import { + Button, + ButtonGroup, + Menu, + MenuDivider, + MenuItem, + Popover, + Position, +} from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; import type { JSX } from 'react'; import React, { useState } from 'react'; @@ -110,39 +118,36 @@ export const ExecutionSummaryPanel = React.memo(function ExecutionSummaryPanel( : `Query ID\n${execution.id}\n(click to copy)`) } />, - execution?.destination?.type === 'durableStorage' && execution.destinationPages ? ( -