chg: Add icon in node if it contains a downloaded file

Fix #792
pull/793/head
Raphaël Vinot 2023-09-28 16:56:09 +02:00
parent 532dcba04d
commit 7d85d93b23
2 changed files with 6 additions and 3 deletions

View File

@ -36,7 +36,7 @@
"stats.css": "/kY943FwWBTne4IIyf7iBROSfbGd82TeBicEXqKkRwawMVRIvM/Pk5MRa7okUyGIxaDjFQGmV/U1vy+PhN6Jbw==",
"stats_graph.js": "0OEouA6NAxLG2wMd7D2vtGoMrXKna7My98Euc6ecyfdO4/6mIJS87vzISOS4zSZ8u4ehpa+p7E0nWhsXXE7H/Q==",
"tree.css": "R/pWQnE8kMacDrzGy/NpA1tJoHAZpOjFiX6dqtBe+PqAnhYMn1CIQzODh8Ifvh6hBTPLRWX3bsabfEvfaI7Z6A==",
"tree.js": "67R8M7znCyonDtD3GdqyF7uq4p18SLWB/BSwR1dK45M63SHmksENlBEPl9WS3OepzmnfW8q00sH/UBEWqGE8rQ==",
"tree.js": "6KzVwAvILhlTbU1IHy/km1JGa5jmUbzD9ZpnKCY3kTw040sMcztTn/i67I7r4z8VaQdFor8II3PaWeHxU4IqQw==",
"up.jpg": "d1ljZJ9f5JekyM6RLFFH2Ua44j6neiQBdUIXOenRTjGppQr3JaeglpQIH6BjPCJL177+TH52U3UIRNS5YAyKIg==",
"up_right.jpg": "OMmz+n+MxR34P8/fn5t4DkqKqdJRzQbXQ7fAi2lhkZIJGhVs2vIyY1f2hpYoBxDAX1OcYsSE2lqIR2vXNDGZsA==",
"video.png": "gJtmkfr8I1Kw43pYEKjg6CAjgmhl1vIBKBQ3ZkxCu3wvxQm+6kf93iLrrFiY2WuiXzxEn2Leu52GJzmVN5id0g==",

View File

@ -323,7 +323,8 @@ function icon_list(relative_x_pos, relative_y_pos, d) {
['request_cookie', {path: "/static/cookie_read.png", tooltip: "cookie(s) sent to the server in the request"}],
['response_cookie', {path: "/static/cookie_received.png", tooltip: "cookie(s) received in the response"}],
['redirect', {path: "/static/redirect.png", tooltip: "redirect(s)"}],
['redirect_to_nothing', {path: "/static/cookie_in_url.png", tooltip: "redirect(s) to URL(s) missing in the capture"}]
['redirect_to_nothing', {path: "/static/cookie_in_url.png", tooltip: "redirect(s) to URL(s) missing in the capture"}],
['downloaded_filename', {path: "/static/download.png", tooltip: "contains a downloaded file."}]
]);
// Put all the icone in one sub svg document
@ -337,6 +338,8 @@ function icon_list(relative_x_pos, relative_y_pos, d) {
let counter = 0;
if (typeof d.data[key] === 'boolean') {
has_icon = d.data[key];
} else if (typeof d.data[key] === 'string') {
has_icon = d.data[key];
} else if (typeof d.data[key] === 'number') {
has_icon = d.data[key] > 0;
counter = d.data[key];
@ -359,7 +362,7 @@ function icon_list(relative_x_pos, relative_y_pos, d) {
.style('opacity', 1)
.style('left', `${event.pageX + 10}px`)
.style('top', `${event.pageY + 10}px`)
.text(`${counter} ${icon_details.tooltip}`);
.text(counter? `${counter} ${icon_details.tooltip}`:icon_details.tooltip);
})
.on('mouseout', (event, d) => d3.select('#tooltip').style('opacity', 0));
if (counter > 0) {