|
333 | 333 | addCluster: function(args) { |
334 | 334 | var $addCluster = $('<div></div>').addClass('add-cluster'); |
335 | 335 | var addClusterForm = cloudStack.dialog.createForm({ |
| 336 | + context: { |
| 337 | + zones: [{}] |
| 338 | + }, |
336 | 339 | noDialog: true, |
337 | 340 | form: cloudStack.sections.system |
338 | 341 | .subsections.clusters.listView |
|
398 | 401 | addHost: function(args) { |
399 | 402 | var $addHost = $('<div></div>').addClass('add-host'); |
400 | 403 | var addHostForm = cloudStack.dialog.createForm({ |
| 404 | + context: { zones: [{}] }, |
401 | 405 | 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 | + }, |
405 | 433 | after: function(args) { |
406 | 434 | goTo('addPrimaryStorageIntro', 'host', $addHostForm); |
407 | 435 | } |
|
433 | 461 | * Add primary storage intro text |
434 | 462 | * @param args |
435 | 463 | */ |
436 | | - addHostIntro: function(args) { |
| 464 | + addPrimaryStorageIntro: function(args) { |
437 | 465 | var $intro = $('<div></div>').addClass('intro'); |
438 | 466 | var $title = $('<div></div>').addClass('title') |
439 | 467 | .html('Let\'s add primary storage.'); |
|
463 | 491 | var $addPrimaryStorage = $('<div></div>').addClass('add-primary-storage'); |
464 | 492 | var addPrimaryStorageForm = cloudStack.dialog.createForm({ |
465 | 493 | 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 | + }, |
469 | 519 | after: function(args) { |
470 | 520 | goTo('addSecondaryStorageIntro', 'primaryStorage', $addPrimaryStorageForm); |
471 | 521 | } |
|
497 | 547 | * Add secondary storage intro text |
498 | 548 | * @param args |
499 | 549 | */ |
500 | | - addHostIntro: function(args) { |
| 550 | + addSecondaryStorageIntro: function(args) { |
501 | 551 | var $intro = $('<div></div>').addClass('intro'); |
502 | 552 | var $title = $('<div></div>').addClass('title') |
503 | 553 | .html('Let\'s add secondary storage.'); |
|
527 | 577 | var $addSecondaryStorage = $('<div></div>').addClass('add-secondary-storage'); |
528 | 578 | var addSecondaryStorageForm = cloudStack.dialog.createForm({ |
529 | 579 | 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 | + }, |
533 | 594 | after: function(args) { |
534 | 595 | goTo('launchInfo', 'secondaryStorage', $addSecondaryStorageForm); |
535 | 596 | } |
|
593 | 654 | .html('You may want to get a cup of coffee right now.'); |
594 | 655 |
|
595 | 656 | cloudStack.installWizard.action({ |
| 657 | + data: state, |
596 | 658 | response: { |
597 | 659 | success: function() { |
598 | 660 | complete(); |
|
0 commit comments