diff --git a/ui/scripts/cloud.core.alert.js b/ui/scripts/cloud.core.alert.js index bee6007cdfe..4fdf32e18b0 100644 --- a/ui/scripts/cloud.core.alert.js +++ b/ui/scripts/cloud.core.alert.js @@ -46,8 +46,8 @@ function alertJsonToDetailsTab() { var jsonObj = $midmenuItem1.data("jsonObj"); $thisTab.data("jsonObj", jsonObj); - $thisTab.find("#type").text(jsonObj.type); - $thisTab.find("#description").text(jsonObj.description); + $thisTab.find("#type").text(fromdb(jsonObj.type)); + $thisTab.find("#description").text(fromdb(jsonObj.description)); setDateField(jsonObj.sent, $thisTab.find("#sent")); $thisTab.find("#tab_spinning_wheel").hide(); diff --git a/ui/scripts/cloud.core.cluster.js b/ui/scripts/cloud.core.cluster.js index 5ec471b4320..81e54c2a5a9 100644 --- a/ui/scripts/cloud.core.cluster.js +++ b/ui/scripts/cloud.core.cluster.js @@ -49,7 +49,8 @@ function clusterJsonToRightPanel($leftmenuItem1) { function clusterJsonToDetailsTab($leftmenuItem1) { var jsonObj = $leftmenuItem1.data("jsonObj"); var $detailsTab = $("#tab_content_details"); - $detailsTab.data("jsonObj", jsonObj); + $detailsTab.data("jsonObj", jsonObj); + $detailsTab.find("#id").text(fromdb(jsonObj.id)); $detailsTab.find("#name").text(fromdb(jsonObj.name)); $detailsTab.find("#zonename").text(fromdb(jsonObj.zonename)); diff --git a/ui/scripts/cloud.core.diskoffering.js b/ui/scripts/cloud.core.diskoffering.js index 61b7861bd34..d14c1c7b95d 100644 --- a/ui/scripts/cloud.core.diskoffering.js +++ b/ui/scripts/cloud.core.diskoffering.js @@ -206,7 +206,7 @@ function diskOfferingJsonToDetailsTab() { $thisTab.data("jsonObj", jsonObj); $midmenuItem1.data("jsonObj", jsonObj); - $thisTab.find("#id").text(jsonObj.id); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); $thisTab.find("#name").text(fromdb(jsonObj.name)); diff --git a/ui/scripts/cloud.core.domain.js b/ui/scripts/cloud.core.domain.js index d9c61982e2c..97cc71e560d 100644 --- a/ui/scripts/cloud.core.domain.js +++ b/ui/scripts/cloud.core.domain.js @@ -69,12 +69,12 @@ function drawNode(json, level, container) { var template = $("#domain_tree_node_template").clone(true); template.find("#domain_indent").css("marginLeft", (30*(level+1))); - template.attr("id", "domain_"+json.id); + template.attr("id", "domain_"+noNull(json.id)); template.data("jsonObj", json).data("domainLevel", level); - template.find("#domain_title_container").attr("id", "domain_title_container_"+json.id); - template.find("#domain_expand_icon").attr("id", "domain_expand_icon_"+json.id); - template.find("#domain_name").attr("id", "domain_name_"+json.id).text(json.name); - template.find("#domain_children_container").attr("id", "domain_children_container_"+json.id); + template.find("#domain_title_container").attr("id", "domain_title_container_"+noNull(json.id)); + template.find("#domain_expand_icon").attr("id", "domain_expand_icon_"+noNull(json.id)); + template.find("#domain_name").attr("id", "domain_name_"+noNull(json.id)).text(fromdb(json.name)); + template.find("#domain_children_container").attr("id", "domain_children_container_"+noNull(json.id)); container.append(template.show()); return template; } diff --git a/ui/scripts/cloud.core.event.js b/ui/scripts/cloud.core.event.js index 356b3068021..f8191ea37a7 100644 --- a/ui/scripts/cloud.core.event.js +++ b/ui/scripts/cloud.core.event.js @@ -32,8 +32,8 @@ function eventToMidmenu(jsonObj, $midmenuItem1) { else if(jsonObj.level == "WARN") $iconContainer.find("#icon").attr("src", "images/midmenuicon_events_warning.png"); - $midmenuItem1.find("#first_row").text(jsonObj.description.substring(0,25)); - $midmenuItem1.find("#second_row").text(jsonObj.type.substring(0,25)); + $midmenuItem1.find("#first_row").text(fromdb(jsonObj.description).substring(0,25)); + $midmenuItem1.find("#second_row").text(fromdb(jsonObj.type).substring(0,25)); } function eventToRightPanel($midmenuItem1) { @@ -51,13 +51,13 @@ function eventJsonToDetailsTab() { var jsonObj = $midmenuItem1.data("jsonObj"); $thisTab.data("jsonObj", jsonObj); - $thisTab.find("#id").text(fromdb(jsonObj.id)); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#username").text(fromdb(jsonObj.username)); $thisTab.find("#account").text(fromdb(jsonObj.account)); - $thisTab.find("#type").text(jsonObj.type); - $thisTab.find("#level").text(jsonObj.level); + $thisTab.find("#type").text(fromdb(jsonObj.type)); + $thisTab.find("#level").text(fromdb(jsonObj.level)); $thisTab.find("#description").text(fromdb(jsonObj.description)); - $thisTab.find("#state").text(jsonObj.state); + $thisTab.find("#state").text(fromdb(jsonObj.state)); setDateField(jsonObj.created, $thisTab.find("#created")); $thisTab.find("#tab_spinning_wheel").hide(); diff --git a/ui/scripts/cloud.core.host.js b/ui/scripts/cloud.core.host.js index fb191db4a0c..75ff26d0919 100644 --- a/ui/scripts/cloud.core.host.js +++ b/ui/scripts/cloud.core.host.js @@ -66,7 +66,7 @@ function hostJsonToDetailsTab() { var jsonObj = $midmenuItem1.data("jsonObj"); $thisTab.data("jsonObj", jsonObj); - $thisTab.find("#id").text(fromdb(jsonObj.id)); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); $thisTab.find("#name").text(fromdb(jsonObj.name)); diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 41f3d1379db..508fabdb016 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -1322,7 +1322,7 @@ function vmJsonToDetailsTab(){ resetViewConsoleAction(jsonObj, $thisTab); setVmStateInRightPanel(jsonObj.state, $thisTab.find("#state")); - $thisTab.find("#ipAddress").text(jsonObj.ipaddress); + $thisTab.find("#ipAddress").text(noNull(jsonObj.ipaddress)); $thisTab.find("#zoneName").text(fromdb(jsonObj.zonename)); @@ -1347,7 +1347,6 @@ function vmJsonToDetailsTab(){ setBooleanReadField(jsonObj.haenable, $thisTab.find("#haenable")); setBooleanEditField(jsonObj.haenable, $thisTab.find("#haenable_edit")); - //$thisTab.find("#haenable_edit").val(jsonObj.haenable); setBooleanReadField((jsonObj.isoid != null), $thisTab.find("#iso")); @@ -1533,15 +1532,15 @@ var vmVolumeActionMap = { } function vmVolumeJSONToTemplate(json, $template) { - $template.attr("id","vm_volume_"+json.id); + $template.attr("id","vm_volume_"+noNull(json.id)); $template.data("jsonObj", json); $template.find("#title").text(fromdb(json.name)); - $template.find("#id").text(json.id); + $template.find("#id").text(noNull(json.id)); $template.find("#name").text(fromdb(json.name)); if (json.storagetype == "shared") - $template.find("#type").text(json.type + " (shared storage)"); + $template.find("#type").text(fromdb(json.type) + " (shared storage)"); else - $template.find("#type").text(json.type + " (local storage)"); + $template.find("#type").text(fromdb(json.type) + " (local storage)"); $template.find("#size").text((json.size == "0") ? "" : convertBytes(json.size)); setDateField(json.created, $template.find("#created")); @@ -1591,8 +1590,8 @@ function vmRouterJSONToTemplate(jsonObj, $template) { $template.find("#title").text(fromdb(jsonObj.name)); resetViewConsoleAction(jsonObj, $template); - setVmStateInRightPanel(jsonObj.state, $template.find("#state")); - $template.find("#ipAddress").text(jsonObj.publicip); + setVmStateInRightPanel(fromdb(jsonObj.state), $template.find("#state")); + $template.find("#ipAddress").text(noNull(jsonObj.publicip)); $template.find("#zonename").text(fromdb(jsonObj.zonename)); $template.find("#name").text(fromdb(jsonObj.name)); diff --git a/ui/scripts/cloud.core.ipaddress.js b/ui/scripts/cloud.core.ipaddress.js index 1a4bf472902..e136fcfc1fa 100644 --- a/ui/scripts/cloud.core.ipaddress.js +++ b/ui/scripts/cloud.core.ipaddress.js @@ -223,28 +223,18 @@ function ipToRightPanel($midmenuItem1) { copyActionInfoFromMidMenuToRightPanel($midmenuItem1); $("#right_panel_content").data("$midmenuItem1", $midmenuItem1); - $("#tab_details").click(); - - - //Details tab - //ipJsonToDetailsTab($midmenuItem1); - //ipJsonToDetailsTab(); - + $("#tab_details").click(); + //Port Forwarding tab, Load Balancer tab if(isIpManageable(ipObj.domainid, ipObj.account) == true) { $("#tab_port_forwarding, #tab_load_balancer").show(); // Only show VPN tab if the IP is the source nat IP if (ipObj.issourcenat == true) { $("#tab_vpn").show(); - } - //ipJsonToPortForwardingTab(); - //ipJsonToLoadBalancerTab(); + } } else { - $("#tab_port_forwarding, #tab_load_balancer, #tab_vpn").hide(); - //ipClearPortForwardingTab(); - //ipClearLoadBalancerTab(); - //$("#tab_details").click(); + $("#tab_port_forwarding, #tab_load_balancer, #tab_vpn").hide(); } } @@ -258,8 +248,8 @@ function ipJsonToPortForwardingTab() { refreshCreatePortForwardingRow(); - var ipAddress = ipObj.ipaddress; - if(ipAddress == null || ipAddress.length == 0) + var ipAddress = noNull(ipObj.ipaddress); + if(ipAddress.length == 0) return; $.ajax({ data: createURL("command=listPortForwardingRules&ipaddress=" + ipAddress), @@ -291,8 +281,8 @@ function ipJsonToLoadBalancerTab() { refreshCreateLoadBalancerRow(); - var ipAddress = ipObj.ipaddress; - if(ipAddress == null || ipAddress.length == 0) + var ipAddress = noNull(ipObj.ipaddress); + if(ipAddress.length == 0) return; $.ajax({ data: createURL("command=listLoadBalancerRules&publicip="+ipAddress), @@ -699,7 +689,7 @@ function ipJsonToDetailsTab() { $thisTab.find("#tab_spinning_wheel").show(); var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1"); - var ipaddress = $midmenuItem1.data("jsonObj").ipaddress; + var ipaddress = noNull($midmenuItem1.data("jsonObj").ipaddress); var ipObj; $.ajax({ @@ -714,8 +704,9 @@ function ipJsonToDetailsTab() { }); $thisTab.data("jsonObj", ipObj); $midmenuItem1.data("jsonObj", ipObj); - - $thisTab.find("#ipaddress").text(fromdb(ipObj.ipaddress)); + + $thisTab.find("#grid_header_title").text(noNull(ipObj.ipaddress)); + $thisTab.find("#ipaddress").text(noNull(ipObj.ipaddress)); $thisTab.find("#zonename").text(fromdb(ipObj.zonename)); $thisTab.find("#vlanname").text(fromdb(ipObj.vlanname)); setSourceNatField(ipObj.issourcenat, $thisTab.find("#source_nat")); @@ -820,29 +811,27 @@ function ipClearPortForwardingTab() { refreshCreatePortForwardingRow(); } -//var portForwardingIndex = 0; function portForwardingJsonToTemplate(jsonObj, $template) { - //(portForwardingIndex++ % 2 == 0)? $template.find("#row_container").addClass("smallrow_even"): $template.find("#row_container").addClass("smallrow_odd"); - $template.attr("id", "portForwarding_" + jsonObj.id).data("portForwardingId", jsonObj.id); + $template.attr("id", "portForwarding_" + noNull(jsonObj.id)).data("portForwardingId", noNull(jsonObj.id)); - $template.find("#row_container #public_port").text(jsonObj.publicport); - $template.find("#row_container_edit #public_port").text(jsonObj.publicport); + $template.find("#row_container #public_port").text(noNull(jsonObj.publicport)); + $template.find("#row_container_edit #public_port").text(noNull(jsonObj.publicport)); - $template.find("#row_container #private_port").text(jsonObj.privateport); - $template.find("#row_container_edit #private_port").val(jsonObj.privateport); + $template.find("#row_container #private_port").text(noNull(jsonObj.privateport)); + $template.find("#row_container_edit #private_port").val(noNull(jsonObj.privateport)); - $template.find("#row_container #protocol").text(jsonObj.protocol); - $template.find("#row_container_edit #protocol").text(jsonObj.protocol); + $template.find("#row_container #protocol").text(fromdb(jsonObj.protocol)); + $template.find("#row_container_edit #protocol").text(fromdb(jsonObj.protocol)); var vmName = getVmName(jsonObj.vmname, jsonObj.vmdisplayname); //jsonObj doesn't include vmdisplayname property(incorrect). Waiting for Bug 6241 to be fixed.... $template.find("#row_container #vm_name").text(vmName); - var virtualMachineId = jsonObj.virtualmachineid; + var virtualMachineId = noNull(jsonObj.virtualmachineid); var $detailsTab = $("#right_panel_content #tab_content_details"); var ipObj = $detailsTab.data("jsonObj"); - var ipAddress = ipObj.ipaddress; - var IpDomainid = ipObj.domainid; - var IpAccount = ipObj.account; + var ipAddress = noNull(ipObj.ipaddress); + var IpDomainid = noNull(ipObj.domainid); + var IpAccount = fromdb(ipObj.account); $.ajax({ data: createURL("command=listVirtualMachines&domainid="+IpDomainid+"&account="+IpAccount), @@ -852,7 +841,7 @@ function portForwardingJsonToTemplate(jsonObj, $template) { var vmSelect = $template.find("#row_container_edit #vm").empty(); if (instances != null && instances.length > 0) { for (var i = 0; i < instances.length; i++) { - var html = $(""); + var html = $(""); vmSelect.append(html); } vmSelect.val(virtualMachineId); @@ -868,7 +857,7 @@ function portForwardingJsonToTemplate(jsonObj, $template) { $spinningWheel.find("#description").text("Deleting...."); $spinningWheel.show(); $.ajax({ - data: createURL("command=deletePortForwardingRule&id="+jsonObj.id), + data: createURL("command=deletePortForwardingRule&id="+noNull(jsonObj.id)), dataType: "json", success: function(json) { $template.slideUp("slow", function(){ @@ -997,22 +986,20 @@ function ipClearLoadBalancerTab() { } function loadBalancerJsonToTemplate(jsonObj, $template) { - //(loadBalancerIndex++ % 2 == 0)? $template.find("#row_container").addClass("smallrow_even"): $template.find("#row_container").addClass("smallrow_odd"); - - var loadBalancerId = jsonObj.id; + var loadBalancerId = noNull(jsonObj.id); $template.attr("id", "loadBalancer_" + loadBalancerId).data("loadBalancerId", loadBalancerId); $template.find("#row_container #name").text(fromdb(jsonObj.name)); $template.find("#row_container_edit #name").val(fromdb(jsonObj.name)); - $template.find("#row_container #public_port").text(jsonObj.publicport); - $template.find("#row_container_edit #public_port").text(jsonObj.publicport); + $template.find("#row_container #public_port").text(noNull(jsonObj.publicport)); + $template.find("#row_container_edit #public_port").text(noNull(jsonObj.publicport)); - $template.find("#row_container #private_port").text(jsonObj.privateport); - $template.find("#row_container_edit #private_port").val(jsonObj.privateport); + $template.find("#row_container #private_port").text(noNull(jsonObj.privateport)); + $template.find("#row_container_edit #private_port").val(noNull(jsonObj.privateport)); - $template.find("#row_container #algorithm").text(jsonObj.algorithm); - $template.find("#row_container_edit #algorithm").val(jsonObj.algorithm); + $template.find("#row_container #algorithm").text(fromdb(jsonObj.algorithm)); + $template.find("#row_container_edit #algorithm").val(fromdb(jsonObj.algorithm)); $template.find("#manage_link").unbind("click").bind("click", function(event){ var $managementArea = $template.find("#management_area"); @@ -1259,13 +1246,13 @@ function refreshCreateLoadBalancerRow() { function lbVmObjToTemplate(obj, $template) { $template.find("#vm_name").text(obj.vmName); - $template.find("#vm_private_ip").text(obj.vmPrivateIp); + $template.find("#vm_private_ip").text(noNull(obj.vmPrivateIp)); $template.find("#remove_link").bind("click", function(event){ var $spinningWheel = $template.find("#spinning_wheel"); $spinningWheel.show(); $.ajax({ - data: createURL("command=removeFromLoadBalancerRule&id="+obj.loadBalancerId+"&virtualmachineid="+obj.vmId), + data: createURL("command=removeFromLoadBalancerRule&id="+noNull(obj.loadBalancerId)+"&virtualmachineid="+noNull(obj.vmId)), dataType: "json", success: function(json) { var lbJSON = json.removefromloadbalancerruleresponse; diff --git a/ui/scripts/cloud.core.iso.js b/ui/scripts/cloud.core.iso.js index b8d991780f6..d6ef0f0e242 100644 --- a/ui/scripts/cloud.core.iso.js +++ b/ui/scripts/cloud.core.iso.js @@ -217,7 +217,7 @@ function isoJsonToDetailsTab() { $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); - $thisTab.find("#id").text(fromdb(jsonObj.id)); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#zonename").text(fromdb(jsonObj.zonename)); $thisTab.find("#name").text(fromdb(jsonObj.name)); @@ -226,7 +226,7 @@ function isoJsonToDetailsTab() { $thisTab.find("#displaytext").text(fromdb(jsonObj.displaytext)); $thisTab.find("#displaytext_edit").val(fromdb(jsonObj.displaytext)); $thisTab.find("#ostypename").text(fromdb(jsonObj.ostypename)); - $thisTab.find("#ostypename_edit").val(jsonObj.ostypeid); + $thisTab.find("#ostypename_edit").val(noNull(jsonObj.ostypeid)); $thisTab.find("#account").text(fromdb(jsonObj.account)); $thisTab.find("#domain").text(fromdb(jsonObj.domain)); diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index 6249fafdf64..6084ae91642 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -53,7 +53,7 @@ function podJsonToDetailsTab() { var jsonObj = $leftmenuItem1.data("jsonObj"); $thisTab.data("jsonObj", jsonObj); - $thisTab.find("#id").text(fromdb(jsonObj.id)); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); $thisTab.find("#name").text(fromdb(jsonObj.name)); @@ -73,7 +73,7 @@ function podJsonToDetailsTab() { // hide network tab upon zone vlan var zoneVlan; $.ajax({ - data: createURL("command=listZones&id="+jsonObj.zoneid), + data: createURL("command=listZones&id="+noNull(jsonObj.zoneid)), dataType: "json", async: false, success: function(json) { @@ -125,7 +125,7 @@ function podJsonToNetworkTab() { var jsonObj = $leftmenuItem1.data("jsonObj"); $.ajax({ - data: createURL("command=listVlanIpRanges&zoneid="+jsonObj.zoneid+"&podid="+jsonObj.id), + data: createURL("command=listVlanIpRanges&zoneid="+noNull(jsonObj.zoneid)+"&podid="+noNull(jsonObj.id)), dataType: "json", success: function(json) { var items = json.listvlaniprangesresponse.vlaniprange; @@ -146,13 +146,13 @@ function podJsonToNetworkTab() { function podNetworkJsonToTemplate(jsonObj, template) { template.data("jsonObj", jsonObj); - template.attr("id", "pod_VLAN_"+jsonObj.id).data("podVLANId", jsonObj.id); + template.attr("id", "pod_VLAN_"+noNull(jsonObj.id)).data("podVLANId", noNull(jsonObj.id)); template.find("#grid_header_title").text(fromdb(jsonObj.description)); - template.find("#id").text(jsonObj.id); - template.find("#iprange").text(jsonObj.description); - template.find("#netmask").text(jsonObj.netmask); - template.find("#gateway").text(jsonObj.gateway); - template.find("#podname").text(jsonObj.podname); + template.find("#id").text(noNull(jsonObj.id)); + template.find("#iprange").text(fromdb(jsonObj.description)); + template.find("#netmask").text(noNull(jsonObj.netmask)); + template.find("#gateway").text(noNull(jsonObj.gateway)); + template.find("#podname").text(fromdb(jsonObj.podname)); var $actionLink = template.find("#network_action_link"); $actionLink.bind("mouseover", function(event) { diff --git a/ui/scripts/cloud.core.primarystorage.js b/ui/scripts/cloud.core.primarystorage.js index c9339049b85..bb42a1a8d59 100644 --- a/ui/scripts/cloud.core.primarystorage.js +++ b/ui/scripts/cloud.core.primarystorage.js @@ -52,8 +52,9 @@ function primarystorageToRightPanel($midmenuItem1) { function primarystorageJsonToDetailsTab($midmenuItem1) { var jsonObj = $midmenuItem1.data("jsonObj"); var $detailsTab = $("#tab_content_details"); - $detailsTab.data("jsonObj", jsonObj); - $detailsTab.find("#id").text(fromdb(jsonObj.id)); + $detailsTab.data("jsonObj", jsonObj); + + $detailsTab.find("#id").text(noNull(jsonObj.id)); $detailsTab.find("#grid_header_title").text(fromdb(jsonObj.name)); $detailsTab.find("#name").text(fromdb(jsonObj.name)); @@ -63,9 +64,10 @@ function primarystorageJsonToDetailsTab($midmenuItem1) { $detailsTab.find("#podname").text(fromdb(jsonObj.podname)); $detailsTab.find("#clustername").text(fromdb(jsonObj.clustername)); var storageType = "ISCSI Share"; - if (jsonObj.type == 'NetworkFilesystem') storageType = "NFS Share"; - $detailsTab.find("#type").text(storageType); - $detailsTab.find("#ipaddress").text(fromdb(jsonObj.ipaddress)); + if (jsonObj.type == 'NetworkFilesystem') + storageType = "NFS Share"; + $detailsTab.find("#type").text(fromdb(storageType)); + $detailsTab.find("#ipaddress").text(noNull(jsonObj.ipaddress)); $detailsTab.find("#path").text(fromdb(jsonObj.path)); $detailsTab.find("#disksizetotal").text(convertBytes(jsonObj.disksizetotal)); $detailsTab.find("#disksizeallocated").text(convertBytes(jsonObj.disksizeallocated)); diff --git a/ui/scripts/cloud.core.router.js b/ui/scripts/cloud.core.router.js index 74871ad7cd1..b486261603e 100644 --- a/ui/scripts/cloud.core.router.js +++ b/ui/scripts/cloud.core.router.js @@ -25,8 +25,7 @@ function routerToMidmenu(jsonObj, $midmenuItem1) { $midmenuItem1.data("jsonObj", jsonObj); $midmenuItem1.find("#first_row").text(jsonObj.name.substring(0,25)); - if(jsonObj.publicip != null) //jsonObj.publicip is null while router state is Stopped - $midmenuItem1.find("#second_row").text(jsonObj.publicip.substring(0,25)); + $midmenuItem1.find("#second_row").text(fromdb(jsonObj.publicip).substring(0,25)); updateVmStateInMidMenu(jsonObj, $midmenuItem1); } diff --git a/ui/scripts/cloud.core.serviceoffering.js b/ui/scripts/cloud.core.serviceoffering.js index 01b5c1ced23..f5b0a35b396 100644 --- a/ui/scripts/cloud.core.serviceoffering.js +++ b/ui/scripts/cloud.core.serviceoffering.js @@ -216,7 +216,7 @@ function serviceOfferingJsonToDetailsTab() { $thisTab.data("jsonObj", jsonObj); $midmenuItem1.data("jsonObj", jsonObj); - $thisTab.find("#id").text(jsonObj.id); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); $thisTab.find("#name").text(fromdb(jsonObj.name)); @@ -225,7 +225,7 @@ function serviceOfferingJsonToDetailsTab() { $thisTab.find("#displaytext").text(fromdb(jsonObj.displaytext)); $thisTab.find("#displaytext_edit").val(fromdb(jsonObj.displaytext)); - $thisTab.find("#storagetype").text(jsonObj.storagetype); + $thisTab.find("#storagetype").text(fromdb(jsonObj.storagetype)); $thisTab.find("#cpu").text(jsonObj.cpunumber + " x " + convertHz(jsonObj.cpuspeed)); $thisTab.find("#memory").text(convertBytes(parseInt(jsonObj.memory)*1024*1024)); diff --git a/ui/scripts/cloud.core.systemvm.js b/ui/scripts/cloud.core.systemvm.js index 5c1029a7a00..25f4b4095b4 100644 --- a/ui/scripts/cloud.core.systemvm.js +++ b/ui/scripts/cloud.core.systemvm.js @@ -56,10 +56,10 @@ function systemvmJsonToDetailsTab() { $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); resetViewConsoleAction(jsonObj, $thisTab); - setVmStateInRightPanel(jsonObj.state, $thisTab.find("#state")); - $thisTab.find("#ipAddress").text(jsonObj.publicip); + setVmStateInRightPanel(fromdb(jsonObj.state), $thisTab.find("#state")); + $thisTab.find("#ipAddress").text(noNull(jsonObj.publicip)); - $thisTab.find("#state").text(jsonObj.state); + $thisTab.find("#state").text(fromdb(jsonObj.state)); $thisTab.find("#systemvmtype").text(toSystemVMTypeText(jsonObj.systemvmtype)); $thisTab.find("#zonename").text(fromdb(jsonObj.zonename)); $thisTab.find("#id").text(fromdb(jsonObj.id)); diff --git a/ui/scripts/cloud.core.template.js b/ui/scripts/cloud.core.template.js index ea732fc4baf..0bd1403d57e 100644 --- a/ui/scripts/cloud.core.template.js +++ b/ui/scripts/cloud.core.template.js @@ -243,7 +243,7 @@ function templateJsonToDetailsTab() { $thisTab.find("#grid_header_title").text(fromdb(jsonObj.name)); - $thisTab.find("#id").text(fromdb(jsonObj.id)); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#zonename").text(fromdb(jsonObj.zonename)); $thisTab.find("#name").text(fromdb(jsonObj.name)); @@ -264,15 +264,12 @@ function templateJsonToDetailsTab() { setBooleanReadField(jsonObj.passwordenabled, $thisTab.find("#passwordenabled")); setBooleanEditField(jsonObj.passwordenabled, $thisTab.find("#passwordenabled_edit")); - //$thisTab.find("#passwordenabled_edit").val(jsonObj.passwordenabled); - + setBooleanReadField(jsonObj.ispublic, $thisTab.find("#ispublic")); setBooleanEditField(jsonObj.ispublic, $thisTab.find("#ispublic_edit")); - //$thisTab.find("#ispublic_edit").val(jsonObj.ispublic); setBooleanReadField(jsonObj.isfeatured, $thisTab.find("#isfeatured")); setBooleanEditField(jsonObj.isfeatured, $thisTab.find("#isfeatured_edit")); - //$thisTab.find("#isfeatured_edit").val(jsonObj.isfeatured); setBooleanReadField(jsonObj.crossZones, $thisTab.find("#crossZones")); diff --git a/ui/scripts/cloud.core.volume.js b/ui/scripts/cloud.core.volume.js index e0c578d1bca..87e4f4da684 100644 --- a/ui/scripts/cloud.core.volume.js +++ b/ui/scripts/cloud.core.volume.js @@ -309,7 +309,7 @@ function volumeJsonToDetailsTab(){ $thisTab.find("#tab_spinning_wheel").show(); var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1"); - var id = $midmenuItem1.data("jsonObj").id; + var id = noNull($midmenuItem1.data("jsonObj").id); var jsonObj; $.ajax({ @@ -325,7 +325,7 @@ function volumeJsonToDetailsTab(){ $thisTab.data("jsonObj", jsonObj); $midmenuItem1.data("jsonObj", jsonObj); - $thisTab.find("#id").text(fromdb(jsonObj.id)); + $thisTab.find("#id").text(noNull(jsonObj.id)); $thisTab.find("#name").text(fromdb(jsonObj.name)); $thisTab.find("#zonename").text(fromdb(jsonObj.zonename)); $thisTab.find("#device_id").text(fromdb(jsonObj.deviceid)); @@ -374,7 +374,7 @@ function volumeJsonToDetailsTab(){ $thisTab.find("#tab_container").show(); } -function volumeJsonToSnapshotTab() { +function volumeJsonToSnapshotTab() { var $thisTab = $("#right_panel_content #tab_content_snapshot"); $thisTab.find("#tab_container").hide(); $thisTab.find("#tab_spinning_wheel").show(); @@ -384,7 +384,7 @@ function volumeJsonToSnapshotTab() { $.ajax({ cache: false, - data: createURL("command=listSnapshots&volumeid="+jsonObj.id+maxPageSize), + data: createURL("command=listSnapshots&volumeid="+noNull(jsonObj.id)), dataType: "json", success: function(json) { var items = json.listsnapshotsresponse.snapshot; @@ -405,12 +405,12 @@ function volumeJsonToSnapshotTab() { function volumeSnapshotJSONToTemplate(jsonObj, template) { template.data("jsonObj", jsonObj); - template.attr("id", "volume_snapshot_"+jsonObj.id).data("volumeSnapshotId", jsonObj.id); + template.attr("id", "volume_snapshot_"+noNull(jsonObj.id)).data("volumeSnapshotId", noNull(jsonObj.id)); template.find("#grid_header_title").text(fromdb(jsonObj.name)); - template.find("#id").text(jsonObj.id); + template.find("#id").text(noNull(jsonObj.id)); template.find("#name").text(fromdb(jsonObj.name)); template.find("#volumename").text(fromdb(jsonObj.volumename)); - template.find("#intervaltype").text(jsonObj.intervaltype); + template.find("#intervaltype").text(fromdb(jsonObj.intervaltype)); template.find("#account").text(fromdb(jsonObj.account)); template.find("#domain").text(fromdb(jsonObj.domain)); setDateField(jsonObj.created, template.find("#created")); diff --git a/ui/scripts/cloud.core.zone.js b/ui/scripts/cloud.core.zone.js index 5e7d5f06521..1e12c34b669 100644 --- a/ui/scripts/cloud.core.zone.js +++ b/ui/scripts/cloud.core.zone.js @@ -61,8 +61,9 @@ function zoneJsonClearRightPanel() { function zoneJsonToDetailsTab($leftmenuItem1) { var jsonObj = $leftmenuItem1.data("jsonObj"); var $detailsTab = $("#tab_content_details"); - $detailsTab.data("jsonObj", jsonObj); - $detailsTab.find("#id").text(jsonObj.id); + $detailsTab.data("jsonObj", jsonObj); + + $detailsTab.find("#id").text(noNull(jsonObj.id)); $detailsTab.find("#title").text(fromdb(jsonObj.name)); $detailsTab.find("#name").text(fromdb(jsonObj.name));