From b5cf31857faab92625dd2c6e80797cfec0f2b851 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 8 Dec 2010 13:24:41 -0800 Subject: [PATCH] bug 7448: Direct Network page - implement "IP Allocation" tab. --- ui/jsp/network.jsp | 29 ++++++++++++++++++++++ ui/scripts/cloud.core.network.js | 41 ++++++++++++++++++++++++-------- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/ui/jsp/network.jsp b/ui/jsp/network.jsp index db1b514178a..0b81ea876b0 100644 --- a/ui/jsp/network.jsp +++ b/ui/jsp/network.jsp @@ -177,3 +177,32 @@ + + + + \ No newline at end of file diff --git a/ui/scripts/cloud.core.network.js b/ui/scripts/cloud.core.network.js index 7fed9705d77..95bc1796d0e 100644 --- a/ui/scripts/cloud.core.network.js +++ b/ui/scripts/cloud.core.network.js @@ -72,9 +72,8 @@ function directNetworkToMidmenu(jsonObj, $midmenuItem1) { $iconContainer.find("#icon").attr("src", "images/midmenuicon_storage_snapshots.png"); */ - $midmenuItem1.find("#first_row").text("VLAN " + fromdb(jsonObj.vlan)); - $midmenuItem1.find("#second_row").text(fromdb(getIpRange(jsonObj.startip, jsonObj.endip))); - + $midmenuItem1.find("#first_row").text(fromdb(jsonObj.name).substring(0,25)); + $midmenuItem1.find("#second_row").text("VLAN " + fromdb(jsonObj.vlan)); } function directNetworkToRightPanel($midmenuItem1) { @@ -133,12 +132,34 @@ function directNetworkJsonToIpAllocationTab() { var $thisTab = $("#right_panel_content #direct_network_page #tab_content_ipallocation"); $thisTab.find("#tab_container").hide(); $thisTab.find("#tab_spinning_wheel").show(); - - - - - - $thisTab.find("#tab_container").show(); - $thisTab.find("#tab_spinning_wheel").hide(); + + $.ajax({ + data: createURL("command=listVlanIpRanges&zoneid="+ jsonObj.zoneid + "&networkid="+jsonObj.id), + dataType: "json", + success: function(json) { + var items = json.listvlaniprangesresponse.vlaniprange; + var $container = $thisTab.find("#tab_container").empty(); + var $template = $("#directnetwork_iprange_template"); + if(items != null && items.length > 0) { + for(var i=0; i