forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs UI] Improve live streaming behavior when scrolling (elastic#44923)
* [Logs UI] Stop live streaming on scroll or minimap click * Silently pause streaming on scroll up * Fix type checking * Fix type check again * Fix i18n
- Loading branch information
Showing
14 changed files
with
225 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/jump_to_tail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
/* eslint-disable max-classes-per-file */ | ||
|
||
import { EuiButtonEmpty, EuiText } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import * as React from 'react'; | ||
|
||
import euiStyled from '../../../../../../common/eui_styled_components'; | ||
|
||
interface LogTextStreamJumpToTailProps { | ||
onClickJump?: () => void; | ||
width: number; | ||
} | ||
|
||
export class LogTextStreamJumpToTail extends React.PureComponent<LogTextStreamJumpToTailProps> { | ||
public render() { | ||
const { onClickJump, width } = this.props; | ||
return ( | ||
<JumpToTailWrapper width={width}> | ||
<MessageWrapper> | ||
<EuiText color="subdued"> | ||
<FormattedMessage | ||
id="xpack.infra.logs.streamingNewEntriesText" | ||
defaultMessage="Streaming new entries" | ||
/> | ||
</EuiText> | ||
</MessageWrapper> | ||
<EuiButtonEmpty size="xs" onClick={onClickJump} iconType="arrowDown"> | ||
<FormattedMessage | ||
id="xpack.infra.logs.jumpToTailText" | ||
defaultMessage="Jump to most recent entries" | ||
/> | ||
</EuiButtonEmpty> | ||
</JumpToTailWrapper> | ||
); | ||
} | ||
} | ||
|
||
const JumpToTailWrapper = euiStyled.div<{ width: number }>` | ||
align-items: center; | ||
display: flex; | ||
min-height: ${props => props.theme.eui.euiSizeXXL}; | ||
width: ${props => props.width}px; | ||
position: fixed; | ||
bottom: 0; | ||
background-color: ${props => props.theme.eui.euiColorEmptyShade}; | ||
`; | ||
|
||
const MessageWrapper = euiStyled.div` | ||
padding: 8px 16px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.