This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit 96841a4d634af29b1cac09e1669b3d6d04aee7d5 Author: Mryange <[email protected]> AuthorDate: Mon Apr 24 08:44:38 2023 +0800 [feature](ui)add copy profile button #18965 --- ui/src/pages/query-profile/index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/src/pages/query-profile/index.tsx b/ui/src/pages/query-profile/index.tsx index fa257733e8..5590ce9085 100644 --- a/ui/src/pages/query-profile/index.tsx +++ b/ui/src/pages/query-profile/index.tsx @@ -90,6 +90,15 @@ export default function QueryProfile(params: any) { URL.revokeObjectURL(tagA.href); document.body.removeChild(tagA); } + function copyToClipboard(profile: string) { + const profileTxt = replaceToTxt(profile); + const textarea = document.createElement("textarea"); + textarea.value = profileTxt; + document.body.appendChild(textarea); + textarea.select(); + document.execCommand('copy'); + document.body.removeChild(textarea); + } return ( <Typography style={{padding: '30px'}}> @@ -103,6 +112,9 @@ export default function QueryProfile(params: any) { <Button onClick={() => { download(profile) }}>download</Button> + <Button onClick={() => { + copyToClipboard(profile) + }}>copy profile</Button> </Space> : ''} </Col> </Row> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
