ydb-embedded-ui 22.10.0 → 22.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/components/BridgeSyncStatusLabel/BridgeSyncStatusLabel.d.ts +12 -0
  2. package/dist/components/BridgeSyncStatusLabel/BridgeSyncStatusLabel.js +47 -0
  3. package/dist/components/BridgeSyncStatusLabel/BridgeSyncStatusLabel.js.map +1 -0
  4. package/dist/components/BridgeSyncStatusLabel/i18n/en.json +7 -0
  5. package/dist/components/BridgeSyncStatusLabel/i18n/index.d.ts +2 -0
  6. package/dist/components/BridgeSyncStatusLabel/i18n/index.js +4 -0
  7. package/dist/components/BridgeSyncStatusLabel/i18n/index.js.map +1 -0
  8. package/dist/components/BridgeSyncStatusLabel/index.d.ts +1 -0
  9. package/dist/components/BridgeSyncStatusLabel/index.js +2 -0
  10. package/dist/components/BridgeSyncStatusLabel/index.js.map +1 -0
  11. package/dist/components/EntityStatus/EntityStatus.d.ts +11 -2
  12. package/dist/components/EntityStatus/EntityStatus.js +6 -4
  13. package/dist/components/EntityStatus/EntityStatus.js.map +1 -1
  14. package/dist/components/EntityStatus/EntityStatus.scss +18 -0
  15. package/dist/components/StatusIconNew/StatusIcon.d.ts +3 -1
  16. package/dist/components/StatusIconNew/StatusIcon.js +4 -3
  17. package/dist/components/StatusIconNew/StatusIcon.js.map +1 -1
  18. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +2 -1
  19. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js.map +1 -1
  20. package/dist/containers/Cluster/ClusterOverview/components/BridgeDatabasesSummary.d.ts +4 -0
  21. package/dist/containers/Cluster/ClusterOverview/components/BridgeDatabasesSummary.js +47 -0
  22. package/dist/containers/Cluster/ClusterOverview/components/BridgeDatabasesSummary.js.map +1 -0
  23. package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.d.ts +2 -1
  24. package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.js +53 -14
  25. package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.js.map +1 -1
  26. package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.scss +36 -23
  27. package/dist/containers/Cluster/ClusterOverview/components/bridgeInfo.d.ts +7 -0
  28. package/dist/containers/Cluster/ClusterOverview/components/bridgeInfo.js +24 -0
  29. package/dist/containers/Cluster/ClusterOverview/components/bridgeInfo.js.map +1 -0
  30. package/dist/containers/Cluster/i18n/en.json +13 -0
  31. package/dist/containers/Cluster/i18n/index.d.ts +1 -1
  32. package/dist/containers/Operations/useOperationsQueryParams.d.ts +1 -1
  33. package/dist/containers/Storage/PaginatedStorageGroups/PaginatedStorageGroups.js +5 -1
  34. package/dist/containers/Storage/PaginatedStorageGroups/PaginatedStorageGroups.js.map +1 -1
  35. package/dist/containers/Storage/PaginatedStorageGroups/StorageGroupsControls.js +10 -5
  36. package/dist/containers/Storage/PaginatedStorageGroups/StorageGroupsControls.js.map +1 -1
  37. package/dist/containers/Storage/PaginatedStorageGroups/useStorageGroupsBridgeGrouping.d.ts +4 -0
  38. package/dist/containers/Storage/PaginatedStorageGroups/useStorageGroupsBridgeGrouping.js +10 -0
  39. package/dist/containers/Storage/PaginatedStorageGroups/useStorageGroupsBridgeGrouping.js.map +1 -0
  40. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/StorageGroupSyncPopover.d.ts +5 -0
  41. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/StorageGroupSyncPopover.js +24 -0
  42. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/StorageGroupSyncPopover.js.map +1 -0
  43. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/StorageGroupSyncPopover.scss +12 -0
  44. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/i18n/en.json +4 -0
  45. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/i18n/index.d.ts +2 -0
  46. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/i18n/index.js +4 -0
  47. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/i18n/index.js.map +1 -0
  48. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js +25 -2
  49. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/columns.js.map +1 -1
  50. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/constants.d.ts +6 -1
  51. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/constants.js +34 -5
  52. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/constants.js.map +1 -1
  53. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/hooks.js +24 -14
  54. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/hooks.js.map +1 -1
  55. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/en.json +5 -1
  56. package/dist/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/index.d.ts +1 -1
  57. package/dist/containers/Storage/StorageGroupSyncDetails/StorageGroupSyncDetails.d.ts +6 -0
  58. package/dist/containers/Storage/StorageGroupSyncDetails/StorageGroupSyncDetails.js +46 -0
  59. package/dist/containers/Storage/StorageGroupSyncDetails/StorageGroupSyncDetails.js.map +1 -0
  60. package/dist/containers/Storage/StorageGroupSyncDetails/StorageGroupSyncDetails.scss +78 -0
  61. package/dist/containers/Storage/StorageGroupSyncDetails/i18n/en.json +14 -0
  62. package/dist/containers/Storage/StorageGroupSyncDetails/i18n/index.d.ts +2 -0
  63. package/dist/containers/Storage/StorageGroupSyncDetails/i18n/index.js +5 -0
  64. package/dist/containers/Storage/StorageGroupSyncDetails/i18n/index.js.map +1 -0
  65. package/dist/containers/StorageGroupPage/StorageGroupPage.js +5 -3
  66. package/dist/containers/StorageGroupPage/StorageGroupPage.js.map +1 -1
  67. package/dist/containers/StorageGroupPage/StorageGroupPage.scss +18 -0
  68. package/dist/containers/StorageGroupPage/i18n/en.json +2 -0
  69. package/dist/containers/StorageGroupPage/i18n/index.d.ts +1 -1
  70. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +2 -2
  71. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js.map +1 -1
  72. package/dist/containers/Tenant/ObjectSummary/i18n/en.json +4 -0
  73. package/dist/containers/Tenant/ObjectSummary/i18n/index.d.ts +1 -1
  74. package/dist/containers/Tenant/Query/NewSQL/NewSQL.js +1 -1
  75. package/dist/containers/Tenant/Query/NewSQL/NewSQL.js.map +1 -1
  76. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +3 -1
  77. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js.map +1 -1
  78. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.scss +4 -0
  79. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.scss +12 -2
  80. package/dist/containers/Tenant/Query/QueryResult/QueryResultViewer.js +1 -1
  81. package/dist/containers/Tenant/Query/QueryResult/QueryResultViewer.js.map +1 -1
  82. package/dist/containers/Tenant/Query/QueryResult/i18n/en.json +2 -0
  83. package/dist/containers/Tenant/Query/QueryResult/i18n/index.d.ts +1 -1
  84. package/dist/containers/Tenant/Query/QueryResult/utils.js +11 -5
  85. package/dist/containers/Tenant/Query/QueryResult/utils.js.map +1 -1
  86. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.d.ts +3 -1
  87. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js +3 -3
  88. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js.map +1 -1
  89. package/dist/containers/Tenant/utils/schemaQueryTemplates.js +14 -11
  90. package/dist/containers/Tenant/utils/schemaQueryTemplates.js.map +1 -1
  91. package/dist/containers/Tenants/TenantsTable.js +7 -1
  92. package/dist/containers/Tenants/TenantsTable.js.map +1 -1
  93. package/dist/containers/Tenants/bridgeColumns.d.ts +3 -0
  94. package/dist/containers/Tenants/bridgeColumns.js +37 -0
  95. package/dist/containers/Tenants/bridgeColumns.js.map +1 -0
  96. package/dist/containers/Tenants/constants.d.ts +4 -0
  97. package/dist/containers/Tenants/constants.js +10 -0
  98. package/dist/containers/Tenants/constants.js.map +1 -1
  99. package/dist/containers/Tenants/i18n/en.json +5 -1
  100. package/dist/containers/Tenants/i18n/index.d.ts +1 -1
  101. package/dist/store/reducers/capabilities/hooks.d.ts +3 -0
  102. package/dist/store/reducers/capabilities/hooks.js +9 -0
  103. package/dist/store/reducers/capabilities/hooks.js.map +1 -1
  104. package/dist/store/reducers/query/api.js +8 -3
  105. package/dist/store/reducers/query/api.js.map +1 -1
  106. package/dist/store/reducers/query/streaming/reducers.js +1 -1
  107. package/dist/store/reducers/query/streaming/reducers.js.map +1 -1
  108. package/dist/store/reducers/query/types.d.ts +1 -0
  109. package/dist/store/reducers/storage/types.d.ts +2 -2
  110. package/dist/store/reducers/storage/types.js.map +1 -1
  111. package/dist/store/reducers/streamingQuery/streamingQuery.js +5 -2
  112. package/dist/store/reducers/streamingQuery/streamingQuery.js.map +1 -1
  113. package/dist/types/api/capabilities.d.ts +1 -1
  114. package/dist/types/api/cluster.d.ts +21 -0
  115. package/dist/types/api/cluster.js +8 -0
  116. package/dist/types/api/cluster.js.map +1 -1
  117. package/dist/types/api/storage.d.ts +25 -4
  118. package/dist/types/api/storage.js.map +1 -1
  119. package/dist/types/api/tenant.d.ts +3 -0
  120. package/dist/types/api/tenant.js.map +1 -1
  121. package/dist/utils/query.d.ts +1 -0
  122. package/dist/utils/query.js +3 -2
  123. package/dist/utils/query.js.map +1 -1
  124. package/package.json +1 -1
  125. package/src/components/BridgeSyncStatusLabel/BridgeSyncStatusLabel.tsx +77 -0
  126. package/src/components/BridgeSyncStatusLabel/i18n/en.json +7 -0
  127. package/src/components/BridgeSyncStatusLabel/i18n/index.ts +5 -0
  128. package/src/components/BridgeSyncStatusLabel/index.ts +1 -0
  129. package/src/components/EntityStatus/EntityStatus.scss +18 -0
  130. package/src/components/EntityStatus/EntityStatus.tsx +45 -13
  131. package/src/components/StatusIconNew/StatusIcon.tsx +6 -2
  132. package/src/containers/Cluster/ClusterInfo/ClusterInfo.tsx +2 -0
  133. package/src/containers/Cluster/ClusterOverview/components/BridgeDatabasesSummary.tsx +87 -0
  134. package/src/containers/Cluster/ClusterOverview/components/BridgeInfoTable.scss +36 -23
  135. package/src/containers/Cluster/ClusterOverview/components/BridgeInfoTable.tsx +165 -69
  136. package/src/containers/Cluster/ClusterOverview/components/bridgeInfo.ts +27 -0
  137. package/src/containers/Cluster/i18n/en.json +13 -0
  138. package/src/containers/Storage/PaginatedStorageGroups/PaginatedStorageGroups.tsx +6 -1
  139. package/src/containers/Storage/PaginatedStorageGroups/StorageGroupsControls.tsx +16 -7
  140. package/src/containers/Storage/PaginatedStorageGroups/useStorageGroupsBridgeGrouping.ts +13 -0
  141. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/StorageGroupSyncPopover.scss +12 -0
  142. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/StorageGroupSyncPopover.tsx +53 -0
  143. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/i18n/en.json +4 -0
  144. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/StorageGroupSyncPopover/i18n/index.ts +5 -0
  145. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/columns.tsx +31 -2
  146. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/constants.ts +36 -4
  147. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/hooks.ts +29 -14
  148. package/src/containers/Storage/PaginatedStorageGroupsTable/columns/i18n/en.json +5 -1
  149. package/src/containers/Storage/StorageGroupSyncDetails/StorageGroupSyncDetails.scss +78 -0
  150. package/src/containers/Storage/StorageGroupSyncDetails/StorageGroupSyncDetails.tsx +199 -0
  151. package/src/containers/Storage/StorageGroupSyncDetails/i18n/en.json +14 -0
  152. package/src/containers/Storage/StorageGroupSyncDetails/i18n/index.ts +6 -0
  153. package/src/containers/StorageGroupPage/StorageGroupPage.scss +18 -0
  154. package/src/containers/StorageGroupPage/StorageGroupPage.tsx +27 -1
  155. package/src/containers/StorageGroupPage/i18n/en.json +2 -0
  156. package/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx +4 -0
  157. package/src/containers/Tenant/ObjectSummary/i18n/en.json +4 -0
  158. package/src/containers/Tenant/Query/NewSQL/NewSQL.tsx +1 -1
  159. package/src/containers/Tenant/Query/QueryEditor/QueryEditor.scss +4 -0
  160. package/src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx +4 -1
  161. package/src/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.scss +12 -2
  162. package/src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx +2 -0
  163. package/src/containers/Tenant/Query/QueryResult/i18n/en.json +2 -0
  164. package/src/containers/Tenant/Query/QueryResult/utils.ts +13 -5
  165. package/src/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +8 -2
  166. package/src/containers/Tenant/utils/schemaQueryTemplates.ts +16 -11
  167. package/src/containers/Tenants/TenantsTable.tsx +11 -1
  168. package/src/containers/Tenants/bridgeColumns.tsx +50 -0
  169. package/src/containers/Tenants/constants.ts +10 -0
  170. package/src/containers/Tenants/i18n/en.json +6 -1
  171. package/src/store/reducers/capabilities/hooks.ts +12 -0
  172. package/src/store/reducers/query/api.ts +8 -2
  173. package/src/store/reducers/query/streaming/reducers.ts +1 -1
  174. package/src/store/reducers/query/types.ts +1 -0
  175. package/src/store/reducers/storage/types.ts +7 -2
  176. package/src/store/reducers/streamingQuery/streamingQuery.ts +6 -2
  177. package/src/types/api/capabilities.ts +1 -0
  178. package/src/types/api/cluster.ts +23 -0
  179. package/src/types/api/storage.ts +37 -1
  180. package/src/types/api/tenant.ts +3 -0
  181. package/src/utils/query.ts +4 -2
