Resource Management
This page covers how to manage resources in the admin panel, including trackers, production runs, brands, clients, and locations.
Tracker Management
The trackers section allows you to manage trackers, including:
- Creating new trackers
- Editing existing trackers
- Deleting trackers
- Viewing tracker status and location history
- Importing trackers from CSV files
- Sorting trackers by:
- Tracker name (ascending/descending)
- Production run ID (ascending/descending)
- MAC address (ascending/descending)
CSV Import
The admin panel supports importing trackers from CSV files. The CSV file should have the following columns:
- ID/Name: The name or ID of the tracker
- Advertisement Key: The advertisement key for the tracker
- Private Key: The private key for the tracker
- Hashed Adv Key: The hashed advertisement key for the tracker
- MAC Address (optional): The MAC address of the tracker
You can download a template CSV file from the import dialog.
For more details on the CSV import process, see the Tracker CSV Import guide.
Production Run Management
The production runs section allows you to manage production runs, including:
- Creating new production runs
- Editing existing production runs
- Deleting production runs
- Viewing trackers associated with a production run
- Sorting production runs by:
- Description (ascending/descending)
- Brand (ascending/descending)
Production Run Details
Each production run has the following details:
- Description: A description of the production run
- Brand: The brand associated with the production run
- Start Date: The date the production run started
- End Date: The date the production run ended
- Trackers: The trackers associated with the production run
Brand Management
The brands section allows you to manage brands, including:
- Creating new brands
- Editing existing brands
- Deleting brands
- Viewing production runs associated with a brand
- Sorting brands by:
- Brand name (ascending/descending)
- Client name (ascending/descending)
Brand Details
Each brand has the following details:
- Name: The name of the brand
- Client: The client associated with the brand
- Production Runs: The production runs associated with the brand
Client Management
The clients section allows you to manage clients, including:
- Creating new clients
- Editing existing clients
- Deleting clients
- Viewing brands associated with a client
- Sorting clients by:
- Client name (ascending/descending)
Client Details
Each client has the following details:
- Name: The name of the client
- Brands: The brands associated with the client
Location Management
The admin panel allows you to manage two types of locations with customizable geofence settings:
Delivery Locations
Delivery locations are places where trackers are delivered. The delivery locations section allows you to:
- Create new delivery locations
- Edit existing delivery locations
- Delete delivery locations
- View delivery locations on a map with geofence visualization
- Configure custom geofence sizes for each location
Storage Locations
Storage locations are places where trackers are stored. The storage locations section allows you to:
- Create new storage locations
- Edit existing storage locations
- Delete storage locations
- View storage locations on a map with geofence visualization
- Configure custom geofence sizes for each location
Geofence Configuration
Both delivery and storage locations support customizable geofence sizes:
Geofence Settings
- Default Size: 100 meters
- Range: 100m to 1000m
- Increments: 50m steps (100m, 150m, 200m, 250m, etc.)
- Purpose: Defines the radius around each location for geofence detection
Setting Geofence Size
- When creating or editing a location, use the "Geofence Size (meters)" dropdown
- Select from predefined options ranging from 100m (Default) to 1000m (Maximum)
- The map will show a real-time preview of the geofence circle
- The geofence size is displayed in the location details view
Map Visualization
- Interactive Maps: Both create/edit and detail view pages show the geofence as a colored circle
- Color Coding: Blue circles for delivery locations, green circles for storage locations
- Real-time Updates: The circle size updates immediately when changing the geofence setting
- Transparency: Semi-transparent fill allows viewing map details underneath
Relationship Navigation
The admin panel implements a consistent pattern for navigating between related resources using clickable chips:
ClientListField
This component displays clients associated with a user as clickable chips, allowing for easy navigation to specific clients. When a user clicks on a client chip in the user list, they are taken to a filtered client list showing only that specific client.
ClientBrandsField
This component displays brands associated with a client as clickable chips, allowing for easy navigation to specific brands. When a user clicks on a brand chip, they are taken to a filtered brand list showing only that specific brand.
BrandProductionRunsField
This component displays production runs associated with a brand as clickable chips, allowing for easy navigation to specific production runs. When a user clicks on a production run chip, they are taken to a filtered production run list showing only that specific production run.
ProductionRunTrackersField
This component displays the count of trackers associated with a production run as a clickable link. When a user clicks on the tracker count, they are taken to a filtered tracker list showing all trackers for that production run.
Sorting and Caching
The admin panel supports sorting data in tables by various columns. The sorting functionality is implemented both in the frontend and backend:
- Frontend Implementation:
- Each table component maintains its own sorting state (field and order)
- Visual indicators show the current sort field and direction
- Clicking a sortable column header toggles between ascending and descending order
-
Clicking a different column header sets that column as the new sort field with ascending order
-
Backend Implementation:
- API endpoints accept
sort_fieldandsort_orderparameters - Sorting is applied before pagination to ensure consistent results
- Special handling for null values ensures they appear at the end of sorted lists
-
For relationship-based sorting (like sorting brands by client name), the backend performs additional queries to fetch the related data for sorting
-
Caching Mechanism:
- The backend implements a comprehensive caching strategy that properly handles sorted data
- Cache keys include sorting parameters to ensure different sort configurations get different cache entries
- Sorting is applied before caching, so cached data is already properly sorted
- When retrieving from cache, the correctly sorted data is returned without needing to re-sort
- Cache invalidation occurs when records are created, updated, or deleted