fleetmap-reports 1.0.529 → 1.0.531
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/package.json +1 -1
- package/src/index.test.js +2 -2
- package/src/util/index.js +2 -1
- package/src/zone-report.js +2 -2
package/package.json
CHANGED
package/src/index.test.js
CHANGED
|
@@ -41,7 +41,7 @@ describe('Test_Reports', function () {
|
|
|
41
41
|
const userData = await report.getUserData()
|
|
42
42
|
userData.roadSpeedLimits = true
|
|
43
43
|
const { device } = await getSpeedingReport(report, userData)
|
|
44
|
-
assert.equal(device.alerts.length,
|
|
44
|
+
assert.equal(device.alerts.length, 103) // Total Alerts
|
|
45
45
|
// assert.equal(totalDistance, 36.63687856826021) // Total Kms
|
|
46
46
|
// assert.equal(totalEventTime, 1524000) // Total Duration
|
|
47
47
|
}, 200000)
|
|
@@ -114,7 +114,7 @@ describe('Test_Reports', function () {
|
|
|
114
114
|
|
|
115
115
|
assert.equal(data.length, 1)
|
|
116
116
|
const device = data[0].devices.find(d => d.device.id === 25808)
|
|
117
|
-
assert.equal(device.trips.length,
|
|
117
|
+
assert.equal(device.trips.length, 11) // Total Trips
|
|
118
118
|
console.log(device.trips[0])
|
|
119
119
|
// assert.equal(device.trips[0].endAddress, 'RS-409, 184-314 - Centro, Vera Cruz - RS, 96880-000, Brazil')
|
|
120
120
|
assert.equal(device.trips[1].endPOIName, undefined)
|
package/src/util/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { devicesToProcess } = require('./device')
|
|
2
|
+
const { isClientSide } = require('./utils')
|
|
2
3
|
|
|
3
4
|
exports.processServerSide = (userData) => {
|
|
4
5
|
const devices = devicesToProcess(userData)
|
|
5
|
-
return devices.length > 100
|
|
6
|
+
return devices.length > 100 && isClientSide()
|
|
6
7
|
}
|
package/src/zone-report.js
CHANGED
|
@@ -59,13 +59,13 @@ async function createZoneReport (from, to, userData, traccar) {
|
|
|
59
59
|
xpert: devices.filter(d => d.attributes.xpert).length > 0
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const sliced = automaticReports.sliceArray(devices,
|
|
62
|
+
const sliced = automaticReports.sliceArray(devices, 50)
|
|
63
63
|
|
|
64
64
|
let deviceCount = 0
|
|
65
65
|
for (const slice of sliced) {
|
|
66
66
|
const allInOne = await traccarHelper.getAllInOne(
|
|
67
67
|
traccar, from, to, slice, true, false, false, false,
|
|
68
|
-
deviceCount, devices.length,
|
|
68
|
+
deviceCount, devices.length, 50, 10)
|
|
69
69
|
const routeData = allInOne.route
|
|
70
70
|
|
|
71
71
|
const data = getInAndOutEvents(slice, routeData, userData)
|