1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 19:34:34 +00:00

feat(log): put download log icon into log tab

This commit is contained in:
Yury Shkoda
2023-04-26 16:10:04 +03:00
parent a38a9f9c3d
commit 777b3a55be
2 changed files with 16 additions and 21 deletions

View File

@@ -265,25 +265,6 @@ const LogComponent = (props: LogComponentProps) => {
</pre>
</div>
)}
<div
style={{
display: 'flex',
justifyContent: 'center',
marginTop: 10
}}
>
<Button
onClick={(evt: SyntheticEvent) => {
download(evt, clearErrorsAndWarningsHtmlWrapping(logBody))
}}
variant="contained"
color="primary"
startIcon={<FileDownloadIcon />}
>
download entire log
</Button>
</div>
</>
)
}

View File

@@ -1,12 +1,18 @@
import { ErrorOutline, Warning } from '@mui/icons-material'
import { LogObject } from '../../../../../utils'
import FileDownloadIcon from '@mui/icons-material/FileDownload'
import {
LogObject,
download,
clearErrorsAndWarningsHtmlWrapping
} from '../../../../../utils'
import Tooltip from '@mui/material/Tooltip'
interface LogTabProps {
log: LogObject
}
const LogTabWithIcons = (props: LogTabProps) => {
const { errors, warnings } = props.log
const { errors, warnings, body } = props.log
return (
<div
@@ -24,6 +30,14 @@ const LogTabWithIcons = (props: LogTabProps) => {
{warnings && warnings.length !== 0 && (
<Warning style={{ fontSize: 20, color: 'green' }} />
)}{' '}
<Tooltip
title="Download entire log"
onClick={(evt) => {
download(evt, clearErrorsAndWarningsHtmlWrapping(body))
}}
>
<FileDownloadIcon style={{ fontSize: 20, marginLeft: 20 }} />
</Tooltip>
</div>
)
}