Carry the level everywhere a position is drawn, and gate it per occurrence

This commit is contained in:
2026-08-18 09:37:29 -04:00
parent 8dd383f4ee
commit 09e9d5f047
16 changed files with 516 additions and 400 deletions

View File

@@ -1042,7 +1042,7 @@ def _get_low_supplies_data():
'model': model_number,
'location': location_name,
'mapx': asset.mapx,
'levelid': asset.levelid,
'levelid': asset.levelid,
'mapy': asset.mapy,
'supplies': annotated
})
@@ -1479,6 +1479,10 @@ def dashboard_supplies():
# card, it just has nothing to preview.
'mapx': printer.get('mapx'),
'mapy': printer.get('mapy'),
# The level those pixels belong to (ADR-017). Without it the hover
# preview cannot draw the marker and says so, which is what the
# dashboard card and the toner report were both doing.
'levelid': printer.get('levelid'),
'iscritical': any(s['status'] == 'critical' for s in depleted),
'supplies': [{
'text': '{} {}%'.format(_shortsupplyname(supply.get('name')),