Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Terminal Output] tty toggle now shows number of bytes in tooltip, if no output we disa… #141174

Merged
merged 13 commits into from
Sep 21, 2022
Next Next commit
tty toggle now shows number of bytes in tooltip, if no output we disa…
…ble button (instead of hide)
  • Loading branch information
Karl Godard committed Sep 20, 2022
commit 65b142e2e9fd1bdd58698acd63accbf8e661c4f5
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
"brace": "0.11.1",
"byte-size": "^8.1.0",
"canvg": "^3.0.9",
"cbor-x": "^1.3.3",
"chalk": "^4.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import useLocalStorage from 'react-use/lib/useLocalStorage';
import byteSize from 'byte-size';
import { SectionLoading } from '../../shared_imports';
import { ProcessTree } from '../process_tree';
import {
Expand Down Expand Up @@ -268,31 +269,30 @@ export const SessionView = ({
/>
</EuiFlexItem>

{hasTTYOutput && (
<EuiFlexItem grow={false}>
<EuiToolTip
title={
<FormattedMessage
id="xpack.sessionView.ttyToggle"
defaultMessage="{kb}Kb of tty output"
values={{
kb: Math.round(totalTTYOutputBytes.total / 1024),
}}
/>
}
>
<EuiButtonIcon
isSelected={showTTY}
display={showTTY ? 'fill' : 'empty'}
iconType="apmTrace"
onClick={onToggleTTY}
size="m"
aria-label={TOGGLE_TTY_PLAYER}
data-test-subj="sessionView:TTYPlayerToggle"
<EuiFlexItem grow={false}>
<EuiToolTip
title={
<FormattedMessage
id="xpack.sessionView.ttyToggle"
defaultMessage="{value} {unit} of TTY output"
values={{
...byteSize(totalTTYOutputBytes?.total),
}}
/>
</EuiToolTip>
</EuiFlexItem>
)}
}
>
<EuiButtonIcon
disabled={!hasTTYOutput}
isSelected={showTTY}
display={showTTY ? 'fill' : 'empty'}
iconType="apmTrace"
onClick={onToggleTTY}
size="m"
aria-label={TOGGLE_TTY_PLAYER}
data-test-subj="sessionView:TTYPlayerToggle"
/>
</EuiToolTip>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButtonIcon
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10713,6 +10713,11 @@ builtin-status-codes@^3.0.0:
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=

byte-size@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-8.1.0.tgz#6353d0bc14ab7a69abcefbf11f8db0145a862cb5"
integrity sha512-FkgMTAg44I0JtEaUAvuZTtU2a2YDmBRbQxdsQNSMtLCjhG0hMcF5b1IMN9UjSCJaU4nvlj/GER7B9sI4nKdCgA==

bytes@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
Expand Down