mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add database statement in span flyout for all db types (#128266)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c9aad65b67
commit
126b140662
1 changed files with 22 additions and 21 deletions
|
@ -42,9 +42,27 @@ export function SpanDatabase({ spanDb }: Props) {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (spanDb.type !== 'sql') {
|
||||
return <DatabaseStatement>{spanDb.statement}</DatabaseStatement>;
|
||||
}
|
||||
const statementItem =
|
||||
spanDb.type !== 'sql' ? (
|
||||
spanDb.statement
|
||||
) : (
|
||||
<TruncateHeightSection previewHeight={previewHeight}>
|
||||
<SyntaxHighlighter
|
||||
language={'sql'}
|
||||
style={xcode}
|
||||
customStyle={{
|
||||
color: null,
|
||||
background: null,
|
||||
padding: null,
|
||||
lineHeight: dbSyntaxLineHeight,
|
||||
whiteSpace: 'pre-wrap',
|
||||
overflowX: 'scroll',
|
||||
}}
|
||||
>
|
||||
{spanDb.statement}
|
||||
</SyntaxHighlighter>
|
||||
</TruncateHeightSection>
|
||||
);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
@ -59,24 +77,7 @@ export function SpanDatabase({ spanDb }: Props) {
|
|||
</h3>
|
||||
</EuiTitle>
|
||||
<EuiSpacer size="m" />
|
||||
<DatabaseStatement>
|
||||
<TruncateHeightSection previewHeight={previewHeight}>
|
||||
<SyntaxHighlighter
|
||||
language={'sql'}
|
||||
style={xcode}
|
||||
customStyle={{
|
||||
color: null,
|
||||
background: null,
|
||||
padding: null,
|
||||
lineHeight: dbSyntaxLineHeight,
|
||||
whiteSpace: 'pre-wrap',
|
||||
overflowX: 'scroll',
|
||||
}}
|
||||
>
|
||||
{spanDb.statement}
|
||||
</SyntaxHighlighter>
|
||||
</TruncateHeightSection>
|
||||
</DatabaseStatement>
|
||||
<DatabaseStatement>{statementItem}</DatabaseStatement>
|
||||
<EuiSpacer size="l" />
|
||||
</Fragment>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue