fleetmap-reports 2.0.253 → 2.0.255
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/location-report.js +7 -1
- package/src/util/traccar.js +0 -1
package/package.json
CHANGED
package/src/location-report.js
CHANGED
|
@@ -5,12 +5,13 @@ const { getStyle } = require('./reportStyle')
|
|
|
5
5
|
const { getUserPartner } = require('fleetmap-partners')
|
|
6
6
|
const {
|
|
7
7
|
convertToLocaleString, getTranslations,
|
|
8
|
-
getLanguage
|
|
8
|
+
getLanguage, isClientSide
|
|
9
9
|
} = require('./util/utils')
|
|
10
10
|
const traccarHelper = require('./util/traccar')
|
|
11
11
|
const { devicesToProcess } = require('./util/device')
|
|
12
12
|
const automaticReports = require('./automaticReports')
|
|
13
13
|
const { getDriverName, getDriverData } = require('./util/driver')
|
|
14
|
+
const { default: axios } = require('axios')
|
|
14
15
|
|
|
15
16
|
const fileName = 'LocationReport'
|
|
16
17
|
|
|
@@ -20,6 +21,11 @@ async function createLocationReport (from, to, userData, traccar) {
|
|
|
20
21
|
|
|
21
22
|
if (userData.byDriver) {
|
|
22
23
|
console.log('ByDriver')
|
|
24
|
+
if (isClientSide()) {
|
|
25
|
+
const cookie = await axios.get('/pinmeapi/cookie/get', { withCredentials: true }).then(d => d.data)
|
|
26
|
+
const url = `https://${process.env.SERVER_HOST}/pinmeapi/reports/location-report`
|
|
27
|
+
return axios.post(url, { from, to, userData, cookie }).then(d => d.data)
|
|
28
|
+
}
|
|
23
29
|
const report = await createLocationReportByDriver(from, to, userData, traccar)
|
|
24
30
|
reportData.push(report)
|
|
25
31
|
} else if (userData.byGroup) {
|
package/src/util/traccar.js
CHANGED
|
@@ -2,7 +2,6 @@ const automaticReports = require('../automaticReports')
|
|
|
2
2
|
const { convertFromUTC, isClientSide, convertFromLocal } = require('./utils')
|
|
3
3
|
const path = require('path')
|
|
4
4
|
const { cleanPositions, filterPosition } = require('./route')
|
|
5
|
-
const Piscina = require("piscina");
|
|
6
5
|
async function getRoute (traccar, from, to, devices) {
|
|
7
6
|
const devicesToSlice = devices.slice()
|
|
8
7
|
|