portal: count bridges on home card

This commit is contained in:
Iain Learmonth 2022-05-14 14:46:40 +01:00
parent 264d5a870e
commit 3f22696b41

View file

@ -71,6 +71,7 @@ def portal_home():
s: len(Alarm.query.filter(Alarm.alarm_state == s.upper(), Alarm.last_updated > (now - timedelta(days=1))).all())
for s in ["critical", "warning", "ok", "unknown"]
}
bridges = Bridge.query.filter(Bridge.destroyed == None).all()
br_last = {
d: len(Bridge.query.filter(Bridge.deprecated > (now - timedelta(days=d))).all())
for d in [1, 3, 7]