Skip to content

Commit 0cf3e4c

Browse files
committed
fix
1 parent fc44f2c commit 0cf3e4c

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

src/components/FixedHeightQuery/FixedHeightQuery.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323

2424
height: 100% !important;
2525
margin: 0 !important;
26-
padding: var(--g-spacing-2) !important;
27-
padding-left: 0 !important;
26+
padding: 0 !important;
2827

2928
white-space: pre-wrap !important;
3029
text-overflow: ellipsis !important;
@@ -40,4 +39,8 @@
4039
word-break: break-word !important;
4140
}
4241
}
42+
.ydb-syntax-highlighter__copy {
43+
top: 0;
44+
right: 0;
45+
}
4346
}

src/components/FixedHeightQuery/FixedHeightQuery.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import './FixedHeightQuery.scss';
77

88
const b = cn('ydb-fixed-height-query');
99

10-
const FIXED_PADDING = 8;
10+
const FIXED_PADDING = 0;
1111
const LINE_HEIGHT = 20;
1212

1313
type FixedHeightQueryMode = 'fixed' | 'max';
@@ -53,6 +53,7 @@ export const FixedHeightQuery = ({
5353
alwaysVisible: clipboardButtonAlwaysVisible,
5454
copyText: value,
5555
withLabel: false,
56+
size: 'xs',
5657
}
5758
: false
5859
}

src/components/SyntaxHighlighter/YDBSyntaxHighlighter.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22

3+
import type {ButtonSize} from '@gravity-ui/uikit';
34
import {ClipboardButton} from '@gravity-ui/uikit';
45
import {nanoid} from '@reduxjs/toolkit';
56
import {PrismLight as ReactSyntaxHighlighter} from 'react-syntax-highlighter';
@@ -27,6 +28,7 @@ interface ClipboardButtonOptions {
2728
alwaysVisible?: boolean;
2829
copyText?: string;
2930
withLabel?: boolean;
31+
size?: ButtonSize;
3032
}
3133

3234
export type WithClipboardButtonProp = ClipboardButtonOptions | boolean;
@@ -58,28 +60,22 @@ export function YDBSyntaxHighlighter({
5860
registerLangAndUpdateKey();
5961
}, [language]);
6062

63+
const clipboardButtonProps =
64+
typeof withClipboardButton === 'object' ? withClipboardButton : undefined;
65+
6166
const renderCopyButton = () => {
6267
if (withClipboardButton) {
6368
return (
6469
<div className={b('sticky-container')} onClick={(e) => e.stopPropagation()}>
6570
<ClipboardButton
6671
view="flat-secondary"
67-
size="s"
72+
size={clipboardButtonProps?.size || 'xs'}
6873
className={b('copy', {
69-
visible:
70-
typeof withClipboardButton === 'object' &&
71-
withClipboardButton.alwaysVisible,
74+
visible: clipboardButtonProps?.alwaysVisible,
7275
})}
73-
text={
74-
(typeof withClipboardButton === 'object' &&
75-
withClipboardButton.copyText) ||
76-
text
77-
}
76+
text={clipboardButtonProps?.copyText || text}
7877
>
79-
{typeof withClipboardButton === 'object' &&
80-
withClipboardButton.withLabel === false
81-
? null
82-
: i18n('copy')}
78+
{clipboardButtonProps?.withLabel === false ? null : i18n('copy')}
8379
</ClipboardButton>
8480
</div>
8581
);

src/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"context_storage-groups": "Storage: {{count}} groups",
1919
"context_memory-used": "Memory used",
2020
"context_network-usage": "Network usage",
21-
"context_network-evaluation": "Network usage",
2221
"context_cpu-description": "CPU load is calculated as the cumulative usage across all actor system pools in the database",
2322
"context_memory-description": "Memory usage is the total memory consumed by all processes in the database",
2423
"context_storage-description": "Storage usage shows how much data is stored in the database including user data and indexes",

0 commit comments

Comments
 (0)