aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/SummaryReportPage.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-05-31 14:17:13 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-05-31 14:17:13 +0530
commit8e1bddcc608ba4e52699c30084f5ef950bd7e329 (patch)
tree540c52116542c484f74a09042d83653582b5dc77 /modern/src/reports/SummaryReportPage.js
parent402b30df63f6dfafda32ae37aa2d4df9ef638fd2 (diff)
downloadetbsa-traccar-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.tar.gz
etbsa-traccar-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.tar.bz2
etbsa-traccar-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.zip
Finalizing reports implemetations
Diffstat (limited to 'modern/src/reports/SummaryReportPage.js')
-rw-r--r--modern/src/reports/SummaryReportPage.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/modern/src/reports/SummaryReportPage.js b/modern/src/reports/SummaryReportPage.js
index f63f50b..a2392f2 100644
--- a/modern/src/reports/SummaryReportPage.js
+++ b/modern/src/reports/SummaryReportPage.js
@@ -1,11 +1,12 @@
import React, { useState } from 'react';
import { DataGrid } from '@material-ui/data-grid';
import { Grid, FormControlLabel, Checkbox } from '@material-ui/core';
-import t from '../common/localization';
+import { useTheme } from "@material-ui/core/styles";
import { formatDistance, formatHours, formatDate, formatSpeed, formatVolume } from '../common/formatter';
import ReportFilter from './ReportFilter';
import ReportLayoutPage from './ReportLayoutPage';
import { useAttributePreference } from '../common/preferences';
+import t from '../common/localization';
const Filter = ({ setItems }) => {
@@ -39,6 +40,8 @@ const Filter = ({ setItems }) => {
const SummaryReportPage = () => {
+ const theme = useTheme();
+
const distanceUnit = useAttributePreference('distanceUnit');
const speedUnit = useAttributePreference('speedUnit');
const volumeUnit = useAttributePreference('volumeUnit');
@@ -49,49 +52,49 @@ const SummaryReportPage = () => {
headerName: t('reportStartDate'),
field: 'startTime',
type: 'dateTime',
- flex: 1,
+ width: theme.dimensions.dateColumnWidth,
valueFormatter: ({ value }) => formatDate(value, 'YYYY-MM-DD'),
}, {
headerName: t('sharedDistance'),
field: 'distance',
type: 'number',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
valueFormatter: ({ value }) => formatDistance(value, distanceUnit),
}, {
headerName: t('reportStartOdometer'),
field: 'startOdometer',
type: 'number',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
valueFormatter: ({ value }) => formatDistance(value, distanceUnit),
}, {
headerName: t('reportEndOdometer'),
field: 'endOdometer',
type: 'number',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
valueFormatter: ({ value }) => formatDistance(value, distanceUnit),
}, {
headerName: t('reportAverageSpeed'),
field: 'averageSpeed',
type: 'number',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
valueFormatter: ({ value }) => formatSpeed(value, speedUnit),
}, {
headerName: t('reportMaximumSpeed'),
field: 'maxSpeed',
type: 'number',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
valueFormatter: ({ value }) => formatSpeed(value, speedUnit),
}, {
headerName: t('reportEngineHours'),
field: 'engineHours',
type: 'string',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
valueFormatter: ({ value }) => formatHours(value),
}, {
headerName: t('reportSpentFuel'),
field: 'spentFuel',
type: 'number',
- flex: 1,
+ width: theme.dimensions.numberColumnWidth,
hide: true,
valueFormatter: ({ value }) => formatVolume(value, volumeUnit),
}]