diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-08 16:52:45 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-08 16:52:45 -0700 |
commit | 9200986d36b88f549ed40606246d4ef08c93f18f (patch) | |
tree | 1e1a2265ad4115af4af8b382bea7a956a89d4156 /modern/src/reports/components | |
parent | cbb5a320802031c102818f8221d853f8181b54f3 (diff) | |
download | trackermap-web-9200986d36b88f549ed40606246d4ef08c93f18f.tar.gz trackermap-web-9200986d36b88f549ed40606246d4ef08c93f18f.tar.bz2 trackermap-web-9200986d36b88f549ed40606246d4ef08c93f18f.zip |
Improve reports handling
Diffstat (limited to 'modern/src/reports/components')
-rw-r--r-- | modern/src/reports/components/ReportFilter.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/modern/src/reports/components/ReportFilter.js b/modern/src/reports/components/ReportFilter.js index 100dab90..07c406d6 100644 --- a/modern/src/reports/components/ReportFilter.js +++ b/modern/src/reports/components/ReportFilter.js @@ -24,7 +24,7 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev const disabled = !ignoreDevice && !deviceId && !deviceIds.length && !groupIds.length; - const handleClick = (mail, json) => { + const handleClick = (type) => { let selectedFrom; let selectedTo; switch (period) { @@ -58,15 +58,13 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev break; } - const accept = json ? 'application/json' : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; handleSubmit({ deviceId, deviceIds, groupIds, from: selectedFrom.toISOString(), to: selectedTo.toISOString(), - mail, - headers: { Accept: accept }, + type, }); }; @@ -145,7 +143,7 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev {children} <div className={classes.filterButtons}> <Button - onClick={() => handleClick(false, true)} + onClick={() => handleClick('json')} variant="outlined" color="secondary" className={classes.filterButton} @@ -155,7 +153,7 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev </Button> {!showOnly && ( <Button - onClick={() => handleClick(false, false)} + onClick={() => handleClick('export')} variant="outlined" color="secondary" className={classes.filterButton} @@ -166,7 +164,7 @@ const ReportFilter = ({ children, handleSubmit, showOnly, ignoreDevice, multiDev )} {!showOnly && ( <Button - onClick={() => handleClick(true, false)} + onClick={() => handleClick('mail')} variant="outlined" color="secondary" className={classes.filterButton} |