From 8de59166a43df2ca8418885f3a17bbdff47eafea Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Mon, 5 Dec 2011 16:37:55 -0800 Subject: [PATCH] bug 12315 -Show summary of actions being performed on installation --- ui/css/cloudstack3.css | 11 +++++++ ui/scripts-test/installWizard.js | 42 +++++++++++++++++++++------ ui/scripts/installWizard.js | 12 +++++++- ui/scripts/ui-custom/installWizard.js | 17 +++++++++++ 4 files changed, 72 insertions(+), 10 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index a905ba60443..25ec6d44d37 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -684,6 +684,17 @@ body.login { margin-bottom: 9px; } +.install-wizard .step.intro .subtitle li { + position: relative; + width: 45%; + height: 24px; + list-style: circle; +} + +.install-wizard .step.intro .subtitle li img { + float: right; +} + /*Notifications*/ div.notification-box { width: 323px; diff --git a/ui/scripts-test/installWizard.js b/ui/scripts-test/installWizard.js index fbd74aee17a..98e189e29ca 100644 --- a/ui/scripts-test/installWizard.js +++ b/ui/scripts-test/installWizard.js @@ -3,7 +3,7 @@ // Check if install wizard should be invoked check: function(args) { args.response.success({ - doInstall: true + doInstall: args.context.users[0].username == 'newuser' }); }, @@ -218,38 +218,62 @@ action: function(args) { var complete = args.response.success; + var message = args.response.message; var createZone = function(args) { - createPod(); + message('Creating zone'); + setTimeout(function() { + createPod(); + }, 500); }; var createPod = function(args) { - createIPRange(); + message('Creating pod'); + setTimeout(function() { + createIPRange(); + }, 500); }; var createIPRange = function(args) { - createCluster(); + message('Creating network'); + setTimeout(function() { + createCluster(); + }, 500); }; var createCluster = function(args) { - createHost(); + message('Creating cluster'); + setTimeout(function() { + createHost(); + }, 500); }; var createHost = function(args) { - createPrimaryStorage(); + message('Creating host'); + setTimeout(function() { + createPrimaryStorage(); + }, 500); }; var createPrimaryStorage = function(args) { - createSecondaryStorage(); + message('Creating primary storage'); + setTimeout(function() { + createSecondaryStorage(); + }, 500); }; var createSecondaryStorage = function(args) { - pollSystemVMs(); + message('Creating secondary storage'); + setTimeout(function() { + pollSystemVMs(); + }, 500); }; var pollSystemVMs = function() { + message('Creating system VMs (this may take a while)'); setTimeout(function() { - complete(); + message('Done!', { ignoreLoadingAnim: true }); + setTimeout(complete, 1000); }, 5000); }; diff --git a/ui/scripts/installWizard.js b/ui/scripts/installWizard.js index b66d0a95bfa..437110204b7 100644 --- a/ui/scripts/installWizard.js +++ b/ui/scripts/installWizard.js @@ -230,9 +230,11 @@ action: function(args) { var complete = args.response.success; + var message = args.response.message; var data = args.data; var createZone = function(args) { + message('Creating zone'); var addZoneAction = function(args) { var array1 = []; @@ -445,6 +447,7 @@ }; var createPod = function(args) { + message('Creating pod'); var array1 = []; array1.push("&zoneId=" + args.data.zone.id); array1.push("&name=" + todb(data.pod.name)); @@ -471,6 +474,7 @@ }; var createNetwork = function(args) { + message('Creating network'); var createNetworkAction = function(selectedZoneObj, args) { var array1 = []; array1.push("&zoneId=" + selectedZoneObj.id); @@ -626,6 +630,7 @@ }; var createCluster = function(args) { + message('Creating cluster'); $.ajax({ url: createURL('addCluster'), data: { @@ -648,6 +653,7 @@ }; var createHost = function(args) { + message('Creating host'); $.ajax({ url: createURL('addHost'), data: { @@ -673,6 +679,7 @@ }; var createPrimaryStorage = function(args) { + message('Creating primary storage'); $.ajax({ url: createURL('createStoragePool'), data: { @@ -697,6 +704,7 @@ }; var createSecondaryStorage = function(args) { + message('Creating secondary storage'); $.ajax({ url: createURL('addSecondaryStorage'), data: { @@ -713,6 +721,7 @@ }; var pollSystemVMs = function() { + message('Creating system VMs (this may take a while)'); var poll = setInterval(function() { $.ajax({ url: createURL('listSystemVms'), @@ -726,7 +735,8 @@ return vm.state == 'Running'; }).length) { clearInterval(poll); - complete(); + message('Done!'); + setTimeout(complete, 1000); } } } diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index 205d373f5e7..12337efbad1 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -625,10 +625,27 @@ .html('Now building your cloud...'); var $subtitle = $('
').addClass('subtitle') .html(''); + var $loading = $('').attr({ + src: 'images/ajax-loader-small.gif' + }); cloudStack.installWizard.action({ data: state, response: { + message: function(msg, options) { + if (!options) options = {}; + $subtitle.append(function() { + var $li = $('
  • ').html(msg); + + if (!options.ignoreLoadingAnim) { + $li.append($loading); + } else { + $loading.remove(); + } + + return $li; + }); + }, success: function() { complete(); }