Buildings and levels for the floor map, and make every identifier searchable

This commit is contained in:
2026-08-17 13:03:54 -04:00
parent 47fb65fdd2
commit fbd99041b0
54 changed files with 4173 additions and 880 deletions

View File

@@ -358,6 +358,7 @@ def printer_install_list():
'iscsf': printer.iscsf,
'locationname': asset.location.locationname if asset.location else None,
'mapx': asset.mapx,
'levelid': asset.levelid,
'mapy': asset.mapy,
})
@@ -366,7 +367,7 @@ def printer_install_list():
# hand-rolled JSON parser. The web map uses the default JSON.
if request.args.get('format') == 'text':
fields = ('printerid', 'windowsname', 'vendorname', 'modelnumber',
'hostname', 'ipaddress', 'mapx', 'mapy')
'hostname', 'ipaddress', 'mapx', 'mapy', 'levelid')
lines = [_text_line(row, fields) for row in rows]
return Response('\n'.join(lines), mimetype='text/plain')
@@ -738,6 +739,7 @@ def create_printer():
locationid=data.get('locationid'),
businessunitid=data.get('businessunitid'),
mapx=data.get('mapx'),
levelid=data.get('levelid'),
mapy=data.get('mapy'),
notes=data.get('notes')
)
@@ -819,7 +821,7 @@ def update_printer(printer_id: int):
# Update asset fields (optional identifiers gated per-type in Settings)
asset_fields = ['assetnumber', 'name', 'serialnumber', 'gaugelabreference',
'maintenancereference', 'statusid',
'locationid', 'businessunitid', 'mapx', 'mapy',
'locationid', 'businessunitid', 'mapx', 'mapy', 'levelid',
'notes', 'isactive']
for key in asset_fields:
if key in data:
@@ -1035,6 +1037,7 @@ def _get_low_supplies_data():
'model': model_number,
'location': location_name,
'mapx': asset.mapx,
'levelid': asset.levelid,
'mapy': asset.mapy,
'supplies': annotated
})