From 55d08e76757ba31f263fa1ab7cf0288bc4ac9756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sat, 8 Aug 2020 19:09:34 +0200 Subject: [PATCH] fix: Properly highlight node across captures --- website/web/static/tree.js | 8 ++++++-- website/web/templates/hostname_popup.html | 3 +++ website/web/templates/macros.html | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/website/web/static/tree.js b/website/web/static/tree.js index 4336ad8..2de326d 100644 --- a/website/web/static/tree.js +++ b/website/web/static/tree.js @@ -78,8 +78,12 @@ function collapse(d) { } }; -function openTreeInNewTab(treeUUID) { - var win = window.open('/tree/' + treeUUID, '_blank'); +function openTreeInNewTab(capture_uuid, hostnode_uuid=null) { + var url = '/tree/' + capture_uuid; + if (hostnode_uuid) { + url += '/' + hostnode_uuid; + }; + var win = window.open(url, '_blank'); // FIXME: If win is None, the browser didn't allow opening a new tab, we need to inform the user. win.focus(); } diff --git a/website/web/templates/hostname_popup.html b/website/web/templates/hostname_popup.html index 4722555..8fb6cc6 100644 --- a/website/web/templates/hostname_popup.html +++ b/website/web/templates/hostname_popup.html @@ -16,6 +16,9 @@ function flag(hostname_uuid) { window.opener.PermanentNodeHighlight(hostname_uuid); }; + function openTreeInNewTab(capture_uuid, hostnode_uuid=Null) { + window.opener.openTreeInNewTab(capture_uuid, hostnode_uuid); + }