Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fix copy bootstrap command (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGodbehere authored Feb 21, 2024
1 parent eae4cbd commit 5e4b44b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions resources/js/components/Containers/NodeContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ export default {
copyBootstrapCommand (item) {
axios.get(`/api/edge-clusters/${item.uuid}/bootstrap-command`).then((response) => {
if (response.data.data) {
this.copyToClipboard(response.data.data)

this.copyToClipboard(`curl ${response.data.data} | sh -`)
window.showNotification({
title: 'Copied to clipboard',
description: 'The bootstrap command has been copied to your clipboard. Paste this onto the node you wish to bootstrap.',
Expand All @@ -286,11 +287,11 @@ export default {
this.newClusterDialogVisible = false
},

async copyToClipboard (text) {
async copyToClipboard (command) {
try {
await navigator.clipboard.writeText(text)
await navigator.clipboard.writeText(command)
} catch (err) {
console.warn(`Failed to copy to clipboard: ${text}`);
console.warn(`Failed to copy to clipboard: ${command}`);
window.showNotification({
title: 'Failed to copy to clipboard.',
description: err,
Expand Down

0 comments on commit 5e4b44b

Please sign in to comment.