aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/DevicesPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/settings/DevicesPage.js')
-rw-r--r--modern/src/settings/DevicesPage.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/modern/src/settings/DevicesPage.js b/modern/src/settings/DevicesPage.js
index 0ad76106..8f267a21 100644
--- a/modern/src/settings/DevicesPage.js
+++ b/modern/src/settings/DevicesPage.js
@@ -1,7 +1,9 @@
import React, { useState } from 'react';
+import { useNavigate } from 'react-router-dom';
import {
Table, TableRow, TableCell, TableHead, TableBody,
} from '@mui/material';
+import LinkIcon from '@mui/icons-material/Link';
import makeStyles from '@mui/styles/makeStyles';
import { useEffectAsync } from '../reactHelper';
import { useTranslation } from '../common/components/LocalizationProvider';
@@ -23,6 +25,7 @@ const useStyles = makeStyles((theme) => ({
const DevicesPage = () => {
const classes = useStyles();
+ const navigate = useNavigate();
const t = useTranslation();
const hours12 = usePreference('twelveHourFormat');
@@ -46,6 +49,13 @@ const DevicesPage = () => {
}
}, [timestamp]);
+ const actionConnections = {
+ key: 'connections',
+ title: t('sharedConnections'),
+ icon: <LinkIcon fontSize="small" />,
+ handler: (deviceId) => navigate(`/settings/device/${deviceId}/connections`),
+ };
+
return (
<PageLayout menu={<SettingsMenu />} breadcrumbs={['settingsTitle', 'sharedDrivers']}>
<SearchHeader keyword={searchKeyword} setKeyword={setSearchKeyword} />
@@ -71,7 +81,13 @@ const DevicesPage = () => {
<TableCell>{item.contact}</TableCell>
<TableCell>{formatTime(item.expirationTime, 'date', hours12)}</TableCell>
<TableCell className={classes.columnAction} padding="none">
- <CollectionActions itemId={item.id} editPath="/settings/device" endpoint="devices" setTimestamp={setTimestamp} />
+ <CollectionActions
+ itemId={item.id}
+ editPath="/settings/device"
+ endpoint="devices"
+ setTimestamp={setTimestamp}
+ customActions={[actionConnections]}
+ />
</TableCell>
</TableRow>
)) : (<TableShimmer columns={6} endAction />)}