From cc5c3fac0b0e103be02550cd92f37eac32bb5506 Mon Sep 17 00:00:00 2001 From: valcryst Date: Thu, 25 Feb 2016 21:11:58 +0100 Subject: [PATCH] nodeInfos add iframes to embed grafana graphs or custom content. --- lib/infobox/node.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/infobox/node.js b/lib/infobox/node.js index cde1c8d..3e701b1 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -147,7 +147,16 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], content = document.createElement("img") content.src = o.thumbnail.replace("{NODE_ID}", nodeId) } - + + if (o.embed) { + content = document.createElement("iframe") + content.width = "98%" + content.height = "332px" + content.scrolling = "no" + content.frameBorder = "0" + content.src = o.embed.replace("{NODE_ID}", nodeId) + } + if (o.caption) { caption = o.caption.replace("{NODE_ID}", nodeId)