Add print badges, pagination, route splitting, JWT auth fixes, and list page alignment
- Fix equipment badge barcode not rendering (loading race condition) - Fix printer QR code not rendering on initial load (same race condition) - Add model image to equipment badge via imageurl from Model table - Fix white-on-white machine number text on badge, tighten barcode spacing - Add PaginationBar component used across all list pages - Split monolithic router into per-plugin route modules - Fix 25 GET API endpoints returning 401 (jwt_required -> optional=True) - Align list page columns across Equipment, PCs, and Network pages - Add print views: EquipmentBadge, PrinterQRSingle, PrinterQRBatch, USBLabelBatch - Add PC Relationships report, migration docs, and CLAUDE.md project guide - Various plugin model, API, and frontend refinements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -227,7 +227,7 @@ def get_network_device(device_id: int):
|
||||
)
|
||||
|
||||
result = netdev.asset.to_dict() if netdev.asset else {}
|
||||
result['network_device'] = netdev.to_dict()
|
||||
result['networkdevice'] = netdev.to_dict()
|
||||
|
||||
return success_response(result)
|
||||
|
||||
@@ -246,7 +246,7 @@ def get_network_device_by_asset(asset_id: int):
|
||||
)
|
||||
|
||||
result = netdev.asset.to_dict() if netdev.asset else {}
|
||||
result['network_device'] = netdev.to_dict()
|
||||
result['networkdevice'] = netdev.to_dict()
|
||||
|
||||
return success_response(result)
|
||||
|
||||
@@ -265,7 +265,7 @@ def get_network_device_by_hostname(hostname: str):
|
||||
)
|
||||
|
||||
result = netdev.asset.to_dict() if netdev.asset else {}
|
||||
result['network_device'] = netdev.to_dict()
|
||||
result['networkdevice'] = netdev.to_dict()
|
||||
|
||||
return success_response(result)
|
||||
|
||||
@@ -353,7 +353,7 @@ def create_network_device():
|
||||
db.session.commit()
|
||||
|
||||
result = asset.to_dict()
|
||||
result['network_device'] = netdev.to_dict()
|
||||
result['networkdevice'] = netdev.to_dict()
|
||||
|
||||
return success_response(result, message='Network device created', http_code=201)
|
||||
|
||||
@@ -413,7 +413,7 @@ def update_network_device(device_id: int):
|
||||
db.session.commit()
|
||||
|
||||
result = asset.to_dict()
|
||||
result['network_device'] = netdev.to_dict()
|
||||
result['networkdevice'] = netdev.to_dict()
|
||||
|
||||
return success_response(result, message='Network device updated')
|
||||
|
||||
@@ -479,10 +479,10 @@ def dashboard_summary():
|
||||
|
||||
return success_response({
|
||||
'total': total,
|
||||
'by_type': [{'type': t, 'count': c} for t, c in by_type],
|
||||
'by_vendor': [{'vendor': v, 'count': c} for v, c in by_vendor],
|
||||
'bytype': [{'type': t, 'count': c} for t, c in by_type],
|
||||
'byvendor': [{'vendor': v, 'count': c} for v, c in by_vendor],
|
||||
'poe': poe_count,
|
||||
'non_poe': total - poe_count
|
||||
'nonpoe': total - poe_count
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ class NetworkDevice(BaseModel):
|
||||
|
||||
# Add related object names
|
||||
if self.networkdevicetype:
|
||||
result['networkdevicetype_name'] = self.networkdevicetype.networkdevicetype
|
||||
result['networkdevicetypename'] = self.networkdevicetype.networkdevicetype
|
||||
if self.vendor:
|
||||
result['vendor_name'] = self.vendor.vendor
|
||||
result['vendorname'] = self.vendor.vendor
|
||||
|
||||
return result
|
||||
|
||||
@@ -78,8 +78,8 @@ class NetworkPlugin(BasePlugin):
|
||||
if not existing:
|
||||
at = AssetType(
|
||||
assettype='network_device',
|
||||
plugin_name='network',
|
||||
table_name='networkdevices',
|
||||
pluginname='network',
|
||||
tablename='networkdevices',
|
||||
description='Network infrastructure devices (switches, APs, cameras, etc.)',
|
||||
icon='network-wired'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user