@fleetbase/fleetops-engine 0.6.20 → 0.6.22
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/custom-entity/form.hbs +14 -14
- package/addon/components/device/card.hbs +1 -0
- package/addon/components/device/card.js +3 -0
- package/addon/components/device/details.hbs +92 -43
- package/addon/components/device/form.hbs +108 -60
- package/addon/components/device/form.js +36 -8
- package/addon/components/device/manager.hbs +29 -0
- package/addon/components/device/manager.js +95 -0
- package/addon/components/device/panel-header.hbs +32 -0
- package/addon/components/device/panel-header.js +3 -0
- package/addon/components/device/pill.hbs +16 -0
- package/addon/components/device/pill.js +3 -0
- package/addon/components/driver/details.hbs +4 -0
- package/addon/components/driver/details.js +19 -1
- package/addon/components/driver/form.hbs +14 -3
- package/addon/components/driver/form.js +49 -47
- package/addon/components/driver/pill.hbs +17 -0
- package/addon/components/driver/pill.js +3 -0
- package/addon/components/entity/form.hbs +7 -5
- package/addon/components/layout/fleet-ops-sidebar.js +12 -12
- package/addon/components/map/drawer/device-event-listing.hbs +64 -0
- package/addon/components/map/drawer/device-event-listing.js +181 -0
- package/addon/components/map/drawer/position-listing.hbs +100 -0
- package/addon/components/map/drawer/position-listing.js +455 -0
- package/addon/components/map/drawer.js +2 -0
- package/addon/components/map/leaflet-live-map.hbs +7 -2
- package/addon/components/modals/attach-device.hbs +18 -0
- package/addon/components/modals/attach-device.js +3 -0
- package/addon/components/order/details/detail.hbs +2 -54
- package/addon/components/order/details/detail.js +1 -0
- package/addon/components/order/details/payload.hbs +6 -4
- package/addon/components/order/details/payload.js +2 -0
- package/addon/components/order/pill.hbs +34 -0
- package/addon/components/order/pill.js +3 -0
- package/addon/components/order-config-manager/custom-fields.js +1 -1
- package/addon/components/positions-replay.hbs +339 -0
- package/addon/components/positions-replay.js +409 -0
- package/addon/components/sensor/details.hbs +64 -38
- package/addon/components/sensor/form.hbs +112 -63
- package/addon/components/sensor/form.js +36 -24
- package/addon/components/sensor/panel-header.hbs +32 -0
- package/addon/components/sensor/panel-header.js +3 -0
- package/addon/components/telematic/details.hbs +40 -16
- package/addon/components/telematic/form.hbs +63 -64
- package/addon/components/telematic/form.js +73 -4
- package/addon/components/vehicle/card.hbs +2 -2
- package/addon/components/vehicle/details.hbs +4 -0
- package/addon/components/vehicle/details.js +19 -1
- package/addon/components/vehicle/form.hbs +4 -0
- package/addon/components/vehicle/pill.hbs +34 -0
- package/addon/components/vehicle/pill.js +3 -0
- package/addon/controllers/analytics/reports/index/edit.js +1 -1
- package/addon/controllers/connectivity/devices/index/details.js +22 -1
- package/addon/controllers/connectivity/devices/index/edit.js +66 -1
- package/addon/controllers/connectivity/devices/index.js +51 -9
- package/addon/controllers/connectivity/events/index.js +65 -16
- package/addon/controllers/connectivity/sensors/index/details.js +22 -1
- package/addon/controllers/connectivity/sensors/index/edit.js +66 -1
- package/addon/controllers/connectivity/sensors/index.js +66 -6
- package/addon/controllers/connectivity/telematics/index/details.js +22 -1
- package/addon/controllers/connectivity/telematics/index/edit.js +66 -1
- package/addon/controllers/connectivity/telematics/index.js +20 -11
- package/addon/controllers/management/fleets/index/details.js +26 -21
- package/addon/controllers/management/fleets/index/edit.js +9 -6
- package/addon/controllers/management/vehicles/index/details.js +26 -13
- package/addon/controllers/settings/custom-fields.js +6 -0
- package/addon/helpers/get-fleet-ops-option-label.js +11 -0
- package/addon/routes/connectivity/devices/index/details.js +27 -1
- package/addon/routes/connectivity/devices/index/edit.js +27 -1
- package/addon/routes/connectivity/sensors/index/details.js +27 -1
- package/addon/routes/connectivity/sensors/index/edit.js +27 -1
- package/addon/routes/connectivity/telematics/index/details.js +27 -1
- package/addon/routes/connectivity/telematics/index/edit.js +27 -1
- package/addon/routes/management/drivers/index/details/positions.js +3 -0
- package/addon/routes/management/vehicles/index/details/positions.js +3 -0
- package/addon/routes.js +4 -0
- package/addon/services/movement-tracker.js +81 -30
- package/addon/services/position-playback.js +486 -0
- package/addon/services/resource-metadata.js +46 -0
- package/addon/styles/fleetops-engine.css +157 -0
- package/addon/templates/connectivity/devices/index/details/index.hbs +2 -2
- package/addon/templates/connectivity/devices/index/details.hbs +15 -2
- package/addon/templates/connectivity/devices/index/edit.hbs +1 -1
- package/addon/templates/connectivity/events/index.hbs +1 -1
- package/addon/templates/connectivity/sensors/index/details/index.hbs +2 -2
- package/addon/templates/connectivity/sensors/index/details.hbs +15 -2
- package/addon/templates/connectivity/sensors/index/edit.hbs +1 -1
- package/addon/templates/connectivity/telematics/index/details/index.hbs +2 -2
- package/addon/templates/connectivity/telematics/index/details.hbs +14 -2
- package/addon/templates/connectivity/telematics/index/edit.hbs +1 -1
- package/addon/templates/management/drivers/index/details/positions.hbs +2 -0
- package/addon/templates/management/vehicles/index/details/devices.hbs +1 -2
- package/addon/templates/management/vehicles/index/details/positions.hbs +1 -0
- package/addon/utils/fleet-ops-options.js +95 -0
- package/app/components/device/card.js +1 -0
- package/app/components/device/manager.js +1 -0
- package/app/components/device/panel-header.js +1 -0
- package/app/components/device/pill.js +1 -0
- package/app/components/driver/pill.js +1 -0
- package/app/components/map/drawer/device-event-listing.js +1 -0
- package/app/components/map/drawer/position-listing.js +1 -0
- package/app/components/modals/attach-device.js +1 -0
- package/app/components/order/pill.js +1 -0
- package/app/components/positions-replay.js +1 -0
- package/app/components/sensor/panel-header.js +1 -0
- package/app/components/vehicle/pill.js +1 -0
- package/app/helpers/get-fleet-ops-option-label.js +1 -0
- package/app/routes/management/drivers/index/details/positions.js +1 -0
- package/app/routes/management/vehicles/index/details/positions.js +1 -0
- package/app/services/position-playback.js +1 -0
- package/app/services/resource-metadata.js +1 -0
- package/app/templates/management/drivers/index/details/positions.js +1 -0
- package/app/templates/management/vehicles/index/details/positions.js +1 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +4 -4
- package/server/config/telematics.php +111 -0
- package/server/migrations/2025_10_27_000001_add_telematics_integration_fields.php +70 -0
- package/server/migrations/2025_10_27_171322_fix_device_column_names.php +107 -0
- package/server/migrations/2025_10_27_203023_add_company_uuid_to_device_events_table.php +28 -0
- package/server/src/Console/Commands/ReplayVehicleLocations.php +225 -0
- package/server/src/Contracts/TelematicProviderDescriptor.php +72 -0
- package/server/src/Contracts/TelematicProviderInterface.php +119 -0
- package/server/src/Exceptions/TelematicProviderException.php +14 -0
- package/server/src/Exceptions/TelematicRateLimitExceededException.php +12 -0
- package/server/src/Http/Controllers/Api/v1/DriverController.php +24 -14
- package/server/src/Http/Controllers/Api/v1/VehicleController.php +27 -7
- package/server/src/Http/Controllers/Internal/v1/DeviceController.php +22 -0
- package/server/src/Http/Controllers/Internal/v1/PositionController.php +240 -0
- package/server/src/Http/Controllers/Internal/v1/SensorController.php +11 -0
- package/server/src/Http/Controllers/Internal/v1/TelematicController.php +141 -0
- package/server/src/Http/Controllers/TelematicWebhookController.php +169 -0
- package/server/src/Http/Filter/DeviceEventFilter.php +68 -0
- package/server/src/Http/Filter/PositionFilter.php +35 -0
- package/server/src/Http/Resources/v1/Position.php +44 -0
- package/server/src/Jobs/ReplayPositions.php +64 -0
- package/server/src/Jobs/SendPositionReplay.php +65 -0
- package/server/src/Jobs/SyncTelematicDevicesJob.php +106 -0
- package/server/src/Jobs/TestTelematicConnectionJob.php +102 -0
- package/server/src/Models/Asset.php +10 -8
- package/server/src/Models/Device.php +79 -12
- package/server/src/Models/DeviceEvent.php +33 -3
- package/server/src/Models/Driver.php +28 -1
- package/server/src/Models/Maintenance.php +15 -12
- package/server/src/Models/Part.php +2 -0
- package/server/src/Models/Payload.php +0 -1
- package/server/src/Models/Place.php +4 -1
- package/server/src/Models/Position.php +27 -17
- package/server/src/Models/Sensor.php +78 -13
- package/server/src/Models/Telematic.php +116 -6
- package/server/src/Models/TrackingNumber.php +3 -1
- package/server/src/Models/Vehicle.php +8 -11
- package/server/src/Models/WorkOrder.php +8 -5
- package/server/src/Providers/FleetOpsServiceProvider.php +2 -0
- package/server/src/Support/Telematics/Providers/AbstractProvider.php +151 -0
- package/server/src/Support/Telematics/Providers/FlespiProvider.php +182 -0
- package/server/src/Support/Telematics/Providers/GeotabProvider.php +181 -0
- package/server/src/Support/Telematics/Providers/SamsaraProvider.php +177 -0
- package/server/src/Support/Telematics/TelematicProviderRegistry.php +147 -0
- package/server/src/Support/Telematics/TelematicService.php +223 -0
- package/server/src/Support/Utils.php +1 -1
- package/server/src/routes.php +24 -1
|
@@ -1,3 +1,68 @@
|
|
|
1
1
|
import Controller from '@ember/controller';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { task } from 'ember-concurrency';
|
|
2
6
|
|
|
3
|
-
export default class ConnectivityTelematicsIndexEditController extends Controller {
|
|
7
|
+
export default class ConnectivityTelematicsIndexEditController extends Controller {
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service intl;
|
|
10
|
+
@service notifications;
|
|
11
|
+
@service modalsManager;
|
|
12
|
+
@tracked overlay;
|
|
13
|
+
|
|
14
|
+
get actionButtons() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
icon: 'eye',
|
|
18
|
+
fn: this.view,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@task *save(telematic) {
|
|
24
|
+
try {
|
|
25
|
+
yield telematic.save();
|
|
26
|
+
this.overlay?.close();
|
|
27
|
+
|
|
28
|
+
yield this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index.details', telematic);
|
|
29
|
+
this.notifications.success(
|
|
30
|
+
this.intl.t('common.resource-updated-success', {
|
|
31
|
+
resource: this.intl.t('resource.telematic'),
|
|
32
|
+
resourceName: telematic.name ?? telematic.provider,
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
this.notifications.serverError(err);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@action cancel() {
|
|
41
|
+
if (this.model.hasDirtyAttributes) {
|
|
42
|
+
return this.#confirmContinueWithUnsavedChanges(this.model);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@action view() {
|
|
49
|
+
if (this.model.hasDirtyAttributes) {
|
|
50
|
+
return this.#confirmContinueWithUnsavedChanges(this.model);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index.details', this.model);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#confirmContinueWithUnsavedChanges(telematic, options = {}) {
|
|
57
|
+
return this.modalsManager.confirm({
|
|
58
|
+
title: this.intl.t('common.continue-without-saving'),
|
|
59
|
+
body: this.intl.t('common.continue-without-saving-prompt', { resource: this.intl.t('resource.telematic') }),
|
|
60
|
+
acceptButtonText: this.intl.t('common.continue'),
|
|
61
|
+
confirm: async () => {
|
|
62
|
+
telematic.rollbackAttributes();
|
|
63
|
+
await this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index.details', telematic);
|
|
64
|
+
},
|
|
65
|
+
...options,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import Controller from '@ember/controller';
|
|
2
2
|
import { inject as service } from '@ember/service';
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import fleetOpsOptions from '../../../utils/fleet-ops-options';
|
|
4
5
|
|
|
5
6
|
export default class ConnectivityTelematicsIndexController extends Controller {
|
|
6
7
|
@service telematicActions;
|
|
7
8
|
@service intl;
|
|
8
9
|
|
|
9
10
|
/** query params */
|
|
10
|
-
@tracked queryParams = ['name', 'page', 'limit', 'sort', 'query', 'public_id', 'created_at', 'updated_at'];
|
|
11
|
+
@tracked queryParams = ['name', 'provider', 'status', 'page', 'limit', 'sort', 'query', 'public_id', 'created_at', 'updated_at'];
|
|
11
12
|
@tracked page = 1;
|
|
12
13
|
@tracked limit;
|
|
13
14
|
@tracked sort = '-created_at';
|
|
14
15
|
@tracked public_id;
|
|
15
16
|
@tracked name;
|
|
17
|
+
@tracked provider;
|
|
18
|
+
@tracked status;
|
|
16
19
|
|
|
17
20
|
/** action buttons */
|
|
18
21
|
@tracked actionButtons = [
|
|
@@ -54,25 +57,32 @@ export default class ConnectivityTelematicsIndexController extends Controller {
|
|
|
54
57
|
/** columns */
|
|
55
58
|
@tracked columns = [
|
|
56
59
|
{
|
|
57
|
-
label:
|
|
58
|
-
valuePath: '
|
|
59
|
-
width: '180px',
|
|
60
|
+
label: 'Provider',
|
|
61
|
+
valuePath: 'provider',
|
|
60
62
|
cellComponent: 'table/cell/anchor',
|
|
61
63
|
cellClassNames: 'uppercase',
|
|
62
64
|
action: this.telematicActions.transition.view,
|
|
63
65
|
permission: 'fleet-ops view telematic',
|
|
64
|
-
hidden: true,
|
|
65
66
|
resizable: true,
|
|
66
67
|
sortable: true,
|
|
67
68
|
filterable: true,
|
|
68
69
|
filterParam: 'name',
|
|
69
70
|
filterComponent: 'filter/string',
|
|
70
71
|
},
|
|
72
|
+
{
|
|
73
|
+
label: this.intl.t('column.status'),
|
|
74
|
+
valuePath: 'status',
|
|
75
|
+
cellComponent: 'table/cell/status',
|
|
76
|
+
resizable: true,
|
|
77
|
+
sortable: true,
|
|
78
|
+
filterable: true,
|
|
79
|
+
filterComponent: 'filter/multi-option',
|
|
80
|
+
filterOptions: fleetOpsOptions('telematicStatuses'),
|
|
81
|
+
},
|
|
71
82
|
{
|
|
72
83
|
label: this.intl.t('column.created-at'),
|
|
73
84
|
valuePath: 'createdAt',
|
|
74
85
|
sortParam: 'created_at',
|
|
75
|
-
width: '10%',
|
|
76
86
|
resizable: true,
|
|
77
87
|
sortable: true,
|
|
78
88
|
filterable: true,
|
|
@@ -82,7 +92,6 @@ export default class ConnectivityTelematicsIndexController extends Controller {
|
|
|
82
92
|
label: this.intl.t('column.updated-at'),
|
|
83
93
|
valuePath: 'updatedAt',
|
|
84
94
|
sortParam: 'updated_at',
|
|
85
|
-
width: '10%',
|
|
86
95
|
resizable: true,
|
|
87
96
|
sortable: true,
|
|
88
97
|
hidden: true,
|
|
@@ -96,18 +105,18 @@ export default class ConnectivityTelematicsIndexController extends Controller {
|
|
|
96
105
|
ddButtonText: false,
|
|
97
106
|
ddButtonIcon: 'ellipsis-h',
|
|
98
107
|
ddButtonIconPrefix: 'fas',
|
|
99
|
-
ddMenuLabel: this.intl.t('common.resource-actions', { resource: this.intl.t('resource.
|
|
108
|
+
ddMenuLabel: this.intl.t('common.resource-actions', { resource: this.intl.t('resource.telematic') }),
|
|
100
109
|
cellClassNames: 'overflow-visible',
|
|
101
110
|
wrapperClass: 'flex items-center justify-end mx-2',
|
|
102
111
|
width: '10%',
|
|
103
112
|
actions: [
|
|
104
113
|
{
|
|
105
|
-
label: this.intl.t('
|
|
114
|
+
label: this.intl.t('common.view-resource', { resource: this.intl.t('resource.telematic') }),
|
|
106
115
|
fn: this.telematicActions.transition.view,
|
|
107
116
|
permission: 'fleet-ops view telematic',
|
|
108
117
|
},
|
|
109
118
|
{
|
|
110
|
-
label: this.intl.t('
|
|
119
|
+
label: this.intl.t('common.edit-resource', { resource: this.intl.t('resource.telematic') }),
|
|
111
120
|
fn: this.telematicActions.transition.edit,
|
|
112
121
|
permission: 'fleet-ops update telematic',
|
|
113
122
|
},
|
|
@@ -115,7 +124,7 @@ export default class ConnectivityTelematicsIndexController extends Controller {
|
|
|
115
124
|
separator: true,
|
|
116
125
|
},
|
|
117
126
|
{
|
|
118
|
-
label: this.intl.t('
|
|
127
|
+
label: this.intl.t('common.delete-resource', { resource: this.intl.t('resource.telematic') }),
|
|
119
128
|
fn: this.telematicActions.delete,
|
|
120
129
|
permission: 'fleet-ops delete telematic',
|
|
121
130
|
},
|
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import Controller from '@ember/controller';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
2
|
import { inject as service } from '@ember/service';
|
|
4
3
|
|
|
5
4
|
export default class ManagementFleetsIndexDetailsController extends Controller {
|
|
6
5
|
@service hostRouter;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
|
|
7
|
+
get tabs() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
route: 'management.fleets.index.details.index',
|
|
11
|
+
label: 'Overview',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
route: 'management.fleets.index.details.vehicles',
|
|
15
|
+
label: 'Vehicles',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
route: 'management.fleets.index.details.drivers',
|
|
19
|
+
label: 'Drivers',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get actionButtons() {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
icon: 'pencil',
|
|
28
|
+
fn: () => this.hostRouter.transitionTo('console.fleet-ops.management.fleets.index.edit', this.model),
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
27
32
|
}
|
|
@@ -10,12 +10,15 @@ export default class ManagementFleetsIndexEditController extends Controller {
|
|
|
10
10
|
@service notifications;
|
|
11
11
|
@service modalsManager;
|
|
12
12
|
@tracked overlay;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
|
|
14
|
+
get actionButtons() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
icon: 'eye',
|
|
18
|
+
fn: this.view,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
19
22
|
|
|
20
23
|
@task *save(fleet) {
|
|
21
24
|
try {
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import Controller from '@ember/controller';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
2
|
import { inject as service } from '@ember/service';
|
|
4
3
|
|
|
5
4
|
export default class ManagementVehiclesIndexDetailsController extends Controller {
|
|
6
5
|
@service hostRouter;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
|
|
7
|
+
get tabs() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
route: 'management.vehicles.index.details.index',
|
|
11
|
+
label: 'Overview',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
route: 'management.vehicles.index.details.positions',
|
|
15
|
+
label: 'Positions',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
route: 'management.vehicles.index.details.devices',
|
|
19
|
+
label: 'Devices',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get actionButtons() {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
icon: 'pencil',
|
|
28
|
+
fn: () => this.hostRouter.transitionTo('console.fleet-ops.management.vehicles.index.edit', this.model),
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
19
32
|
}
|
|
@@ -33,6 +33,12 @@ export default class SettingsCustomFieldsController extends Controller {
|
|
|
33
33
|
label: 'Place',
|
|
34
34
|
groups: [],
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
model: 'entity',
|
|
38
|
+
type: 'fleet-ops:entity',
|
|
39
|
+
label: 'Entity',
|
|
40
|
+
groups: [],
|
|
41
|
+
},
|
|
36
42
|
{
|
|
37
43
|
model: 'fleet',
|
|
38
44
|
type: 'fleet-ops:fleet',
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import fleetOpsOptions from '../utils/fleet-ops-options';
|
|
3
|
+
|
|
4
|
+
export function getFleetOpsOptionLabel(optionsKey, value) {
|
|
5
|
+
const allOptions = fleetOpsOptions(optionsKey);
|
|
6
|
+
return allOptions.find((opt) => opt.value === value)?.label ?? null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default helper(function getFleetOpsOptionLabelHelper([optionsKey, value]) {
|
|
10
|
+
return getFleetOpsOptionLabel(optionsKey, value);
|
|
11
|
+
});
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
2
4
|
|
|
3
|
-
export default class ConnectivityDevicesIndexDetailsRoute extends Route {
|
|
5
|
+
export default class ConnectivityDevicesIndexDetailsRoute extends Route {
|
|
6
|
+
@service store;
|
|
7
|
+
@service notifications;
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service abilities;
|
|
10
|
+
@service intl;
|
|
11
|
+
|
|
12
|
+
@action error(error) {
|
|
13
|
+
this.notifications.serverError(error);
|
|
14
|
+
if (typeof error.message === 'string' && error.message.endsWith('not found')) {
|
|
15
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.devices.index');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeModel() {
|
|
20
|
+
if (this.abilities.cannot('fleet-ops view device')) {
|
|
21
|
+
this.notifications.warning(this.intl.t('common.unauthorized-access'));
|
|
22
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.devices.index');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model({ public_id }) {
|
|
27
|
+
return this.store.findRecord('device', public_id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
2
4
|
|
|
3
|
-
export default class ConnectivityDevicesIndexEditRoute extends Route {
|
|
5
|
+
export default class ConnectivityDevicesIndexEditRoute extends Route {
|
|
6
|
+
@service store;
|
|
7
|
+
@service notifications;
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service abilities;
|
|
10
|
+
@service intl;
|
|
11
|
+
|
|
12
|
+
@action error(error) {
|
|
13
|
+
this.notifications.serverError(error);
|
|
14
|
+
if (typeof error.message === 'string' && error.message.endsWith('not found')) {
|
|
15
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.devices.index');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeModel() {
|
|
20
|
+
if (this.abilities.cannot('fleet-ops update device')) {
|
|
21
|
+
this.notifications.warning(this.intl.t('common.unauthorized-access'));
|
|
22
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.devices.index');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model({ public_id }) {
|
|
27
|
+
return this.store.findRecord('device', public_id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
2
4
|
|
|
3
|
-
export default class ConnectivitySensorsIndexDetailsRoute extends Route {
|
|
5
|
+
export default class ConnectivitySensorsIndexDetailsRoute extends Route {
|
|
6
|
+
@service store;
|
|
7
|
+
@service notifications;
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service abilities;
|
|
10
|
+
@service intl;
|
|
11
|
+
|
|
12
|
+
@action error(error) {
|
|
13
|
+
this.notifications.serverError(error);
|
|
14
|
+
if (typeof error.message === 'string' && error.message.endsWith('not found')) {
|
|
15
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.sensors.index');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeModel() {
|
|
20
|
+
if (this.abilities.cannot('fleet-ops view sensor')) {
|
|
21
|
+
this.notifications.warning(this.intl.t('common.unauthorized-access'));
|
|
22
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.sensors.index');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model({ public_id }) {
|
|
27
|
+
return this.store.findRecord('sensor', public_id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
2
4
|
|
|
3
|
-
export default class ConnectivitySensorsIndexEditRoute extends Route {
|
|
5
|
+
export default class ConnectivitySensorsIndexEditRoute extends Route {
|
|
6
|
+
@service store;
|
|
7
|
+
@service notifications;
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service abilities;
|
|
10
|
+
@service intl;
|
|
11
|
+
|
|
12
|
+
@action error(error) {
|
|
13
|
+
this.notifications.serverError(error);
|
|
14
|
+
if (typeof error.message === 'string' && error.message.endsWith('not found')) {
|
|
15
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.sensors.index');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeModel() {
|
|
20
|
+
if (this.abilities.cannot('fleet-ops update sensor')) {
|
|
21
|
+
this.notifications.warning(this.intl.t('common.unauthorized-access'));
|
|
22
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.sensors.index');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model({ public_id }) {
|
|
27
|
+
return this.store.findRecord('sensor', public_id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
2
4
|
|
|
3
|
-
export default class ConnectivityTelematicsIndexDetailsRoute extends Route {
|
|
5
|
+
export default class ConnectivityTelematicsIndexDetailsRoute extends Route {
|
|
6
|
+
@service store;
|
|
7
|
+
@service notifications;
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service abilities;
|
|
10
|
+
@service intl;
|
|
11
|
+
|
|
12
|
+
@action error(error) {
|
|
13
|
+
this.notifications.serverError(error);
|
|
14
|
+
if (typeof error.message === 'string' && error.message.endsWith('not found')) {
|
|
15
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeModel() {
|
|
20
|
+
if (this.abilities.cannot('fleet-ops view telematic')) {
|
|
21
|
+
this.notifications.warning(this.intl.t('common.unauthorized-access'));
|
|
22
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model({ public_id }) {
|
|
27
|
+
return this.store.findRecord('telematic', public_id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
2
4
|
|
|
3
|
-
export default class ConnectivityTelematicsIndexEditRoute extends Route {
|
|
5
|
+
export default class ConnectivityTelematicsIndexEditRoute extends Route {
|
|
6
|
+
@service store;
|
|
7
|
+
@service notifications;
|
|
8
|
+
@service hostRouter;
|
|
9
|
+
@service abilities;
|
|
10
|
+
@service intl;
|
|
11
|
+
|
|
12
|
+
@action error(error) {
|
|
13
|
+
this.notifications.serverError(error);
|
|
14
|
+
if (typeof error.message === 'string' && error.message.endsWith('not found')) {
|
|
15
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
beforeModel() {
|
|
20
|
+
if (this.abilities.cannot('fleet-ops update telematic')) {
|
|
21
|
+
this.notifications.warning(this.intl.t('common.unauthorized-access'));
|
|
22
|
+
return this.hostRouter.transitionTo('console.fleet-ops.connectivity.telematics.index');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
model({ public_id }) {
|
|
27
|
+
return this.store.findRecord('telematic', public_id);
|
|
28
|
+
}
|
|
29
|
+
}
|
package/addon/routes.js
CHANGED
|
@@ -62,6 +62,7 @@ export default buildRoutes(function () {
|
|
|
62
62
|
this.route('new');
|
|
63
63
|
this.route('details', { path: '/:public_id' }, function () {
|
|
64
64
|
this.route('index', { path: '/' });
|
|
65
|
+
this.route('positions');
|
|
65
66
|
});
|
|
66
67
|
this.route('edit', { path: '/edit/:public_id' });
|
|
67
68
|
});
|
|
@@ -71,6 +72,9 @@ export default buildRoutes(function () {
|
|
|
71
72
|
this.route('new');
|
|
72
73
|
this.route('details', { path: '/:public_id' }, function () {
|
|
73
74
|
this.route('index', { path: '/' });
|
|
75
|
+
this.route('positions');
|
|
76
|
+
this.route('devices');
|
|
77
|
+
this.route('equipment');
|
|
74
78
|
});
|
|
75
79
|
this.route('edit', { path: '/edit/:public_id' });
|
|
76
80
|
});
|