From d65da7fddadf2893649af65dad84995be7bf589b Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Fri, 6 Dec 2024 09:15:14 +0100 Subject: [PATCH] fix(ns-api): improve dpireport details When showing details of network traffic, do not display hosts with 0 bytes of traffic --- packages/ns-api/files/ns.dpireport | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ns-api/files/ns.dpireport b/packages/ns-api/files/ns.dpireport index d76e978b..885cf45e 100755 --- a/packages/ns-api/files/ns.dpireport +++ b/packages/ns-api/files/ns.dpireport @@ -205,6 +205,9 @@ def summary_v2(year=None, month=None, day=None, narrow_client=None, narrow_secti 'traffic': raw_client_total_traffic }) + # do not display empty values when seeing details + if narrow_section and narrow_value: + raw_clients = [client for client in raw_clients if client['traffic'] > 0] raw_clients.sort(key=lambda x: x['traffic'], reverse=True) final_clients = raw_clients[:limit]