fleetmap-reports 1.0.613 → 1.0.614
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/events-report.js +6 -1
package/package.json
CHANGED
package/src/events-report.js
CHANGED
|
@@ -156,7 +156,9 @@ async function exportSpeedingReportToPDF (userData, reportData) {
|
|
|
156
156
|
userData.eventTypes.forEach(e => {
|
|
157
157
|
const data = e.startsWith('alarm') ? { type: 'alarm', attributes: { alarm: e.slice(6) } } : { type: e }
|
|
158
158
|
const value = e.startsWith('alarm') ? d.alerts.filter(a => a.attributes.alarm === data.attributes.alarm).length : d.alerts.filter(a => a.type === e).length
|
|
159
|
-
|
|
159
|
+
if (value > 0) {
|
|
160
|
+
headerEventTypes.push([getEventType(data, translations, d.device), value])
|
|
161
|
+
}
|
|
160
162
|
})
|
|
161
163
|
|
|
162
164
|
doc.autoTable({
|
|
@@ -281,6 +283,9 @@ function deviceName (device) {
|
|
|
281
283
|
}
|
|
282
284
|
|
|
283
285
|
function getAlertInfo (drivers, alert, device, translations) {
|
|
286
|
+
if (alert.type === 'alarm' && alert.attributes.alarm === 'sensor') {
|
|
287
|
+
return device ? device.attributes.sensor1on : ''
|
|
288
|
+
}
|
|
284
289
|
if (alert.type === 'alarm' && alert.position) {
|
|
285
290
|
return getDigitalPortValue(alert.position, 1, translations, device.attributes)
|
|
286
291
|
}
|