ydb-embedded-ui 6.1.0 → 6.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/dist/components/DateRange/DateRange.scss +7 -0
  2. package/dist/components/EntityStatus/EntityStatus.d.ts +3 -1
  3. package/dist/components/EntityStatus/EntityStatus.js +4 -4
  4. package/dist/components/EntityStatus/EntityStatus.scss +2 -10
  5. package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -2
  6. package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +1 -10
  7. package/dist/components/QueryResultTable/QueryResultTable.d.ts +2 -2
  8. package/dist/components/QueryResultTable/QueryResultTable.js +2 -1
  9. package/dist/components/QueryResultTable/QueryResultTable.scss +1 -0
  10. package/dist/components/ResizeableDataTable/ResizeableDataTable.d.ts +7 -0
  11. package/dist/components/ResizeableDataTable/ResizeableDataTable.js +14 -0
  12. package/dist/components/ResizeableDataTable/ResizeableDataTable.scss +8 -0
  13. package/dist/components/VirtualTable/ResizeHandler.d.ts +8 -0
  14. package/dist/components/VirtualTable/ResizeHandler.js +62 -0
  15. package/dist/components/VirtualTable/ResizeableVirtualTable.d.ts +6 -0
  16. package/dist/components/VirtualTable/ResizeableVirtualTable.js +16 -0
  17. package/dist/components/VirtualTable/TableHead.d.ts +3 -3
  18. package/dist/components/VirtualTable/TableHead.js +16 -31
  19. package/dist/components/VirtualTable/VirtualTable.d.ts +2 -4
  20. package/dist/components/VirtualTable/VirtualTable.scss +24 -4
  21. package/dist/components/VirtualTable/types.d.ts +3 -0
  22. package/dist/components/VirtualTable/utils.d.ts +2 -0
  23. package/dist/components/VirtualTable/utils.js +21 -0
  24. package/dist/containers/ClusterModeGuard/ClusterModeGuard.js +1 -1
  25. package/dist/containers/Clusters/Clusters.js +3 -2
  26. package/dist/containers/Clusters/Clusters.scss +5 -0
  27. package/dist/containers/Clusters/columns.d.ts +1 -0
  28. package/dist/containers/Clusters/columns.js +4 -3
  29. package/dist/containers/Nodes/Nodes.js +4 -4
  30. package/dist/containers/Nodes/Nodes.scss +0 -5
  31. package/dist/containers/Nodes/VirtualNodes.js +4 -6
  32. package/dist/containers/Nodes/getNodesColumns.d.ts +1 -0
  33. package/dist/containers/Nodes/getNodesColumns.js +9 -1
  34. package/dist/containers/PDiskPage/PDiskGroups.js +3 -3
  35. package/dist/containers/Storage/Storage.scss +0 -4
  36. package/dist/containers/Storage/StorageGroups/StorageGroups.js +3 -3
  37. package/dist/containers/Storage/StorageGroups/VirtualStorageGroups.js +3 -3
  38. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +3 -0
  39. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +7 -3
  40. package/dist/containers/Storage/StorageNodes/StorageNodes.js +3 -3
  41. package/dist/containers/Storage/StorageNodes/VirtualStorageNodes.js +3 -3
  42. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.d.ts +3 -0
  43. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js +2 -0
  44. package/dist/containers/Tablet/Tablet.scss +0 -4
  45. package/dist/containers/Tablet/TabletTable/TabletTable.js +5 -3
  46. package/dist/containers/Tenant/Acl/Acl.js +3 -2
  47. package/dist/containers/Tenant/Acl/Acl.scss +0 -6
  48. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
  49. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.scss +2 -0
  50. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.d.ts +1 -0
  51. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.js +2 -0
  52. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +5 -4
  53. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +1 -5
  54. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +8 -4
  55. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +2 -0
  56. package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.js +1 -1
  57. package/dist/containers/Tenant/Diagnostics/Partitions/columns/Columns.scss +0 -8
  58. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.d.ts +1 -0
  59. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.js +11 -4
  60. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +2 -2
  61. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +2 -2
  62. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +3 -2
  63. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -2
  64. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +2 -2
  65. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +3 -7
  66. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.d.ts +2 -2
  67. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.js +2 -2
  68. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +2 -2
  69. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +4 -2
  70. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +8 -11
  71. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.scss +2 -24
  72. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +1 -0
  73. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +7 -0
  74. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.d.ts +1 -2
  75. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.js +3 -4
  76. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +0 -1
  77. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -10
  78. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.scss +4 -15
  79. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.d.ts +1 -0
  80. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.js +5 -0
  81. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +1 -1
  82. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +0 -6
  83. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +1 -21
  84. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +4 -4
  85. package/dist/containers/Tenant/Query/ExplainResult/utils.d.ts +0 -3
  86. package/dist/containers/Tenant/Query/ExplainResult/utils.js +0 -34
  87. package/dist/containers/Tenant/Query/Preview/Preview.js +3 -2
  88. package/dist/containers/Tenant/Query/Preview/Preview.scss +6 -3
  89. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.js +4 -2
  90. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.scss +0 -1
  91. package/dist/containers/Tenant/Query/QueryEditor/helpers.js +2 -1
  92. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.js +4 -1
  93. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.scss +0 -1
  94. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +1 -2
  95. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +4 -3
  96. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.d.ts +1 -0
  97. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.js +4 -2
  98. package/dist/containers/Tenants/Tenants.js +12 -7
  99. package/dist/containers/Tenants/Tenants.scss +15 -9
  100. package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.scss +0 -2
  101. package/dist/containers/Versions/NodesTable/NodesTable.js +14 -9
  102. package/dist/styles/mixins.scss +0 -47
  103. package/dist/utils/constants.d.ts +25 -10
  104. package/dist/utils/hooks/useTableResize.d.ts +2 -7
  105. package/dist/utils/hooks/useTableResize.js +12 -24
  106. package/package.json +10 -10
  107. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.scss +0 -8
