From 7d85d93b23e5c543f1a20f2b2e016531b25a5450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 28 Sep 2023 16:56:09 +0200 Subject: [PATCH] chg: Add icon in node if it contains a downloaded file Fix #792 --- website/web/sri.txt | 2 +- website/web/static/tree.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/website/web/sri.txt b/website/web/sri.txt index afe0a2ae..2d1c9e57 100644 --- a/website/web/sri.txt +++ b/website/web/sri.txt @@ -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==", diff --git a/website/web/static/tree.js b/website/web/static/tree.js index 7650b17c..bf5874d7 100644 --- a/website/web/static/tree.js +++ b/website/web/static/tree.js @@ -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) {