|
568 | 568 | $('<div>').addClass('value').append( |
569 | 569 | $('<input>').attr({ type: 'text' }).addClass('required') |
570 | 570 | ) |
571 | | - ); |
572 | | - if($wizard.find('.select-network-model input:radio[name=network-model]:checked').val() == 'Advanced') { |
573 | | - $nameField.append( |
574 | | - $('<div>').addClass('name').append( |
575 | | - $('<label>').html('Physical network name') |
576 | | - ), |
577 | | - $('<div>').addClass('value').append( |
578 | | - $('<input>').attr({ type: 'text' }).addClass('required') |
579 | | - ), |
580 | | - $('<div>').append( |
581 | | - $('<span style=\"font-size:11px\;padding-right:5px;padding-left:50px">').html('Isolation method'), |
582 | | - $('<select>').append( |
583 | | - $('<option>').attr({ |
584 | | - value: '' |
585 | | - }).html(''), |
586 | | - $('<option>').attr({ |
587 | | - value: 'VLAN' |
588 | | - }).html('VLAN'), |
589 | | - //User should not be given the option to create a physical network with "L3" isolation method. (CS-15312) |
590 | | - /* |
591 | | - $('<option>').attr({ |
592 | | - value: 'L3' |
593 | | - }).html('L3'), |
594 | | - */ |
595 | | - $('<option>').attr({ |
596 | | - value: 'GRE' |
597 | | - }).html('GRE') |
| 571 | + ); |
| 572 | + |
| 573 | + |
| 574 | + var ovsTunnelManager = false; |
| 575 | + $.ajax({ |
| 576 | + url: createURL('listConfigurations'), |
| 577 | + data: { |
| 578 | + name: 'sdn.ovs.controller' |
| 579 | + }, |
| 580 | + dataType: "json", |
| 581 | + async: false, |
| 582 | + success: function(json) { |
| 583 | + var items = json.listconfigurationsresponse.configuration; //2 entries returned: 'sdn.ovs.controller', 'sdn.ovs.controller.default.label' |
| 584 | + $(items).each(function(){ |
| 585 | + if(this.name == 'sdn.ovs.controller') { |
| 586 | + if(this.value == 'true' || this.value == true) { |
| 587 | + ovsTunnelManager = true; |
| 588 | + } |
| 589 | + return false; //break each loop |
| 590 | + } |
| 591 | + }); |
| 592 | + } |
| 593 | + }); |
| 594 | + //when OVS tunnel manager is used |
| 595 | + if(ovsTunnelManager == true) { |
| 596 | + //Advanced zone supports 2 isolation method(VLAN, GRE), so show dropdown including the 2 options |
| 597 | + if($wizard.find('.select-network-model input:radio[name=network-model]:checked').val() == 'Advanced') { |
| 598 | + $nameField.append( |
| 599 | + $('<div>').addClass('name').append( |
| 600 | + $('<label>').html('Physical network name') |
| 601 | + ), |
| 602 | + $('<div>').addClass('value').append( |
| 603 | + $('<input>').attr({ type: 'text' }).addClass('required') |
| 604 | + ), |
| 605 | + $('<div>').append( |
| 606 | + $('<span style=\"font-size:11px\;padding-right:5px;padding-left:50px">').html('Isolation method'), |
| 607 | + $('<select>').append( |
| 608 | + $('<option>').attr({ |
| 609 | + value: 'VLAN' |
| 610 | + }).html('VLAN'), |
| 611 | + $('<option>').attr({ |
| 612 | + value: 'GRE' |
| 613 | + }).html('GRE') |
| 614 | + ) |
598 | 615 | ) |
599 | | - ) |
600 | | - ); |
| 616 | + ); |
| 617 | + } |
| 618 | + //Basic zone supports only 1 isolation method (L3), so there is no point showing dropdown. |
601 | 619 | } |
| 620 | + //when OVS tunnel manager is not used, isolationmethods parameter in createPhysicalNetwork API is ignored. So no showing dropdown. |
| 621 | + //isolationmethods parameter has not been used by network gurus so far. By default(i.e. when OVS tunnel manager is not used), networks are isolated with VLANs in Advanced zone, with L3 in basic zone. |
| 622 | + |
602 | 623 |
|
603 | 624 | var $dropContainer = $('<div>').addClass('drop-container').append( |
604 | 625 | $('<span>').addClass('empty-message').html( |
|
0 commit comments