From c770b13903378025281ba483795dd944437efe47 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 9 Oct 2019 15:44:32 -0400 Subject: [PATCH] Fixes #3474: Fix device status page loading when NAPALM call fails --- CHANGELOG.md | 1 + netbox/templates/dcim/device_status.html | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba9a171c4..3f2fda94f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ v2.6.6 (FUTURE) ## Bug Fixes * [#3463](https://github.com/netbox-community/netbox/issues/3463) - Correct CSV headers for exported power feeds +* [#3474](https://github.com/netbox-community/netbox/issues/3474) - Fix device status page loading when NAPALM call fails * [#3571](https://github.com/netbox-community/netbox/issues/3571) - Prevent erroneous redirects when editing tags * [#3573](https://github.com/netbox-community/netbox/issues/3573) - Ensure consistent display of changelog retention period * [#3574](https://github.com/netbox-community/netbox/issues/3574) - Change `device` to `parent` in interface editing VLAN filtering logic diff --git a/netbox/templates/dcim/device_status.html b/netbox/templates/dcim/device_status.html index 5d7f0770a..ffb61286e 100644 --- a/netbox/templates/dcim/device_status.html +++ b/netbox/templates/dcim/device_status.html @@ -94,8 +94,11 @@ $(document).ready(function() { var row="" + name + "" + obj['%usage'] + "%"; $("#cpu").after(row) }); - $('#memory').after("Used" + json['get_environment']['memory']['used_ram'] + ""); - $('#memory').after("Available" + json['get_environment']['memory']['available_ram'] + ""); + if (json['get_environment']['memory']) { + var memory = $('#memory'); + memory.after("Used" + json['get_environment']['memory']['used_ram'] + ""); + memory.after("Available" + json['get_environment']['memory']['available_ram'] + ""); + } $.each(json['get_environment']['temperature'], function(name, obj) { var style = "success"; if (obj['is_alert']) {