Migrate frontend to plugin-based asset architecture
- Add equipmentApi and computersApi to replace legacy machinesApi - Add controller vendor/model fields to Equipment model and forms - Fix map marker navigation to use plugin-specific IDs (equipmentid, computerid, printerid, networkdeviceid) instead of assetid - Fix search to use unified Asset table with correct plugin IDs - Remove legacy printer search that used non-existent field names - Enable optional JWT auth for detail endpoints (public read access) - Clean up USB plugin models (remove unused checkout model) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ from flask import Flask, Blueprint
|
||||
from shopdb.plugins.base import BasePlugin, PluginMeta
|
||||
from shopdb.extensions import db
|
||||
|
||||
from .models import USBCheckout
|
||||
from .models import USBDevice, USBDeviceType, USBCheckout
|
||||
from .api import usb_bp
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -18,10 +18,10 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class USBPlugin(BasePlugin):
|
||||
"""
|
||||
USB plugin - manages USB device checkouts.
|
||||
|
||||
USB devices are stored in the machines table (machinetypeid=44).
|
||||
This plugin provides checkout/checkin tracking.
|
||||
USB plugin - manages USB device tracking and checkouts.
|
||||
|
||||
Standalone plugin for tracking USB flash drives, external drives,
|
||||
and other portable storage devices with checkout/checkin functionality.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
@@ -54,7 +54,7 @@ class USBPlugin(BasePlugin):
|
||||
|
||||
def get_models(self) -> List[Type]:
|
||||
"""Return list of SQLAlchemy model classes."""
|
||||
return [USBCheckout]
|
||||
return [USBDeviceType, USBDevice, USBCheckout]
|
||||
|
||||
def init_app(self, app: Flask, db_instance) -> None:
|
||||
"""Initialize plugin with Flask app."""
|
||||
|
||||
Reference in New Issue
Block a user