@@ -1,11 +1,21 @@
1
1
  .ydb-query-editor-controls {
2
2
  display: flex;
3
- flex: 0 0 60px;
3
+ flex: none;
4
+ flex-wrap: wrap;
4
5
  justify-content: space-between;
5
6
  align-items: center;
6
- gap: 24px;
7
+ gap: var(--g-spacing-2) var(--g-spacing-6);
7
8
 
8
9
  min-height: 60px;
10
+ padding-block: var(--g-spacing-4);
11
+
12
+ &__left {
13
+ flex-wrap: wrap;
14
+ }
15
+
16
+ &__right {
17
+ margin-inline-start: auto;
18
+ }
9
19
 
10
20
  &__right,
11
21
  &__left {
@@ -363,6 +363,8 @@ export function QueryResultViewer({
363
363
  {renderDiagnosticsButton()}
364
364
  <EnableFullscreenButton />
365
365
  <PaneVisibilityToggleButtons
366
+ collapseLabel={i18n('action_collapse-results')}
367
+ expandLabel={i18n('action_expand-results')}
366
368
  onCollapse={onCollapseResults}
367
369
  onExpand={onExpandResults}
368
370
  isCollapsed={isResultsCollapsed}
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "description.graph-is-not-supported": "Graph can not be rendered",
3
3
  "description.empty-result": "There is no {{activeSection}} for the request",
4
+ "action_collapse-results": "Collapse results",
5
+ "action_expand-results": "Expand results",
4
6
  "action.result": "Result",
5
7
  "action.stats": "Stats",
6
8
  "action.json": "JSON",
@@ -3,6 +3,7 @@ import type {
3
3
  QueryPlanView,
4
4
  QueryResult,
5
5
  } from '../../../../store/reducers/query/types';
6
+ import {MAX_QUERY_LIMIT_ROWS} from '../../../../utils/query';
6
7
  import {safeParseNumber} from '../../../../utils/utils';
7
8
 
8
9
  export function getInitialQueryPlanView(data: PreparedQueryData): QueryPlanView {
@@ -19,7 +20,7 @@ export function getInitialQueryPlanView(data: PreparedQueryData): QueryPlanView
19
20
  }
20
21
 
21
22
  export function getResultRowsPerSecond(result: QueryResult): number | undefined {
22
- const {data, error, isLoading, streamingStatus} = result;
23
+ const {data, error, isLoading, limitRows, streamingStatus} = result;
23
24
  if (
24
25
  error ||
25
26
  isLoading ||
@@ -35,12 +36,19 @@ export function getResultRowsPerSecond(result: QueryResult): number | undefined
35
36
  if (!resultSet?.result || resultSet.truncated) {
36
37
  return undefined;
37
38
  }
38
- const rows = safeParseNumber(ResultRows, NaN);
39
+ const rows = resultSet.result.length;
40
+ // Viewer can stop exactly at limit_rows without marking the final chunk truncated.
41
+ if (
42
+ !limitRows ||
43
+ !Number.isSafeInteger(limitRows) ||
44
+ limitRows > MAX_QUERY_LIMIT_ROWS ||
45
+ rows >= limitRows
46
+ ) {
47
+ return undefined;
48
+ }
39
49
  const duration = safeParseNumber(DurationUs, NaN);
40
50
  if (
41
- !Number.isSafeInteger(rows) ||
42
- rows < 0 ||
43
- rows !== resultSet.result.length ||
51
+ (ResultRows !== undefined && safeParseNumber(ResultRows, NaN) !== rows) ||
44
52
  !Number.isFinite(duration) ||
45
53
  duration <= 0
46
54
  ) {
@@ -59,6 +59,8 @@ interface ToggleButtonProps {
59
59
  isCollapsed?: boolean;
60
60
  initialDirection?: 'right' | 'left' | 'top' | 'bottom';
61
61
  className?: string;
62
+ collapseLabel: string;
63
+ expandLabel: string;
62
64
  }
63
65
 
64
66
  const b = cn('kv-pane-visibility-button');
@@ -69,13 +71,16 @@ export function PaneVisibilityToggleButtons({
69
71
  isCollapsed,
70
72
  initialDirection = 'top',
71
73
  className,
74
+ collapseLabel,
75
+ expandLabel,
72
76
  }: ToggleButtonProps) {
73
77
  useResizeObserverTrigger([isCollapsed]);
74
78
  return (
75
79
  <React.Fragment>
76
- <ActionTooltip title="Collapse">
80
+ <ActionTooltip title={collapseLabel}>
77
81
  <Button
78
82
  view="flat-secondary"
83
+ aria-label={collapseLabel}
79
84
  onClick={onCollapse}
80
85
  className={b(
81
86
  {
@@ -89,9 +94,10 @@ export function PaneVisibilityToggleButtons({
89
94
  </Button>
90
95
  </ActionTooltip>
91
96
 
92
- <ActionTooltip title="Expand">
97
+ <ActionTooltip title={expandLabel}>
93
98
  <Button
94
99
  view="flat-secondary"
100
+ aria-label={expandLabel}
95
101
  onClick={onExpand}
96
102
  className={b(
97
103
  {
@@ -20,6 +20,18 @@ function normalizeParameter(param: string) {
20
20
  return param.replace(/\$/g, '\\$');
21
21
  }
22
22
 
23
+ function escapeSnippetText(text: string) {
24
+ return text.replace(/[$}\\]/g, '\\$&');
25
+ }
26
+
27
+ function getStreamingQueryNameSnippet(relativePath?: string) {
28
+ if (!relativePath) {
29
+ return '${1:<my_streaming_query>}';
30
+ }
31
+ const escapedName = relativePath.replace(/[\\`]/g, '\\$&');
32
+ return escapeSnippetText(`\`${escapedName}\``);
33
+ }
34
+
23
35
  function toLF(str: string) {
24
36
  return str.replace(/\r\n?/g, '\n');
25
37
  }
@@ -430,9 +442,7 @@ END DO;`;
430
442
  };
431
443
 
432
444
  export const alterStreamingQuerySettingsTemplate = (params?: SchemaQueryParams) => {
433
- const streamingQueryName = params?.relativePath
434
- ? `\`${normalizeParameter(params.relativePath)}\``
435
- : '${1:<my_streaming_query>}';
445
+ const streamingQueryName = getStreamingQueryNameSnippet(params?.relativePath);
436
446
  return `ALTER STREAMING QUERY ${streamingQueryName} SET (
437
447
  RUN = FALSE, -- Stop query execution
438
448
  RESOURCE_POOL = "default" -- Workload manager pool for query
@@ -440,18 +450,15 @@ export const alterStreamingQuerySettingsTemplate = (params?: SchemaQueryParams)
440
450
  };
441
451
 
442
452
  export const alterStreamingQueryText = (params?: SchemaQueryParams) => {
443
- const streamingQueryName = params?.relativePath
444
- ? `\`${normalizeParameter(params.relativePath)}\``
445
- : '${1:<my_streaming_query>}';
453
+ const streamingQueryName = getStreamingQueryNameSnippet(params?.relativePath);
446
454
 
447
455
  const sysData = params?.streamingQueryData;
448
456
  const rawQueryText = getStringifiedData(sysData?.resultSets?.[0]?.result?.[0]?.Text);
449
457
  let queryText = toLF(rawQueryText);
450
458
  queryText = trimOuterEmptyLines(queryText);
451
459
  queryText = stripIndentByFirstLine(queryText);
452
- queryText = normalizeParameter(queryText);
453
460
 
454
- const bodyQueryText = queryText ? queryText : '${2:<streaming_query_text>}';
461
+ const bodyQueryText = queryText ? escapeSnippetText(queryText) : '${2:<streaming_query_text>}';
455
462
  return `ALTER STREAMING QUERY ${streamingQueryName} SET (
456
463
  FORCE = TRUE, -- Allow to drop last query checkpoint if query state can't be loaded
457
464
  ) AS
@@ -463,9 +470,7 @@ END DO;`;
463
470
  };
464
471
 
465
472
  export const dropStreamingQueryTemplate = (params?: SchemaQueryParams) => {
466
- const streamingQueryName = params?.relativePath
467
- ? `\`${normalizeParameter(params.relativePath)}\``
468
- : '${1:<my_streaming_query>}';
473
+ const streamingQueryName = getStreamingQueryNameSnippet(params?.relativePath);
469
474
  return `DROP STREAMING QUERY ${streamingQueryName};`;
470
475
  };
471
476
 
@@ -17,7 +17,11 @@ import {TableColumnSetup} from '../../components/TableColumnSetup/TableColumnSet
17
17
  import {TableWithControlsLayout} from '../../components/TableWithControlsLayout/TableWithControlsLayout';
18
18
  import {TenantNameWrapper} from '../../components/TenantNameWrapper/TenantNameWrapper';
19
19
  import {getTenantLink} from '../../components/TenantNameWrapper/utils';
20
- import {useEmMetaAvailable} from '../../store/reducers/capabilities/hooks';
20
+ import {
21
+ useBridgeModeEnabled,
22
+ useEmMetaAvailable,
23
+ useViewerTenantInfoHasBridgeFields,
24
+ } from '../../store/reducers/capabilities/hooks';
21
25
  import {useClusterBaseInfo} from '../../store/reducers/cluster/cluster';
22
26
  import {
23
27
  filterTenantsByDomain,
@@ -48,6 +52,7 @@ import {isNumeric} from '../../utils/utils';
48
52
 
49
53
  import type {DatabaseStatusClickHandler} from './DatabaseDrawerHealthcheck';
50
54
  import {DatabaseDrawerHealthcheck} from './DatabaseDrawerHealthcheck';
55
+ import {getDatabaseBridgeColumns} from './bridgeColumns';
51
56
  import {
52
57
  DATABASES_COLUMNS_IDS,
53
58
  DATABASES_COLUMNS_TITLES,
@@ -145,6 +150,9 @@ const TenantsTableContent = ({
145
150
  const [sortParams, setSortParams] = React.useState<SortOrder | SortOrder[] | undefined>();
146
151
 
147
152
  const isCreateDBAvailable = useEmMetaAvailable() && uiFactory.onCreateDB !== undefined;
153
+ const bridgeModeEnabled = useBridgeModeEnabled();
154
+ const tenantInfoHasBridgeFields = useViewerTenantInfoHasBridgeFields();
155
+ const bridgeColumnsAvailable = bridgeModeEnabled && tenantInfoHasBridgeFields;
148
156
 
149
157
  const {domain: domainRoot, settings, isResolved: isClusterInfoResolved} = useClusterBaseInfo();
150
158
  const loading = (isFetching && currentData === undefined) || !isClusterInfoResolved;
@@ -313,6 +321,7 @@ const TenantsTableContent = ({
313
321
  </Label>
314
322
  ),
315
323
  },
324
+ ...(bridgeColumnsAvailable ? getDatabaseBridgeColumns() : []),
316
325
  {
317
326
  name: DATABASES_COLUMNS_IDS.CPU,
318
327
  header: DATABASES_COLUMNS_TITLES[DATABASES_COLUMNS_IDS.CPU],
@@ -407,6 +416,7 @@ const TenantsTableContent = ({
407
416
 
408
417
  return columns;
409
418
  }, [
419
+ bridgeColumnsAvailable,
410
420
  clusterName,
411
421
  additionalTenantsProps,
412
422
  environmentName,
@@ -0,0 +1,50 @@
1
+ import {NodesRight} from '@gravity-ui/icons';
2
+ import type {Column} from '@gravity-ui/react-data-table';
3
+ import DataTable from '@gravity-ui/react-data-table';
4
+ import {Icon, Label} from '@gravity-ui/uikit';
5
+
6
+ import {
7
+ BridgeSyncStatusLabel,
8
+ getBridgeSyncStatusPresentation,
9
+ } from '../../components/BridgeSyncStatusLabel';
10
+ import type {PreparedTenant} from '../../store/reducers/tenants/types';
11
+ import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
12
+
13
+ import {DATABASES_COLUMNS_IDS, DATABASES_COLUMNS_TITLES} from './constants';
14
+ import i18n from './i18n';
15
+
16
+ function getModeLabel({BridgeMode}: PreparedTenant) {
17
+ if (BridgeMode === true) {
18
+ return (
19
+ <Label theme="utility" size="xs" icon={<Icon data={NodesRight} size={12} />}>
20
+ {i18n('value_bridge')}
21
+ </Label>
22
+ );
23
+ }
24
+ return BridgeMode === false ? i18n('value_non-bridge') : EMPTY_DATA_PLACEHOLDER;
25
+ }
26
+
27
+ export function getDatabaseBridgeColumns(): Column<PreparedTenant>[] {
28
+ return [
29
+ {
30
+ name: DATABASES_COLUMNS_IDS.BridgeMode,
31
+ header: DATABASES_COLUMNS_TITLES.BridgeMode,
32
+ width: 100,
33
+ sortable: true,
34
+ defaultOrder: DataTable.ASCENDING,
35
+ sortAccessor: ({BridgeMode}) =>
36
+ typeof BridgeMode === 'boolean' ? Number(!BridgeMode) : undefined,
37
+ render: ({row}) => getModeLabel(row),
38
+ },
39
+ {
40
+ name: DATABASES_COLUMNS_IDS.BridgeSyncStatus,
41
+ header: DATABASES_COLUMNS_TITLES.BridgeSyncStatus,
42
+ width: 140,
43
+ sortable: true,
44
+ defaultOrder: DataTable.ASCENDING,
45
+ sortAccessor: ({BridgeSyncStatus}) =>
46
+ getBridgeSyncStatusPresentation(BridgeSyncStatus)?.label(),
47
+ render: ({row}) => <BridgeSyncStatusLabel status={row.BridgeSyncStatus} />,
48
+ },
49
+ ];
50
+ }
@@ -8,6 +8,8 @@ export const DATABASES_COLUMNS_IDS = {
8
8
  Name: 'Name',
9
9
  Type: 'Type',
10
10
  State: 'State',
11
+ BridgeMode: 'BridgeMode',
12
+ BridgeSyncStatus: 'BridgeSyncStatus',
11
13
  CPU: 'cpu',
12
14
  Memory: 'memory',
13
15
  Storage: 'storage',
@@ -23,6 +25,8 @@ export const DATABASES_DEFAULT_COLUMNS: DatabasesColumnId[] = [
23
25
  DATABASES_COLUMNS_IDS.Name,
24
26
  DATABASES_COLUMNS_IDS.Type,
25
27
  DATABASES_COLUMNS_IDS.State,
28
+ DATABASES_COLUMNS_IDS.BridgeMode,
29
+ DATABASES_COLUMNS_IDS.BridgeSyncStatus,
26
30
  DATABASES_COLUMNS_IDS.CPU,
27
31
  DATABASES_COLUMNS_IDS.Memory,
28
32
  DATABASES_COLUMNS_IDS.Storage,
@@ -43,6 +47,12 @@ export const DATABASES_COLUMNS_TITLES = {
43
47
  get [DATABASES_COLUMNS_IDS.State]() {
44
48
  return i18n('column-state');
45
49
  },
50
+ get [DATABASES_COLUMNS_IDS.BridgeMode]() {
51
+ return i18n('column-mode');
52
+ },
53
+ get [DATABASES_COLUMNS_IDS.BridgeSyncStatus]() {
54
+ return i18n('column-sync-status');
55
+ },
46
56
  get [DATABASES_COLUMNS_IDS.CPU]() {
47
57
  return i18n('column-cpu');
48
58
  },
@@ -5,11 +5,16 @@
5
5
  "column-name": "Database",
6
6
  "column-type": "Type",
7
7
  "column-state": "State",
8
+ "column-mode": "Mode",
9
+ "column-sync-status": "Sync status",
8
10
  "column-cpu": "CPU",
9
11
  "column-memory": "Memory",
10
12
  "column-storage": "Storage",
11
13
  "column-network": "Network",
12
14
  "column-nodes": "Nodes",
13
15
  "column-groups": "Groups",
14
- "column-pools": "Pools"
16
+ "column-pools": "Pools",
17
+
18
+ "value_bridge": "Bridge",
19
+ "value_non-bridge": "Non-bridge"
15
20
  }
@@ -106,6 +106,18 @@ export const useStorageGroupsHandlerHasGrouping = () => {
106
106
  return useGetFeatureVersion('/storage/groups') > 4;
107
107
  };
108
108
 
109
+ export const useStorageGroupsHandlerHasBridgeSyncStatus = () => {
110
+ return useGetFeatureVersion('/storage/groups') >= 17;
111
+ };
112
+
113
+ export const useStorageGroupsHandlerHasBridgeMode = () => {
114
+ return useGetFeatureVersion('/storage/groups') >= 18;
115
+ };
116
+
117
+ export const useViewerTenantInfoHasBridgeFields = () => {
118
+ return useGetFeatureVersion('/viewer/tenantinfo') >= 7;
119
+ };
120
+
109
121
  export const useViewerNodesAliveFilterAvailable = () => {
110
122
  return useGetFeatureVersion('/viewer/nodes/alive') >= 1;
111
123
  };
@@ -6,6 +6,7 @@ import type {StreamDataChunk} from '../../../types/store/streaming';
6
6
  import {valueIsDefined} from '../../../utils';
7
7
  import {QUERY_TECHNICAL_MARK} from '../../../utils/constants';
8
8
  import {
9
+ DEFAULT_QUERY_SETTINGS,
9
10
  MAX_QUERY_TIMEOUT_SECONDS,
10
11
  RESOURCE_POOL_NO_OVERRIDE_VALUE,
11
12
  isExecutionQueryAction,
@@ -147,6 +148,7 @@ export const queryApi = api.injectEndpoints({
147
148
  {signal, dispatch, getState},
148
149
  ) => {
149
150
  const executionId = uuidv4();
151
+ const limitRows = getLimitRowsParam(querySettings.limitRows);
150
152
  const {query: finalQuery, preparedQueryPrefixLineCount} =
151
153
  prepareQueryWithPragmasMetadata(query, querySettings.pragmas);
152
154
  const resultSourcePosition = sourcePosition
@@ -160,6 +162,7 @@ export const queryApi = api.injectEndpoints({
160
162
  executionId,
161
163
  type: 'execute',
162
164
  statisticsMode: querySettings.statisticsMode,
165
+ limitRows: limitRows ?? DEFAULT_QUERY_SETTINGS.limitRows,
163
166
  queryId: '',
164
167
  isLoading: true,
165
168
  startTime,
@@ -208,7 +211,7 @@ export const queryApi = api.injectEndpoints({
208
211
  syntax,
209
212
  stats: querySettings.statisticsMode,
210
213
  tracingLevel: getTracingLevelParam(querySettings, enableTracingLevel),
211
- limit_rows: getLimitRowsParam(querySettings.limitRows),
214
+ limit_rows: limitRows,
212
215
  transaction_mode: getTransactionModeParam(
213
216
  querySettings.transactionMode,
214
217
  ),
@@ -241,6 +244,7 @@ export const queryApi = api.injectEndpoints({
241
244
  // Last chunk is query response chunk
242
245
  onQueryResponseChunk: (chunk) => {
243
246
  if (!isFinalized) {
247
+ cancelPendingBatch(false);
244
248
  dispatch(setStreamQueryResponse({tabId, executionId, chunk}));
245
249
  }
246
250
  },
@@ -354,6 +358,7 @@ export const queryApi = api.injectEndpoints({
354
358
  actionType,
355
359
  querySettings,
356
360
  );
361
+ const limitRows = getLimitRowsParam(effectiveQuerySettings.limitRows);
357
362
  const {query: finalQuery, preparedQueryPrefixLineCount} =
358
363
  prepareQueryWithPragmasMetadata(query, effectiveQuerySettings.pragmas);
359
364
  const resultSourcePosition = sourcePosition
@@ -391,7 +396,7 @@ export const queryApi = api.injectEndpoints({
391
396
  effectiveQuerySettings,
392
397
  enableTracingLevel,
393
398
  ),
394
- limit_rows: getLimitRowsParam(effectiveQuerySettings.limitRows),
399
+ limit_rows: limitRows,
395
400
  transaction_mode: getTransactionModeParam(
396
401
  effectiveQuerySettings.transactionMode,
397
402
  ),
@@ -455,6 +460,7 @@ export const queryApi = api.injectEndpoints({
455
460
  executionId,
456
461
  type: actionType,
457
462
  statisticsMode: effectiveQuerySettings.statisticsMode,
463
+ limitRows: limitRows ?? DEFAULT_QUERY_SETTINGS.limitRows,
458
464
  data,
459
465
  isLoading: false,
460
466
  queryId,
@@ -127,6 +127,6 @@ export const addStreamingChunks = (
127
127
  formattedRows.forEach((row) => {
128
128
  resultSet.result?.push(row);
129
129
  });
130
- resultSet.truncated = chunk.result.truncated;
130
+ resultSet.truncated ||= chunk.result.truncated;
131
131
  }
132
132
  };
@@ -110,6 +110,7 @@ export interface QueryResult {
110
110
  executionId: string;
111
111
  type: QueryAction;
112
112
  statisticsMode?: StatisticsMode;
113
+ limitRows?: number;
113
114
  data?: PreparedQueryData;
114
115
  error?: unknown;
115
116
  queryId: string;
@@ -2,7 +2,12 @@ import {z} from 'zod';
2
2
 
3
3
  import type {ECapacityAlert, EFlag} from '../../../types/api/enums';
4
4
  import type {NodesGroupByField, TNodeInfo} from '../../../types/api/nodes';
5
- import type {Erasure, GroupsGroupByField, TStorageGroupStateInfo} from '../../../types/api/storage';
5
+ import type {
6
+ Erasure,
7
+ GroupsGroupByField,
8
+ TBridgeGroupSyncInfo,
9
+ TStorageGroupStateInfo,
10
+ } from '../../../types/api/storage';
6
11
  import type {TTabletStateInfo} from '../../../types/api/tablet';
7
12
  import type {ResponseDataQuality} from '../../../utils/dataIssues/types';
8
13
  import type {PreparedPDisk, PreparedVDisk} from '../../../utils/disks/types';
@@ -61,7 +66,7 @@ export interface PreparedStorageGroupFilters {
61
66
  filterGroupBy?: GroupsGroupByField;
62
67
  }
63
68
 
64
- export interface PreparedStorageGroup {
69
+ export interface PreparedStorageGroup extends TBridgeGroupSyncInfo {
65
70
  PoolName?: string;
66
71
  PileName?: string;
67
72
  MediaType?: string;
@@ -2,9 +2,13 @@ import {QUERY_TECHNICAL_MARK} from '../../../utils/constants';
2
2
  import {isQueryErrorResponse, parseQueryAPIResponse} from '../../../utils/query';
3
3
  import {api} from '../api';
4
4
 
5
+ function escapePathForYqlString(path: string) {
6
+ return path.replace(/['\\]/g, '\\$&');
7
+ }
8
+
5
9
  function getStreamingQueryInfoSQL(path: string) {
6
10
  // Select available columns so older backends without lifecycle fields remain supported.
7
- const safePath = path.replace(/'/g, "''");
11
+ const safePath = escapePathForYqlString(path);
8
12
  return `${QUERY_TECHNICAL_MARK}
9
13
  SELECT * WITHOUT Plan, Ast
10
14
  FROM \`.sys/streaming_queries\`
@@ -13,7 +17,7 @@ LIMIT 1`;
13
17
  }
14
18
 
15
19
  function getStreamingQueryPlanSQL(path: string) {
16
- const safePath = path.replace(/'/g, "''");
20
+ const safePath = escapePathForYqlString(path);
17
21
  return `${QUERY_TECHNICAL_MARK}
18
22
  SELECT
19
23
  Status,
@@ -25,6 +25,7 @@ export type Capability =
25
25
  | '/viewer/feature_flags'
26
26
  | '/viewer/config'
27
27
  | '/viewer/cluster'
28
+ | '/viewer/tenantinfo'
28
29
  | '/vdisk/blobindexstat'
29
30
  | '/viewer/nodes'
30
31
  | '/viewer/nodes/alive'
@@ -115,6 +115,17 @@ export enum BridgePileGroupStatus {
115
115
  DISINTEGRATED = 'DISINTEGRATED',
116
116
  }
117
117
 
118
+ export enum BridgeSyncStatus {
119
+ SYNCED = 'SYNCED',
120
+ SYNCING = 'SYNCING',
121
+ PENDING = 'PENDING',
122
+ UNKNOWN = 'UNKNOWN',
123
+ NOT_REQUIRED = 'NOT_REQUIRED',
124
+ }
125
+
126
+ /** Counts are uint64 values, serialized as strings by Viewer. */
127
+ export type BridgeDatabaseCounts = Record<string, string | number>;
128
+
118
129
  export interface TBridgePile {
119
130
  /** unique pile identifier */
120
131
  PileId?: number;
@@ -124,10 +135,22 @@ export interface TBridgePile {
124
135
  State?: BridgePileState;
125
136
  /** number of nodes in the pile */
126
137
  Nodes?: number;
138
+ /** Known static nodes and those that responded during collection. */
139
+ StorageNodes?: number;
140
+ AliveStorageNodes?: number;
141
+ /** Known dynamic nodes and those that responded during collection. */
142
+ ComputeNodes?: number;
143
+ AliveComputeNodes?: number;
127
144
  /** storage group statuses in the pile */
128
145
  GroupStatuses?: Partial<Record<BridgePileGroupStatus, number>>;
129
146
  }
130
147
 
131
148
  export interface TBridgeInfo {
132
149
  Piles?: TBridgePile[];
150
+ /** uint64 */
151
+ BridgeDatabases?: string | number;
152
+ /** False when ownership is incomplete or global synchronization counts are unavailable. */
153
+ BridgeDatabasesComplete?: boolean;
154
+ /** Each fully bridged storage owner is counted once across all required copies. Viewer v11+. */
155
+ DatabaseCountsBySyncStatus?: BridgeDatabaseCounts;
133
156
  }
@@ -1,3 +1,4 @@
1
+ import type {BridgeSyncStatus} from './cluster';
1
2
  import type {BackendSortParam, SchemaPathParam} from './common';
2
3
  import type {ECapacityAlert, EFlag} from './enums';
3
4
  import type {EDecommitStatus, EDriveStatus, EMaintenanceStatus, TPDiskStateInfo} from './pdisk';
@@ -41,7 +42,29 @@ export interface TStorageGroupStateInfo {
41
42
  FailedDomainsPerRealm?: number[];
42
43
  }
43
44
 
44
- export interface TGroupsStorageGroupInfo {
45
+ export interface TBridgeGroupLink {
46
+ GroupId?: string;
47
+ PileName?: string;
48
+ }
49
+
50
+ export interface TBridgeGroupSyncInfo {
51
+ BridgeMode?: boolean;
52
+ BridgeSyncStatus?: BridgeSyncStatus;
53
+ BridgeSyncStage?: string;
54
+ BridgeGroups?: TBridgeGroupLink[];
55
+ BridgeSyncLastError?: string;
56
+ /** Unix microseconds. */
57
+ BridgeSyncLastErrorTimestamp?: string;
58
+ /** Unix microseconds. */
59
+ BridgeSyncLastProgressTimestamp?: string;
60
+ /** uint64, blob bytes per second. */
61
+ BridgeSyncCopyBytesPerSecond?: string;
62
+ /** uint64, a lower bound until the estimate is complete. */
63
+ BridgeSyncRemainingBytes?: string;
64
+ BridgeSyncRemainingBytesComplete?: boolean;
65
+ }
66
+
67
+ export interface TGroupsStorageGroupInfo extends TBridgeGroupSyncInfo {
45
68
  GroupId?: string;
46
69
  /** uint64 */
47
70
  GroupGeneration?: string;
@@ -174,6 +197,9 @@ export type Erasure = 'none' | 'block-4-2' | 'mirror-3-dc' | 'mirror-3of4';
174
197
  */
175
198
  export type GroupsSortField =
176
199
  | 'PoolName'
200
+ | 'PileName'
201
+ | 'BridgeMode'
202
+ | 'BridgeSyncStatus'
177
203
  | 'Kind'
178
204
  | 'MediaType'
179
205
  | 'Erasure'
@@ -209,6 +235,7 @@ export type GroupsGroupByField =
209
235
  | 'DiskSpaceUsage'
210
236
  | 'PoolName'
211
237
  | 'PileName'
238
+ | 'BridgeSyncStatus'
212
239
  | 'Kind'
213
240
  | 'Encryption'
214
241
  | 'MediaType'
@@ -221,6 +248,15 @@ export type GroupsRequiredField =
221
248
  | 'GroupId' // always required
222
249
  | 'PoolName'
223
250
  | 'PileName'
251
+ | 'BridgeMode'
252
+ | 'BridgeSyncStatus'
253
+ | 'BridgeGroups'
254
+ | 'BridgeSyncLastError'
255
+ | 'BridgeSyncLastErrorTimestamp'
256
+ | 'BridgeSyncLastProgressTimestamp'
257
+ | 'BridgeSyncCopyBytesPerSecond'
258
+ | 'BridgeSyncRemainingBytes'
259
+ | 'BridgeSyncRemainingBytesComplete'
224
260
  | 'Kind'
225
261
  | 'MediaType'
226
262
  | 'Erasure'
@@ -1,3 +1,4 @@
1
+ import type {BridgeSyncStatus} from './cluster';
1
2
  import type {EFlag} from './enums';
2
3
  import type {MetaTenants} from './meta';
3
4
  import type {TMemoryStats, TPoolStats} from './nodes';
@@ -29,6 +30,8 @@ export interface TTenant {
29
30
  Id?: string;
30
31
  Cluster?: string;
31
32
  Type?: ETenantType;
33
+ BridgeMode?: boolean;
34
+ BridgeSyncStatus?: BridgeSyncStatus;
32
35
  State?: State;
33
36
  StateStats?: THiveDomainStatsStateCount[];
34
37
  Metrics?: TMetrics;
@@ -408,6 +408,8 @@ export const RESOURCE_POOL_NO_OVERRIDE_VALUE = '__no_pool_override__';
408
408
 
409
409
  export type ResourcePoolValue = typeof RESOURCE_POOL_NO_OVERRIDE_VALUE | string;
410
410
 
411
+ export const MAX_QUERY_LIMIT_ROWS = 100_000;
412
+
411
413
  export const DEFAULT_QUERY_SETTINGS = {
412
414
  queryMode: QUERY_MODES.query,
413
415
  transactionMode: TRANSACTION_MODES.implicit,
@@ -436,7 +438,7 @@ export const querySettingsValidationSchema = z.object({
436
438
  ),
437
439
  limitRows: z.preprocess(
438
440
  emptyStringToUndefined,
439
- z.coerce.number<string | number>().gt(0).lte(100_000).optional(),
441
+ z.coerce.number<string | number>().gt(0).lte(MAX_QUERY_LIMIT_ROWS).optional(),
440
442
  ),
441
443
  outputChunkMaxSize: z.preprocess(
442
444
  emptyStringToUndefined,
@@ -465,7 +467,7 @@ export const querySettingsRestoreSchema = z
465
467
  limitRows: z
466
468
  .preprocess(
467
469
  emptyStringToUndefined,
468
- z.coerce.number<string | number>().gt(0).lte(100_000).optional(),
470
+ z.coerce.number<string | number>().gt(0).lte(MAX_QUERY_LIMIT_ROWS).optional(),
469
471
  )
470
472
  .catch(DEFAULT_QUERY_SETTINGS.limitRows),
471
473
  outputChunkMaxSize: z