aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-04-30 11:41:21 -0700
committerAnton Tananaev <anton@traccar.org>2023-04-30 11:41:21 -0700
commite16f7353e850f69b29f285c80e1a0f200e5992be (patch)
tree3f862be6d5332a645e481cdc05c778a2916096ee /modern/src
parent70d15a4ecd73c894c462a7dd70c79d4a99e113d6 (diff)
downloadtrackermap-web-e16f7353e850f69b29f285c80e1a0f200e5992be.tar.gz
trackermap-web-e16f7353e850f69b29f285c80e1a0f200e5992be.tar.bz2
trackermap-web-e16f7353e850f69b29f285c80e1a0f200e5992be.zip
Add group column
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/settings/DevicesPage.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/modern/src/settings/DevicesPage.js b/modern/src/settings/DevicesPage.js
index 5a40af1a..d3ebc85f 100644
--- a/modern/src/settings/DevicesPage.js
+++ b/modern/src/settings/DevicesPage.js
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import {
Table, TableRow, TableCell, TableHead, TableBody,
@@ -29,6 +30,8 @@ const DevicesPage = () => {
const navigate = useNavigate();
const t = useTranslation();
+ const groups = useSelector((state) => state.groups.items);
+
const hours12 = usePreference('twelveHourFormat');
const deviceReadonly = useDeviceReadonly();
@@ -67,6 +70,7 @@ const DevicesPage = () => {
<TableRow>
<TableCell>{t('sharedName')}</TableCell>
<TableCell>{t('deviceIdentifier')}</TableCell>
+ <TableCell>{t('groupParent')}</TableCell>
<TableCell>{t('sharedPhone')}</TableCell>
<TableCell>{t('deviceModel')}</TableCell>
<TableCell>{t('deviceContact')}</TableCell>
@@ -79,6 +83,7 @@ const DevicesPage = () => {
<TableRow key={item.id}>
<TableCell>{item.name}</TableCell>
<TableCell>{item.uniqueId}</TableCell>
+ <TableCell>{item.groupId ? groups[item.groupId].name : null}</TableCell>
<TableCell>{item.phone}</TableCell>
<TableCell>{item.model}</TableCell>
<TableCell>{item.contact}</TableCell>
@@ -94,7 +99,7 @@ const DevicesPage = () => {
/>
</TableCell>
</TableRow>
- )) : (<TableShimmer columns={6} endAction />)}
+ )) : (<TableShimmer columns={7} endAction />)}
</TableBody>
</Table>
<CollectionFab editPath="/settings/device" />