-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Terminal Output] Truncated process output msg #143304
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
81c5d71
xterm updated to v5. initial work done for max kb warning msg
1c4b3e5
Merge branch 'main' into truncated_output_msg
184d4f9
max bytes exceeded msg implemented, along with authz gated link to se…
977f337
marker indication on max bytes exceeded fixed
277fdd7
tests written
f0edcad
tests written
84629c6
fixed a bug where an active search would prevent normal playback/seeking
05d58ee
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine b8dd4ab
updates per review comments
0d88ff2
Merge branch 'truncated_output_msg' of github.com:mitodrummer/kibana …
06b1fbe
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 6fa3d7a
fixed text
2c4be48
Merge branch 'truncated_output_msg' of github.com:mitodrummer/kibana …
1188458
fixed ts error
25792d5
fix to scroll hack
9670ebe
Merge branch 'main' into truncated_output_msg
mitodrummer f3fa5af
Merge branch 'main' into truncated_output_msg
mitodrummer 989b63b
Merge branch 'main' into truncated_output_msg
36a4651
Merge branch 'main' into truncated_output_msg
mitodrummer 2cb1590
Merge branch 'main' into truncated_output_msg
mitodrummer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
x-pack/plugins/session_view/public/components/tty_player/ansi_helpers.ts
This file contains hidden or 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,28 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { Teletype } from '../../../common/types/process_tree'; | ||
| import { | ||
| PROCESS_DATA_LIMIT_EXCEEDED_START, | ||
| PROCESS_DATA_LIMIT_EXCEEDED_END, | ||
| VIEW_POLICIES, | ||
| } from './translations'; | ||
|
|
||
| export const renderTruncatedMsg = (tty?: Teletype, policiesUrl?: string, processName?: string) => { | ||
| if (tty?.columns) { | ||
| const lineBreak = '-'.repeat(tty.columns); | ||
| const message = ` ⚠ ${PROCESS_DATA_LIMIT_EXCEEDED_START} \x1b[1m${processName}.\x1b[22m ${PROCESS_DATA_LIMIT_EXCEEDED_END}`; | ||
| const link = policiesUrl | ||
| ? `\x1b[${Math.min( | ||
| message.length + 2, | ||
| tty.columns - VIEW_POLICIES.length - 4 | ||
| )}G\x1b[1m\x1b]8;;${policiesUrl}\x1b\\[ ${VIEW_POLICIES} ]\x1b]8;;\x1b\\\x1b[22m` | ||
| : ''; | ||
|
|
||
| return `\n\x1b[33m${lineBreak}\n${message}${link}\n${lineBreak}\x1b[0m\n\n`; | ||
| } | ||
| }; |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about this one, nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does using the
canAccessEndpointManagementaccomplish?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ansi message will contain a link to /security/administration/policy which is a listing of the defend integration policies. Only users with this permission can access it. I'm passing it as a parameter since I can't import this hook into session_view as it would introduce a circular dependency.