|
7347 | 7347 | docID: 'helpClusterHypervisor', |
7348 | 7348 | select: function(args) { |
7349 | 7349 | var vSwitchEnabled = false; |
| 7350 | + var dvSwitchEnabled = false; |
7350 | 7351 |
|
7351 | 7352 | $.ajax({ |
7352 | 7353 | url: createURL("listHypervisors"), |
|
7375 | 7376 | } |
7376 | 7377 | } |
7377 | 7378 | }); |
| 7379 | + |
| 7380 | + //Check whether dvSwitch is enabled or not |
| 7381 | + $.ajax({ |
| 7382 | + url: createURL('listConfigurations'), |
| 7383 | + data: { |
| 7384 | + name: 'vmware.use.dvswitch' |
| 7385 | + }, |
| 7386 | + async: false, |
| 7387 | + success: function(json) { |
| 7388 | + if (json.listconfigurationsresponse.configuration[0].value == 'true') { |
| 7389 | + dvSwitchEnabled = true; |
| 7390 | + } |
| 7391 | + } |
| 7392 | + }); |
| 7393 | + |
7378 | 7394 |
|
7379 | 7395 | args.$select.bind("change", function(event) { |
7380 | 7396 | var $form = $(this).closest('form'); |
|
7390 | 7406 |
|
7391 | 7407 | if ($(this).val() == "VMware") { |
7392 | 7408 | //$('li[input_sub_group="external"]', $dialogAddCluster).show(); |
| 7409 | + |
| 7410 | + if(dvSwitchEnabled){ |
| 7411 | + // $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'inline-block'); |
| 7412 | + // $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block'); |
| 7413 | + // $form.find('.form-item[rel=vSwitchPublicName]').css('display','inline-block'); |
| 7414 | + //$form.find('.form-item[rel=vSwitchGuestName]').css('display','inline-block'); |
| 7415 | + $form.find('.form-item[rel=overridepublictraffic]').css('display','inline-block'); |
| 7416 | + $form.find('.form-item[rel=overridepublictraffic]').find('input[type=checkbox]').removeAttr('checked'); |
| 7417 | + |
| 7418 | + $form.find('.form-item[rel=overrideguesttraffic]').css('display','inline-block'); |
| 7419 | + $form.find('.form-item[rel=overrideguesttraffic]').find('input[type=checkbox]').removeAttr('checked'); |
| 7420 | + |
| 7421 | + |
| 7422 | + |
| 7423 | + } |
| 7424 | + else { |
| 7425 | + // $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); |
| 7426 | + // $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); |
| 7427 | + // $form.find('.form-item[rel=vSwitchPublicName]').css('display','none'); |
| 7428 | + // $form.find('.form-item[rel=vSwitchGuestName]').css('display','none'); |
| 7429 | + $form.find('.form-item[rel=overridepublictraffic]').css('display','none'); |
| 7430 | + $form.find('.form-item[rel=overrideguesttraffic]').css('display','none'); |
| 7431 | + |
| 7432 | + |
| 7433 | + } |
7393 | 7434 | $form.find('.form-item[rel=vCenterHost]').css('display', 'inline-block'); |
7394 | 7435 | $form.find('.form-item[rel=vCenterUsername]').css('display', 'inline-block'); |
7395 | 7436 | $form.find('.form-item[rel=vCenterPassword]').css('display', 'inline-block'); |
|
7401 | 7442 | $vsmFields.css('display', 'none'); |
7402 | 7443 | } |
7403 | 7444 | } else { |
| 7445 | + |
| 7446 | + |
| 7447 | + $form.find('.form-item[rel=overridepublictraffic]').css('display', 'none'); |
| 7448 | + $form.find('.form-item[rel=overrideguesttraffic]').css('display', 'none'); |
| 7449 | + $form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none'); |
| 7450 | + $form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none'); |
| 7451 | + $form.find('.form-item[rel=vSwitchPublicName]').css('display','none'); |
| 7452 | + $form.find('.form-item[rel=vSwitchGuestName]').css('display','none'); |
| 7453 | + |
| 7454 | + |
7404 | 7455 | $form.find('.form-item[rel=vCenterHost]').css('display', 'none'); |
7405 | 7456 | $form.find('.form-item[rel=vCenterUsername]').css('display', 'none'); |
7406 | 7457 | $form.find('.form-item[rel=vCenterPassword]').css('display', 'none'); |
|
7453 | 7504 | }, |
7454 | 7505 |
|
7455 | 7506 | //hypervisor==VMWare begins here |
| 7507 | + |
7456 | 7508 | vCenterHost: { |
7457 | 7509 | label: 'label.vcenter.host', |
7458 | 7510 | docID: 'helpClustervCenterHost', |
|
7474 | 7526 | docID: 'helpClustervCenterDatacenter', |
7475 | 7527 | validation: { required: true } |
7476 | 7528 | }, |
| 7529 | + |
| 7530 | + overridepublictraffic:{ |
| 7531 | + label:'Override Public-Traffic', |
| 7532 | + isBoolean:true, |
| 7533 | + isHidden:true, |
| 7534 | + isChecked:false |
| 7535 | + |
| 7536 | + }, |
| 7537 | + |
| 7538 | + |
| 7539 | + vSwitchPublicType:{ |
| 7540 | + label: 'Public Traffic vSwitch Type', |
| 7541 | + select: function(args) { |
| 7542 | + var vSwitchEnabled = false; |
| 7543 | + var items = [] |
| 7544 | + $.ajax({ |
| 7545 | + url: createURL('listConfigurations'), |
| 7546 | + data: { |
| 7547 | + name: 'vmware.use.nexus.vswitch' |
| 7548 | + }, |
| 7549 | + async: false, |
| 7550 | + success: function(json) { |
| 7551 | + if (json.listconfigurationsresponse.configuration[0].value == 'true') { |
| 7552 | + vSwitchEnabled = true; |
| 7553 | + } |
| 7554 | + } |
| 7555 | + }); |
| 7556 | + |
| 7557 | + if(vSwitchEnabled) { |
| 7558 | + |
| 7559 | + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); |
| 7560 | + |
| 7561 | + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); |
| 7562 | + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); |
| 7563 | + |
| 7564 | + |
| 7565 | + |
| 7566 | + |
| 7567 | + } |
| 7568 | + |
| 7569 | + // items.push({id: "" , description:" " }); |
| 7570 | + else{ |
| 7571 | + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); |
| 7572 | + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); |
| 7573 | + |
| 7574 | + |
| 7575 | + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); |
| 7576 | + } |
| 7577 | + |
| 7578 | + args.response.success({data: items}); |
| 7579 | + }, |
| 7580 | + isHidden:true, |
| 7581 | + dependsOn:'overridepublictraffic' |
| 7582 | + }, |
| 7583 | + |
| 7584 | + vSwitchPublicName:{ |
| 7585 | + label:'Public Traffic vSwitch Name', |
| 7586 | + dependsOn:'overridepublictraffic', |
| 7587 | + isHidden:true |
| 7588 | + |
| 7589 | + |
| 7590 | + }, |
| 7591 | + |
| 7592 | + overrideguesttraffic:{ |
| 7593 | + label:'Override Guest-Traffic', |
| 7594 | + isBoolean:true, |
| 7595 | + isHidden:true, |
| 7596 | + isChecked:false |
| 7597 | + }, |
| 7598 | + |
| 7599 | + |
| 7600 | + vSwitchGuestType:{ |
| 7601 | + label: 'Guest Traffic vSwitch Type', |
| 7602 | + select: function(args) { |
| 7603 | + var items = [] |
| 7604 | + // items.push({id: "" , description:" " }); |
| 7605 | + |
| 7606 | + var vSwitchEnabled = false; |
| 7607 | + $.ajax({ |
| 7608 | + url: createURL('listConfigurations'), |
| 7609 | + data: { |
| 7610 | + name: 'vmware.use.nexus.vswitch' |
| 7611 | + }, |
| 7612 | + async: false, |
| 7613 | + success: function(json) { |
| 7614 | + if (json.listconfigurationsresponse.configuration[0].value == 'true') { |
| 7615 | + vSwitchEnabled = true; |
| 7616 | + } |
| 7617 | + } |
| 7618 | + }); |
| 7619 | + |
| 7620 | + |
| 7621 | + if(vSwitchEnabled){ |
| 7622 | + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); |
| 7623 | + |
| 7624 | + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); |
| 7625 | + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); |
| 7626 | + |
| 7627 | + |
| 7628 | + } |
| 7629 | + |
| 7630 | + |
| 7631 | + else{ |
| 7632 | + |
| 7633 | + items.push({id: "vmwaresvs", description: "VMware vNetwork Standard Virtual Switch"}); |
| 7634 | + items.push({id: "vmwaredvs", description: "VMware vNetwork Distributed Virtual Switch"}); |
| 7635 | + |
| 7636 | + items.push({ id:" nexusdvs" , description: "Cisco Nexus 1000v Distributed Virtual Switch"}); |
| 7637 | + |
| 7638 | + |
| 7639 | + } |
| 7640 | + args.response.success({data: items}); |
| 7641 | + }, |
| 7642 | + isHidden:true, |
| 7643 | + dependsOn:'overrideguesttraffic' |
| 7644 | + |
| 7645 | + }, |
| 7646 | + |
| 7647 | + vSwitchGuestName:{ |
| 7648 | + label:' Guest Traffic vSwitch Name', |
| 7649 | + dependsOn:'overrideguesttraffic', |
| 7650 | + isHidden:true |
| 7651 | + |
| 7652 | + |
| 7653 | + }, |
| 7654 | + |
| 7655 | + |
7477 | 7656 | vsmipaddress: { |
7478 | 7657 | label: 'Nexus 1000v IP Address', |
7479 | 7658 | validation: { required: true }, |
|
7519 | 7698 | if(args.data.hypervisor == "VMware") { |
7520 | 7699 | array1.push("&username=" + todb(args.data.vCenterUsername)); |
7521 | 7700 | array1.push("&password=" + todb(args.data.vCenterPassword)); |
| 7701 | + |
| 7702 | + //vSwitch Public Type |
| 7703 | + if(args.data.vSwitchPublicType != "") |
| 7704 | + array1.push("&publicvswitchtype=" + args.data.vSwitchPublicType); |
| 7705 | + |
| 7706 | + if(args.data.vSwitchPublicName != "") |
| 7707 | + array1.push("&publicvswitchname=" +args.data.vSwitchPublicName); |
| 7708 | + |
| 7709 | + |
| 7710 | + //vSwitch Guest Type |
| 7711 | + if(args.data.vSwitchGuestType != "") |
| 7712 | + array1.push("&guestvswitchtype=" + args.data.vSwitchGuestType); |
| 7713 | + |
| 7714 | + if(args.data.vSwitchGuestName !="") |
| 7715 | + array1.push("&guestvswitchname=" +args.data.vSwitchGuestName); |
7522 | 7716 |
|
7523 | 7717 | if (args.data.vsmipaddress) { |
7524 | 7718 | array1.push('&vsmipaddress=' + args.data.vsmipaddress); |
|
0 commit comments