diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index 5d9de8f510..6286aa5168 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -478,6 +478,7 @@ define(function(require) { //before running the action. $(document).on("click", '.confirm_button', function() { var dialogInstance = _getDialogInstance(CONFIRM_DIALOG_ID) + dialogInstance.reset(); $('#' + CONFIRM_DIALOG_ID).data('buttonAction', $(this).attr('href')); $('#' + CONFIRM_DIALOG_ID).data('buttonTab', $(this).parents('.tab').attr('id')); dialogInstance.show(); diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js index 361faa94ae..d7b4fac7ef 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js @@ -45,7 +45,7 @@ define(function(require) { return selected_nodes; } - function roleVMElements() { + function roleVMElements(opts) { var selected_nodes = []; var dataTable = $('table[id^=datatable_vms]', '#'+TAB_ID+' #'+ROLES_PANEL_ID); @@ -54,6 +54,16 @@ define(function(require) { selected_nodes.push($(this).val()); }); + if (opts && opts.names){ + var pairs = []; + + $.each(selected_nodes, function(){ + pairs.push({id: this, name: OpenNebulaVM.getName(this)}); + }); + + return pairs; + } + return selected_nodes; } diff --git a/src/sunstone/public/app/utils/dialogs/confirm.js b/src/sunstone/public/app/utils/dialogs/confirm.js index dabfc418ff..f8a57b6514 100644 --- a/src/sunstone/public/app/utils/dialogs/confirm.js +++ b/src/sunstone/public/app/utils/dialogs/confirm.js @@ -75,7 +75,7 @@ define(function(require) { $('#confirm_proceed', dialog).val(actionId); $('#confirm_tip', dialog).text(tip); - if(button.text) { + if(button && button.text) { $('.subheader', dialog).html(button.text); }