@@ -7,7 +7,7 @@
7
7
  flex-grow: 1;
8
8
  flex-direction: column;
9
9
 
10
- padding: 0px 10px;
10
+ padding-left: 10px;
11
11
 
12
12
  @include query-data-table();
13
13
  & .data-table__table-wrapper {
@@ -20,8 +20,6 @@
20
20
  flex-direction: column;
21
21
 
22
22
  width: 100%;
23
- margin-top: 10px;
24
- padding: 0 10px 10px;
25
23
  }
26
24
 
27
25
  &__result-tabs {
@@ -59,7 +57,6 @@
59
57
  gap: 4px;
60
58
  }
61
59
  &__inspector {
62
- max-width: calc(100% - 50px);
63
60
  padding: 15px 10px;
64
61
  @include json-tree-styles();
65
62
  &_fullscreen {
@@ -70,21 +67,4 @@
70
67
  padding: 10px;
71
68
  }
72
69
  }
73
-
74
- &__fullscreen-table-wrapper {
75
- overflow: auto;
76
-
77
- width: 100%;
78
- height: 100%;
79
- margin: 20px;
80
-
81
- background-color: var(--g-color-base-background);
82
- @include table-styles();
83
- table {
84
- width: 100% !important;
85
- }
86
- .data-table__table-wrapper {
87
- padding: 0 !important;
88
- }
89
- }
90
70
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { TextOverflow, getTopology, getYdbPlanNodeShape } from '@gravity-ui/paranoid';
3
+ import { getTopology, getYdbPlanNodeShape } from '@gravity-ui/paranoid';
4
4
  import { Loader, RadioButton } from '@gravity-ui/uikit';
5
5
  import JSONTree from 'react-json-inspector';
6
6
  import Divider from '../../../../components/Divider/Divider';
@@ -14,7 +14,7 @@ import { cn } from '../../../../utils/cn';
14
14
  import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
15
15
  import { LANGUAGE_S_EXPRESSION_ID } from '../../../../utils/monaco/s-expression/constants';
16
16
  import { PaneVisibilityToggleButtons } from '../../utils/paneVisibilityToggleHelpers';
17
- import { getColors, renderExplainNode } from './utils';
17
+ import { renderExplainNode } from './utils';
18
18
  import './ExplainResult.scss';
19
19
  import 'react-json-inspector/json-inspector.css';
20
20
  const b = cn('ydb-query-explain-result');
@@ -46,7 +46,7 @@ function GraphRoot(props) {
46
46
  throw new Error("Can't find element with id #graphRoot");
47
47
  }
48
48
  graphRoot.innerHTML = '';
49
- paranoid.current = getTopology('graphRoot', data, Object.assign(Object.assign({}, opts), { colors: getColors() }), shapes);
49
+ paranoid.current = getTopology('graphRoot', data, opts, shapes);
50
50
  paranoid.current.render();
