From 1c88467e8ea2b148faab77c62fc31ab401360ce6 Mon Sep 17 00:00:00 2001 From: aiooss-anssi Date: Mon, 9 Sep 2024 09:32:41 +0200 Subject: [PATCH] flowdisplay: fix established flows detection --- webapp/static/js/flowdisplay.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/static/js/flowdisplay.js b/webapp/static/js/flowdisplay.js index df6363f..b6f973c 100644 --- a/webapp/static/js/flowdisplay.js +++ b/webapp/static/js/flowdisplay.js @@ -253,7 +253,8 @@ class FlowDisplay { // Application protocol card const appProto = flow.flow.app_proto - document.getElementById('display-down').classList.toggle('d-none', appProto) + const flowEstablished = flow.flow.state !== 'new' + document.getElementById('display-down').classList.toggle('d-none', flowEstablished) if (appProto && appProto !== 'failed' && flow[appProto] !== undefined) { document.getElementById('display-app').classList.remove('d-none') document.querySelector('#display-app > header > a').classList.toggle('d-none', appProto !== 'http') @@ -338,7 +339,7 @@ class FlowDisplay { } // Show raw data card if a TCP or UDP connection was established - if (['TCP', 'UDP'].includes(flow.flow.proto) && appProto) { + if (['TCP', 'UDP'].includes(flow.flow.proto) && flowEstablished) { document.getElementById('display-raw').classList.remove('d-none') document.getElementById('display-raw-replay').href = `api/replay-raw/${flowId}`