aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-03-02 21:31:36 -0800
committerAnton Tananaev <anton@traccar.org>2024-03-02 21:31:36 -0800
commit8c6900bc6cbc0e15e30eb3c60242bdfa93fd5151 (patch)
tree9e18edf0b4e6eb87c14ac6b23a2d42cb6a3dbf41
parent3309317e3bb7db4f1eb3d9ae1803effb637a4faf (diff)
downloadtrackermap-web-8c6900bc6cbc0e15e30eb3c60242bdfa93fd5151.tar.gz
trackermap-web-8c6900bc6cbc0e15e30eb3c60242bdfa93fd5151.tar.bz2
trackermap-web-8c6900bc6cbc0e15e30eb3c60242bdfa93fd5151.zip
Add device export report
-rw-r--r--modern/src/settings/DevicesPage.jsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/modern/src/settings/DevicesPage.jsx b/modern/src/settings/DevicesPage.jsx
index 5ef5aae5..e4bfe5b5 100644
--- a/modern/src/settings/DevicesPage.jsx
+++ b/modern/src/settings/DevicesPage.jsx
@@ -2,10 +2,10 @@ import React, { useState } from 'react';
import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import {
- Table, TableRow, TableCell, TableHead, TableBody,
+ Table, TableRow, TableCell, TableHead, TableBody, Button, TableFooter,
} from '@mui/material';
import LinkIcon from '@mui/icons-material/Link';
-import { useEffectAsync } from '../reactHelper';
+import { useCatch, useEffectAsync } from '../reactHelper';
import { useTranslation } from '../common/components/LocalizationProvider';
import PageLayout from '../common/components/PageLayout';
import SettingsMenu from './components/SettingsMenu';
@@ -48,6 +48,10 @@ const DevicesPage = () => {
}
}, [timestamp]);
+ const handleExport = () => {
+ window.location.assign(`/api/reports/devices/xlsx`);
+ };
+
const actionConnections = {
key: 'connections',
title: t('sharedConnections'),
@@ -94,6 +98,13 @@ const DevicesPage = () => {
</TableRow>
)) : (<TableShimmer columns={7} endAction />)}
</TableBody>
+ <TableFooter>
+ <TableRow>
+ <TableCell colSpan={8} align="right">
+ <Button onClick={handleExport} variant="text">{t('reportExport')}</Button>
+ </TableCell>
+ </TableRow>
+ </TableFooter>
</Table>
<CollectionFab editPath="/settings/device" />
</PageLayout>