include device data in export

This commit is contained in:
proddy
2024-06-25 10:41:36 +02:00
parent c7759a71b4
commit 4ebd0657f4

View File

@@ -426,8 +426,9 @@ const Devices: FC = () => {
document.body.removeChild(downloadLink); document.body.removeChild(downloadLink);
}; };
const device = { ...{ device: coreData.devices[deviceIndex] }, ...deviceData };
downloadBlob( downloadBlob(
new Blob([JSON.stringify(deviceData, null, 2)], { new Blob([JSON.stringify(device, null, 2)], {
type: 'text;charset:utf-8' type: 'text;charset:utf-8'
}) })
); );
@@ -650,7 +651,7 @@ const Devices: FC = () => {
</Typography> </Typography>
<Grid container justifyContent="space-between"> <Grid container justifyContent="space-between">
<Typography sx={{ ml: 1 }} variant="subtitle2" color="primary"> <Typography sx={{ ml: 1 }} variant="subtitle2" color="grey">
{LL.SHOWING() + {LL.SHOWING() +
' ' + ' ' +
shown_data.length + shown_data.length +
@@ -660,61 +661,40 @@ const Devices: FC = () => {
LL.ENTITIES(shown_data.length)} LL.ENTITIES(shown_data.length)}
<ButtonTooltip title="Info"> <ButtonTooltip title="Info">
<IconButton onClick={() => setShowDeviceInfo(true)}> <IconButton onClick={() => setShowDeviceInfo(true)}>
<InfoOutlinedIcon <InfoOutlinedIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton> </IconButton>
</ButtonTooltip> </ButtonTooltip>
{me.admin && ( {me.admin && (
<ButtonTooltip title={LL.CUSTOMIZATIONS()}> <ButtonTooltip title={LL.CUSTOMIZATIONS()}>
<IconButton onClick={customize}> <IconButton onClick={customize}>
<FormatListNumberedIcon <FormatListNumberedIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton> </IconButton>
</ButtonTooltip> </ButtonTooltip>
)} )}
<ButtonTooltip title={LL.EXPORT()}> <ButtonTooltip title={LL.EXPORT()}>
<IconButton onClick={handleDownloadCsv}> <IconButton onClick={handleDownloadCsv}>
<DownloadIcon <DownloadIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton> </IconButton>
</ButtonTooltip> </ButtonTooltip>
<ButtonTooltip title="Favorites"> <ButtonTooltip title="Favorites">
<IconButton onClick={() => setOnlyFav(!onlyFav)}> <IconButton onClick={() => setOnlyFav(!onlyFav)}>
{onlyFav ? ( {onlyFav ? (
<StarIcon <StarIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
) : ( ) : (
<StarBorderOutlinedIcon <StarBorderOutlinedIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
)} )}
</IconButton> </IconButton>
</ButtonTooltip> </ButtonTooltip>
<ButtonTooltip title={LL.REFRESH()}> <ButtonTooltip title={LL.REFRESH()}>
<IconButton onClick={refreshData}> <IconButton onClick={refreshData}>
<RefreshIcon <RefreshIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton> </IconButton>
</ButtonTooltip> </ButtonTooltip>
</Typography> </Typography>
<Grid item zeroMinWidth justifyContent="flex-end"> <Grid item zeroMinWidth justifyContent="flex-end">
<ButtonTooltip title={LL.CANCEL()}> <ButtonTooltip title={LL.CANCEL()}>
<IconButton onClick={resetDeviceSelect}> <IconButton onClick={resetDeviceSelect}>
<HighlightOffIcon <HighlightOffIcon color="primary" sx={{ fontSize: 18 }} />
color="primary"
sx={{ fontSize: 18, verticalAlign: 'middle' }}
/>
</IconButton> </IconButton>
</ButtonTooltip> </ButtonTooltip>
</Grid> </Grid>