mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix
This commit is contained in:
@@ -54,12 +54,17 @@ export function TrackingPage() {
|
||||
}));
|
||||
}, [vehicles]);
|
||||
|
||||
const selectedVehicle = vehiclesWithGPS.find(v => v.id === selectedVehicleId);
|
||||
const vehicleOptions = useMemo(
|
||||
() => vehiclesWithGPS.map(v => ({ label: v.registrationNumber, value: v.id })),
|
||||
const activeVehicles = useMemo(
|
||||
() => vehiclesWithGPS.filter(v => v.status === 'ACTIVE'),
|
||||
[vehiclesWithGPS]
|
||||
);
|
||||
|
||||
const selectedVehicle = activeVehicles.find(v => v.id === selectedVehicleId);
|
||||
const vehicleOptions = useMemo(
|
||||
() => activeVehicles.map(v => ({ label: v.registrationNumber, value: v.id })),
|
||||
[activeVehicles]
|
||||
);
|
||||
|
||||
// Map dimensions
|
||||
const mapWidth = 800;
|
||||
const mapHeight = 500;
|
||||
@@ -146,8 +151,8 @@ export function TrackingPage() {
|
||||
))}
|
||||
</svg>
|
||||
|
||||
{/* Vehicle markers */}
|
||||
{vehiclesWithGPS.map((vehicle) => {
|
||||
{/* Vehicle markers - show only active vehicles */}
|
||||
{vehiclesWithGPS.filter(v => v.status === 'ACTIVE').map((vehicle) => {
|
||||
const coords = getMapCoords(vehicle.gps.lat, vehicle.gps.lng);
|
||||
const isSelected = vehicle.id === selectedVehicleId;
|
||||
|
||||
@@ -303,14 +308,14 @@ export function TrackingPage() {
|
||||
</Card>
|
||||
)}
|
||||
|
||||
{/* All Vehicles List */}
|
||||
{/* All Active Vehicles List */}
|
||||
<Card withBorder p="lg">
|
||||
<Stack gap="md">
|
||||
<Text fw={500}>All Vehicles</Text>
|
||||
<Text fw={500}>Active Vehicles ({activeVehicles.length})</Text>
|
||||
<div style={{ maxHeight: '300px', overflowY: 'auto' }}>
|
||||
<Table size="sm">
|
||||
<Table.Tbody>
|
||||
{vehiclesWithGPS.slice(0, 10).map(v => (
|
||||
{activeVehicles.slice(0, 10).map(v => (
|
||||
<Table.Tr
|
||||
key={v.id}
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user