diff --git a/api/get_mac_oui_count_by_vendor.js b/api/get_mac_oui_count_by_vendor.js index 84298f9..42cc384 100644 --- a/api/get_mac_oui_count_by_vendor.js +++ b/api/get_mac_oui_count_by_vendor.js @@ -10,7 +10,7 @@ router.get('/', function (req, res, next) { /* Mac OUI Lookup */ var mac_oui = ""; - if (typeof dhcp_lease_data[key].mac.split(":").join("") !== "undefined") { + if (typeof dhcp_lease_data[key].mac !== "undefined") { mac_oui = dhcp_lease_data[key].mac.split(":").join("").toUpperCase().slice(0, 6); } @@ -41,4 +41,4 @@ router.get('/', function (req, res, next) { res.send(JSON.stringify(stat_data)); }); -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/routes/dhcp_lease_search.js b/routes/dhcp_lease_search.js index ae28477..0e42839 100644 --- a/routes/dhcp_lease_search.js +++ b/routes/dhcp_lease_search.js @@ -49,11 +49,14 @@ router.post('/', function(req, res, next) { table_row = table_row + '' + (dhcp_lease_data[key].host ? dhcp_lease_data[key].host : '') + ''; table_row = table_row + '' + human_time(dhcp_lease_data[key].start * 1000) + ''; table_row = table_row + '' + human_time(dhcp_lease_data[key].end * 1000) + ''; - table_row = table_row + '' + + if (typeof dhcp_lease_data[key].mac !== "undefined" ) { + table_row = table_row + '' + '' + '' + ''; - + } else { + table_row = table_row + ''; + } table_data = table_data + '' + table_row + ''; count++; @@ -69,4 +72,4 @@ router.post('/', function(req, res, next) { res.send(table_data); }); -module.exports = router; \ No newline at end of file +module.exports = router;