Преглед изворни кода

Implemented copy to clipboard on cluster list

jnfrati пре 5 година
родитељ
комит
a7bf5f4884
1 измењених фајлова са 8 додато и 3 уклоњено
  1. 8 3
      dashboard/src/main/home/dashboard/ClusterList.tsx

+ 8 - 3
dashboard/src/main/home/dashboard/ClusterList.tsx

@@ -6,9 +6,10 @@ import api from "shared/api";
 import { ClusterType } from "shared/types";
 import Helper from "components/values-form/Helper";
 
-import Loading from "components/Loading";
 import { RouteComponentProps, withRouter } from "react-router";
 
+import CopyToClipboard from "components/CopyToClipboard";
+
 type PropsType = RouteComponentProps & {
   currentCluster: ClusterType;
 };
@@ -71,13 +72,17 @@ class Templates extends Component<PropsType, StateType> {
             {this.renderIcon()}
             <TemplateTitle>{cluster.name}</TemplateTitle>
           </TitleContainer>
-          <Url>
+          <Url onClick={e => e.stopPropagation()}>
+            <CopyToClipboard text={cluster.server} />
             <Bolded>Cluster IP:</Bolded>
             <span>
               {cluster.server}
             </span>
-            <i className="material-icons-outlined">content_copy</i>
+            <i className="material-icons-outlined">
+              content_copy
+            </i>
           </Url>
+          
         </TemplateBlock>
       );
     });