lib/nagios-dashboard/static/js/nagios-dashboard.js in nagios-dashboard-0.0.2 vs lib/nagios-dashboard/static/js/nagios-dashboard.js in nagios-dashboard-0.0.3

- old
+ new

@@ -3,17 +3,23 @@ $.getJSON('node/'+hostname, function(attributes) { var roles = ''; $.each(attributes['automatic']['roles'], function() { roles += this + ' '; }); + var ip_address = ''; + if ("ec2" in attributes['automatic']) { + ip_address = attributes['automatic']['ec2']['public_ipv4']; + } else { + ip_address = attributes['automatic']['ipaddress']; + } $('.chef_attributes').html( '<strong>Node Name: </strong><pre>'+attributes['name']+'</pre><br />' - +'<strong>Public IP: </strong><pre>'+attributes['automatic']['ec2']['public_ipv4']+'</pre><br />' + +'<strong>Public IP: </strong><pre>'+ip_address+'</pre><br />' +'<strong>Roles: </strong><pre>'+roles+'</pre>' ); }); } - ws = new WebSocket("ws://" + location.hostname + ":9000"); + ws = new WebSocket("ws://" + location.hostname + ":8000"); ws.onmessage = function(evt) { $("#messages").empty(); $("#popups_container").empty(); data = JSON.parse(evt.data); for(var msg in data) {