@fleetbase/fleetops-engine 0.6.19 → 0.6.21
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/details.hbs +92 -43
- package/addon/components/device/form.hbs +108 -60
- package/addon/components/device/form.js +36 -8
- package/addon/components/device/panel-header.hbs +32 -0
- package/addon/components/device/panel-header.js +3 -0
- package/addon/components/driver/form.hbs +1 -1
- package/addon/components/driver/form.js +49 -47
- 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 +58 -0
- package/addon/components/map/drawer/device-event-listing.js +181 -0
- package/addon/components/map/drawer/position-listing.hbs +84 -0
- package/addon/components/map/drawer/position-listing.js +289 -0
- package/addon/components/map/drawer.js +2 -0
- package/addon/components/map/leaflet-live-map.hbs +7 -2
- package/addon/components/order/details/payload.hbs +6 -4
- package/addon/components/order/details/payload.js +2 -0
- package/addon/components/order/kanban.hbs +12 -10
- package/addon/components/order/kanban.js +27 -3
- package/addon/components/order-config-manager/custom-fields.js +1 -1
- package/addon/components/positions-replay.hbs +333 -0
- package/addon/components/positions-replay.js +372 -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 +1 -1
- 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 +21 -13
- package/addon/controllers/operations/orders/index/new.js +4 -2
- package/addon/controllers/operations/orders/index.js +50 -45
- 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/vehicles/index/details/positions.js +3 -0
- package/addon/routes/operations/orders/index.js +0 -3
- package/addon/routes.js +1 -0
- package/addon/services/movement-tracker.js +81 -30
- package/addon/services/order-creation.js +4 -8
- package/addon/services/order-validation.js +3 -3
- package/addon/styles/fleetops-engine.css +192 -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/vehicles/index/details/positions.hbs +1 -0
- package/addon/templates/operations/orders/index.hbs +26 -2
- package/addon/utils/fleet-ops-options.js +95 -0
- package/addon/utils/setup-customer-portal.js +7 -0
- package/app/components/device/panel-header.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/positions-replay.js +1 -0
- package/app/components/sensor/panel-header.js +1 -0
- package/app/helpers/get-fleet-ops-option-label.js +1 -0
- package/app/routes/management/vehicles/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/OrderController.php +50 -68
- 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/Internal/v1/TelematicWebhookController.php +170 -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/Device.php +72 -10
- package/server/src/Models/DeviceEvent.php +7 -0
- package/server/src/Models/Driver.php +28 -1
- package/server/src/Models/Payload.php +11 -3
- package/server/src/Models/Place.php +9 -2
- package/server/src/Models/Position.php +17 -17
- package/server/src/Models/Sensor.php +78 -13
- package/server/src/Models/Telematic.php +116 -6
- package/server/src/Models/Vehicle.php +104 -1
- 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 +12 -1
|
@@ -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,27 @@
|
|
|
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
|
+
}
|
|
19
|
+
get actionButtons() {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
icon: 'pencil',
|
|
23
|
+
fn: () => this.hostRouter.transitionTo('console.fleet-ops.management.vehicles.index.edit', this.model),
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
19
27
|
}
|
|
@@ -66,8 +66,10 @@ export default class OperationsOrdersIndexNewController extends Controller {
|
|
|
66
66
|
this.universe.trigger('fleet-ops.order.creating', order);
|
|
67
67
|
|
|
68
68
|
// Save custom field values
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
if (order.cfManager) {
|
|
70
|
+
const { created: customFieldValues } = yield order.cfManager.saveTo(order);
|
|
71
|
+
order.custom_field_values.pushObjects(customFieldValues);
|
|
72
|
+
}
|
|
71
73
|
|
|
72
74
|
// Save order
|
|
73
75
|
const createdOrder = yield order.save();
|
|
@@ -63,57 +63,62 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
63
63
|
@tracked without_driver;
|
|
64
64
|
@tracked status;
|
|
65
65
|
@tracked type;
|
|
66
|
+
@tracked orderConfig;
|
|
66
67
|
@tracked bulkSearchValue = '';
|
|
67
68
|
@tracked bulk_query = '';
|
|
68
69
|
@tracked layout = 'map';
|
|
69
70
|
|
|
70
71
|
/** action buttons */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
get actionButtons() {
|
|
73
|
+
return [
|
|
74
|
+
{
|
|
75
|
+
icon: 'refresh',
|
|
76
|
+
onClick: this.orderActions.refresh,
|
|
77
|
+
helpText: this.intl.t('common.refresh'),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
text: this.intl.t('common.new'),
|
|
81
|
+
type: 'primary',
|
|
82
|
+
icon: 'plus',
|
|
83
|
+
onClick: this.orderActions.transition.create,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
text: this.intl.t('common.export'),
|
|
87
|
+
icon: 'long-arrow-up',
|
|
88
|
+
iconClass: 'rotate-icon-45',
|
|
89
|
+
wrapperClass: 'hidden md:flex',
|
|
90
|
+
onClick: this.orderActions.export,
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
}
|
|
91
94
|
|
|
92
95
|
/** bulk actions */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
96
|
+
get bulkActions() {
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
label: this.intl.t('common.cancel-resource', { resource: this.intl.t('resource.orders') }),
|
|
100
|
+
icon: 'ban',
|
|
101
|
+
fn: this.orderActions.bulkCancel,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: this.intl.t('common.delete-resource', { resource: this.intl.t('resource.orders') }),
|
|
105
|
+
icon: 'trash',
|
|
106
|
+
class: 'text-red-500',
|
|
107
|
+
fn: this.orderActions.bulkDelete,
|
|
108
|
+
},
|
|
109
|
+
{ separator: true },
|
|
110
|
+
{
|
|
111
|
+
label: this.intl.t('common.dispatch-orders'),
|
|
112
|
+
icon: 'rocket',
|
|
113
|
+
fn: this.orderActions.bulkDispatch,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: this.intl.t('common.assign-driver'),
|
|
117
|
+
icon: 'user-plus',
|
|
118
|
+
fn: this.orderActions.bulkAssignDriver,
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
}
|
|
117
122
|
|
|
118
123
|
/** columns */
|
|
119
124
|
get columns() {
|
|
@@ -366,7 +371,7 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
366
371
|
ddButtonText: false,
|
|
367
372
|
ddButtonIcon: 'ellipsis-h',
|
|
368
373
|
ddButtonIconPrefix: 'fas',
|
|
369
|
-
ddMenuLabel: this.intl.t('common.resource-actions', { resource: this.intl.t('resource.
|
|
374
|
+
ddMenuLabel: this.intl.t('common.resource-actions', { resource: this.intl.t('resource.order') }),
|
|
370
375
|
cellClassNames: 'overflow-visible',
|
|
371
376
|
wrapperClass: 'flex items-center justify-end mx-2',
|
|
372
377
|
width: '12%',
|
|
@@ -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
|
+
}
|
|
@@ -30,9 +30,6 @@ export default class OperationsOrdersIndexRoute extends Route {
|
|
|
30
30
|
before: { refreshModel: true },
|
|
31
31
|
type: { refreshModel: true },
|
|
32
32
|
layout: { refreshModel: false },
|
|
33
|
-
drawerOpen: { refreshModel: false },
|
|
34
|
-
drawerTab: { refreshModel: false },
|
|
35
|
-
orderPanelOpen: { refreshModel: false },
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
model(params) {
|
package/addon/routes.js
CHANGED