51
51
  return () => {
52
52
  paranoid.current = undefined;
@@ -109,7 +109,7 @@ export function ExplainResult(props) {
109
109
  hidden: activeOption !== ExplainOptionIds.schema,
110
110
  }), children: _jsx(GraphRoot, { theme: theme, data: { links, nodes }, opts: {
111
111
  renderNodeTitle: renderExplainNode,
112
- textOverflow: TextOverflow.Normal,
112
+ textOverflow: 'normal',
113
113
  initialZoomFitsCanvas: true,
114
114
  }, shapes: {
115
115
  node: getYdbPlanNodeShape,
@@ -1,5 +1,2 @@
1
1
  import type { GraphNode } from '@gravity-ui/paranoid';
2
2
  export declare const renderExplainNode: (node: GraphNode) => string;
3
- export declare function getColors(): {
4
- getCommonColor: (name: string) => string;
5
- };
@@ -2,37 +2,3 @@ export const renderExplainNode = (node) => {
2
2
  const parts = node.name.split('|');
3
3
  return parts.length > 1 ? parts[1] : node.name;
4
4
  };
5
- export function getColors() {
6
- const colorsMap = {
7
- success: '--g-color-text-positive',
8
- error: '--g-color-text-danger',
9
- warning: '--g-color-text-warning',
10
- errorBackground: '--g-color-base-danger-medium',
11
- warningBackground: '--g-color-base-warning-medium',
12
- mute: '--g-color-line-generic',
13
- stroke: '--g-color-text-hint',
14
- fill: '--g-color-base-generic-ultralight',
15
- nodeFill: '--g-color-base-float',
16
- nodeShadow: '--g-color-sfx-shadow',
17
- titleColor: '--g-color-text-primary',
18
- textColor: '--g-color-text-complementary',
19
- buttonBorderColor: '--g-color-line-generic',
20
- // groupBorderColor: '--g-color-celestial-thunder',
21
- // groupFill: '--g-color-celestial',
22
- titleHoverColor: '--g-color-text-link-hover',
23
- nodeHover: '--g-color-base-float-hover',
24
- specialHover: '--g-color-line-focus',
25
- };
26
- const style = getComputedStyle(document.body);
27
- const colors = Object.keys(colorsMap).reduce((acc, key) => {
28
- const color = style.getPropertyValue(colorsMap[key]).replace(/ /g, '');
29
- if (color) {
30
- acc[key] = color;
31
- }
32
- return acc;
33
- }, {});
34
- const getCommonColor = (name) => {
35
- return style.getPropertyValue(`--g-color-${name}`).replace(/ /g, '');
36
- };
37
- return Object.assign(Object.assign({}, colors), { getCommonColor });
38
- }
@@ -15,10 +15,11 @@ import './Preview.scss';
15
15
  const b = cn('kv-preview');
16
16
  export const Preview = ({ database, type }) => {
17
17
  const dispatch = useTypedDispatch();
18
+ const isPreviewAvailable = isTableType(type);
18
19
  const { autorefresh, currentSchemaPath } = useTypedSelector((state) => state.schema);
19
20
  const isFullscreen = useTypedSelector((state) => state.fullscreen);
20
21
  const query = `--!syntax_v1\nselect * from \`${currentSchemaPath}\` limit 32`;
21
- const { currentData, isFetching, error } = previewApi.useSendQueryQuery({ database, query, action: isExternalTable(type) ? 'execute-query' : 'execute-scan' }, { pollingInterval: autorefresh });
22
+ const { currentData, isFetching, error } = previewApi.useSendQueryQuery({ database, query, action: isExternalTable(type) ? 'execute-query' : 'execute-scan' }, { pollingInterval: autorefresh, skip: !isPreviewAvailable });
22
23
  const loading = isFetching && currentData === undefined;
23
24
  const data = currentData !== null && currentData !== void 0 ? currentData : {};
24
25
  const handleClosePreview = () => {
@@ -31,7 +32,7 @@ export const Preview = ({ database, type }) => {
31
32
  return (_jsx("div", { className: b('loader-container'), children: _jsx(Loader, { size: "m" }) }));
32
33
  }
33
34
  let message;
34
- if (!isTableType(type)) {
35
+ if (!isPreviewAvailable) {
35
36
  message = _jsx("div", { className: b('message-container'), children: i18n('preview.not-available') });
36
37
  }
37
38
  else if (error) {
@@ -1,8 +1,9 @@
1
- @import '../../../../styles/mixins.scss';
1
+ @use '../../../../styles/mixins.scss';
2
2
 
3
3
  .kv-preview {
4
4
  height: 100%;
5
- @include query-data-table;
5
+ @include mixins.flex-container();
6
+ @include mixins.query-data-table();
6
7
 
7
8
  &__header {
8
9
  position: sticky;
@@ -48,9 +49,11 @@
48
49
  &__result {
49
50
  overflow: auto;
50
51
 
52
+ width: 100%;
53
+
51
54
  // This fixes last row display for ordinary preview (not fullscreen)
52
55
  height: calc(100% - 40px);
53
- padding: 0 10px;
56
+ padding-left: 10px;
54
57
 
55
58
  // Fix white space footer block for fullscreen preview
56
59
  .kv-fullscreen & {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import DataTable from '@gravity-ui/react-data-table';
2
+ import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
3
3
  import { TruncatedQuery } from '../../../../components/TruncatedQuery/TruncatedQuery';
4
4
  import { selectQueriesHistory } from '../../../../store/reducers/executeQuery';
5
5
  import { TENANT_QUERY_TABS_ID } from '../../../../store/reducers/tenant/constants';
@@ -11,6 +11,7 @@ import { MAX_QUERY_HEIGHT, QUERY_TABLE_SETTINGS } from '../../utils/constants';
11
11
  import i18n from '../i18n';
12
12
  import './QueriesHistory.scss';
13
13
  const b = cn('ydb-queries-history');
14
+ const QUERIES_HISTORY_COLUMNS_WIDTH_LS_KEY = 'queriesHistoryTableColumnsWidth';
14
15
  function QueriesHistory({ changeUserInput }) {
15
16
  const dispatch = useTypedDispatch();
16
17
  const [queryMode, setQueryMode] = useQueryModes();
@@ -35,6 +36,7 @@ function QueriesHistory({ changeUserInput }) {
35
36
  return (_jsx("div", { className: b('query'), children: _jsx(TruncatedQuery, { value: row.queryText, maxQueryHeight: MAX_QUERY_HEIGHT }) }));
36
37
  },
37
38
  sortable: false,
39
+ width: 600,
38
40
  },
39
41
  {
40
42
  name: 'syntax',
@@ -46,6 +48,6 @@ function QueriesHistory({ changeUserInput }) {
46
48
  width: 200,
47
49
  },
48
50
  ];
49
- return (_jsx("div", { className: b(), children: _jsx(DataTable, { theme: "yandex-cloud", columns: columns, data: reversedHistory, settings: QUERY_TABLE_SETTINGS, emptyDataMessage: i18n('history.empty'), onRowClick: (row) => onQueryClick(row), rowClassName: () => b('table-row') }) }));
51
+ return (_jsx("div", { className: b(), children: _jsx(ResizeableDataTable, { columnsWidthLSKey: QUERIES_HISTORY_COLUMNS_WIDTH_LS_KEY, columns: columns, data: reversedHistory, settings: QUERY_TABLE_SETTINGS, emptyDataMessage: i18n('history.empty'), onRowClick: (row) => onQueryClick(row), rowClassName: () => b('table-row') }) }));
50
52
  }
51
53
  export default QueriesHistory;
@@ -7,7 +7,6 @@
7
7
  padding: 0 16px;
8
8
 
9
9
  @include flex-container();
10
- @include table-styles;
11
10
 
12
11
  &__table-row {
13
12
  cursor: pointer;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { AUTOCOMPLETE_ON_ENTER, ENABLE_AUTOCOMPLETE, useSetting } from '../../../../lib';
2
+ import { AUTOCOMPLETE_ON_ENTER, ENABLE_AUTOCOMPLETE } from '../../../../utils/constants';
3
+ import { useSetting } from '../../../../utils/hooks';
3
4
  export const EDITOR_OPTIONS = {
4
5
  automaticLayout: true,
5
6
  selectOnLineNumbers: true,
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import DataTable from '@gravity-ui/react-data-table';
4
4
  import { Button, Dialog } from '@gravity-ui/uikit';
5
5
  import { Icon } from '../../../../components/Icon';
6
+ import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
6
7
  import { TruncatedQuery } from '../../../../components/TruncatedQuery/TruncatedQuery';
7
8
  import { setQueryNameToEdit } from '../../../../store/reducers/saveQuery';
8
9
  import { TENANT_QUERY_TABS_ID } from '../../../../store/reducers/tenant/constants';
@@ -16,6 +17,7 @@ const b = cn('ydb-saved-queries');
16
17
  const DeleteDialog = ({ visible, queryName, onCancelClick, onConfirmClick }) => {
17
18
  return (_jsxs(Dialog, { open: visible, hasCloseButton: false, size: "s", onClose: onCancelClick, onEnterKeyDown: onConfirmClick, children: [_jsx(Dialog.Header, { caption: i18n('delete-dialog.header') }), _jsxs(Dialog.Body, { className: b('dialog-body'), children: [i18n('delete-dialog.question'), _jsx("span", { className: b('dialog-query-name'), children: ` ${queryName}?` })] }), _jsx(Dialog.Footer, { textButtonApply: i18n('delete-dialog.delete'), textButtonCancel: i18n('delete-dialog.cancel'), onClickButtonCancel: onCancelClick, onClickButtonApply: onConfirmClick })] }));
18
19
  };
20
+ const SAVED_QUERIES_COLUMNS_WIDTH_LS_KEY = 'savedQueriesTableColumnsWidth';
19
21
  export const SavedQueries = ({ savedQueries, changeUserInput, onDeleteQuery }) => {
20
22
  const dispatch = useTypedDispatch();
21
23
  const [isDeleteDialogVisible, setIsDeleteDialogVisible] = React.useState(false);
@@ -56,9 +58,10 @@ export const SavedQueries = ({ savedQueries, changeUserInput, onDeleteQuery }) =
56
58
  header: 'Query Text',
57
59
  render: ({ row: query }) => (_jsxs("div", { className: b('query'), children: [_jsx("div", { className: b('query-body'), children: _jsx(TruncatedQuery, { value: query.body, maxQueryHeight: MAX_QUERY_HEIGHT }) }), _jsxs("span", { className: b('controls'), children: [_jsx(Button, { view: "flat-secondary", children: _jsx(Icon, { name: "pencil", viewBox: "0 0 24 24" }) }), _jsx(Button, { view: "flat-secondary", onClick: onDeleteQueryClick(query.name), children: _jsx(Icon, { name: "trash", viewBox: "0 0 24 24" }) })] })] })),
58
60
  sortable: false,
61
+ resizeMinWidth: 650,
59
62
  },
60
63
  ];
61
- return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), children: _jsx(DataTable, { theme: "yandex-cloud", columns: columns, data: savedQueries, settings: QUERY_TABLE_SETTINGS, emptyDataMessage: i18n('saved.empty'), rowClassName: () => b('row'), onRowClick: (row) => onQueryClick(row.body, row.name), initialSortOrder: {
64
+ return (_jsxs(React.Fragment, { children: [_jsx("div", { className: b(), children: _jsx(ResizeableDataTable, { columnsWidthLSKey: SAVED_QUERIES_COLUMNS_WIDTH_LS_KEY, columns: columns, data: savedQueries, settings: QUERY_TABLE_SETTINGS, emptyDataMessage: i18n('saved.empty'), rowClassName: () => b('row'), onRowClick: (row) => onQueryClick(row.body, row.name), initialSortOrder: {
62
65
  columnId: 'name',
63
66
  order: DataTable.ASCENDING,
64
67
  } }) }), _jsx(DeleteDialog, { visible: isDeleteDialogVisible, queryName: queryNameToDelete, onCancelClick: onCancelDeleteClick, onConfirmClick: onConfirmDeleteClick })] }));
@@ -9,7 +9,6 @@
9
9
  padding: 0 16px;
10
10
 
11
11
  @include flex-container();
12
- @include table-styles;
13
12
 
14
13
  &__row {
15
14
  cursor: pointer;
@@ -1,10 +1,9 @@
1
1
  import type { EPathType } from '../../../../types/api/schema';
2
2
  import './SchemaViewer.scss';
3
3
  interface SchemaViewerProps {
4
- className?: string;
5
4
  type?: EPathType;
6
5
  path?: string;
7
6
  withFamilies?: boolean;
8
7
  }
9
- export declare const SchemaViewer: ({ className, type, path, withFamilies }: SchemaViewerProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const SchemaViewer: ({ type, path, withFamilies }: SchemaViewerProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,18 +1,19 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import DataTable from '@gravity-ui/react-data-table';
3
+ import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
3
4
  import { TableSkeleton } from '../../../../components/TableSkeleton/TableSkeleton';
4
5
  import { cn } from '../../../../utils/cn';
5
6
  import { DEFAULT_TABLE_SETTINGS } from '../../../../utils/constants';
6
7
  import { useTypedSelector } from '../../../../utils/hooks';
7
- import { SchemaViewerColumns, prepareColumnDescriptions, prepareFamilies, prepareSchemaTableColumns, } from './helpers';
8
+ import { SCHEMA_COLUMNS_WIDTH_LS_KEY, SchemaViewerColumns, prepareColumnDescriptions, prepareFamilies, prepareSchemaTableColumns, } from './helpers';
8
9
  import './SchemaViewer.scss';
9
10
  const b = cn('schema-viewer');
10
- export const SchemaViewer = ({ className, type, path, withFamilies = false }) => {
11
+ export const SchemaViewer = ({ type, path, withFamilies = false }) => {
11
12
  const { data, loading } = useTypedSelector((state) => state.schema);
12
13
  const currentObjectData = path ? data[path] : undefined;
13
14
  const { columns, keyColumnIds } = prepareColumnDescriptions(type, currentObjectData);
14
15
  const families = prepareFamilies(currentObjectData);
15
- return (_jsx("div", { className: b(null, className), children: loading ? (_jsx(TableSkeleton, {})) : (_jsx(DataTable, { theme: "yandex-cloud", data: columns, columns: prepareSchemaTableColumns({
16
+ return (_jsx("div", { className: b(null), children: loading ? (_jsx(TableSkeleton, {})) : (_jsx(ResizeableDataTable, { columnsWidthLSKey: SCHEMA_COLUMNS_WIDTH_LS_KEY, data: columns, columns: prepareSchemaTableColumns({
16
17
  type,
17
18
  b,
18
19
  families,
@@ -16,6 +16,7 @@ export declare function prepareColumnDescriptions(type?: EPathType, scheme?: TEv
16
16
  keyColumnIds: number[];
17
17
  };
18
18
  export declare function prepareFamilies(scheme?: TEvDescribeSchemeResult): Record<number, TFamilyDescription>;
19
+ export declare const SCHEMA_COLUMNS_WIDTH_LS_KEY = "schemaTableColumnsWidth";
19
20
  export declare function prepareSchemaTableColumns(options: {
20
21
  type?: EPathType;
21
22
  b: ClassNameFormatter;
@@ -69,6 +69,7 @@ export function prepareFamilies(scheme) {
69
69
  return acc;
70
70
  }, {})) !== null && _e !== void 0 ? _e : {});
71
71
  }
72
+ export const SCHEMA_COLUMNS_WIDTH_LS_KEY = 'schemaTableColumnsWidth';
72
73
  export function prepareSchemaTableColumns(options) {
73
74
  const keyColumnsOrderValues = options.keyColumnIds.reduce((result, keyColumnId, index) => {
74
75
  // Put columns with negative values, so they will be the first with ascending sort
@@ -79,14 +80,15 @@ export function prepareSchemaTableColumns(options) {
79
80
  const columns = [
80
81
  {
81
82
  name: SchemaViewerColumns.id,
82
- width: 40,
83
+ width: 60,
83
84
  },
84
85
  ];
85
86
  if (!isExternalTable(options.type)) {
86
87
  // External tables don't have key columns
87
88
  columns.push({
88
89
  name: SchemaViewerColumns.key,
89
- width: 40,
90
+ width: 70,
91
+ resizeMinWidth: 70,
90
92
  // Table should start with key columns on sort click
91
93
  defaultOrder: DataTable.ASCENDING,
92
94
  // Values in keyColumnsOrderValues are always negative, so it will be 1 for not key columns
@@ -8,6 +8,7 @@ import { ResponseError } from '../../components/Errors/ResponseError';
8
8
  import { Illustration } from '../../components/Illustration';
9
9
  import { PoolsGraph } from '../../components/PoolsGraph/PoolsGraph';
10
10
  import { ProblemFilter } from '../../components/ProblemFilter';
11
+ import { ResizeableDataTable } from '../../components/ResizeableDataTable/ResizeableDataTable';
11
12
  import { Search } from '../../components/Search';
12
13
  import { TableWithControlsLayout } from '../../components/TableWithControlsLayout/TableWithControlsLayout';
13
14
  import { TabletsStatistic } from '../../components/TabletsStatistic';
@@ -22,6 +23,7 @@ import { useTypedDispatch, useTypedSelector } from '../../utils/hooks';
22
23
  import { getTenantPath } from '../Tenant/TenantPages';
23
24
  import './Tenants.scss';
24
25
  const b = cn('tenants');
26
+ const DATABASES_COLUMNS_WIDTH_LS_KEY = 'databasesTableColumnsWidth';
25
27
  export const Tenants = ({ additionalTenantsProps }) => {
26
28
  const dispatch = useTypedDispatch();
27
29
  const { currentData, isFetching, error } = tenantsApi.useGetTenantsInfoQuery({ clusterName }, { pollingInterval: DEFAULT_POLLING_INTERVAL });
@@ -53,10 +55,10 @@ export const Tenants = ({ additionalTenantsProps }) => {
53
55
  var _a;
54
56
  const backend = getTenantBackend(row);
55
57
  const isExternalLink = Boolean(backend);
56
- return (_jsxs("div", { className: b('name-wrapper'), children: [_jsx(EntityStatus, { externalLink: isExternalLink, className: b('name'), name: row.Name || 'unknown database', withLeftTrim: true, status: row.Overall, hasClipboardButton: true, path: getTenantPath({
57
- name: row.Name,
58
- backend,
59
- }) }), (_a = additionalTenantsProps === null || additionalTenantsProps === void 0 ? void 0 : additionalTenantsProps.getMonitoringLink) === null || _a === void 0 ? void 0 : _a.call(additionalTenantsProps, row.Name, row.Type)] }));
58
+ return (_jsx(EntityStatus, { externalLink: isExternalLink, className: b('name'), name: row.Name || 'unknown database', withLeftTrim: true, status: row.Overall, hasClipboardButton: true, path: getTenantPath({
59
+ name: row.Name,
60
+ backend,
61
+ }), additionalControls: _jsx("span", { className: b('monitoring-button'), children: (_a = additionalTenantsProps === null || additionalTenantsProps === void 0 ? void 0 : additionalTenantsProps.getMonitoringLink) === null || _a === void 0 ? void 0 : _a.call(additionalTenantsProps, row.Name, row.Type) }) }));
60
62
  },
61
63
  width: 440,
62
64
  sortable: true,
@@ -75,6 +77,7 @@ export const Tenants = ({ additionalTenantsProps }) => {
75
77
  {
76
78
  name: 'Type',
77
79
  width: 200,
80
+ resizeMinWidth: 150,
78
81
  render: ({ row }) => {
79
82
  if (row.Type !== 'Serverless') {
80
83
  return row.Type;
@@ -138,6 +141,7 @@ export const Tenants = ({ additionalTenantsProps }) => {
138
141
  name: 'PoolStats',
139
142
  header: 'Pools',
140
143
  width: 100,
144
+ resizeMinWidth: 60,
141
145
  sortAccessor: ({ PoolStats = [] }) => PoolStats.reduce((acc, item) => acc + (item.Usage || 0), 0),
142
146
  defaultOrder: DataTable.DESCENDING,
143
147
  align: DataTable.LEFT,
@@ -147,7 +151,8 @@ export const Tenants = ({ additionalTenantsProps }) => {
147
151
  name: 'Tablets',
148
152
  header: 'Tablets States',
149
153
  sortable: false,
150
- width: 430,
154
+ width: 500,
155
+ resizeMinWidth: 500,
151
156
  render: ({ row }) => {
152
157
  const backend = getTenantBackend(row);
153
158
  return row.Tablets ? (_jsx(TabletsStatistic, { path: row.Name, tablets: row.Tablets, nodeIds: row.NodeIds || [], backend: backend })) : ('—');
@@ -157,10 +162,10 @@ export const Tenants = ({ additionalTenantsProps }) => {
157
162
  if (filteredTenants.length === 0 && problemFilter !== ProblemFilterValues.ALL) {
158
163
  return _jsx(Illustration, { name: "thumbsUp", width: "200" });
159
164
  }
160
- return (_jsx(DataTable, { theme: "yandex-cloud", data: filteredTenants, columns: columns, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: "No such tenants" }));
165
+ return (_jsx(ResizeableDataTable, { columnsWidthLSKey: DATABASES_COLUMNS_WIDTH_LS_KEY, data: filteredTenants, columns: columns, settings: DEFAULT_TABLE_SETTINGS, emptyDataMessage: "No such tenants" }));
161
166
  };
162
167
  if (error) {
163
168
  return _jsx(ResponseError, { error: error });
164
169
  }
165
- return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), _jsx(TableWithControlsLayout.Table, { loading: loading, className: b('table'), children: renderTable() })] }));
170
+ return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), _jsx(TableWithControlsLayout.Table, { loading: loading, children: renderTable() })] }));
166
171
  };
@@ -25,26 +25,32 @@
25
25
  }
26
26
  }
27
27
 
28
- &__table {
29
- @include table-styles;
28
+ &__type {
29
+ display: flex;
30
+ flex-direction: row;
31
+ align-items: center;
32
+ gap: 10px;
30
33
  }
31
34
 
32
35
  &__type-value {
33
- margin-right: 10px;
36
+ overflow: hidden;
37
+
38
+ width: min-content;
39
+
40
+ white-space: nowrap;
41
+ text-overflow: ellipsis;
34
42
  }
35
43
 
36
44
  &__type-button {
37
- visibility: hidden;
45
+ display: none;
38
46
  }
39
47
 
40
48
  .data-table__row:hover &__type-button {
41
- visibility: visible;
49
+ display: block;
42
50
  }
43
51
 
44
- &__name-wrapper {
45
- display: flex;
46
- align-items: center;
47
- gap: 4px;
52
+ &__monitoring-button {
53
+ margin-left: 4px;
48
54
  }
49
55
 
50
56
  &__name {
@@ -23,8 +23,6 @@
23
23
 
24
24
  @include freeze-nth-column(1);
25
25
  @include freeze-nth-column(2, 80px);
26
-
27
- @include table-styles;
28
26
  }
29
27
 
30
28
  .ydb-tree-view {
@@ -3,15 +3,18 @@ import DataTable from '@gravity-ui/react-data-table';
3
3
  import { EntityStatus } from '../../../components/EntityStatus/EntityStatus';
4
4
  import { PoolsGraph } from '../../../components/PoolsGraph/PoolsGraph';
5
5
  import { ProgressViewer } from '../../../components/ProgressViewer/ProgressViewer';
6
+ import { ResizeableDataTable } from '../../../components/ResizeableDataTable/ResizeableDataTable';
6
7
  import { DEFAULT_TABLE_SETTINGS } from '../../../utils/constants';
7
8
  import { formatBytes } from '../../../utils/dataFormatters/dataFormatters';
8
9
  import { isUnavailableNode } from '../../../utils/nodes';
9
10
  import { getDefaultNodePath } from '../../Node/NodePages';
11
+ const VERSIONS_COLUMNS_WIDTH_LS_KEY = 'versionsTableColumnsWidth';
10
12
  const columns = [
11
13
  {
12
14
  name: 'NodeId',
13
15
  header: '#',
14
- width: '80px',
16
+ width: 80,
17
+ resizeMinWidth: 80,
15
18
  align: DataTable.LEFT,
16
19
  render: ({ row }) => row.NodeId,
17
20
  },
@@ -25,7 +28,7 @@ const columns = [
25
28
  const nodePath = !isUnavailableNode(row) && row.NodeId ? getDefaultNodePath(row.NodeId) : undefined;
26
29
  return (_jsx(EntityStatus, { name: title, path: nodePath, hasClipboardButton: true, showStatus: false }));
27
30
  },
28
- width: '400px',
31
+ width: 400,
29
32
  align: DataTable.LEFT,
30
33
  },
31
34
  {
@@ -34,14 +37,14 @@ const columns = [
34
37
  render: ({ row }) => row.Endpoints
35
38
  ? row.Endpoints.map(({ Name, Address }) => `${Name} ${Address}`).join(', ')
36
39
  : '-',
37
- width: '300px',
40
+ width: 300,
38
41
  align: DataTable.LEFT,
39
42
  },
40
43
  {
41
44
  name: 'uptime',
42
45
  header: 'Uptime',
43
46
  sortAccessor: ({ StartTime }) => StartTime && -StartTime,
44
- width: '120px',
47
+ width: 120,
45
48
  align: DataTable.LEFT,
46
49
  render: ({ row }) => row.uptime,
47
50
  },
@@ -51,7 +54,7 @@ const columns = [
51
54
  sortAccessor: ({ MemoryUsed = 0 }) => Number(MemoryUsed),
52
55
  defaultOrder: DataTable.DESCENDING,
53
56
  render: ({ row }) => (row.MemoryUsed ? formatBytes(row.MemoryUsed) : '—'),
54
- width: '120px',
57
+ width: 120,
55
58
  align: DataTable.RIGHT,
56
59
  },
57
60
  {
@@ -60,7 +63,7 @@ const columns = [
60
63
  sortAccessor: ({ MemoryLimit = 0 }) => Number(MemoryLimit),
61
64
  defaultOrder: DataTable.DESCENDING,
62
65
  render: ({ row }) => (row.MemoryLimit ? formatBytes(row.MemoryLimit) : '—'),
63
- width: '120px',
66
+ width: 120,
64
67
  align: DataTable.RIGHT,
65
68
  },
66
69
  {
@@ -68,7 +71,8 @@ const columns = [
68
71
  header: 'Pools',
69
72
  sortAccessor: ({ PoolStats = [] }) => PoolStats.reduce((acc, item) => acc + (item.Usage || 0), 0),
70
73
  defaultOrder: DataTable.DESCENDING,
71
- width: '120px',
74
+ width: 80,
75
+ resizeMinWidth: 60,
72
76
  render: ({ row }) => (row.PoolStats ? _jsx(PoolsGraph, { pools: row.PoolStats }) : '—'),
73
77
  align: DataTable.LEFT,
74
78
  },
@@ -77,11 +81,12 @@ const columns = [
77
81
  header: 'Load average',
78
82
  sortAccessor: ({ LoadAverage = [] }) => LoadAverage.slice(0, 1).reduce((acc, item) => acc + item, 0),
79
83
  defaultOrder: DataTable.DESCENDING,
80
- width: '200px',
84
+ width: 140,
85
+ resizeMinWidth: 140,
81
86
  render: ({ row }) => row.LoadAverage && row.LoadAverage.length > 0 ? (_jsx(ProgressViewer, { value: row.LoadAverage[0], percents: true, capacity: 100, colorizeProgress: true })) : ('—'),
82
87
  align: DataTable.LEFT,
83
88
  },
84
89
  ];
85
90
  export const NodesTable = ({ nodes }) => {
86
- return (_jsx(DataTable, { theme: "yandex-cloud", data: nodes, columns: columns, settings: DEFAULT_TABLE_SETTINGS }));
91
+ return (_jsx(ResizeableDataTable, { columnsWidthLSKey: VERSIONS_COLUMNS_WIDTH_LS_KEY, data: nodes, columns: columns, settings: DEFAULT_TABLE_SETTINGS }));
87
92
  };
@@ -96,13 +96,6 @@
96
96
 
97
97
  @mixin query-data-table() {
98
98
  & .data-table {
99
- $_: &;
100
-
101
- &__table {
102
- border-spacing: 0;
103
- border-collapse: separate;
104
- }
105
-
106
99
  &__th,
107
100
  &__td {
108
101
  vertical-align: middle;
@@ -114,11 +107,6 @@
114
107
  }
115
108
  }
116
109
 
117
- &__row,
118
- &__sticky th {
119
- height: 40px;
120
- }
121
-
122
110
  &__th {
123
111
  box-shadow: inset 0 -1px 0 0 var(--g-tabs-color-divider);
124
112
  }
@@ -170,41 +158,6 @@
170
158
  }
171
159
  }
172
160
 
173
- @mixin table-styles {
174
- & .data-table {
175
- &__table {
176
- width: 100%;
177
- }
178
-
179
- &__row,
180
- &__sticky th {
181
- height: 40px;
182
- }
183
-
184
- &__box {
185
- .data-table__table-wrapper {
186
- padding-bottom: 20px;
187
- }
188
-
189
- &_sticky-head_fixed {
190
- overflow: initial;
191
- }
192
- }
193
- }
194
- }
195
-
196
- @mixin table-sticky-styles {
197
- & .data-table {
198
- &__th {
199
- height: auto;
200
- }
201
- }
202
-
203
- & {
204
- padding-bottom: 20px;
205
- }
206
- }
207
-
208
161
  @mixin json-tree-styles {
209
162
  // stylelint-disable
210
163
  font-family: var(--g-font-family-monospace) !important;