Skip to content

Commit

Permalink
fix(ns-api): improve dpireport details (#958)
Browse files Browse the repository at this point in the history
When showing details of network traffic, do not
display hosts with 0 bytes of traffic

#900
  • Loading branch information
gsanchietti authored Dec 6, 2024
1 parent 5a0e30d commit 61b7ac4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ns-api/files/ns.dpireport
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 61b7ac4

Please sign in to comment.