Skip to content

Commit

Permalink
Fix a few visual issues on the network topology diagram.
Browse files Browse the repository at this point in the history
This commit separates CIDR labels with a comma and adjusts the vertical
positioning of port labels for improved readability.

Change-Id: I57510033fcc309b5d570d7ee6a9369a97775719b
Fixes: bug #1199086
  • Loading branch information
Ryan Petrello committed Jul 15, 2013
1 parent 47ea680 commit b163c97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions horizon/static/horizon/js/horizon.networktopology.js
Expand Up @@ -145,14 +145,14 @@ horizon.network_topology = {
return self.model.networks.length;
},
select_cidr:function(network_id){
var cidr = "";
var cidr = [];
$.each(this.model.subnets, function(index, subnet){
if(subnet.network_id != network_id){
return;
}
cidr += subnet.cidr;
cidr.push(subnet.cidr);
});
return cidr;
return cidr.join(', ');
},
draw_devices: function(type){
var self = this;
Expand Down Expand Up @@ -191,6 +191,9 @@ horizon.network_topology = {
{height: Math.max(self.device_min_height, port_position) + "px"});
self.device_last_position += device_html.height() + self.device_margin;
$("#" + parent_network).append(device_html);
$('div.port span.ip').each(function(i, ip){
$(ip).css('top', '-'+$(ip).height()+'px');
});
});
return self.model[type + 's'].length;
},
Expand Down Expand Up @@ -234,7 +237,7 @@ horizon.network_topology = {
var port_html = $('<div class="port"><div class="dot"></div></div>');
var ip_label = "";
$.each(port.fixed_ips, function(){
ip_label += this.ip_address + " ";
ip_label += this.ip_address + "<br />";
})
var ip_html = $('<span class="ip" />').html(ip_label);
port_html
Expand Down
1 change: 0 additions & 1 deletion openstack_dashboard/static/dashboard/less/horizon.less
Expand Up @@ -2002,7 +2002,6 @@ div.network {
line-height: 1;
text-shadow: 0px -1px #fff;
position: relative;
top:-1em;
width: 90px;
display: inline-block;
padding-right:8px;
Expand Down

0 comments on commit b163c97

Please sign in to comment.