Skip to content

Commit 7377547

Browse files
author
arthosofteq
authored
Merge pull request #585 from RedisInsight/bugfix/RI-2735-fix-websocket-connection-close
prevent closing current windows connections on nsDocLoader::Stop afte…
2 parents cdf3815 + 016da5a commit 7377547

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

redisinsight/ui/src/components/monitor/MonitorLog/MonitorLog.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import React from 'react'
44
import { useDispatch, useSelector } from 'react-redux'
55
import AutoSizer from 'react-virtualized-auto-sizer'
66
import { ApiEndpoints } from 'uiSrc/constants'
7-
import { AppEnv } from 'uiSrc/constants/env'
87
import { monitorSelector, resetProfiler, stopMonitor } from 'uiSrc/slices/cli/monitor'
98
import { cutDurationText, getBaseApiUrl } from 'uiSrc/utils'
109

@@ -13,6 +12,7 @@ import styles from './styles.module.scss'
1312
const PADDINGS_OUTSIDE = 12
1413
const MIDDLE_SCREEN_RESOLUTION = 460 - PADDINGS_OUTSIDE
1514
const SMALL_SCREEN_RESOLUTION = 360 - PADDINGS_OUTSIDE
15+
const DOWNLOAD_IFRAME_NAME = 'logFileDownloadIFrame'
1616

1717
const MonitorLog = () => {
1818
const { timestamp, logFileId, isSaveToFile } = useSelector(monitorSelector)
@@ -28,13 +28,9 @@ const MonitorLog = () => {
2828
)
2929
const baseApiUrl = getBaseApiUrl()
3030
const linkToDownload = `${baseApiUrl}/api/${ApiEndpoints.PROFILER_LOGS}/${logFileId}`
31-
const isElectron = process.env.APP_ENV === AppEnv.ELECTRON
3231

33-
const downloadBtnProps: any = {}
34-
if (isElectron) {
35-
downloadBtnProps.download = true
36-
} else {
37-
downloadBtnProps.target = '_blank'
32+
const downloadBtnProps: any = {
33+
target: DOWNLOAD_IFRAME_NAME
3834
}
3935

4036
const onResetProfiler = () => {
@@ -50,6 +46,7 @@ const MonitorLog = () => {
5046

5147
return (
5248
<div className={styles.monitorLogWrapper}>
49+
<iframe title="downloadIframeTarget" name={DOWNLOAD_IFRAME_NAME} style={{ display: 'none' }} />
5350
<AutoSizer disableHeight>
5451
{({ width }) => (
5552
<div

0 commit comments

Comments
 (0)