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,34 +1,49 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {
4
- Archive,
5
4
  ArrowChevronRight,
6
5
  Ban,
7
- ChevronRight,
6
+ Check,
8
7
  CirclePause,
8
+ CrownDiamond,
9
9
  LinkSlash,
10
10
  MapPin,
11
11
  } from '@gravity-ui/icons';
12
- import {Flex, Icon, Label, Text} from '@gravity-ui/uikit';
12
+ import {
13
+ ActionTooltip,
14
+ Card,
15
+ DefinitionList,
16
+ Flex,
17
+ Icon,
18
+ Label,
19
+ Progress,
20
+ Text,
21
+ Tooltip,
22
+ text,
23
+ } from '@gravity-ui/uikit';
13
24
  import type {LabelProps} from '@gravity-ui/uikit';
14
25
 
15
- import {EntityStatus} from '../../../../components/EntityStatus/EntityStatus';
26
+ import {EFlagToStatusName, EntityStatus} from '../../../../components/EntityStatus/EntityStatus';
16
27
  import {LabelWithHelpMark} from '../../../../components/LabelWithHelpMark/LabelWithHelpMark';
17
28
  import {Skeleton} from '../../../../components/Skeleton/Skeleton';
18
29
  import {
19
30
  healthcheckApi,
20
31
  selectLeavesIssues,
21
32
  } from '../../../../store/reducers/healthcheckInfo/healthcheckInfo';
22
- import type {TBridgePile} from '../../../../types/api/cluster';
33
+ import type {TBridgeInfo, TBridgePile} from '../../../../types/api/cluster';
23
34
  import {BridgePileState} from '../../../../types/api/cluster';
35
+ import {EFlag} from '../../../../types/api/enums';
24
36
  import {cn} from '../../../../utils/cn';
25
37
  import {EMPTY_DATA_PLACEHOLDER} from '../../../../utils/constants';
26
38
  import {formatNumber} from '../../../../utils/dataFormatters/dataFormatters';
27
39
  import {useAutoRefreshInterval, useTypedSelector} from '../../../../utils/hooks';
28
40
  import {useIsUserAllowedToMakeChanges} from '../../../../utils/hooks/useIsUserAllowedToMakeChanges';
41
+ import {parseOptionalNonNegativeNumber} from '../../../../utils/utils';
29
42
  import {useClusterHealthcheckQueryParams} from '../../ClusterDrawerHealthcheck';
30
43
  import i18n from '../../i18n';
31
44
 
45
+ import {BridgeDatabasesSummary} from './BridgeDatabasesSummary';
46
+ import {getBridgeNodesProgress} from './bridgeInfo';
32
47
  import type {BridgePileHealthcheckTarget} from './bridgePileHealthcheck';
33
48
  import {getBridgePileHealthcheck} from './bridgePileHealthcheck';
34
49
 
