Skip to content

Commit f3c93ea

Browse files
committed
fix
1 parent 0dc672a commit f3c93ea

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

src/containers/Configs/Configs.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
--ydb-table-with-controls-layout-controls-height
1010
) - var(--configs-padding-bottom)
1111
);
12-
12+
max-width: 100%;
1313
padding-bottom: var(--configs-padding-bottom);
1414

1515
&__feature-flags {
@@ -20,8 +20,6 @@
2020
--ydb-table-with-controls-layout-controls-height: 44px;
2121
}
2222
&__startup {
23-
pre {
24-
border-radius: 4px;
25-
}
23+
height: var(--ydb-syntax-highlighter-height);
2624
}
2725
}

src/containers/Configs/components/Startup/Startup.tsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
1+
import {useThemeValue} from '@gravity-ui/uikit';
2+
import MonacoEditor from 'react-monaco-editor';
3+
14
import {ResponseError} from '../../../../components/Errors/ResponseError';
25
import {LoaderWrapper} from '../../../../components/LoaderWrapper/LoaderWrapper';
3-
import {YDBSyntaxHighlighterLazy} from '../../../../components/SyntaxHighlighter/lazy';
46
import {configsApi} from '../../../../store/reducers/configs';
57
import {useAutoRefreshInterval} from '../../../../utils/hooks/useAutoRefreshInterval';
68

79
interface StartupProps {
810
database?: string;
911
className?: string;
1012
}
13+
14+
const EDITOR_OPTIONS = {
15+
automaticLayout: true,
16+
selectOnLineNumbers: true,
17+
readOnly: true,
18+
minimap: {
19+
enabled: false,
20+
},
21+
wrappingIndent: 'indent' as const,
22+
};
23+
1124
export function Startup({database, className}: StartupProps) {
1225
const [autoRefreshInterval] = useAutoRefreshInterval();
26+
const theme = useThemeValue();
1327
const {currentData, isLoading, error} = configsApi.useGetConfigQuery(
1428
{database},
1529
{pollingInterval: autoRefreshInterval},
@@ -21,13 +35,14 @@ export function Startup({database, className}: StartupProps) {
2135
<LoaderWrapper loading={isLoading}>
2236
{error ? <ResponseError error={error} /> : null}
2337
{startup ? (
24-
<YDBSyntaxHighlighterLazy
25-
className={className}
26-
language="yaml"
27-
text={startup}
28-
transparentBackground={false}
29-
withClipboardButton={{alwaysVisible: true, withLabel: false, size: 'm'}}
30-
/>
38+
<div className={className}>
39+
<MonacoEditor
40+
language={'yaml'}
41+
value={startup}
42+
options={EDITOR_OPTIONS}
43+
theme={`vs-${theme}`}
44+
/>
45+
</div>
3146
) : null}
3247
</LoaderWrapper>
3348
);

0 commit comments

Comments
 (0)