chg: Disable bookmarks by default

pull/135/head
Raphaël Vinot 2020-11-29 23:56:42 +01:00
parent 55ef3ed04d
commit 287fdeb8e6
4 changed files with 25 additions and 16 deletions

View File

@ -18,6 +18,7 @@
"enable_default_blur_screenshot": false,
"enable_context_by_users": false,
"enable_categorization": false,
"enable_bookmark": false,
"auto_trigger_modules": false,
"enable_mail_notification": false,
"email": {
@ -44,6 +45,7 @@
"enable_default_blur_screenshot": "If true, blur the screenshot by default (useful on public instances)",
"enable_context_by_users": "Allow the users to add context to a response body",
"enable_categorization": "Allow the users to add contextualization to a capture",
"enable_bookmark": "Allow to bookmark nodes on tree",
"auto_trigger_modules": "Automatically trigger the modules when the tree is loaded",
"enable_mail_notification": "Enable email notification or not",
"email": "Configuration for sending email notifications."

View File

@ -52,6 +52,7 @@ max_depth = get_config('generic', 'max_depth')
enable_mail_notification = get_config('generic', 'enable_mail_notification')
enable_context_by_users = get_config('generic', 'enable_context_by_users')
enable_categorization = get_config('generic', 'enable_categorization')
enable_bookmark = get_config('generic', 'enable_bookmark')
auto_trigger_modules = get_config('generic', 'auto_trigger_modules')
logging.basicConfig(level=get_config('generic', 'loglevel'))
@ -357,6 +358,7 @@ def tree(tree_uuid: str, urlnode_uuid: Optional[str]=None):
meta=meta, enable_mail_notification=enable_mail_notification,
enable_context_by_users=enable_context_by_users,
enable_categorization=enable_categorization,
enable_bookmark=enable_bookmark,
blur_screenshot=blur_screenshot, urlnode_uuid=urlnode_uuid,
auto_trigger_modules=auto_trigger_modules,
has_redirects=True if cache['redirects'] else False)

View File

@ -453,22 +453,24 @@ function update(root, computed_node_width=0) {
node_width = node_width > selected_node_bbox.width ? node_width : selected_node_bbox.width;
// Set Bookmark
d3.select(this).append("text")
.attr('x', `${selected_node_bbox.width - 12}px`)
.attr('y', '20px')
.style("font-size", "16px")
.attr("id", "bookmark")
.text("🏁")
.attr('cursor', 'pointer')
.on('click', (event, d) => NodeHighlight(d.data.uuid))
.on('mouseover', (event, d) => {
d3.select('#tooltip')
.style('opacity', 1)
.style('left', `${event.pageX + 10}px`)
.style('top', `${event.pageY + 10}px`)
.text('Bookmark this node');
})
.on('mouseout', (event, d) => d3.select('#tooltip').style('opacity', 0));
if (enable_bookmark) {
d3.select(this).append("text")
.attr('x', `${selected_node_bbox.width - 12}px`)
.attr('y', '20px')
.style("font-size", "16px")
.attr("id", "bookmark")
.text("🏁")
.attr('cursor', 'pointer')
.on('click', (event, d) => NodeHighlight(d.data.uuid))
.on('mouseover', (event, d) => {
d3.select('#tooltip')
.style('opacity', 1)
.style('left', `${event.pageX + 10}px`)
.style('top', `${event.pageY + 10}px`)
.text('Bookmark this node');
})
.on('mouseout', (event, d) => d3.select('#tooltip').style('opacity', 0));
};
const http_icon_size = 24;
if (d.data.http_content) {

View File

@ -68,6 +68,7 @@
<script>
var treeUUID = "{{ tree_uuid }}";
var enable_bookmark = {{ enable_bookmark|tojson }};
var treeData = {{ tree_json | safe }};
</script>
@ -123,9 +124,11 @@
<a href="{{ url_for('redirects', tree_uuid=tree_uuid) }}" role="button">Download redirects</a>
</li>
{% endif %}
{% if enable_bookmark %}
<li>
<a href="#/" role="button" onclick="UnbookmarkAllNodes();">Unbookmark all nodes</a>
</li>
{% endif %}
<li>
<a href="{{ url_for('image', tree_uuid=tree_uuid) }}" role="button">Download screenshot</a>
</li>