Skip to content

Commit 105080e

Browse files
committed
Fix wizard forms
1 parent 68e550d commit 105080e

1 file changed

Lines changed: 73 additions & 11 deletions

File tree

‎ui/scripts/ui-custom/installWizard.js‎

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@
333333
addCluster: function(args) {
334334
var $addCluster = $('<div></div>').addClass('add-cluster');
335335
var addClusterForm = cloudStack.dialog.createForm({
336+
context: {
337+
zones: [{}]
338+
},
336339
noDialog: true,
337340
form: cloudStack.sections.system
338341
.subsections.clusters.listView
@@ -398,10 +401,35 @@
398401
addHost: function(args) {
399402
var $addHost = $('<div></div>').addClass('add-host');
400403
var addHostForm = cloudStack.dialog.createForm({
404+
context: { zones: [{}] },
401405
noDialog: true,
402-
form: cloudStack.sections.system
403-
.subsections.hosts.listView
404-
.actions.add.createForm,
406+
form: {
407+
title: 'Add new host',
408+
desc: 'Please fill in the following information to add a new host fro the specified zone configuration.',
409+
fields: {
410+
hostname: {
411+
label: 'Host name',
412+
validation: { required: true }
413+
},
414+
415+
username: {
416+
label: 'User name',
417+
validation: { required: true }
418+
},
419+
420+
password: {
421+
label: 'Password',
422+
validation: { required: true },
423+
isPassword: true
424+
},
425+
//always appear (begin)
426+
hosttags: {
427+
label: 'Host tags',
428+
validation: { required: false }
429+
}
430+
//always appear (end)
431+
}
432+
},
405433
after: function(args) {
406434
goTo('addPrimaryStorageIntro', 'host', $addHostForm);
407435
}
@@ -433,7 +461,7 @@
433461
* Add primary storage intro text
434462
* @param args
435463
*/
436-
addHostIntro: function(args) {
464+
addPrimaryStorageIntro: function(args) {
437465
var $intro = $('<div></div>').addClass('intro');
438466
var $title = $('<div></div>').addClass('title')
439467
.html('Let\'s add primary storage.');
@@ -463,9 +491,31 @@
463491
var $addPrimaryStorage = $('<div></div>').addClass('add-primary-storage');
464492
var addPrimaryStorageForm = cloudStack.dialog.createForm({
465493
noDialog: true,
466-
form: cloudStack.sections.system
467-
.subsections['primary-storage'].listView
468-
.actions.add.createForm,
494+
form: {
495+
title: 'Add new primary storage',
496+
desc: 'Please fill in the following information to add a new primary storage',
497+
fields: {
498+
name: {
499+
label: 'Name',
500+
validation: { required: true }
501+
},
502+
503+
server: {
504+
label: 'Server',
505+
validation: { required: true }
506+
},
507+
508+
path: {
509+
label: 'Path',
510+
validation: { required: true }
511+
},
512+
513+
storageTags: {
514+
label: 'Storage Tags',
515+
validation: { required: false }
516+
}
517+
}
518+
},
469519
after: function(args) {
470520
goTo('addSecondaryStorageIntro', 'primaryStorage', $addPrimaryStorageForm);
471521
}
@@ -497,7 +547,7 @@
497547
* Add secondary storage intro text
498548
* @param args
499549
*/
500-
addHostIntro: function(args) {
550+
addSecondaryStorageIntro: function(args) {
501551
var $intro = $('<div></div>').addClass('intro');
502552
var $title = $('<div></div>').addClass('title')
503553
.html('Let\'s add secondary storage.');
@@ -527,9 +577,20 @@
527577
var $addSecondaryStorage = $('<div></div>').addClass('add-secondary-storage');
528578
var addSecondaryStorageForm = cloudStack.dialog.createForm({
529579
noDialog: true,
530-
form: cloudStack.sections.system
531-
.subsections['secondary-storage'].listView
532-
.actions.add.createForm,
580+
form: {
581+
title: 'Add new secondary storage',
582+
desc: 'Please fill in the following information to add a new secondary storage',
583+
fields: {
584+
nfsServer: {
585+
label: 'NFS Server',
586+
validation: { required: true }
587+
},
588+
path: {
589+
label: 'Path',
590+
validation: { required: true }
591+
}
592+
}
593+
},
533594
after: function(args) {
534595
goTo('launchInfo', 'secondaryStorage', $addSecondaryStorageForm);
535596
}
@@ -593,6 +654,7 @@
593654
.html('You may want to get a cup of coffee right now.');
594655

595656
cloudStack.installWizard.action({
657+
data: state,
596658
response: {
597659
success: function() {
598660
complete();

0 commit comments

Comments
 (0)