mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 11:24:35 +00:00
feat(log): put download log icon into log tab
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user