mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
RPC API fixes
This commit is contained in:
@ -130,8 +130,11 @@ class JunosNC(RPCClient):
|
||||
for neighbor_raw in lldp_neighbors_raw:
|
||||
neighbor = dict()
|
||||
neighbor['local-interface'] = neighbor_raw.get('lldp-local-port-id')
|
||||
neighbor['name'] = neighbor_raw.get('lldp-remote-system-name')
|
||||
neighbor['name'] = neighbor['name'].split('.')[0] # Split hostname from domain if one is present
|
||||
name = neighbor_raw.get('lldp-remote-system-name')
|
||||
if name:
|
||||
neighbor['name'] = name.split('.')[0] # Split hostname from domain if one is present
|
||||
else:
|
||||
neighbor['name'] = ''
|
||||
try:
|
||||
neighbor['remote-interface'] = neighbor_raw['lldp-remote-port-description']
|
||||
except KeyError:
|
||||
|
@ -47,7 +47,7 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$.ajax({
|
||||
url: "{% url 'dcim-api:device_lldp-neighbors' pk=device.pk %}",
|
||||
url: "{% url 'dcim-api:device-lldp-neighbors' pk=device.pk %}",
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
$.each(json, function(i, neighbor) {
|
||||
@ -66,6 +66,9 @@ $(document).ready(function() {
|
||||
row.addClass('danger');
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(xhr) {
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user