mirror of https://github.com/CIRCL/lookyloo
fix: Properly highlight node across captures
parent
db8e79677e
commit
55d08e7675
|
@ -78,8 +78,12 @@ function collapse(d) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function openTreeInNewTab(treeUUID) {
|
function openTreeInNewTab(capture_uuid, hostnode_uuid=null) {
|
||||||
var win = window.open('/tree/' + treeUUID, '_blank');
|
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.
|
// FIXME: If win is None, the browser didn't allow opening a new tab, we need to inform the user.
|
||||||
win.focus();
|
win.focus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
function flag(hostname_uuid) {
|
function flag(hostname_uuid) {
|
||||||
window.opener.PermanentNodeHighlight(hostname_uuid);
|
window.opener.PermanentNodeHighlight(hostname_uuid);
|
||||||
};
|
};
|
||||||
|
function openTreeInNewTab(capture_uuid, hostnode_uuid=Null) {
|
||||||
|
window.opener.openTreeInNewTab(capture_uuid, hostnode_uuid);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
// Source: https://codepen.io/nathanlong/pen/ZpAmjv
|
// Source: https://codepen.io/nathanlong/pen/ZpAmjv
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for capture_uuid, urlnode_uuid, title, hostname in details['different_url'] %}
|
{% for capture_uuid, urlnode_uuid, title, hostname in details['different_url'] %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ url_for('tree', tree_uuid=capture_uuid, urlnode_uuid=urlnode_uuid) }}">{{ title }}</a> - {{ hostname }}
|
<a href="#/" onclick="openTreeInNewTab('{{ capture_uuid }}', '{{ urlnode_uuid }}')">{{ title }}</a> - {{ hostname }}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
{% for capture_uuid, urlnode_uuid, title, hostname in details['same_url'] %}
|
{% for capture_uuid, urlnode_uuid, title, hostname in details['same_url'] %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ url_for('tree', tree_uuid=capture_uuid, urlnode_uuid=urlnode_uuid) }}">{{ title }}</a> - {{ hostname }}
|
<a href="#/" onclick="openTreeInNewTab('{{ capture_uuid }}', '{{ urlnode_uuid }}')">{{ title }}</a> - {{ hostname }}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue