From d6af02bb0ef15faabf7b30f95c7361306bc4c54c Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 7 Dec 2010 14:06:35 -0800 Subject: [PATCH] instance page - deployVM with template that is passwordEnabled - pop up a dialog box to show password after action succeeds. --- ui/scripts/cloud.core.instance.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 3588f7750d1..cb0f88f0444 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -1007,11 +1007,19 @@ function initVMWizard() { vmToMidmenu(item, $midmenuItem1); bindClickToMidMenu($midmenuItem1, vmToRightPanel, getMidmenuId); - if (item.passwordenabled == 'true') { + if (item.passwordenabled == true) { var extraMessage = "New password: " + item.password; afterAddingMidMenuItem($midmenuItem1, true, extraMessage); - var afterActionInfo = "Your instance has been successfully created. Your new password is : " + item.password; + var afterActionInfo = "Instance " + getVmName(item.name, item.displayname) + " has been created successfully. New password is: " + item.password; $midmenuItem1.data("afterActionInfo", afterActionInfo); + + $("#dialog_info") + .text(afterActionInfo) + .dialog('option', 'buttons', { + "OK": function() { + $(this).dialog("close"); + } + }).dialog("open"); } else { afterAddingMidMenuItem($midmenuItem1, true);