Skip to content

Commit

Permalink
- Allow Address pair was not getting removed if it has 1 entrey - Fix…
Browse files Browse the repository at this point in the history
…ed it.

    issue was if all Allow address pair was removed the sending JSON was
    wrong fixed it
- Tool tip was showing wrong for icon changed it.
- MAC Address validation was not happening for the lastset fixed it.
Partial-Bug: #1400590

Change-Id: I90c477f3f045dbd400fe495ec95a281b7cc490df
  • Loading branch information
balamurugang committed Dec 13, 2014
1 parent 46cba19 commit d2cccf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions webroot/config/ports/ui/js/ports_config.js
Expand Up @@ -558,7 +558,7 @@ function initActions() {


//Allow Address Pair
portConfig["virtual_machine_interface_allowed_address_pairs"] = {};
portConfig["virtual-machine-interface"]["virtual_machine_interface_allowed_address_pairs"] = {};
var aapElement = "AAPTuples";
var allaapTuples = $("#"+aapElement)[0].children;
if (allaapTuples && allaapTuples.length > 0) {
Expand Down Expand Up @@ -1824,7 +1824,7 @@ function createDHCPEntry(DHCPData, id,element) {
var iBtnAddRule = document.createElement("i");
iBtnAddRule.className = "icon-plus";
iBtnAddRule.setAttribute("onclick", "appendDHCPEntry(this,'"+element+"');");
iBtnAddRule.setAttribute("title", "Add DHCP below");
iBtnAddRule.setAttribute("title", "Add DHCP Options below");

var divPullLeftMargin5Plus = document.createElement("div");
divPullLeftMargin5Plus.className = "pull-left margin-5";
Expand All @@ -1833,7 +1833,7 @@ function createDHCPEntry(DHCPData, id,element) {
var iBtnDeleteRule = document.createElement("i");
iBtnDeleteRule.className = "icon-minus";
iBtnDeleteRule.setAttribute("onclick", "deleteDHCPEntry(this);");
iBtnDeleteRule.setAttribute("title", "Delete DHCP");
iBtnDeleteRule.setAttribute("title", "Delete DHCP Options");

var divPullLeftMargin5Minus = document.createElement("div");
divPullLeftMargin5Minus.className = "pull-left margin-5";
Expand Down Expand Up @@ -2128,7 +2128,7 @@ function createAAPEntry(AAPData, id,element) {
var iBtnAddRule = document.createElement("i");
iBtnAddRule.className = "icon-plus";
iBtnAddRule.setAttribute("onclick", "appendAAPEntry(this,'"+element+"');");
iBtnAddRule.setAttribute("title", "Add FixedIP below");
iBtnAddRule.setAttribute("title", "Add Allowed address pairs below");

var divPullLeftMargin5Plus = document.createElement("div");
divPullLeftMargin5Plus.className = "pull-left margin-5";
Expand All @@ -2137,7 +2137,7 @@ function createAAPEntry(AAPData, id,element) {
var iBtnDeleteRule = document.createElement("i");
iBtnDeleteRule.className = "icon-minus";
iBtnDeleteRule.setAttribute("onclick", "deleteAAPEntry(this);");
iBtnDeleteRule.setAttribute("title", "Delete FixedIP");
iBtnDeleteRule.setAttribute("title", "Delete Allowed address pairs");

var divPullLeftMargin5Minus = document.createElement("div");
divPullLeftMargin5Minus.className = "pull-left margin-5";
Expand Down Expand Up @@ -2394,7 +2394,8 @@ Handlebars.registerHelper("formatAAP",function(AllowedAddressPairValue,options)
});

function isValidMACAddress(mac) {
var mac_address_regex = /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-F]{2})$/;
mac = mac.toUpperCase();
var mac_address_regex = /^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/;
return mac_address_regex.test(mac);
}

Expand Down
2 changes: 1 addition & 1 deletion webroot/config/ports/ui/views/ports_config.view
Expand Up @@ -255,7 +255,7 @@
<h6>Option value</h6>
</div>
<div class="pull-left">
<div title="Add DHCP below" class="margin-5 padding-10-0">
<div title="Add DHCP Options below" class="margin-5 padding-10-0">
<i class="pull-right icon-plus" onclick="appendDHCPEntry(this, 'DHCPTuples',true);"></i>
</div>
</div>
Expand Down

0 comments on commit d2cccf9

Please sign in to comment.