From 1f22ef7a77a21a38d29feff621ba3a12ce60ea8f Mon Sep 17 00:00:00 2001 From: user Date: Sat, 23 Mar 2024 22:41:02 +0100 Subject: fix graph --- src/ssh_node5_net.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ssh_node5_net.py b/src/ssh_node5_net.py index 54e5721..e594f38 100644 --- a/src/ssh_node5_net.py +++ b/src/ssh_node5_net.py @@ -68,9 +68,9 @@ def index(): by_ip = {} for d in histogram: if d['ip'] not in by_ip: - by_ip[d['ip']] = [] + by_ip[d['ip']] = list(range(len(all_dates))) for date in all_dates: - by_ip[d['ip']].append(d['total_count'] if date == d['date'] else 0) + by_ip[d['ip']][all_dates.index(d['date'])] = (d['total_count'] if date == d['date'] else 0) histogram_chartjs = json.dumps([{ 'label': str(ip), -- cgit v1.2.3