diff --git a/ui/src/app/shared/components/clipboard-text.tsx b/ui/src/app/shared/components/clipboard-text.tsx new file mode 100644 index 000000000000..56dc0674e6d6 --- /dev/null +++ b/ui/src/app/shared/components/clipboard-text.tsx @@ -0,0 +1,26 @@ +import {Tooltip} from 'argo-ui'; +import * as React from 'react'; +import {useState} from 'react'; + +export const ClipboardText = ({text}: {text: string}) => { + const [justClicked, setJustClicked] = useState(false); + + return ( + <> + {text} +     + + + { + setJustClicked(true); + navigator.clipboard.writeText(text); + setInterval(() => setJustClicked(false), 2000); + }} + /> + + + + ); +}; diff --git a/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx b/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx index bf00a80e3001..0c2c8e90137d 100644 --- a/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx +++ b/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx @@ -5,6 +5,7 @@ import * as React from 'react'; import * as models from '../../../../models'; import {Artifact, NodeStatus, Workflow} from '../../../../models'; import {Button} from '../../../shared/components/button'; +import {ClipboardText} from '../../../shared/components/clipboard-text'; import {DropDownButton} from '../../../shared/components/drop-down-button'; import {DurationPanel} from '../../../shared/components/duration-panel'; import {InlineTable} from '../../../shared/components/inline-table/inline-table'; @@ -61,7 +62,7 @@ const AttributeRows = (props: {attributes: {title: string; value: any}[]}) => ( const WorkflowNodeSummary = (props: Props) => { const attributes = [ - {title: 'NAME', value: props.node.name}, + {title: 'NAME', value: }, {title: 'TYPE', value: props.node.type}, { title: 'PHASE', @@ -112,10 +113,10 @@ const WorkflowNodeSummary = (props: Props) => { attributes.splice( 2, 0, - {title: 'POD NAME', value: props.node.id}, + {title: 'POD NAME', value: }, { title: 'HOST NODE NAME', - value: props.node.hostNodeName + value: } ); }