@@ -48,7 +63,8 @@ function getBridgePileStateInfo(state?: BridgePileState): BridgePileStateInfo {
48
63
  case BridgePileState.PRIMARY:
49
64
  return {
50
65
  label: i18n('value_bridge-state-primary'),
51
- theme: 'normal',
66
+ theme: 'utility',
67
+ icon: <Icon data={CrownDiamond} size={12} />,
52
68
  help: i18n('context_bridge-pile-state-primary'),
53
69
  };
54
70
  case BridgePileState.PROMOTED:
@@ -61,7 +77,8 @@ function getBridgePileStateInfo(state?: BridgePileState): BridgePileStateInfo {
61
77
  case BridgePileState.SYNCHRONIZED:
62
78
  return {
63
79
  label: i18n('value_bridge-state-synchronised'),
64
- theme: 'normal',
80
+ theme: 'success',
81
+ icon: <Icon data={Check} size={12} />,
65
82
  help: i18n('context_bridge-pile-state-synchronised'),
66
83
  };
67
84
  case BridgePileState.NOT_SYNCHRONIZED:
@@ -100,6 +117,7 @@ function getBridgePileStateInfo(state?: BridgePileState): BridgePileStateInfo {
100
117
 
101
118
  interface BridgeInfoTableProps {
102
119
  piles: TBridgePile[];
120
+ bridgeInfo?: TBridgeInfo;
103
121
  database?: string;
104
122
  clusterName?: string;
105
123
  }
@@ -131,6 +149,18 @@ const BridgePileCard = React.memo(function BridgePileCard({
131
149
  return null;
132
150
  }
133
151
 
152
+ if (pile.State === BridgePileState.PRIMARY && help) {
153
+ return (
154
+ <ActionTooltip title={help}>
155
+ <span className={b('state-label')} tabIndex={0}>
156
+ <Label theme={theme} size="xs" icon={icon}>
157
+ {label}
158
+ </Label>
159
+ </span>
160
+ </ActionTooltip>
161
+ );
162
+ }
163
+
134
164
  return (
135
165
  <LabelWithHelpMark
136
166
  theme={theme}
@@ -165,67 +195,123 @@ const BridgePileCard = React.memo(function BridgePileCard({
165
195
 
166
196
  const pileName = pile.Name?.trim() || EMPTY_DATA_PLACEHOLDER;
167
197
  const nodes = pile.Nodes === undefined ? EMPTY_DATA_PLACEHOLDER : formatNumber(pile.Nodes);
198
+ const hasRoleCounters = [
199
+ pile.StorageNodes,
200
+ pile.AliveStorageNodes,
201
+ pile.ComputeNodes,
202
+ pile.AliveComputeNodes,
203
+ ].some((value) => value !== undefined);
204
+ const formatCount = (value?: number) => {
205
+ const count = parseOptionalNonNegativeNumber(value);
206
+ return count === undefined ? EMPTY_DATA_PLACEHOLDER : formatNumber(count);
207
+ };
208
+ const nodeCounters = [
209
+ {kind: 'storage', total: pile.StorageNodes, alive: pile.AliveStorageNodes},
210
+ {kind: 'compute', total: pile.ComputeNodes, alive: pile.AliveComputeNodes},
211
+ ] as const;
168
212
  const handleHealthcheckClick = () => {
169
213
  if (pileHealthcheck.target) {
170
214
  onHealthcheckClick(pileHealthcheck.target);
171
215
  }
172
216
  };
217
+ const healthcheckAccessibleName = `${i18n('label_bridge-pile-health-status-prefix', {pileName})} ${EFlagToStatusName[pileHealthcheck.status]}`;
173
218
 
174
219
  return (
175
- <Flex direction="column" gap={2} className={b('pile')}>
176
- <Flex justifyContent="space-between" alignItems="flex-start" gap={2} width="100%">
177
- <Text variant="subheader-1" ellipsis className={b('pile-name')}>
178
- {pileName}
179
- </Text>
180
- {current ? (
181
- <Label
182
- theme="clear"
183
- size="xs"
184
- icon={<Icon data={MapPin} size={12} />}
185
- className={b('current-pile')}
186
- >
187
- {i18n('label_you-are-here')}
188
- </Label>
189
- ) : null}
190
- </Flex>
191
- <Flex gap={2} alignItems="center" wrap>
220
+ <Flex as={Card} view="outlined" direction="column" gap={3} className={b('pile')}>
221
+ <Flex justifyContent="space-between" alignItems="center" gap={2} width="100%">
222
+ <Flex alignItems="center" gap={1} minWidth={0}>
223
+ <Text variant="subheader-1" ellipsis className={b('pile-name')}>
224
+ {pileName}
225
+ </Text>
226
+ {current ? (
227
+ <Tooltip content={i18n('context_bridge-pile-current')}>
228
+ <span
229
+ role="img"
230
+ aria-label={i18n('label_you-are-here')}
231
+ className={b('current-pile')}
232
+ tabIndex={0}
233
+ >
234
+ <Label
235
+ theme="info"
236
+ size="xs"
237
+ icon={<Icon data={MapPin} size={12} />}
238
+ qa="bridge-current-pile"
239
+ />
240
+ </span>
241
+ </Tooltip>
242
+ ) : null}
243
+ </Flex>
192
244
  {stateStatus}
193
- {healthcheckAllowed &&
194
- (healthcheckLoading ? (
195
- <Skeleton className={b('healthcheck-skeleton')} />
196
- ) : (
197
- <EntityStatus.Label
198
- status={pileHealthcheck.status}
199
- size="xs"
200
- className={b('healthcheck-status')}
201
- onClick={pileHealthcheck.target ? handleHealthcheckClick : undefined}
202
- endContent={
203
- pileHealthcheck.target ? (
204
- <Icon data={ChevronRight} size={12} />
205
- ) : undefined
206
- }
207
- qa="bridge-pile-healthcheck"
208
- >
209
- {pileHealthcheck.target ? (
210
- <span className={b('healthcheck-accessible-prefix')}>
211
- {i18n('label_bridge-pile-health-status-prefix', {pileName})}
212
- </span>
213
- ) : null}
214
- </EntityStatus.Label>
215
- ))}
216
- </Flex>
217
- <Flex gap={1} alignItems="center" className={b('nodes')}>
218
- <Icon data={Archive} size={14} />
219
- <Text variant="body-1">
220
- {i18n('field_nodes')}: {nodes}
221
- </Text>
222
245
  </Flex>
246
+ <DefinitionList nameMaxWidth={130} className={text({variant: 'body-1'}, b('details'))}>
247
+ {hasRoleCounters ? (
248
+ nodeCounters.map(({kind, total, alive}) => {
249
+ const title = i18n(
250
+ kind === 'storage' ? 'field_storage-nodes' : 'field_compute-nodes',
251
+ );
252
+ const progress = getBridgeNodesProgress(total, alive);
253
+ return (
254
+ <DefinitionList.Item key={kind} name={title}>
255
+ <Flex
256
+ alignItems="center"
257
+ gap={2}
258
+ wrap
259
+ qa={'bridge-pile-' + kind + '-nodes'}
260
+ >
261
+ {progress !== undefined ? (
262
+ <span className={b('nodes-progress')} aria-hidden="true">
263
+ <Progress value={progress} size="xs" theme="info" />
264
+ </span>
265
+ ) : null}
266
+ <Text whiteSpace="nowrap">
267
+ {i18n('value_nodes-alive', {
268
+ alive: formatCount(alive),
269
+ total: formatCount(total),
270
+ })}
271
+ </Text>
272
+ </Flex>
273
+ </DefinitionList.Item>
274
+ );
275
+ })
276
+ ) : (
277
+ <DefinitionList.Item name={i18n('field_nodes')}>{nodes}</DefinitionList.Item>
278
+ )}
279
+ {healthcheckAllowed && (
280
+ <DefinitionList.Item name={i18n('field_healthcheck')}>
281
+ {healthcheckLoading ? (
282
+ <Skeleton className={b('healthcheck-skeleton')} />
283
+ ) : (
284
+ <Flex shrink={0}>
285
+ <EntityStatus.Label
286
+ view="compact"
287
+ status={pileHealthcheck.status}
288
+ checkIcon="check"
289
+ tooltipTitle={
290
+ pileHealthcheck.status === EFlag.Green
291
+ ? i18n('context_bridge-pile-no-issues')
292
+ : undefined
293
+ }
294
+ size="xxs"
295
+ iconSize={12}
296
+ onClick={
297
+ pileHealthcheck.target ? handleHealthcheckClick : undefined
298
+ }
299
+ aria-label={healthcheckAccessibleName}
300
+ tabIndex={pileHealthcheck.target ? undefined : 0}
301
+ qa="bridge-pile-healthcheck"
302
+ />
303
+ </Flex>
304
+ )}
305
+ </DefinitionList.Item>
306
+ )}
307
+ </DefinitionList>
223
308
  </Flex>
224
309
  );
225
310
  });
226
311
 
227
312
  export const BridgeInfoTable = React.memo(function BridgeInfoTable({
228
313
  piles,
314
+ bridgeInfo,
229
315
  database,
230
316
  clusterName,
231
317
  }: BridgeInfoTableProps) {
@@ -257,8 +343,15 @@ export const BridgeInfoTable = React.memo(function BridgeInfoTable({
257
343
 
258
344
  const sortedPiles = React.useMemo(() => {
259
345
  return piles
260
- .map((pile, index) => ({pile, index}))
346
+ .map((pile, index) => ({
347
+ pile,
348
+ index,
349
+ current: Boolean(currentPileName?.trim() && pile.Name === currentPileName),
350
+ }))
261
351
  .sort((left, right) => {
352
+ if (left.current !== right.current) {
353
+ return left.current ? -1 : 1;
354
+ }
262
355
  const leftPrimary = left.pile.State === BridgePileState.PRIMARY;
263
356
  const rightPrimary = right.pile.State === BridgePileState.PRIMARY;
264
357
  if (leftPrimary !== rightPrimary) {
@@ -266,23 +359,26 @@ export const BridgeInfoTable = React.memo(function BridgeInfoTable({
266
359
  }
267
360
  return left.index - right.index;
268
361
  });
269
- }, [piles]);
362
+ }, [piles, currentPileName]);
270
363
 
271
364
  return (
272
- <Flex wrap className={b()}>
273
- {sortedPiles.map(({pile, index}) => (
274
- <BridgePileCard
275
- key={pile.PileId ?? pile.Name ?? index}
276
- pile={pile}
277
- current={Boolean(currentPileName?.trim() && pile.Name === currentPileName)}
278
- healthcheckAllowed={Boolean(isMonitoringAllowed)}
279
- healthcheckAvailable={healthcheckAvailable}
280
- healthcheckSupportsPiles={healthcheckSupportsPiles}
281
- healthcheckLoading={healthcheckLoading}
282
- leavesIssues={leavesIssues}
283
- onHealthcheckClick={handleOpenHealthcheckIssue}
284
- />
285
- ))}
365
+ <Flex direction="column" gap={3} className={b()}>
366
+ {bridgeInfo ? <BridgeDatabasesSummary bridgeInfo={bridgeInfo} /> : null}
367
+ <Flex wrap className={b('piles')}>
368
+ {sortedPiles.map(({pile, index, current}) => (
369
+ <BridgePileCard
370
+ key={pile.PileId ?? pile.Name ?? index}
371
+ pile={pile}
372
+ current={current}
373
+ healthcheckAllowed={Boolean(isMonitoringAllowed)}
374
+ healthcheckAvailable={healthcheckAvailable}
375
+ healthcheckSupportsPiles={healthcheckSupportsPiles}
376
+ healthcheckLoading={healthcheckLoading}
377
+ leavesIssues={leavesIssues}
378
+ onHealthcheckClick={handleOpenHealthcheckIssue}
379
+ />
380
+ ))}
381
+ </Flex>
286
382
  </Flex>
287
383
  );
288
384
  });
@@ -0,0 +1,27 @@
1
+ import type {TBridgeInfo} from '../../../../types/api/cluster';
2
+ import {BridgeSyncStatus} from '../../../../types/api/cluster';
3
+ import {getUsage} from '../../../../utils/storage';
4
+ import {parseOptionalNonNegativeNumber} from '../../../../utils/utils';
5
+
6
+ export function getBridgeDatabaseCounts(bridgeInfo?: TBridgeInfo) {
7
+ const counts = bridgeInfo?.DatabaseCountsBySyncStatus;
8
+ if (counts === undefined || counts === null) {
9
+ return undefined;
10
+ }
11
+
12
+ return Object.values(BridgeSyncStatus)
13
+ .filter((status) => status !== BridgeSyncStatus.NOT_REQUIRED)
14
+ .flatMap((status) => {
15
+ const count = parseOptionalNonNegativeNumber(counts[status]);
16
+ return count === undefined ? [] : [{status, count}];
17
+ });
18
+ }
19
+
20
+ export function getBridgeNodesProgress(total?: number, alive?: number) {
21
+ const totalCount = parseOptionalNonNegativeNumber(total);
22
+ const aliveCount = parseOptionalNonNegativeNumber(alive);
23
+ if (totalCount === undefined || aliveCount === undefined) {
24
+ return undefined;
25
+ }
26
+ return getUsage({Used: aliveCount, Limit: totalCount});
27
+ }
@@ -22,6 +22,19 @@
22
22
  "label_overview": "Overview",
23
23
  "field_state": "State",
24
24
  "field_nodes": "Nodes",
25
+ "field_storage-nodes": "Storage nodes",
26
+ "field_compute-nodes": "Compute nodes",
27
+ "value_nodes-alive": "{{alive}} / {{total}} alive",
28
+ "field_healthcheck": "Healthcheck",
29
+ "context_bridge-pile-current": "You are viewing the cluster from this pile’s perspective",
30
+ "context_bridge-pile-no-issues": "No issues reported for this pile",
31
+ "field_bridge-databases": "Bridge databases",
32
+ "context_bridge-sync-status": "Sync status: {{status}}",
33
+ "value_bridge-sync-synced": "Synchronised",
34
+ "value_bridge-sync-syncing": "Syncing",
35
+ "value_bridge-sync-pending": "Pending",
36
+ "value_bridge-sync-unknown": "Unknown",
37
+ "value_bridge-sync-not-required": "Not applicable",
25
38
  "value_nodes": {
26
39
  "one": "{{formattedCount}} node",
27
40
  "other": "{{formattedCount}} nodes"
@@ -10,6 +10,7 @@ import {useStorageQueryParams} from '../useStorageQueryParams';
10
10
 
11
11
  import {GroupedStorageGroupsComponent} from './GroupedStorageGroupsComponent';
12
12
  import {StorageGroupsComponent} from './StorageGroupsComponent';
13
+ import {useStorageGroupsBridgeGrouping} from './useStorageGroupsBridgeGrouping';
13
14
 
14
15
  import '../Storage.scss';
15
16
 
@@ -19,6 +20,10 @@ export function PaginatedStorageGroups(props: PaginatedStorageProps) {
19
20
 
20
21
  const capabilitiesLoaded = useCapabilitiesLoaded();
21
22
  const storageGroupsHandlerHasGrouping = useStorageGroupsHandlerHasGrouping();
23
+ const {bridgeModeEnabled, bridgeSyncGroupingAvailable} = useStorageGroupsBridgeGrouping();
24
+ const groupingUnavailable =
25
+ (storageGroupsGroupByParam === 'PileName' && !bridgeModeEnabled) ||
26
+ (storageGroupsGroupByParam === 'BridgeSyncStatus' && !bridgeSyncGroupingAvailable);
22
27
 
23
28
  // Other filters do not fit with grouping
24
29
  // Reset them if grouping available
@@ -29,7 +34,7 @@ export function PaginatedStorageGroups(props: PaginatedStorageProps) {
29
34
  }, [handleShowAllGroups, storageGroupsHandlerHasGrouping, visibleEntities]);
30
35
 
31
36
  const renderContent = () => {
32
- if (storageGroupsHandlerHasGrouping && storageGroupsGroupByParam) {
37
+ if (storageGroupsHandlerHasGrouping && storageGroupsGroupByParam && !groupingUnavailable) {
33
38
  return <GroupedStorageGroupsComponent {...props} />;
34
39
  }
35
40
 
@@ -9,7 +9,6 @@ import {Search} from '../../../components/Search/Search';
9
9
  import {
10
10
  useBlobStorageCapacityMetricsAvailable,
11
11
  useBlobStorageCapacityMetricsEnabled,
12
- useBridgeModeEnabled,
13
12
  } from '../../../store/reducers/capabilities/hooks';
14
13
  import {SETTING_KEYS} from '../../../store/reducers/settings/constants';
15
14
  import {useSetting} from '../../../utils/hooks';
@@ -26,6 +25,8 @@ import i18n from '../i18n';
26
25
  import {b} from '../shared';
27
26
  import {useIsStorageExpertMode, useStorageQueryParams} from '../useStorageQueryParams';
28
27
 
28
+ import {useStorageGroupsBridgeGrouping} from './useStorageGroupsBridgeGrouping';
29
+
29
30
  interface StorageControlsProps {
30
31
  withTypeSelector?: boolean;
31
32
  withGroupBySelect?: boolean;
@@ -70,16 +71,26 @@ export function StorageGroupsControls({
70
71
  );
71
72
  const isStorageExpertMode = useIsStorageExpertMode();
72
73
  const storageExpertModeAvailable = useBlobStorageCapacityMetricsAvailable();
73
- const bridgeModeEnabled = useBridgeModeEnabled();
74
74
  const blobMetricsEnabled = useBlobStorageCapacityMetricsEnabled();
75
+ const {bridgeModeEnabled, bridgeSyncGroupingAvailable} = useStorageGroupsBridgeGrouping();
75
76
 
76
77
  const isVDisksPDisksColumnVisible = React.useMemo(() => {
77
78
  return columns.some((column) => column.name === STORAGE_GROUPS_COLUMNS_IDS.VDisksPDisks);
78
79
  }, [columns]);
79
80
 
80
81
  const groupByOptions = React.useMemo(() => {
81
- return getStorageGroupsGroupByOptions(blobMetricsEnabled, bridgeModeEnabled);
82
- }, [bridgeModeEnabled, blobMetricsEnabled]);
82
+ return getStorageGroupsGroupByOptions(
83
+ blobMetricsEnabled,
84
+ bridgeModeEnabled,
85
+ bridgeSyncGroupingAvailable,
86
+ );
87
+ }, [bridgeModeEnabled, blobMetricsEnabled, bridgeSyncGroupingAvailable]);
88
+
89
+ const groupByValue =
90
+ storageGroupsGroupByParam &&
91
+ groupByOptions.some(({value}) => value === storageGroupsGroupByParam)
92
+ ? [storageGroupsGroupByParam]
93
+ : [];
83
94
 
84
95
  const handleGroupBySelectUpdate = (value: string[]) => {
85
96
  handleStorageGroupsGroupByParamChange(value[0]);
@@ -118,9 +129,7 @@ export function StorageGroupsControls({
118
129
  qa="storage-groups-group-by"
119
130
  placeholder={'-'}
120
131
  width={150}
121
- defaultValue={
122
- storageGroupsGroupByParam ? [storageGroupsGroupByParam] : undefined
123
- }
132
+ value={groupByValue}
124
133
  onUpdate={handleGroupBySelectUpdate}
125
134
  options={groupByOptions}
126
135
  />
@@ -0,0 +1,13 @@
1
+ import {
2
+ useBridgeModeEnabled,
3
+ useStorageGroupsHandlerHasBridgeSyncStatus,
4
+ } from '../../../store/reducers/capabilities/hooks';
5
+
6
+ export function useStorageGroupsBridgeGrouping() {
7
+ const bridgeModeEnabled = useBridgeModeEnabled();
8
+ const handlerHasBridgeSyncStatus = useStorageGroupsHandlerHasBridgeSyncStatus();
9
+ return {
10
+ bridgeModeEnabled,
11
+ bridgeSyncGroupingAvailable: bridgeModeEnabled && handlerHasBridgeSyncStatus,
12
+ };
13
+ }
@@ -0,0 +1,12 @@
1
+ .ydb-storage-group-sync-popover {
2
+ display: flex;
3
+
4
+ box-sizing: border-box;
5
+ max-width: min(338px, calc(100vw - 64px));
6
+
7
+ &__body {
8
+ flex: 1;
9
+
10
+ min-width: 0;
11
+ }
12
+ }
@@ -0,0 +1,53 @@
1
+ import {Flex, Text} from '@gravity-ui/uikit';
2
+
3
+ import {BridgeSyncStatusLabel} from '../../../../../components/BridgeSyncStatusLabel';
4
+ import {HoverPopup} from '../../../../../components/HoverPopup/HoverPopup';
5
+ import type {PreparedStorageGroup} from '../../../../../store/reducers/storage/types';
6
+ import {BridgeSyncStatus} from '../../../../../types/api/cluster';
7
+ import {cn} from '../../../../../utils/cn';
8
+ import {StorageGroupSyncDetails} from '../../../StorageGroupSyncDetails/StorageGroupSyncDetails';
9
+
10
+ import i18n from './i18n';
11
+
12
+ import './StorageGroupSyncPopover.scss';
13
+
14
+ const b = cn('ydb-storage-group-sync-popover');
15
+
16
+ function hasSyncDetails(group: PreparedStorageGroup) {
17
+ return (
18
+ group.BridgeSyncStatus === BridgeSyncStatus.SYNCING ||
19
+ group.BridgeSyncStatus === BridgeSyncStatus.PENDING
20
+ );
21
+ }
22
+
23
+ function SyncDetails({group}: {group: PreparedStorageGroup}) {
24
+ return (
25
+ <div
26
+ className={b()}
27
+ data-qa="storage-group-sync-details"
28
+ role="presentation"
29
+ onClick={(event) => event.stopPropagation()}
30
+ >
31
+ <Flex direction="column" gap={4} className={b('body')}>
32
+ <Text variant="subheader-2">{i18n('title_sync')}</Text>
33
+ <StorageGroupSyncDetails group={group} />
34
+ </Flex>
35
+ </div>
36
+ );
37
+ }
38
+
39
+ export function StorageGroupSyncPopover({group}: {group: PreparedStorageGroup}) {
40
+ if (!hasSyncDetails(group)) {
41
+ return <BridgeSyncStatusLabel status={group.BridgeSyncStatus} />;
42
+ }
43
+ return (
44
+ <HoverPopup
45
+ placement={['right-start', 'left-start', 'bottom-start']}
46
+ renderPopupContent={() => <SyncDetails group={group} />}
47
+ >
48
+ <Flex as="span" inline onClick={(event) => event.stopPropagation()}>
49
+ <BridgeSyncStatusLabel status={group.BridgeSyncStatus} withInfo interactive />
50
+ </Flex>
51
+ </HoverPopup>
52
+ );
53
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title_sync": "Storage group synchronisation",
3
+ "action_open": "Synchronization details for group {{groupId}}"
4
+ }
@@ -0,0 +1,5 @@
1
+ import {registerKeysets} from '../../../../../../utils/i18n';
2
+
3
+ import en from './en.json';
4
+
5
+ export default registerKeysets('ydb-storage-group-sync-popover', {en});
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import {ShieldKeyhole} from '@gravity-ui/icons';
3
+ import {NodesRight, ShieldKeyhole} from '@gravity-ui/icons';
4
4
  import DataTable from '@gravity-ui/react-data-table';
5
5
  import {Flex, Icon, Label, Popover} from '@gravity-ui/uikit';
6
6
  import {isNil} from 'lodash';
@@ -39,12 +39,14 @@ import {getDegradedSeverity} from '../../utils';
39
39
  import {getStorageGroupStateLabel} from '../../utils/getStorageGroupStateLabel';
40
40
  import i18n from '../i18n';
41
41
 
42
+ import {StorageGroupSyncPopover} from './StorageGroupSyncPopover/StorageGroupSyncPopover';
42
43
  import {
43
44
  STORAGE_GROUPS_COLUMNS_IDS,
44
45
  STORAGE_GROUPS_COLUMNS_TITLES,
45
46
  STORAGE_GROUPS_DISKS_COLUMN_TITLES,
46
47
  isSortableStorageGroupsColumn,
47
48
  } from './constants';
49
+ import columnsI18n from './i18n';
48
50
  import type {GetStorageColumnsData, StorageColumnsGetter, StorageGroupsColumn} from './types';
49
51
 
50
52
  import './StorageGroupsColumns.scss';
@@ -82,6 +84,31 @@ const pileNameColumn: StorageGroupsColumn = {
82
84
  align: DataTable.LEFT,
83
85
  };
84
86
 
87
+ const bridgeModeColumn: StorageGroupsColumn = {
88
+ name: STORAGE_GROUPS_COLUMNS_IDS.BridgeMode,
89
+ header: STORAGE_GROUPS_COLUMNS_TITLES.BridgeMode,
90
+ width: 100,
91
+ render: ({row}) => {
92
+ if (row.BridgeMode === true) {
93
+ return (
94
+ <Label theme="utility" size="xs" icon={<Icon data={NodesRight} size={12} />}>
95
+ {columnsI18n('value_bridge')}
96
+ </Label>
97
+ );
98
+ }
99
+ return row.BridgeMode === false ? columnsI18n('value_non-bridge') : EMPTY_DATA_PLACEHOLDER;
100
+ },
101
+ align: DataTable.LEFT,
102
+ };
103
+
104
+ const bridgeSyncStatusColumn: StorageGroupsColumn = {
105
+ name: STORAGE_GROUPS_COLUMNS_IDS.BridgeSyncStatus,
106
+ header: STORAGE_GROUPS_COLUMNS_TITLES.BridgeSyncStatus,
107
+ width: 170,
108
+ render: ({row}) => <StorageGroupSyncPopover group={row} />,
109
+ align: DataTable.LEFT,
110
+ };
111
+
85
112
  const typeColumn: StorageGroupsColumn = {
86
113
  name: STORAGE_GROUPS_COLUMNS_IDS.MediaType,
87
114
  header: STORAGE_GROUPS_COLUMNS_TITLES.MediaType,
@@ -378,9 +405,11 @@ export const getStorageGroupsColumns: StorageColumnsGetter = (data) => {
378
405
  const columns = [
379
406
  groupIdColumn,
380
407
  poolNameColumn,
381
- pileNameColumn,
382
408
  typeColumn,
383
409
  erasureColumn,
410
+ bridgeModeColumn,
411
+ pileNameColumn,
412
+ bridgeSyncStatusColumn,
384
413
  degradedColumn,
385
414
  stateColumn,
386
415
  usageColumn,