diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-03-06 17:31:26 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-03-06 17:38:05 +0100 |
commit | 46f68501d575431656b5254a4bda8acb2982ab77 (patch) | |
tree | 030c68ea408f61de131b93a51b1394648c4a7b85 /examples/py-flow-dashboard/plotly_dash.py | |
parent | 9db048c9d93a00adf4b258d2341b24229d2a45a1 (diff) |
Added daemon event: DAEMON_EVENT_STATUS (periodically send's daemon statistics.)
* Improved distributor timeout handling (per-thread).
* flow-info.py / flow-dash.py: Distinguish between flow risk severities.
* nDPId: Skip tag switch datalink packet dissection / processing.
* nDPId: Fixed incorrect value for current active flows.
* Improved JSON schema's.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/py-flow-dashboard/plotly_dash.py')
-rw-r--r-- | examples/py-flow-dashboard/plotly_dash.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/py-flow-dashboard/plotly_dash.py b/examples/py-flow-dashboard/plotly_dash.py index 3577776cf..adc103afb 100644 --- a/examples/py-flow-dashboard/plotly_dash.py +++ b/examples/py-flow-dashboard/plotly_dash.py @@ -89,7 +89,7 @@ def build_piechart(labels, values, color_map=None): COLOR_MAP = { 'piechart-flows': ['rgb(153, 153, 255)', 'rgb(153, 204, 255)', 'rgb(255, 204, 153)', 'rgb(255, 255, 255)'], 'piechart-midstream-flows': ['rgb(255, 255, 153)', 'rgb(153, 153, 255)'], - 'piechart-risky-flows': ['rgb(255, 153, 153)', 'rgb(153, 153, 255)'], + 'piechart-risky-flows': ['rgb(255, 0, 0)', 'rgb(255, 128, 0)', 'rgb(255, 255, 0)', 'rgb(128, 255, 0)', 'rgb(153, 153, 255)'], 'graph-flows': {'Current Active Flows': {'color': 'rgb(153, 153, 255)', 'width': 1}, 'Current Risky Flows': {'color': 'rgb(255, 153, 153)', 'width': 3}, 'Current Midstream Flows': {'color': 'rgb(255, 255, 153)', 'width': 3}, @@ -150,7 +150,7 @@ def generate_tab_flow(): config={ 'displayModeBar': False, }, - figure=build_piechart(['Risky', 'Not Risky'], + figure=build_piechart(['Severy Risk', 'High Risk', 'Medium Risk', 'Low Risk', 'No Risk'], [0, 0], COLOR_MAP['piechart-risky-flows']), ), ], style={'padding': 10, 'flex': 1}), @@ -257,8 +257,11 @@ def tab_flow_update_components(n): shared_flow_dict['current-flows'] - shared_flow_dict['current-midstream-flows']], COLOR_MAP['piechart-midstream-flows']), - build_piechart(['Risky', 'Not Risky'], - [shared_flow_dict['current-risky-flows'], + build_piechart(['Severe', 'High', 'Medium', 'Low', 'No Risk'], + [shared_flow_dict['current-risky-flows-severe'], + shared_flow_dict['current-risky-flows-high'], + shared_flow_dict['current-risky-flows-medium'], + shared_flow_dict['current-risky-flows-low'], shared_flow_dict['current-flows'] - shared_flow_dict['current-risky-flows']], COLOR_MAP['piechart-risky-flows'])] |