diff options
Diffstat (limited to 'modern')
-rw-r--r-- | modern/src/DevicePage.js | 28 | ||||
-rw-r--r-- | modern/src/common/formatter.js | 1 | ||||
-rw-r--r-- | modern/src/reports/EventReportPage.js | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/modern/src/DevicePage.js b/modern/src/DevicePage.js index 145ecc9f..ed5a6cba 100644 --- a/modern/src/DevicePage.js +++ b/modern/src/DevicePage.js @@ -137,6 +137,34 @@ const DevicePage = () => { titleGetter={it => t(prefixString('event', it.type))} label={t('sharedNotifications')} variant="filled" /> + <LinkField + margin="normal" + endpointAll="/api/drivers" + endpointLinked={"/api/drivers?deviceId=" + item.id} + baseId={item.id} + keyBase="deviceId" + keyLink="driverId" + label={t('sharedDrivers')} + variant="filled" /> + <LinkField + margin="normal" + endpointAll="/api/attributes/computed" + endpointLinked={"/api/attributes/computed?deviceId=" + item.id} + baseId={item.id} + keyBase="deviceId" + keyLink="attributeId" + titleGetter={it => it.description} + label={t('sharedComputedAttributes')} + variant="filled" /> + <LinkField + margin="normal" + endpointAll="/api/maintenance" + endpointLinked={"/api/maintenance?deviceId=" + item.id} + baseId={item.id} + keyBase="deviceId" + keyLink="maintenanceId" + label={t('sharedMaintenance')} + variant="filled" /> </AccordionDetails> </Accordion> } diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js index e41e591e..289a6d94 100644 --- a/modern/src/common/formatter.js +++ b/modern/src/common/formatter.js @@ -9,6 +9,7 @@ export const formatPosition = (value, key) => { case 'fixTime': case 'deviceTime': case 'serverTime': + case 'eventTime': return moment(value).format('LLL'); case 'latitude': case 'longitude': diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index 054181d0..459383e9 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -74,7 +74,7 @@ const EventReportPage = () => { <TableBody> {items.map(item => ( <TableRow key={item.id}> - <TableCell>{formatPosition(item, 'serverTime')}</TableCell> + <TableCell>{formatPosition(item, 'eventTime')}</TableCell> <TableCell>{item.type}</TableCell> <TableCell>{}</TableCell> <TableCell>{}</TableCell> |