From 44bb8e9d3df334aa607ecba46f2894afc48d66ad Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 10 Dec 2016 11:45:21 +0100 Subject: [PATCH] Use resolved data if gateway was already resolved (#78) This is now very dirty, I think the old approach was better (although it requires a server side change) --- lib/infobox/node.js | 3 +++ lib/proportions.js | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/infobox/node.js b/lib/infobox/node.js index fcc5de6..38b56e8 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -317,6 +317,9 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], if (!d) return null + if (d.node || d.id) + return d + var node = nodeDict[d.substr(0, 8)] if (!node) return d diff --git a/lib/proportions.js b/lib/proportions.js index 3d18103..cf5f80d 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -155,6 +155,12 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc if (d === null) return null + if (d.node) + return d.node.nodeinfo.hostname + + if (d.id) + return d.id + var n = nodeDict[d.substr(0, 8)] if (!n) return d @@ -169,6 +175,12 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc if (d === null) return null + if (d.node) + return d.node.nodeinfo.hostname + + if (d.id) + return d.id + var n = nodeDict[d.substr(0, 8)] if (!n) return d