You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/04/24 00:44:45 UTC

[doris] branch master updated: [feature](ui)add copy profile button #18965

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 0dd45ce158 [feature](ui)add copy profile button #18965
0dd45ce158 is described below

commit 0dd45ce15811d0fac8652c714d67e460d595164a
Author: Mryange <59...@users.noreply.github.com>
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org