@fleetbase/fleetops-engine 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/components/context-panel.hbs +5 -0
- package/addon/components/context-panel.js +6 -0
- package/addon/components/driver-form-panel.hbs +22 -22
- package/addon/components/driver-form-panel.js +28 -3
- package/addon/components/driver-panel.hbs +8 -8
- package/addon/components/driver-panel.js +23 -6
- package/addon/components/fleet-vehicle-listing.hbs +1 -1
- package/addon/components/live-map.hbs +20 -9
- package/addon/components/live-map.js +1045 -354
- package/addon/components/settings-window.hbs +1 -1
- package/addon/components/vehicle-form-panel.hbs +24 -24
- package/addon/components/vehicle-form-panel.js +26 -3
- package/addon/components/vehicle-panel.hbs +8 -9
- package/addon/components/vehicle-panel.js +21 -4
- package/addon/controllers/operations/orders/index/new.js +3 -5
- package/addon/controllers/operations/orders/index/view.js +5 -7
- package/addon/controllers/operations/orders/index.js +15 -2
- package/addon/engine.js +6 -0
- package/addon/routes/operations/orders/index/view.js +4 -2
- package/addon/routes/operations/orders/index.js +5 -1
- package/addon/services/context-panel.js +106 -0
- package/addon/services/leaflet-contextmenu-manager.js +311 -0
- package/addon/services/leaflet-map-manager.js +61 -0
- package/addon/services/service-areas.js +242 -32
- package/addon/templates/application.hbs +2 -1
- package/addon/utils/find-leaflet-layer.js +13 -0
- package/addon/utils/fly-to-leaflet-layer.js +25 -0
- package/addon/utils/get-leaflet-layer-by-id.js +12 -0
- package/addon/utils/layer-can-bind-contextmenu.js +3 -0
- package/app/components/context-panel.js +1 -0
- package/app/services/context-panel.js +1 -0
- package/app/services/leaflet-contextmenu-manager.js +1 -0
- package/app/services/leaflet-map-manager.js +1 -0
- package/app/utils/find-leaflet-layer.js +1 -0
- package/app/utils/fly-to-leaflet-layer.js +1 -0
- package/app/utils/get-leaflet-layer-by-id.js +1 -0
- package/app/utils/layer-can-bind-contextmenu.js +1 -0
- package/composer.json +11 -1
- package/extension.json +1 -1
- package/package.json +2 -2
- package/server/src/Http/Controllers/Internal/v1/LiveController.php +7 -4
- package/server/src/Http/Filter/VehicleFilter.php +7 -0
- package/server/src/Http/Resources/v1/Vehicle.php +51 -39
- package/addon/services/map-manager.js +0 -3
- package/app/services/map-manager.js +0 -1
|
@@ -4,6 +4,7 @@ namespace Fleetbase\FleetOps\Http\Resources\v1;
|
|
|
4
4
|
|
|
5
5
|
use Fleetbase\Http\Resources\FleetbaseResource;
|
|
6
6
|
use Fleetbase\Support\Http;
|
|
7
|
+
use Grimzy\LaravelMysqlSpatial\Types\Point;
|
|
7
8
|
|
|
8
9
|
class Vehicle extends FleetbaseResource
|
|
9
10
|
{
|
|
@@ -19,27 +20,33 @@ class Vehicle extends FleetbaseResource
|
|
|
19
20
|
return array_merge(
|
|
20
21
|
$this->getInternalIds(),
|
|
21
22
|
[
|
|
22
|
-
'id'
|
|
23
|
-
'uuid'
|
|
24
|
-
'public_id'
|
|
25
|
-
'internal_id'
|
|
26
|
-
'name'
|
|
27
|
-
'display_name'
|
|
28
|
-
'vin'
|
|
29
|
-
'driver'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
23
|
+
'id' => $this->when(Http::isInternalRequest(), $this->id, $this->public_id),
|
|
24
|
+
'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
|
|
25
|
+
'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
|
|
26
|
+
'internal_id' => $this->internal_id,
|
|
27
|
+
'name' => $this->display_name,
|
|
28
|
+
'display_name' => $this->when(Http::isInternalRequest(), $this->display_name),
|
|
29
|
+
'vin' => $this->vin ?? null,
|
|
30
|
+
'driver' => $this->whenLoaded('driver', new Driver($this->driver)),
|
|
31
|
+
'devices' => $this->whenLoaded('devices', $this->devices),
|
|
32
|
+
'photo' => $this->photoUrl,
|
|
33
|
+
'make' => $this->make,
|
|
34
|
+
'model' => $this->model,
|
|
35
|
+
'year' => $this->year,
|
|
36
|
+
'trim' => $this->trim,
|
|
37
|
+
'type' => $this->type,
|
|
38
|
+
'plate_number' => $this->plate_number,
|
|
39
|
+
'vin' => $this->vin,
|
|
40
|
+
'vin_data' => $this->vin_data,
|
|
41
|
+
'status' => $this->status,
|
|
42
|
+
'online' => $this->online,
|
|
43
|
+
'location' => data_get($this, 'location', new Point(0, 0)),
|
|
44
|
+
'heading' => (int) data_get($this, 'heading', 0),
|
|
45
|
+
'altitude' => (int) data_get($this, 'altitude', 0),
|
|
46
|
+
'speed' => (int) data_get($this, 'speed', 0),
|
|
47
|
+
'meta' => $this->meta ?? [],
|
|
48
|
+
'updated_at' => $this->updated_at,
|
|
49
|
+
'created_at' => $this->created_at,
|
|
43
50
|
]
|
|
44
51
|
);
|
|
45
52
|
}
|
|
@@ -52,24 +59,29 @@ class Vehicle extends FleetbaseResource
|
|
|
52
59
|
public function toWebhookPayload()
|
|
53
60
|
{
|
|
54
61
|
return [
|
|
55
|
-
'id'
|
|
56
|
-
'internal_id'
|
|
57
|
-
'name'
|
|
58
|
-
'vin'
|
|
59
|
-
'driver'
|
|
60
|
-
'photo'
|
|
61
|
-
'make'
|
|
62
|
-
'model'
|
|
63
|
-
'year'
|
|
64
|
-
'trim'
|
|
65
|
-
'type'
|
|
66
|
-
'plate_number'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
62
|
+
'id' => $this->public_id,
|
|
63
|
+
'internal_id' => $this->internal_id,
|
|
64
|
+
'name' => $this->name,
|
|
65
|
+
'vin' => $this->vin ?? null,
|
|
66
|
+
'driver' => $this->whenLoaded('driver', new Driver($this->driver)),
|
|
67
|
+
'photo' => $this->photoUrl,
|
|
68
|
+
'make' => $this->make,
|
|
69
|
+
'model' => $this->model,
|
|
70
|
+
'year' => $this->year,
|
|
71
|
+
'trim' => $this->trim,
|
|
72
|
+
'type' => $this->type,
|
|
73
|
+
'plate_number' => $this->plate_number,
|
|
74
|
+
'vin' => $this->vin,
|
|
75
|
+
'vin_data' => $this->vin_data,
|
|
76
|
+
'status' => $this->status,
|
|
77
|
+
'online' => $this->online,
|
|
78
|
+
'location' => data_get($this, 'location', new Point(0, 0)),
|
|
79
|
+
'heading' => (int) data_get($this, 'heading', 0),
|
|
80
|
+
'altitude' => (int) data_get($this, 'altitude', 0),
|
|
81
|
+
'speed' => (int) data_get($this, 'speed', 0),
|
|
82
|
+
'meta' => $this->meta ?? [],
|
|
83
|
+
'updated_at' => $this->updated_at,
|
|
84
|
+
'created_at' => $this->created_at,
|
|
73
85
|
];
|
|
74
86
|
}
|
|
75
87
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/services/map-manager';
|