Skip to content

Commit

Permalink
Merge "Bug 1456887 In floating IP page - * Grid loading removed Insta…
Browse files Browse the repository at this point in the history
…nce and UUID from the main grid * Added ports fixed IP and port UUID of the port in the grid. * Add the expansion for the grid with the detail of fip detail along with the floating ip UUID."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 23, 2015
2 parents c14d4b0 + 5882905 commit 55121f6
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 10 deletions.
36 changes: 26 additions & 10 deletions webroot/config/fip/ui/js/fip_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,32 +88,32 @@ $("#gridfip").contrailGrid({
{
id:"ip_addr",
field:"ip_addr",
name:"IP Address",
name:"Floating IP",
sortable: true,
width: 100,
sorter : comparatorIP
},
{
id:"instance",
field:"instance",
name:"Instance",
name:"Mapped Fixed IP Address",
sortable: true,
width: 200
width: 400
},
{
id:"fipPool",
field:"fipPool",
name:"Floating IP Pool",
sortable: true,
width: 200
},
}/*,
{
id:"uuid",
field:"uuid",
name:"UUID",
sortable: true,
width: 200
}
}*/
]
},
body : {
Expand All @@ -129,6 +129,9 @@ $("#gridfip").contrailGrid({
$('#btnDeletefip').removeClass('disabled-link');
}
},
detail:{
template: $("#gridFIPDetailTemplate").html()
},
actionCell: [
{
title: '   Associate Port',
Expand Down Expand Up @@ -503,16 +506,29 @@ function successHandlerForGridFIPRow(fipBackRefs) {
var fip = fips[i];
var ip_addr = ""
ip_addr = String(jsonPath(fip, "$.floating_ip_address"));
var instanceId = "-";
var instanceId = "";
var instance = jsonPath(fip, "$.virtual_machine_interface_refs");
if (typeof instance === "object" && instance.length === 1) {
instance = instance[0];
instance = jsonPath(instance, "$..virtual_machine_refs[*].uuid");
if(false !== instance && instance.length > 0) {
instanceId = instance.join(",");
var uuid = "";
var ip = "";
for (var k = 0; k < instance.length; k++) {
if (k > 0) uuid += ", ";
uuid += instance[k]["uuid"];
var fixedIPArr = instance[k]["instance_ip_back_refs"];
if (fixedIPArr != null && fixedIPArr != undefined) {
for (var j = 0; j < fixedIPArr.length; j++) {
if (j > 0) ip += ", ";
ip += fixedIPArr[j]["fixedip"]["ip"]
}
}
}
if(ip == "") ip = "-\xa0\xa0\xa0\xa0";
if(uuid != "")
instanceId = ip + " (" + uuid + ")";
}
var fipPool = "-";
if(instanceId.trim() == "") instanceId = "-";
var fipPool = "-";
var fipPoolVal = jsonPath(fip, "$.fq_name");
if (typeof fipPoolVal === "object" && fipPoolVal.length === 1)
fipPool = String(fipPoolVal[0][2]) + ":" + String(fipPoolVal[0][3]);
Expand Down
32 changes: 32 additions & 0 deletions webroot/config/fip/ui/views/fip_config.view
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
<!--
Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
-->
<script type="text/x-handlebars-template" id="gridFIPDetailTemplate">
<div>
<div class="row-fluid">

<div class="row-fluid">
<div>
<span class="span2"><label>Floating IP</label> </span>
<span class="span10">: {{ip_addr}} </span>
</div>
</div>
<div class="row-fluid">
<div>
<span class="span2"><label>UUID</label> </span>
<span class="span10">: {{uuid}} </span>
</div>
</div>
<div class="row-fluid">
<div>
<span class="span2"><label>Mapped Fixed IP Address</label> </span>
<span class="span10">: {{instance}} </span>
</div>
</div>
<div class="row-fluid">
<div>
<span class="span2"><label>Floating IP Pool</label> </span>
<span class="span10">: {{fipPool}} </span>
</div>
</div>
</div>
</div>
</script>

<script type="text/x-handlebars-template" id='fip-config-template'>
<div id="windowCreatefip" class="modal modal-700 hide" tabindex="-1">
<div class="modal-header">
Expand Down

0 comments on commit 55121f6

Please sign in to comment.