fleetmap-reports 2.0.52 → 2.0.54
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/kms-report.js +2 -2
- package/src/util/utils.js +4 -3
package/package.json
CHANGED
package/src/kms-report.js
CHANGED
|
@@ -44,8 +44,8 @@ async function createKmsReportByDevice (from, to, userData, traccarInstance) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (isClientSide() && (allDevices.length > 50 || ((new Date(to).getTime() - new Date(from).getTime()) > (1000 * 60 * 60 * 24 * 15))) && userData.groupByDay) {
|
|
47
|
-
const sliced = automaticReports.sliceArray(allDevices,
|
|
48
|
-
await executeServerSide('kms-report', sliced, from, to, userData, allDevices.length, traccarInstance).then(devices => {
|
|
47
|
+
const sliced = automaticReports.sliceArray(allDevices, 2)
|
|
48
|
+
await executeServerSide('kms-report', sliced, from, to, userData, allDevices.length, traccarInstance, 1).then(devices => {
|
|
49
49
|
allData.devices = devices
|
|
50
50
|
})
|
|
51
51
|
} else {
|
package/src/util/utils.js
CHANGED
|
@@ -240,7 +240,7 @@ async function executeServerSide (type, sliced, from, to, userData, totalItems,
|
|
|
240
240
|
await Promise.all(_sliced.map(async items => {
|
|
241
241
|
const url = `https://${getServerHost()}/reports/${type}`
|
|
242
242
|
try {
|
|
243
|
-
|
|
243
|
+
await axios.post(url, {
|
|
244
244
|
from,
|
|
245
245
|
to,
|
|
246
246
|
userData: userData.byDriver
|
|
@@ -254,8 +254,9 @@ async function executeServerSide (type, sliced, from, to, userData, totalItems,
|
|
|
254
254
|
devices: items,
|
|
255
255
|
geofences: []
|
|
256
256
|
}
|
|
257
|
-
}, { withCredentials: true }).then(d =>
|
|
258
|
-
|
|
257
|
+
}, { withCredentials: true }).then(d => {
|
|
258
|
+
reportData.push(...(userData.byDriver ? d.data[0].drivers : d.data[0].devices))
|
|
259
|
+
})
|
|
259
260
|
itemsCount = itemsCount + items.length
|
|
260
261
|
} catch (e) {
|
|
261
262
|
console.error(e)
|