diff --git a/src/client/nb_console.js b/src/client/nb_console.js index 6b2ea23948..e5d84b63c4 100644 --- a/src/client/nb_console.js +++ b/src/client/nb_console.js @@ -315,6 +315,28 @@ nb_console.controller('UserManagementViewCtrl', [ scope.password = ''; scope.email = ''; console.log('system:', JSON.stringify(nbSystem.system)); + + scope.copy_to_clipboard = function() { + var copyFrom = $window.document.getElementById('copy-text-area'); + var selection = $window.getSelection(); + selection.removeAllRanges(); + var range = $window.document.createRange(); + range.selectNodeContents(copyFrom); + selection.addRange(range); + try { + var success = $window.document.execCommand('copy', false, null); + if (success) { + nbAlertify.success('Email details copied to clipboard'); + } else { + nbAlertify.error('Cannot copy email details to clipboard, please copy manually'); + } + selection.removeAllRanges(); + } catch (err) { + console.error('err while copy', err); + nbAlertify.error('Cannot copy email details to clipboard, please copy manually'); + } + }; + scope.update_email_message = function() { scope.email_message = 'Hi,\r\n' + 'I created a noobaa user for you\r\n' + diff --git a/src/client/nb_nodes.js b/src/client/nb_nodes.js index a5e33c0593..c2b75d8b1c 100644 --- a/src/client/nb_nodes.js +++ b/src/client/nb_nodes.js @@ -287,6 +287,27 @@ nb_api.factory('nbNodes', [ scope.next_stage(); }); }; + + scope.copy_to_clipboard = function() { + var copyFrom = $window.document.getElementById('copy-text-area'); + var selection = $window.getSelection(); + selection.removeAllRanges(); + var range = $window.document.createRange(); + range.selectNodeContents(copyFrom); + selection.addRange(range); + try { + var success = $window.document.execCommand('copy', false, null); + if (success) { + nbAlertify.success('Agent configuration copied to clipboard'); + } else { + nbAlertify.error('Cannot copy agent configuration to clipboard, please copy manually'); + } + selection.removeAllRanges(); + } catch (err) { + console.error('err while copy', err); + nbAlertify.error('Cannot copy agent configuration to clipboard, please copy manually'); + } + }; scope.modal = nbModal({ template: 'console/add_node_dialog.html', scope: scope, diff --git a/src/ngview/console/account_create_dialog.html b/src/ngview/console/account_create_dialog.html index 0538237c89..aa79074d00 100644 --- a/src/ngview/console/account_create_dialog.html +++ b/src/ngview/console/account_create_dialog.html @@ -26,21 +26,12 @@
Copy the following text and send it to the user -
{{$parent.email_message}}
- +
{{$parent.email_message}}
- - - +
- -
/S /config {{ encoding.type }}
- - - - - -

Review the new nodes