You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/02/17 03:43:49 UTC

[incubator-skywalking-ui] branch master updated: Update: update db-trace copy (#232)

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

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 5adaaec  Update: update db-trace copy (#232)
5adaaec is described below

commit 5adaaecfe2c6aae3986dd7cdd247438f8961158b
Author: Allen Wang <Al...@outlook.com>
AuthorDate: Sun Feb 17 11:43:45 2019 +0800

    Update: update db-trace copy (#232)
    
    * Update: update db-trace copy
    
    * Update: update copyed => copied
---
 src/components/Trace/TraceListDB/index.js | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/components/Trace/TraceListDB/index.js b/src/components/Trace/TraceListDB/index.js
index 62ee941..5cb8792 100644
--- a/src/components/Trace/TraceListDB/index.js
+++ b/src/components/Trace/TraceListDB/index.js
@@ -16,7 +16,7 @@
  */
 
 import React, { PureComponent } from 'react';
-import {List, Button } from 'antd';
+import {List, Button, message } from 'antd';
 import Ellipsis from 'ant-design-pro/lib/Ellipsis';
 import styles from './index.less';
 
@@ -33,6 +33,14 @@ class TraceList extends PureComponent {
           }}
         />
         <div className={styles.mainInfo}>
+          <a 
+            style={{
+              margin: '0 10px',
+            }}
+            onClick={this.handleClick.bind(this, opName)}
+          >
+            Copy
+          </a>
           <Ellipsis length={100} tooltip style={{ width: 'initial' }}>
             {opName}
           </Ellipsis>
@@ -42,6 +50,18 @@ class TraceList extends PureComponent {
     );
   };
 
+  handleClick = (i) => {
+    const input = document.createElement('input');
+    input.value = i;
+    message.info('copied');
+    document.body.appendChild(input);
+    input.select();
+    if (document.execCommand('Copy')) {
+        document.execCommand('Copy');
+    }
+    input.style.display = 'none';
+  }
+
   renderDescription = (start, traceIds) => {
     const { onClickTraceTag } = this.props;
     return (