ydb-embedded-ui 1.11.0 → 1.11.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.11.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.11.0...v1.11.1) (2022-08-26)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * number type instead of string for uint32 ([e60799e](https://github.com/ydb-platform/ydb-embedded-ui/commit/e60799edec4ef831e8c0d51f4384cde83520541d))
9
+ * **Storage:** expect arbitrary donors data ([09f8e08](https://github.com/ydb-platform/ydb-embedded-ui/commit/09f8e085c94faacd9da502643355e932346502ac))
10
+ * vdisk data contains pdisk data, not id ([bd1ea7f](https://github.com/ydb-platform/ydb-embedded-ui/commit/bd1ea7f59e0461256bb12f146b50470d21ac1ace))
11
+
3
12
  ## [1.11.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v1.10.3...v1.11.0) (2022-08-23)
4
13
 
5
14
 
@@ -3,7 +3,6 @@ import cn from 'bem-cn-lite';
3
3
  import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-table';
4
4
  import {Popover, PopoverBehavior} from '@yandex-cloud/uikit';
5
5
 
6
- import Vdisk from '../Vdisk/Vdisk';
7
6
  import {Stack} from '../../../components/Stack/Stack';
8
7
  //@ts-ignore
9
8
  import EntityStatus from '../../../components/EntityStatus/EntityStatus';
@@ -16,6 +15,9 @@ import {bytesToGB, bytesToSpeed} from '../../../utils/utils';
16
15
  //@ts-ignore
17
16
  import {stringifyVdiskId} from '../../../utils';
18
17
 
18
+ import Vdisk from '../Vdisk/Vdisk';
19
+ import {isFullDonorData} from '../utils';
20
+
19
21
  import './StorageGroups.scss';
20
22
 
21
23
  enum TableColumnsIds {
@@ -197,34 +199,38 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
197
199
  header: tableColumnsNames[TableColumnsIds.VDisks],
198
200
  render: ({value, row}) => (
199
201
  <div className={b('vdisks-wrapper')}>
200
- {_.map(value as TVDiskStateInfo[], (el) => (
201
- Array.isArray(el.Donors) && el.Donors.length > 0 ? (
202
- <Stack className={b('vdisks-item')} key={stringifyVdiskId(el.VDiskId)}>
203
- <Vdisk
204
- {...el}
205
- PoolName={row[TableColumnsIds.PoolName]}
206
- nodes={nodes}
207
- />
208
- {el.Donors.map((donor) => (
202
+ {_.map(value as TVDiskStateInfo[], (el) => {
203
+ const donors = Array.isArray(el.Donors) ? el.Donors.filter(isFullDonorData) : [];
204
+
205
+ return (
206
+ donors.length > 0 ? (
207
+ <Stack className={b('vdisks-item')} key={stringifyVdiskId(el.VDiskId)}>
208
+ <Vdisk
209
+ {...el}
210
+ PoolName={row[TableColumnsIds.PoolName]}
211
+ nodes={nodes}
212
+ />
213
+ {donors.map((donor) => (
214
+ <Vdisk
215
+ {...donor}
216
+ // donor and acceptor are always in the same group
217
+ PoolName={row[TableColumnsIds.PoolName]}
218
+ nodes={nodes}
219
+ key={stringifyVdiskId(donor.VDiskId)}
220
+ />
221
+ ))}
222
+ </Stack>
223
+ ) : (
224
+ <div className={b('vdisks-item')} key={stringifyVdiskId(el.VDiskId)}>
209
225
  <Vdisk
210
- {...donor}
211
- // donor and acceptor are always in the same group
226
+ {...el}
212
227
  PoolName={row[TableColumnsIds.PoolName]}
213
228
  nodes={nodes}
214
- key={stringifyVdiskId(donor.VDiskId)}
215
229
  />
216
- ))}
217
- </Stack>
218
- ) : (
219
- <div className={b('vdisks-item')} key={stringifyVdiskId(el.VDiskId)}>
220
- <Vdisk
221
- {...el}
222
- PoolName={row[TableColumnsIds.PoolName]}
223
- nodes={nodes}
224
- />
225
- </div>
226
- )
227
- ))}
230
+ </div>
231
+ )
232
+ );
233
+ })}
228
234
  </div>
229
235
  ),
230
236
  align: DataTable.CENTER,
@@ -1 +1,6 @@
1
+ import type {TVDiskStateInfo, TVSlotId} from '../../../types/api/storage';
2
+
1
3
  export * from './constants';
4
+
5
+ export const isFullDonorData = (donor: TVDiskStateInfo | TVSlotId): donor is TVDiskStateInfo =>
6
+ 'VDiskId' in donor;
@@ -91,27 +91,19 @@ export interface TTableDescription {
91
91
  export interface TPartitionConfig {
92
92
  /** uint64 */
93
93
  FollowerCount?: string;
94
- /**
95
- * uint32
96
- * @deprecated use FollowerGroups
97
- */
98
- CrossDataCenterFollowerCount?: string;
94
+ /** @deprecated use FollowerGroups */
95
+ CrossDataCenterFollowerCount?: number;
99
96
  /** 0 or 1 items */
100
97
  FollowerGroups?: TFollowerGroup[];
101
98
  }
102
99
 
103
100
  export interface TFollowerGroup {
104
- /** uint32 */
105
- FollowerCount?: string;
101
+ FollowerCount?: number;
106
102
  AllowLeaderPromotion?: boolean;
107
103
  AllowClientRead?: boolean;
108
- /** uint32[] */
109
- AllowedNodeIDs?: string[];
110
- /**
111
- * uint32[]
112
- * @deprecated use AllowedDataCenters
113
- */
114
- AllowedDataCenterNumIDs?: string[];
104
+ AllowedNodeIDs?: number[];
105
+ /** @deprecated use AllowedDataCenters */
106
+ AllowedDataCenterNumIDs?: number[];
115
107
  RequireAllDataCenters?: boolean;
116
108
  LocalNodeOnly?: boolean;
117
109
  RequireDifferentNodes?: boolean;
@@ -64,12 +64,11 @@ export enum EVDiskState {
64
64
 
65
65
  interface TRank {
66
66
  /**
67
- * uint32
68
67
  * Rank in percents; 0-100% is good; >100% is bad.
69
68
  * Formula for rank calculation is the following:
70
69
  * Rank = actual_value / max_allowed_value * 100
71
70
  */
72
- RankPercent?: string;
71
+ RankPercent?: number;
73
72
 
74
73
  /**
75
74
  * Flag is the Rank transformed to something simple
@@ -84,16 +83,17 @@ interface TVDiskSatisfactionRank {
84
83
  }
85
84
 
86
85
  interface TVDiskID {
87
- /** uint32 */
88
- GroupID?: string;
89
- /** uint32 */
90
- GroupGeneration?: string;
91
- /** uint32 */
92
- Ring?: string;
93
- /** uint32 */
94
- Domain?: string;
95
- /** uint32 */
96
- VDisk?: string;
86
+ GroupID?: number;
87
+ GroupGeneration?: number;
88
+ Ring?: number;
89
+ Domain?: number;
90
+ VDisk?: number;
91
+ }
92
+
93
+ export interface TVSlotId {
94
+ NodeId?: number;
95
+ PDiskId?: number;
96
+ VSlotId?: number;
97
97
  }
98
98
 
99
99
  export interface TVDiskStateInfo {
@@ -102,18 +102,14 @@ export interface TVDiskStateInfo {
102
102
  CreateTime?: string;
103
103
  /** uint64 */
104
104
  ChangeTime?: string;
105
- /** uint32 */
106
- PDiskId?: string;
107
- /** uint32 */
108
- VDiskSlotId?: string;
105
+ PDisk?: TPDiskStateInfo;
106
+ VDiskSlotId?: number;
109
107
  /** uint64 */
110
108
  Guid?: string;
111
109
  /** uint64 */
112
110
  Kind?: string;
113
- /** uint32 */
114
- NodeId?: string;
115
- /** uint32 */
116
- Count?: string;
111
+ NodeId?: number;
112
+ Count?: number;
117
113
 
118
114
  Overall?: EFlag;
119
115
 
@@ -154,7 +150,8 @@ export interface TVDiskStateInfo {
154
150
  * VDisk actor instance guid
155
151
  */
156
152
  InstanceGuid?: string;
157
- Donors?: TVDiskStateInfo[];
153
+ // in reality it is `Donors: TVDiskStateInfo[] | TVSlotId[]`, but this way it is more error-proof
154
+ Donors?: Array<TVDiskStateInfo | TVSlotId>;
158
155
 
159
156
  /** VDisk (Skeleton) Front Queue Status */
160
157
  FrontQueues?: EFlag;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],