Skip to content

Commit 8de5916

Browse files
committed
bug 12315
-Show summary of actions being performed on installation
1 parent 214e81e commit 8de5916

4 files changed

Lines changed: 72 additions & 10 deletions

File tree

ui/css/cloudstack3.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,17 @@ body.login {
684684
margin-bottom: 9px;
685685
}
686686

687+
.install-wizard .step.intro .subtitle li {
688+
position: relative;
689+
width: 45%;
690+
height: 24px;
691+
list-style: circle;
692+
}
693+
694+
.install-wizard .step.intro .subtitle li img {
695+
float: right;
696+
}
697+
687698
/*Notifications*/
688699
div.notification-box {
689700
width: 323px;

ui/scripts-test/installWizard.js

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Check if install wizard should be invoked
44
check: function(args) {
55
args.response.success({
6-
doInstall: true
6+
doInstall: args.context.users[0].username == 'newuser'
77
});
88
},
99

@@ -218,38 +218,62 @@
218218

219219
action: function(args) {
220220
var complete = args.response.success;
221+
var message = args.response.message;
221222

222223
var createZone = function(args) {
223-
createPod();
224+
message('Creating zone');
225+
setTimeout(function() {
226+
createPod();
227+
}, 500);
224228
};
225229

226230
var createPod = function(args) {
227-
createIPRange();
231+
message('Creating pod');
232+
setTimeout(function() {
233+
createIPRange();
234+
}, 500);
228235
};
229236

230237
var createIPRange = function(args) {
231-
createCluster();
238+
message('Creating network');
239+
setTimeout(function() {
240+
createCluster();
241+
}, 500);
232242
};
233243

234244
var createCluster = function(args) {
235-
createHost();
245+
message('Creating cluster');
246+
setTimeout(function() {
247+
createHost();
248+
}, 500);
236249
};
237250

238251
var createHost = function(args) {
239-
createPrimaryStorage();
252+
message('Creating host');
253+
setTimeout(function() {
254+
createPrimaryStorage();
255+
}, 500);
240256
};
241257

242258
var createPrimaryStorage = function(args) {
243-
createSecondaryStorage();
259+
message('Creating primary storage');
260+
setTimeout(function() {
261+
createSecondaryStorage();
262+
}, 500);
244263
};
245264

246265
var createSecondaryStorage = function(args) {
247-
pollSystemVMs();
266+
message('Creating secondary storage');
267+
setTimeout(function() {
268+
pollSystemVMs();
269+
}, 500);
248270
};
249271

250272
var pollSystemVMs = function() {
273+
message('Creating system VMs (this may take a while)');
251274
setTimeout(function() {
252-
complete();
275+
message('Done!', { ignoreLoadingAnim: true });
276+
setTimeout(complete, 1000);
253277
}, 5000);
254278
};
255279

ui/scripts/installWizard.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,11 @@
230230

231231
action: function(args) {
232232
var complete = args.response.success;
233+
var message = args.response.message;
233234
var data = args.data;
234235

235236
var createZone = function(args) {
237+
message('Creating zone');
236238
var addZoneAction = function(args) {
237239
var array1 = [];
238240

@@ -445,6 +447,7 @@
445447
};
446448

447449
var createPod = function(args) {
450+
message('Creating pod');
448451
var array1 = [];
449452
array1.push("&zoneId=" + args.data.zone.id);
450453
array1.push("&name=" + todb(data.pod.name));
@@ -471,6 +474,7 @@
471474
};
472475

473476
var createNetwork = function(args) {
477+
message('Creating network');
474478
var createNetworkAction = function(selectedZoneObj, args) {
475479
var array1 = [];
476480
array1.push("&zoneId=" + selectedZoneObj.id);
@@ -626,6 +630,7 @@
626630
};
627631

628632
var createCluster = function(args) {
633+
message('Creating cluster');
629634
$.ajax({
630635
url: createURL('addCluster'),
631636
data: {
@@ -648,6 +653,7 @@
648653
};
649654

650655
var createHost = function(args) {
656+
message('Creating host');
651657
$.ajax({
652658
url: createURL('addHost'),
653659
data: {
@@ -673,6 +679,7 @@
673679
};
674680

675681
var createPrimaryStorage = function(args) {
682+
message('Creating primary storage');
676683
$.ajax({
677684
url: createURL('createStoragePool'),
678685
data: {
@@ -697,6 +704,7 @@
697704
};
698705

699706
var createSecondaryStorage = function(args) {
707+
message('Creating secondary storage');
700708
$.ajax({
701709
url: createURL('addSecondaryStorage'),
702710
data: {
@@ -713,6 +721,7 @@
713721
};
714722

715723
var pollSystemVMs = function() {
724+
message('Creating system VMs (this may take a while)');
716725
var poll = setInterval(function() {
717726
$.ajax({
718727
url: createURL('listSystemVms'),
@@ -726,7 +735,8 @@
726735
return vm.state == 'Running';
727736
}).length) {
728737
clearInterval(poll);
729-
complete();
738+
message('Done!');
739+
setTimeout(complete, 1000);
730740
}
731741
}
732742
}

ui/scripts/ui-custom/installWizard.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,27 @@
625625
.html('Now building your cloud...');
626626
var $subtitle = $('<div></div>').addClass('subtitle')
627627
.html('');
628+
var $loading = $('<img>').attr({
629+
src: 'images/ajax-loader-small.gif'
630+
});
628631

629632
cloudStack.installWizard.action({
630633
data: state,
631634
response: {
635+
message: function(msg, options) {
636+
if (!options) options = {};
637+
$subtitle.append(function() {
638+
var $li = $('<li>').html(msg);
639+
640+
if (!options.ignoreLoadingAnim) {
641+
$li.append($loading);
642+
} else {
643+
$loading.remove();
644+
}
645+
646+
return $li;
647+
});
648+
},
632649
success: function() {
633650
complete();
634651
}

0 commit comments

Comments
 (0)