@fleetbase/fleetops-engine 0.6.27 → 0.6.28
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/admin/avatar-management.js +24 -26
- package/addon/components/admin/navigator-app.hbs +1 -1
- package/addon/components/driver/details.hbs +4 -0
- package/addon/components/layout/fleet-ops-sidebar.js +3 -2
- package/addon/components/map/drawer.hbs +1 -1
- package/addon/components/map/drawer.js +2 -1
- package/addon/components/map/leaflet-live-map.js +8 -7
- package/addon/components/order/details/purchase-rate.hbs +2 -2
- package/addon/components/order/form/payload.hbs +1 -1
- package/addon/components/order-config-manager.js +2 -1
- package/addon/components/vehicle/details.hbs +5 -1
- package/addon/controllers/connectivity/devices/index/details/virtual.js +7 -0
- package/addon/controllers/connectivity/devices/index/details.js +4 -0
- package/addon/controllers/connectivity/sensors/index/details/virtual.js +7 -0
- package/addon/controllers/connectivity/sensors/index/details.js +4 -0
- package/addon/controllers/management/drivers/index/details/virtual.js +7 -0
- package/addon/controllers/management/drivers/index/details.js +4 -4
- package/addon/controllers/management/fleets/index/details/virtual.js +7 -0
- package/addon/controllers/management/fleets/index/details.js +4 -0
- package/addon/controllers/management/places/index/details/virtual.js +7 -0
- package/addon/controllers/management/places/index/details.js +22 -13
- package/addon/controllers/management/vehicles/index/details/virtual.js +7 -0
- package/addon/controllers/management/vehicles/index/details.js +4 -0
- package/addon/controllers/management/vehicles/index.js +2 -2
- package/addon/engine.js +1 -128
- package/addon/extension.js +116 -0
- package/addon/instance-initializers/register-osrm.js +32 -0
- package/addon/instance-initializers/setup-customer-portal.js +10 -0
- package/addon/routes/connectivity/devices/index/details/virtual.js +23 -0
- package/addon/routes/connectivity/sensors/index/details/virtual.js +23 -0
- package/addon/routes/management/drivers/index/details/virtual.js +23 -0
- package/addon/routes/management/drivers/index/details.js +0 -4
- package/addon/routes/management/fleets/index/details/virtual.js +23 -0
- package/addon/routes/management/places/index/details/virtual.js +23 -0
- package/addon/routes/management/vehicles/index/details/virtual.js +23 -0
- package/addon/routes/management/vehicles/index/details.js +0 -4
- package/addon/routes/virtual.js +2 -1
- package/addon/routes.js +6 -0
- package/addon/styles/fleetops-engine.css +5 -0
- package/addon/templates/connectivity/devices/index/details/virtual.hbs +1 -0
- package/addon/templates/connectivity/sensors/index/details/virtual.hbs +1 -0
- package/addon/templates/management/drivers/index/details/virtual.hbs +1 -0
- package/addon/templates/management/fleets/index/details/virtual.hbs +1 -0
- package/addon/templates/management/places/index/details/virtual.hbs +1 -0
- package/addon/templates/management/vehicles/index/details/virtual.hbs +1 -0
- package/addon/templates/virtual.hbs +1 -1
- package/addon/utils/setup-customer-portal.js +49 -23
- package/app/controllers/connectivity/devices/index/details/virtual.js +1 -0
- package/app/controllers/connectivity/sensors/index/details/virtual.js +1 -0
- package/app/controllers/management/drivers/index/details/virtual.js +1 -0
- package/app/controllers/management/fleets/index/details/virtual.js +1 -0
- package/app/controllers/management/places/index/details/virtual.js +1 -0
- package/app/controllers/management/vehicles/index/details/virtual.js +1 -0
- package/app/routes/connectivity/devices/index/details/virtual.js +1 -0
- package/app/routes/connectivity/sensors/index/details/virtual.js +1 -0
- package/app/routes/management/drivers/index/details/virtual.js +1 -0
- package/app/routes/management/fleets/index/details/virtual.js +1 -0
- package/app/routes/management/places/index/details/virtual.js +1 -0
- package/app/routes/management/vehicles/index/details/virtual.js +1 -0
- package/app/templates/connectivity/devices/index/details/virtual.js +1 -0
- package/app/templates/connectivity/sensors/index/details/virtual.js +1 -0
- package/app/templates/management/drivers/index/details/virtual.js +1 -0
- package/app/templates/management/fleets/index/details/virtual.js +1 -0
- package/app/templates/management/places/index/details/virtual.js +1 -0
- package/app/templates/management/vehicles/index/details/virtual.js +1 -0
- package/composer.json +1 -1
- package/config/environment.js +1 -1
- package/extension.json +1 -1
- package/package.json +3 -3
- package/addon/helpers/avatar-url.js +0 -9
- package/addon/helpers/point-coordinates.js +0 -10
- package/addon/helpers/point-to-coordinates.js +0 -32
- package/addon/helpers/unwrap-coordinates.js +0 -83
- package/app/helpers/avatar-url.js +0 -1
- package/app/helpers/point-coordinates.js +0 -1
- package/app/helpers/point-to-coordinates.js +0 -1
- package/app/helpers/unwrap-coordinates.js +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { MenuItem, Widget, ExtensionComponent } from '@fleetbase/ember-core/contracts';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
setupExtension(app, universe) {
|
|
5
|
+
const menuService = universe.getService('menu');
|
|
6
|
+
const registryService = universe.getService('registry');
|
|
7
|
+
const widgetService = universe.getService('widget');
|
|
8
|
+
|
|
9
|
+
// Register header navigation
|
|
10
|
+
menuService.registerHeaderMenuItem('Fleet-Ops', 'console.fleet-ops', { icon: 'route', priority: 0 });
|
|
11
|
+
|
|
12
|
+
// Register admin sections
|
|
13
|
+
menuService.registerAdminMenuPanel(
|
|
14
|
+
'Fleet-Ops Config',
|
|
15
|
+
[
|
|
16
|
+
new MenuItem({
|
|
17
|
+
title: 'Navigator App',
|
|
18
|
+
icon: 'location-arrow',
|
|
19
|
+
component: new ExtensionComponent('@fleetbase/fleetops-engine', 'admin/navigator-app'),
|
|
20
|
+
}),
|
|
21
|
+
new MenuItem({
|
|
22
|
+
title: 'Avatar Managemenet',
|
|
23
|
+
icon: 'images',
|
|
24
|
+
component: new ExtensionComponent('@fleetbase/fleetops-engine', 'admin/avatar-management'),
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
{
|
|
28
|
+
slug: 'fleet-ops',
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
// Register track order button
|
|
33
|
+
menuService.registerMenuItem(
|
|
34
|
+
'auth:login',
|
|
35
|
+
new MenuItem({
|
|
36
|
+
title: 'Track Order',
|
|
37
|
+
route: 'virtual',
|
|
38
|
+
slug: 'track-order',
|
|
39
|
+
icon: 'barcode',
|
|
40
|
+
type: 'link',
|
|
41
|
+
wrapperClass: 'btn-block py-1 border dark:border-gray-700 border-gray-200 hover:opacity-50',
|
|
42
|
+
component: new ExtensionComponent('@fleetbase/fleetops-engine', 'order-tracking-lookup'),
|
|
43
|
+
onClick: (menuItem) => {
|
|
44
|
+
universe.transitionMenuItem('virtual', menuItem);
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Register widgets
|
|
50
|
+
this.registerWidgets(widgetService);
|
|
51
|
+
|
|
52
|
+
// Create registries
|
|
53
|
+
this.createRegistries(registryService);
|
|
54
|
+
|
|
55
|
+
// Setup customer portal
|
|
56
|
+
const isCustomerPortalInstalled = universe.extensionManager.isInstalled('@fleetbase/customer-portal-engine');
|
|
57
|
+
if (isCustomerPortalInstalled) {
|
|
58
|
+
universe.whenEngineLoaded('@fleetbase/customer-portal-engine', () => {
|
|
59
|
+
universe.extensionManager.ensureEngineLoaded('@fleetbase/fleetops-engine');
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
registerWidgets(widgetService) {
|
|
65
|
+
const widgets = [
|
|
66
|
+
new Widget({
|
|
67
|
+
id: 'fleet-ops-key-metrics-widget',
|
|
68
|
+
name: 'Fleet-Ops Metrics',
|
|
69
|
+
description: 'Key metrics from Fleet-Ops.',
|
|
70
|
+
icon: 'truck',
|
|
71
|
+
component: new ExtensionComponent('@fleetbase/fleetops-engine', 'widget/fleet-ops-key-metrics'),
|
|
72
|
+
grid_options: { w: 12, h: 12, minW: 8, minH: 12 },
|
|
73
|
+
default: true,
|
|
74
|
+
}),
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
widgetService.registerWidgets('dashboard', widgets);
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
createRegistries(registryService) {
|
|
81
|
+
registryService.createRegistries([
|
|
82
|
+
'engine:fleet-ops',
|
|
83
|
+
'fleet-ops:component:map:drawer',
|
|
84
|
+
'fleet-ops:component:vehicle:details',
|
|
85
|
+
'fleet-ops:component:driver:details',
|
|
86
|
+
'fleet-ops:component:order-config-manager',
|
|
87
|
+
'fleet-ops:component:contact:form',
|
|
88
|
+
'fleet-ops:component:contact:form:details',
|
|
89
|
+
'fleet-ops:component:customer:form',
|
|
90
|
+
'fleet-ops:component:customer:form:details',
|
|
91
|
+
'fleet-ops:component:driver:form',
|
|
92
|
+
'fleet-ops:component:driver:form:details',
|
|
93
|
+
'fleet-ops:component:fleet:form',
|
|
94
|
+
'fleet-ops:component:fleet:form:details',
|
|
95
|
+
'fleet-ops:component:place:form',
|
|
96
|
+
'fleet-ops:component:place:form:details',
|
|
97
|
+
'fleet-ops:component:vehicle:form',
|
|
98
|
+
'fleet-ops:component:vehicle:form:details',
|
|
99
|
+
'fleet-ops:component:vendor:form:edit',
|
|
100
|
+
'fleet-ops:component:vendor:form:edit:details',
|
|
101
|
+
'fleet-ops:component:vendor:form:create',
|
|
102
|
+
'fleet-ops:component:vendor:form:create:details',
|
|
103
|
+
'fleet-ops:component:issue:form',
|
|
104
|
+
'fleet-ops:component:issue:form:details',
|
|
105
|
+
'fleet-ops:component:fuel-report:form',
|
|
106
|
+
'fleet-ops:component:fuel-report:form:details',
|
|
107
|
+
'fleet-ops:contextmenu:vehicle',
|
|
108
|
+
'fleet-ops:contextmenu:driver',
|
|
109
|
+
'fleet-ops:component:order:details',
|
|
110
|
+
'fleet-ops:component:order:form',
|
|
111
|
+
'fleet-ops:component:order:form:payload:entity',
|
|
112
|
+
'fleet-ops:component:order:form:payload:entity:form',
|
|
113
|
+
'fleet-ops:template:settings:routing',
|
|
114
|
+
]);
|
|
115
|
+
},
|
|
116
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
2
|
+
import { RoutingControl } from '../services/leaflet-routing-control';
|
|
3
|
+
import { OSRMv1 } from '@fleetbase/leaflet-routing-machine';
|
|
4
|
+
|
|
5
|
+
export function initialize(owner) {
|
|
6
|
+
// Register OSRM as route optimization service
|
|
7
|
+
const routeOptimization = owner.lookup('service:route-optimization');
|
|
8
|
+
const osrm = owner.lookup('service:osrm');
|
|
9
|
+
if (routeOptimization && osrm) {
|
|
10
|
+
routeOptimization.register('osrm', osrm);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Register OSRM as Routing Controler
|
|
14
|
+
const leafletRoutingControl = owner.lookup('service:leaflet-routing-control');
|
|
15
|
+
if (leafletRoutingControl) {
|
|
16
|
+
const routingHost = getRoutingHost();
|
|
17
|
+
leafletRoutingControl.register(
|
|
18
|
+
'osrm',
|
|
19
|
+
new RoutingControl({
|
|
20
|
+
name: 'OSRM',
|
|
21
|
+
router: new OSRMv1({
|
|
22
|
+
serviceUrl: `${routingHost}/route/v1`,
|
|
23
|
+
profile: 'driving',
|
|
24
|
+
}),
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
initialize,
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import setupCustomerPortal from '../utils/setup-customer-portal';
|
|
2
|
+
|
|
3
|
+
export function initialize(engineInstance) {
|
|
4
|
+
const universe = engineInstance.lookup('service:universe');
|
|
5
|
+
setupCustomerPortal(engineInstance, universe);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
initialize,
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
|
|
4
|
+
export default class ConnectivityDevicesIndexDetailsVirtualRoute extends Route {
|
|
5
|
+
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
7
|
+
|
|
8
|
+
queryParams = {
|
|
9
|
+
view: {
|
|
10
|
+
refreshModel: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
model({ section = null, slug }, transition) {
|
|
15
|
+
const view = this.universe.getViewFromTransition(transition);
|
|
16
|
+
return this.menuService.lookupMenuItem('fleet-ops:component:device:details', slug, view, section);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setupController(controller) {
|
|
20
|
+
super.setupController(...arguments);
|
|
21
|
+
controller.resource = this.modelFor('connectivity.devices.index.details');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
|
|
4
|
+
export default class ConnectivitySensorsIndexDetailsVirtualRoute extends Route {
|
|
5
|
+
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
7
|
+
|
|
8
|
+
queryParams = {
|
|
9
|
+
view: {
|
|
10
|
+
refreshModel: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
model({ section = null, slug }, transition) {
|
|
15
|
+
const view = this.universe.getViewFromTransition(transition);
|
|
16
|
+
return this.menuService.lookupMenuItem('fleet-ops:component:sensor:details', slug, view, section);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setupController(controller) {
|
|
20
|
+
super.setupController(...arguments);
|
|
21
|
+
controller.resource = this.modelFor('connectivity.sensors.index.details');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
|
|
4
|
+
export default class ManagementDriversIndexDetailsVirtualRoute extends Route {
|
|
5
|
+
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
7
|
+
|
|
8
|
+
queryParams = {
|
|
9
|
+
view: {
|
|
10
|
+
refreshModel: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
model({ section = null, slug }, transition) {
|
|
15
|
+
const view = this.universe.getViewFromTransition(transition);
|
|
16
|
+
return this.menuService.lookupMenuItem('fleet-ops:component:driver:details', slug, view, section);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setupController(controller) {
|
|
20
|
+
super.setupController(...arguments);
|
|
21
|
+
controller.resource = this.modelFor('management.drivers.index.details');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
|
|
4
|
+
export default class ManagementFleetsIndexDetailsVirtualRoute extends Route {
|
|
5
|
+
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
7
|
+
|
|
8
|
+
queryParams = {
|
|
9
|
+
view: {
|
|
10
|
+
refreshModel: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
model({ section = null, slug }, transition) {
|
|
15
|
+
const view = this.universe.getViewFromTransition(transition);
|
|
16
|
+
return this.menuService.lookupMenuItem('fleet-ops:component:fleet:details', slug, view, section);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setupController(controller) {
|
|
20
|
+
super.setupController(...arguments);
|
|
21
|
+
controller.resource = this.modelFor('management.fleets.index.details');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
|
|
4
|
+
export default class ManagementPlacesIndexDetailsVirtualRoute extends Route {
|
|
5
|
+
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
7
|
+
|
|
8
|
+
queryParams = {
|
|
9
|
+
view: {
|
|
10
|
+
refreshModel: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
model({ section = null, slug }, transition) {
|
|
15
|
+
const view = this.universe.getViewFromTransition(transition);
|
|
16
|
+
return this.menuService.lookupMenuItem('fleet-ops:component:place:details', slug, view, section);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setupController(controller) {
|
|
20
|
+
super.setupController(...arguments);
|
|
21
|
+
controller.resource = this.modelFor('management.places.index.details');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
|
|
4
|
+
export default class ManagementVehiclesIndexDetailsVirtualRoute extends Route {
|
|
5
|
+
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
7
|
+
|
|
8
|
+
queryParams = {
|
|
9
|
+
view: {
|
|
10
|
+
refreshModel: true,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
model({ section = null, slug }, transition) {
|
|
15
|
+
const view = this.universe.getViewFromTransition(transition);
|
|
16
|
+
return this.menuService.lookupMenuItem('fleet-ops:component:vehicle:details', slug, view, section);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
setupController(controller) {
|
|
20
|
+
super.setupController(...arguments);
|
|
21
|
+
controller.resource = this.modelFor('management.vehicles.index.details');
|
|
22
|
+
}
|
|
23
|
+
}
|
package/addon/routes/virtual.js
CHANGED
|
@@ -3,6 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
|
|
4
4
|
export default class VirtualRoute extends Route {
|
|
5
5
|
@service universe;
|
|
6
|
+
@service('universe/menu-service') menuService;
|
|
6
7
|
|
|
7
8
|
queryParams = {
|
|
8
9
|
view: {
|
|
@@ -12,6 +13,6 @@ export default class VirtualRoute extends Route {
|
|
|
12
13
|
|
|
13
14
|
model({ section = null, slug }, transition) {
|
|
14
15
|
const view = this.universe.getViewFromTransition(transition);
|
|
15
|
-
return this.
|
|
16
|
+
return this.menuService.lookupMenuItem('engine:fleet-ops', slug, view, section);
|
|
16
17
|
}
|
|
17
18
|
}
|
package/addon/routes.js
CHANGED
|
@@ -37,6 +37,7 @@ export default buildRoutes(function () {
|
|
|
37
37
|
this.route('index', { path: '/' });
|
|
38
38
|
this.route('vehicles');
|
|
39
39
|
this.route('drivers');
|
|
40
|
+
this.route('virtual', { path: '/:slug' });
|
|
40
41
|
});
|
|
41
42
|
this.route('edit', { path: '/edit/:public_id' });
|
|
42
43
|
});
|
|
@@ -64,6 +65,7 @@ export default buildRoutes(function () {
|
|
|
64
65
|
this.route('index', { path: '/' });
|
|
65
66
|
this.route('positions');
|
|
66
67
|
this.route('schedule');
|
|
68
|
+
this.route('virtual', { path: '/:slug' });
|
|
67
69
|
});
|
|
68
70
|
this.route('edit', { path: '/edit/:public_id' });
|
|
69
71
|
});
|
|
@@ -76,6 +78,7 @@ export default buildRoutes(function () {
|
|
|
76
78
|
this.route('positions');
|
|
77
79
|
this.route('devices');
|
|
78
80
|
this.route('equipment');
|
|
81
|
+
this.route('virtual', { path: '/:slug' });
|
|
79
82
|
});
|
|
80
83
|
this.route('edit', { path: '/edit/:public_id' });
|
|
81
84
|
});
|
|
@@ -92,6 +95,7 @@ export default buildRoutes(function () {
|
|
|
92
95
|
this.route('comments');
|
|
93
96
|
this.route('documents');
|
|
94
97
|
this.route('rules');
|
|
98
|
+
this.route('virtual', { path: '/:slug' });
|
|
95
99
|
});
|
|
96
100
|
this.route('edit', { path: '/edit/:public_id' });
|
|
97
101
|
});
|
|
@@ -152,6 +156,7 @@ export default buildRoutes(function () {
|
|
|
152
156
|
this.route('details', { path: '/:public_id' }, function () {
|
|
153
157
|
this.route('index', { path: '/' });
|
|
154
158
|
this.route('events');
|
|
159
|
+
this.route('virtual', { path: '/:slug' });
|
|
155
160
|
});
|
|
156
161
|
});
|
|
157
162
|
});
|
|
@@ -162,6 +167,7 @@ export default buildRoutes(function () {
|
|
|
162
167
|
this.route('edit', { path: '/edit/:public_id' });
|
|
163
168
|
this.route('details', { path: '/:public_id' }, function () {
|
|
164
169
|
this.route('index', { path: '/' });
|
|
170
|
+
this.route('virtual', { path: '/:slug' });
|
|
165
171
|
});
|
|
166
172
|
});
|
|
167
173
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{component (lazy-engine-component @model.component) resource=this.resource device=this.resource params=@model.componentParams}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{component (lazy-engine-component @model.component) resource=this.resource sensor=this.resource params=@model.componentParams}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{component (lazy-engine-component @model.component) resource=this.resource driver=this.resource params=@model.componentParams}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{component (lazy-engine-component @model.component) resource=this.resource fleet=this.resource params=@model.componentParams}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{component (lazy-engine-component @model.component) resource=this.resource place=this.resource params=@model.componentParams}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{component (lazy-engine-component @model.component) resource=this.resource vehicle=this.resource params=@model.componentParams}}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<Layout::Section::Body id="fleetops-virtual-body" class="overflow-y-scroll h-full">
|
|
4
4
|
<div id="fleetops-virtual-container" class="container mx-auto h-screen">
|
|
5
5
|
<div id="fleetops-virtual-wrapper" class="max-w-3xl my-10 mx-auto">
|
|
6
|
-
{{component @model.component params=@model.componentParams}}
|
|
6
|
+
{{component (lazy-engine-component @model.component) params=@model.componentParams}}
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
<Spacer @height="300px" />
|
|
@@ -1,31 +1,62 @@
|
|
|
1
1
|
import CustomerOrdersComponent from '../components/customer/orders';
|
|
2
2
|
import CustomerAdminSettingsComponent from '../components/customer/admin-settings';
|
|
3
|
+
import { MenuItem } from '@fleetbase/ember-core/contracts';
|
|
3
4
|
import { setOwner } from '@ember/application';
|
|
4
5
|
import { debug } from '@ember/debug';
|
|
5
6
|
|
|
6
|
-
export default function setupCustomerPortal(
|
|
7
|
-
|
|
7
|
+
export default function setupCustomerPortal(fleetopsEngine, universe) {
|
|
8
|
+
const extensionManager = universe.getService('universe/extension-manager');
|
|
9
|
+
const isCustomerPortalInstalled = extensionManager.isInstalled('@fleetbase/customer-portal-engine');
|
|
10
|
+
if (!isCustomerPortalInstalled) return;
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return;
|
|
12
|
+
// If customer portal already loaded just run setup
|
|
13
|
+
if (extensionManager.isEngineLoaded('@fleetbase/customer-portal-engine')) {
|
|
14
|
+
const customerPortalEngine = extensionManager.getEngineInstance('@fleetbase/customer-portal-engine');
|
|
15
|
+
if (customerPortalEngine) {
|
|
16
|
+
return setup(customerPortalEngine, fleetopsEngine, universe);
|
|
14
17
|
}
|
|
18
|
+
}
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
// Otherwise, wait for customer portal engine to load to run setup
|
|
21
|
+
universe.onEngineLoaded('@fleetbase/customer-portal-engine', (customerPortalEngine) => {
|
|
22
|
+
setup(customerPortalEngine, fleetopsEngine, universe);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
icon: 'boxes-packing',
|
|
23
|
-
component: createEngineBoundComponent(portal, CustomerOrdersComponent),
|
|
24
|
-
}),
|
|
25
|
-
]);
|
|
26
|
+
function setup(customerPortalEngine, fleetopsEngine, universe) {
|
|
27
|
+
// If setup already completed don't run again
|
|
28
|
+
if (customerPortalEngine?._fleetopsSetupCompleted === true) return;
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
// Alias FleetOps services into Customer Portal before rendering
|
|
31
|
+
createServiceAlias(fleetopsEngine, customerPortalEngine, [
|
|
32
|
+
'leaflet-map-manager',
|
|
33
|
+
'location',
|
|
34
|
+
'movement-tracker',
|
|
35
|
+
'leaflet-routing-control',
|
|
36
|
+
'order-config-actions',
|
|
37
|
+
'order-creation',
|
|
38
|
+
'order-validation',
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
const menuService = universe.getService('universe/menu-service');
|
|
42
|
+
const registryService = universe.getService('universe/registry-service');
|
|
43
|
+
|
|
44
|
+
// Register customer orders from Fleet-Ops
|
|
45
|
+
menuService.registerMenuItem(
|
|
46
|
+
'customer-portal:sidebar',
|
|
47
|
+
new MenuItem({
|
|
48
|
+
title: 'Orders',
|
|
49
|
+
route: 'customer-portal.portal.virtual',
|
|
50
|
+
icon: 'boxes-packing',
|
|
51
|
+
component: createEngineBoundComponent(customerPortalEngine, CustomerOrdersComponent),
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
// Register registries
|
|
56
|
+
registryService.register('customer-portal:admin-settings', '@fleetbase/customer-portal-engine', CustomerAdminSettingsComponent);
|
|
57
|
+
|
|
58
|
+
// Flag fleetops setup complete
|
|
59
|
+
customerPortalEngine._fleetopsSetupCompleted = true;
|
|
29
60
|
}
|
|
30
61
|
|
|
31
62
|
function createServiceAlias(sourceOwner, destOwner, serviceNames) {
|
|
@@ -60,8 +91,3 @@ function createEngineBoundComponent(engineInstance, ComponentClass) {
|
|
|
60
91
|
}
|
|
61
92
|
};
|
|
62
93
|
}
|
|
63
|
-
|
|
64
|
-
function customerPortalInstalled(app) {
|
|
65
|
-
const extensions = app.extensions ?? [];
|
|
66
|
-
return extensions.find(({ name }) => name === '@fleetbase/customer-portal-engine');
|
|
67
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/connectivity/devices/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/connectivity/sensors/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/management/drivers/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/management/fleets/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/management/places/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/management/vehicles/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/connectivity/devices/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/connectivity/sensors/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/management/drivers/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/management/fleets/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/management/places/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/management/vehicles/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/connectivity/devices/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/connectivity/sensors/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/management/drivers/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/management/fleets/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/management/places/index/details/virtual';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/management/vehicles/index/details/virtual';
|
package/composer.json
CHANGED
package/config/environment.js
CHANGED
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.28",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/core": "^7.23.2",
|
|
45
|
-
"@fleetbase/ember-core": "^0.3.
|
|
46
|
-
"@fleetbase/ember-ui": "^0.3.
|
|
45
|
+
"@fleetbase/ember-core": "^0.3.7",
|
|
46
|
+
"@fleetbase/ember-ui": "^0.3.12",
|
|
47
47
|
"@fleetbase/fleetops-data": "^0.1.23",
|
|
48
48
|
"@fleetbase/leaflet-routing-machine": "^3.2.17",
|
|
49
49
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|