open-nomad/ui/app/templates/components/copy-button.hbs
Buck Doyle 9322dfc46f
UI: Add copy button for client/allocation UUIDs (#5926)
The button shows a success icon and tooltip on click, and resets
after two seconds.
2019-07-15 12:14:32 -05:00

22 lines
699 B
Handlebars

{{#if (eq state 'success')}}
<div class='button is-borderless is-small is-static'>
<span class="tooltip text-center always-active" role="tooltip" aria-label="Copied!">
{{x-icon 'copy-success'}}
</span>
</div>
{{else if (eq state 'error')}}
<div class='button is-borderless is-small is-static'>
<span class="tooltip text-center" role="tooltip" aria-label="Error copying">
{{x-icon 'alert-triangle'}}
</span>
</div>
{{else}}
{{#addon-copy-button
class='button is-borderless is-small'
clipboardText=clipboardText
success=(perform indicateSuccess)
error=(action (mut state) 'error')
}}
{{x-icon 'copy-action'}}
{{/addon-copy-button}}
{{/if}}