ydb-embedded-ui 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/components/BasicNodeViewer/BasicNodeViewer.tsx +2 -3
  3. package/dist/components/ClusterInfo/ClusterInfo.tsx +14 -36
  4. package/dist/components/CopyToClipboard/CopyToClipboard.tsx +1 -2
  5. package/dist/components/CriticalActionDialog/CriticalActionDialog.js +1 -1
  6. package/dist/components/EmptyState/{EmptyState.js → EmptyState.tsx} +12 -15
  7. package/dist/components/EmptyState/index.ts +1 -0
  8. package/dist/components/EnableFullscreenButton/EnableFullscreenButton.tsx +7 -2
  9. package/dist/components/Errors/403/AccessDenied.tsx +1 -1
  10. package/dist/components/Fullscreen/Fullscreen.tsx +1 -1
  11. package/dist/components/Icon/Icon.tsx +33 -0
  12. package/dist/components/Icon/index.ts +1 -0
  13. package/dist/components/Pagination/Pagination.js +1 -1
  14. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.tsx +1 -1
  15. package/dist/components/Tablet/Tablet.tsx +59 -0
  16. package/dist/components/Tablet/index.ts +1 -0
  17. package/dist/components/Tag/Tag.tsx +16 -0
  18. package/dist/components/Tag/index.ts +1 -0
  19. package/dist/components/Tags/Tags.tsx +22 -0
  20. package/dist/components/Tags/index.ts +1 -0
  21. package/dist/containers/Header/Header.tsx +2 -3
  22. package/dist/containers/Header/Host/Host.js +1 -1
  23. package/dist/containers/Node/NodeStructure/Pdisk.tsx +1 -1
  24. package/dist/containers/Nodes/getNodesColumns.tsx +1 -1
  25. package/dist/containers/Storage/EmptyFilter/EmptyFilter.tsx +8 -9
  26. package/dist/containers/Tablet/Tablet.js +6 -6
  27. package/dist/containers/Tablets/Tablets.scss +0 -4
  28. package/dist/containers/Tablets/Tablets.tsx +1 -2
  29. package/dist/containers/TabletsFilters/TabletsFilters.js +1 -1
  30. package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.scss +1 -1
  31. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +27 -1
  32. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +1 -2
  33. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +1 -1
  34. package/dist/containers/Tenant/Diagnostics/Network/Network.js +1 -1
  35. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.tsx +23 -13
  36. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +1 -1
  37. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
  38. package/dist/containers/Tenant/Preview/Preview.js +1 -1
  39. package/dist/containers/Tenant/QueryEditor/QueryEditor.js +1 -1
  40. package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +1 -1
  41. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +1 -1
  42. package/dist/containers/Tenant/TenantPages.tsx +1 -2
  43. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx +2 -2
  44. package/dist/services/api.d.ts +11 -0
  45. package/dist/services/api.js +3 -3
  46. package/dist/store/reducers/consumer.ts +14 -0
  47. package/dist/store/reducers/{host.js → host.ts} +9 -5
  48. package/dist/store/reducers/shardsWorkload.ts +4 -0
  49. package/dist/store/reducers/tablet.ts +111 -0
  50. package/dist/store/state-url-mapping.js +3 -0
  51. package/dist/types/api/cluster.ts +34 -0
  52. package/dist/types/api/systemState.ts +13 -0
  53. package/dist/types/api/tablet.ts +12 -4
  54. package/dist/types/store/consumer.ts +10 -2
  55. package/dist/types/store/host.ts +23 -0
  56. package/dist/types/store/tablet.ts +50 -0
  57. package/dist/types/store/tooltip.ts +3 -1
  58. package/package.json +7 -5
  59. package/dist/components/Icon/Icon.js +0 -28
  60. package/dist/components/Tablet/Tablet.js +0 -61
  61. package/dist/components/Tag/Tag.js +0 -14
  62. package/dist/components/Tags/Tags.js +0 -36
  63. package/dist/store/reducers/tablet.js +0 -94
@@ -1,5 +1,5 @@
1
1
  import block from 'bem-cn-lite';
2
- import {useCallback, useEffect, useMemo, useState} from 'react';
2
+ import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
3
3
  import {useDispatch} from 'react-redux';
4
4
  import {escapeRegExp} from 'lodash/fp';
5
5
 
@@ -17,6 +17,7 @@ import {
17
17
  getConsumer,
18
18
  selectPreparedPartitionsData,
19
19
  setDataWasNotLoaded,
20
+ setSelectedConsumer,
20
21
  } from '../../../../store/reducers/consumer';
21
22
 
22
23
  import {TableSkeleton} from '../../../../components/TableSkeleton/TableSkeleton';
@@ -52,14 +53,17 @@ export const Partitions = ({path, type, nodes, consumers}: PartitionsProps) => {
52
53
 
53
54
  const dispatch = useDispatch();
54
55
 
55
- const [selectedConsumer, setSelectedConsumer] = useState<string[]>();
56
+ const isFirstRenderRef = useRef(true);
57
+
56
58
  const [generalSearchValue, setGeneralSearchValue] = useState('');
57
59
  const [partitionIdSearchValue, setPartitionIdSearchValue] = useState('');
58
60
 
59
61
  const [componentCurrentPath, setComponentCurrentPath] = useState(path);
60
62
 
61
63
  const {autorefresh} = useTypedSelector((state) => state.schema);
62
- const {loading, wasLoaded, error} = useTypedSelector((state) => state.consumer);
64
+ const {loading, wasLoaded, error, selectedConsumer} = useTypedSelector(
65
+ (state) => state.consumer,
66
+ );
63
67
 
64
68
  const partitions = useTypedSelector((state) => selectPreparedPartitionsData(state));
65
69
 
@@ -70,7 +74,15 @@ export const Partitions = ({path, type, nodes, consumers}: PartitionsProps) => {
70
74
  useEffect(() => {
71
75
  // Manual path control to ensure it updates with other values so no request with wrong params will be sent
72
76
  setComponentCurrentPath(path);
73
- }, [path]);
77
+
78
+ // Do not reset selected consumer on first effect call
79
+ // To enable navigating to specific consumer
80
+ if (isFirstRenderRef.current) {
81
+ isFirstRenderRef.current = false;
82
+ } else {
83
+ dispatch(setSelectedConsumer(undefined));
84
+ }
85
+ }, [dispatch, path]);
74
86
 
75
87
  const fetchConsumerData = useCallback(
76
88
  (isBackground: boolean) => {
@@ -78,8 +90,8 @@ export const Partitions = ({path, type, nodes, consumers}: PartitionsProps) => {
78
90
  dispatch(setDataWasNotLoaded());
79
91
  }
80
92
 
81
- if (selectedConsumer && selectedConsumer.length) {
82
- dispatch(getConsumer(componentCurrentPath, selectedConsumer[0]));
93
+ if (selectedConsumer) {
94
+ dispatch(getConsumer(componentCurrentPath, selectedConsumer));
83
95
  }
84
96
  },
85
97
  [dispatch, selectedConsumer, componentCurrentPath],
@@ -99,12 +111,10 @@ export const Partitions = ({path, type, nodes, consumers}: PartitionsProps) => {
99
111
  );
100
112
 
101
113
  useEffect(() => {
102
- if (consumersToSelect && consumersToSelect.length) {
103
- setSelectedConsumer([consumersToSelect[0].value]);
104
- } else {
105
- setSelectedConsumer(undefined);
114
+ if (consumersToSelect && consumersToSelect.length && !selectedConsumer) {
115
+ dispatch(setSelectedConsumer(consumersToSelect[0].value));
106
116
  }
107
- }, [consumersToSelect]);
117
+ }, [dispatch, consumersToSelect, selectedConsumer]);
108
118
 
109
119
  const selectedColumns: string[] = useMemo(
110
120
  () =>
@@ -183,7 +193,7 @@ export const Partitions = ({path, type, nodes, consumers}: PartitionsProps) => {
183
193
  };
184
194
 
185
195
  const handleConsumerSelectChange = (value: string[]) => {
186
- setSelectedConsumer(value);
196
+ dispatch(setSelectedConsumer(value[0]));
187
197
  };
188
198
 
189
199
  const handlePartitionIdSearchChange = (value: string) => {
@@ -210,7 +220,7 @@ export const Partitions = ({path, type, nodes, consumers}: PartitionsProps) => {
210
220
  placeholder={i18n('controls.consumerSelector.placeholder')}
211
221
  label={i18n('controls.consumerSelector')}
212
222
  options={consumersToSelect}
213
- value={selectedConsumer}
223
+ value={[selectedConsumer || '']}
214
224
  onUpdate={handleConsumerSelectChange}
215
225
  />
216
226
  <Search
@@ -7,7 +7,7 @@ import {Loader} from '@gravity-ui/uikit';
7
7
  import EntityStatus from '../../../../components/EntityStatus/EntityStatus';
8
8
  import InfoViewer from '../../../../components/InfoViewer/InfoViewer';
9
9
  import PoolUsage from '../../../../components/PoolUsage/PoolUsage';
10
- import Tablet from '../../../../components/Tablet/Tablet';
10
+ import {Tablet} from '../../../../components/Tablet';
11
11
 
12
12
  import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
13
13
  import {getTenantInfo} from '../../../../store/reducers/tenant';
@@ -18,7 +18,7 @@ import {
18
18
  CDCStreamOverview,
19
19
  PersQueueGroupOverview,
20
20
  } from '../../../components/InfoViewer/schemaOverview';
21
- import Icon from '../../../components/Icon/Icon';
21
+ import {Icon} from '../../../components/Icon';
22
22
 
23
23
  import {
24
24
  EPathSubType,
@@ -5,7 +5,7 @@ import cn from 'bem-cn-lite';
5
5
 
6
6
  import {Loader, Button} from '@gravity-ui/uikit';
7
7
 
8
- import Icon from '../../../components/Icon/Icon';
8
+ import {Icon} from '../../../components/Icon';
9
9
  import Fullscreen from '../../../components/Fullscreen/Fullscreen';
10
10
  import {QueryResultTable} from '../../../components/QueryResultTable';
11
11
 
@@ -11,7 +11,7 @@ import {QueryResultTable} from '../../../components/QueryResultTable';
11
11
 
12
12
  import SaveQuery from './SaveQuery/SaveQuery';
13
13
  import SavedQueries from './SavedQueries/SavedQueries';
14
- import Icon from '../../../components/Icon/Icon';
14
+ import {Icon} from '../../../components/Icon';
15
15
  import QueryResult from './QueryResult/QueryResult';
16
16
  import QueryExplain from './QueryExplain/QueryExplain';
17
17
 
@@ -4,7 +4,7 @@ import cn from 'bem-cn-lite';
4
4
  import {Dialog, Popup, Button} from '@gravity-ui/uikit';
5
5
 
6
6
  import TruncatedQuery from '../../../../components/TruncatedQuery/TruncatedQuery';
7
- import Icon from '../../../../components/Icon/Icon';
7
+ import {Icon} from '../../../../components/Icon';
8
8
  import './SavedQueries.scss';
9
9
  import {setQueryNameToEdit} from '../../../../store/reducers/saveQuery';
10
10
  import {useDispatch} from 'react-redux';
@@ -4,7 +4,7 @@ import cn from 'bem-cn-lite';
4
4
 
5
5
  import find from 'lodash/find';
6
6
 
7
- import Icon from '../../../../components/Icon/Icon';
7
+ import {Icon} from '../../../../components/Icon';
8
8
  import DataTable from '@gravity-ui/react-data-table';
9
9
  import {DEFAULT_TABLE_SETTINGS} from '../../../../utils/constants';
10
10
  import './SchemaViewer.scss';
@@ -1,5 +1,4 @@
1
- //@ts-ignore
2
- import Icon from '../../components/Icon/Icon';
1
+ import {Icon} from '../../components/Icon';
3
2
 
4
3
  export enum TenantGeneralTabsIds {
5
4
  query = 'query',
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import {Button} from '@gravity-ui/uikit';
3
3
  import cn from 'bem-cn-lite';
4
- //@ts-ignore
5
- import Icon from '../../../components/Icon/Icon';
4
+
5
+ import {Icon} from '../../../components/Icon';
6
6
 
7
7
  import './ToggleButton.scss';
8
8
 
@@ -52,10 +52,20 @@ interface Window {
52
52
  getTenantInfo: (params: {
53
53
  path: string;
54
54
  }) => Promise<import('../types/api/tenant').TTenantInfo>;
55
+ getClusterInfo: () => Promise<import('../types/api/cluster').TClusterInfo>;
55
56
  getTabletsInfo: (params: {
56
57
  nodes?: string[];
57
58
  path?: string;
58
59
  }) => Promise<import('../types/api/tablet').TEvTabletStateResponse>;
60
+ getTabletDescribe: (
61
+ tenantId?: import('../types/api/tablet').TDomainKey,
62
+ ) => Promise<import('../types/api/schema').TEvDescribeSchemeResult>;
63
+ getTablet: (params: {
64
+ id?: string;
65
+ }) => Promise<import('../types/api/tablet').TEvTabletStateResponse>;
66
+ getTabletHistory: (params: {
67
+ id?: string;
68
+ }) => Promise<import('../types/api/tablet').UnmergedTEvTabletStateResponse>;
59
69
  getHeatmapData: (params: {
60
70
  path: string;
61
71
  }) => Promise<import('../types/api/schema').TEvDescribeSchemeResult>;
@@ -66,6 +76,7 @@ interface Window {
66
76
  path?: string;
67
77
  consumer?: string;
68
78
  }) => Promise<import('../types/api/consumer').DescribeConsumerResult>;
79
+ getHostInfo: () => Promise<import('../types/api/systemState').TEvSystemStateResponse>;
69
80
  [method: string]: Function;
70
81
  };
71
82
  }
@@ -247,10 +247,10 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
247
247
  this.getPath(`/tablets/app?TabletID=${hiveId}&page=ResumeTablet&tablet=${id}`),
248
248
  );
249
249
  }
250
- getTabletDescribe(TenantId) {
250
+ getTabletDescribe(tenantId) {
251
251
  return this.get(this.getPath('/viewer/json/describe'), {
252
- schemeshard_id: TenantId.SchemeShard,
253
- path_id: TenantId.PathId,
252
+ schemeshard_id: tenantId?.SchemeShard,
253
+ path_id: tenantId?.PathId,
254
254
  });
255
255
  }
256
256
  postSetting(name, value) {
@@ -20,6 +20,7 @@ import {createRequestActionTypes, createApiRequest} from '../utils';
20
20
  export const FETCH_CONSUMER = createRequestActionTypes('consumer', 'FETCH_CONSUMER');
21
21
 
22
22
  const SET_DATA_WAS_NOT_LOADED = 'consumer/SET_DATA_WAS_NOT_LOADED';
23
+ const SET_SELECTED_CONSUMER = 'consumer/SET_SELECTED_CONSUMER';
23
24
 
24
25
  const initialState = {
25
26
  loading: false,
@@ -66,6 +67,12 @@ const consumer: Reducer<IConsumerState, IConsumerAction> = (state = initialState
66
67
  wasLoaded: false,
67
68
  };
68
69
  }
70
+ case SET_SELECTED_CONSUMER: {
71
+ return {
72
+ ...state,
73
+ selectedConsumer: action.data,
74
+ };
75
+ }
69
76
  default:
70
77
  return state;
71
78
  }
@@ -77,6 +84,13 @@ export const setDataWasNotLoaded = () => {
77
84
  } as const;
78
85
  };
79
86
 
87
+ export const setSelectedConsumer = (value?: string) => {
88
+ return {
89
+ type: SET_SELECTED_CONSUMER,
90
+ data: value,
91
+ } as const;
92
+ };
93
+
80
94
  export function getConsumer(path?: string, consumerName?: string) {
81
95
  return createApiRequest({
82
96
  request: window.api.getConsumer({path, consumer: consumerName}),
@@ -1,11 +1,15 @@
1
- import {createRequestActionTypes, createApiRequest} from '../utils';
1
+ import type {Reducer} from 'redux';
2
+
3
+ import type {IHostAction, IHostState} from '../../types/store/host';
2
4
  import '../../services/api';
3
5
 
4
- const FETCH_HOST = createRequestActionTypes('host', 'FETCH_HOST');
6
+ import {createRequestActionTypes, createApiRequest} from '../utils';
7
+
8
+ export const FETCH_HOST = createRequestActionTypes('host', 'FETCH_HOST');
5
9
 
6
10
  const initialState = {loading: true, wasLoaded: false, data: {}};
7
11
 
8
- const cluster = function (state = initialState, action) {
12
+ const host: Reducer<IHostState, IHostAction> = (state = initialState, action) => {
9
13
  switch (action.type) {
10
14
  case FETCH_HOST.REQUEST: {
11
15
  return {
@@ -16,7 +20,7 @@ const cluster = function (state = initialState, action) {
16
20
  case FETCH_HOST.SUCCESS: {
17
21
  return {
18
22
  ...state,
19
- data: action.data.SystemStateInfo[0],
23
+ data: action.data.SystemStateInfo?.[0],
20
24
  loading: false,
21
25
  wasLoaded: true,
22
26
  error: undefined,
@@ -41,4 +45,4 @@ export function getHostInfo() {
41
45
  });
42
46
  }
43
47
 
44
- export default cluster;
48
+ export default host;
@@ -133,6 +133,10 @@ const shardsWorkload: Reducer<IShardsWorkloadState, IShardsWorkloadAction> = (
133
133
  }
134
134
  // 401 Unauthorized error is handled by GenericAPI
135
135
  case SEND_SHARD_QUERY.FAILURE: {
136
+ if (action.error?.isCancelled) {
137
+ return state;
138
+ }
139
+
136
140
  return {
137
141
  ...state,
138
142
  error: action.error || 'Unauthorized',
@@ -0,0 +1,111 @@
1
+ import type {Reducer} from 'redux';
2
+
3
+ import type {TDomainKey} from '../../types/api/tablet';
4
+ import type {
5
+ ITabletAction,
6
+ ITabletDescribeHandledResponse,
7
+ ITabletHandledResponse,
8
+ ITabletPreparedHistoryItem,
9
+ ITabletState,
10
+ } from '../../types/store/tablet';
11
+ import '../../services/api';
12
+
13
+ import {createRequestActionTypes, createApiRequest} from '../utils';
14
+
15
+ export const FETCH_TABLET = createRequestActionTypes('TABLET', 'FETCH_TABLET');
16
+ export const FETCH_TABLET_DESCRIBE = createRequestActionTypes('TABLET', 'FETCH_TABLET_DESCRIBE');
17
+
18
+ const initialState = {
19
+ loading: false,
20
+ tenantPath: '-',
21
+ };
22
+
23
+ const tablet: Reducer<ITabletState, ITabletAction> = (state = initialState, action) => {
24
+ switch (action.type) {
25
+ case FETCH_TABLET.REQUEST: {
26
+ return {
27
+ ...state,
28
+ loading: true,
29
+ };
30
+ }
31
+ case FETCH_TABLET.SUCCESS: {
32
+ const {tabletData, historyData} = action.data;
33
+ const {TabletId: id} = tabletData;
34
+ return {
35
+ ...state,
36
+ id,
37
+ data: tabletData,
38
+ history: historyData,
39
+ loading: false,
40
+ error: undefined,
41
+ };
42
+ }
43
+ case FETCH_TABLET.FAILURE: {
44
+ return {
45
+ ...state,
46
+ error: action.error,
47
+ loading: false,
48
+ };
49
+ }
50
+ case FETCH_TABLET_DESCRIBE.SUCCESS: {
51
+ const {tenantPath} = action.data;
52
+
53
+ return {
54
+ ...state,
55
+ tenantPath,
56
+ error: undefined,
57
+ };
58
+ }
59
+ default:
60
+ return state;
61
+ }
62
+ };
63
+
64
+ export const getTablet = (id: string) => {
65
+ return createApiRequest({
66
+ request: Promise.all([window.api.getTablet({id}), window.api.getTabletHistory({id})]),
67
+ actions: FETCH_TABLET,
68
+ dataHandler: ([tabletResponseData, historyResponseData]): ITabletHandledResponse => {
69
+ const historyData = Object.keys(historyResponseData).reduce<
70
+ ITabletPreparedHistoryItem[]
71
+ >((list, nodeId) => {
72
+ const tabletInfo = historyResponseData[nodeId]?.TabletStateInfo;
73
+ if (tabletInfo && tabletInfo.length) {
74
+ const leaderTablet = tabletInfo.find((t) => t.Leader) || tabletInfo[0];
75
+
76
+ const {ChangeTime, Generation, State, Leader, FollowerId} = leaderTablet;
77
+
78
+ list.push({
79
+ nodeId,
80
+ generation: Generation,
81
+ changeTime: ChangeTime,
82
+ state: State,
83
+ leader: Leader,
84
+ followerId: FollowerId,
85
+ });
86
+ }
87
+ return list;
88
+ }, []);
89
+
90
+ const {TabletStateInfo = []} = tabletResponseData;
91
+ const [tabletData = {}] = TabletStateInfo;
92
+
93
+ return {tabletData, historyData};
94
+ },
95
+ });
96
+ };
97
+
98
+ export const getTabletDescribe = (tenantId: TDomainKey = {}) => {
99
+ return createApiRequest({
100
+ request: window.api.getTabletDescribe(tenantId),
101
+ actions: FETCH_TABLET_DESCRIBE,
102
+ dataHandler: (tabletDescribe): ITabletDescribeHandledResponse => {
103
+ const {SchemeShard, PathId} = tenantId;
104
+ const tenantPath = tabletDescribe.Path || `${SchemeShard}:${PathId}`;
105
+
106
+ return {tenantPath};
107
+ },
108
+ });
109
+ };
110
+
111
+ export default tablet;
@@ -67,6 +67,9 @@ const paramSetup = {
67
67
  stateKey: 'executeTopQueries.filters.to',
68
68
  type: 'number',
69
69
  },
70
+ selectedConsumer: {
71
+ stateKey: 'consumer.selectedConsumer',
72
+ },
70
73
  },
71
74
  };
72
75
 
@@ -0,0 +1,34 @@
1
+ import type {EFlag} from './enums';
2
+ import type {TTabletStateInfo} from './tablet';
3
+
4
+ /**
5
+ * endpoint: viewer/json/cluster
6
+ *
7
+ * source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
8
+ */
9
+ export interface TClusterInfo {
10
+ Name?: string;
11
+ Overall?: EFlag;
12
+ NodesTotal?: number;
13
+ NodesAlive?: number;
14
+ NumberOfCpus?: number;
15
+ /** double */
16
+ LoadAverage?: number;
17
+ /** uint64 */
18
+ MemoryTotal?: string;
19
+ /** uint64 */
20
+ MemoryUsed?: string;
21
+ /** uint64 */
22
+ StorageTotal?: string;
23
+ /** uint64 */
24
+ StorageUsed?: string;
25
+ DataCenters?: string[];
26
+ Versions?: string[];
27
+ SystemTablets?: TTabletStateInfo[];
28
+ /** uint64 */
29
+ Hosts?: string;
30
+ /** uint64 */
31
+ Tenants?: string;
32
+ /** uint64 */
33
+ Tablets?: string;
34
+ }
@@ -0,0 +1,13 @@
1
+ import {TSystemStateInfo} from './nodes';
2
+
3
+ /**
4
+ * endpoint: /viewer/json/sysinfo
5
+ *
6
+ * source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/node_whiteboard.proto
7
+ */
8
+ export interface TEvSystemStateResponse {
9
+ SystemStateInfo?: TSystemStateInfo[];
10
+ /** uint64 */
11
+ ResponseTime?: string;
12
+ ResponseDuration?: number;
13
+ }
@@ -1,8 +1,10 @@
1
1
  import {EFlag} from './enums';
2
2
 
3
- // endpoint: /viewer/json/tabletinfo
4
- // source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/sys_view.proto
5
-
3
+ /**
4
+ * endpoint: /viewer/json/tabletinfo
5
+ *
6
+ * source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/sys_view.proto
7
+ */
6
8
  export interface TEvTabletStateResponse {
7
9
  TabletStateInfo?: TTabletStateInfo[];
8
10
 
@@ -16,6 +18,12 @@ export interface TEvTabletStateResponse {
16
18
  Packed5?: unknown;
17
19
  }
18
20
 
21
+ /**
22
+ * endpoint: /viewer/json/tabletinfo with merge=false in query.
23
+ * Maps nodes to their tablets
24
+ */
25
+ export type UnmergedTEvTabletStateResponse = Record<string, TEvTabletStateResponse>;
26
+
19
27
  export interface TTabletStateInfo {
20
28
  /** uint64 */
21
29
  TabletId?: string;
@@ -46,7 +54,7 @@ interface TCustomTabletAttribute {
46
54
  Value?: string;
47
55
  }
48
56
 
49
- interface TDomainKey {
57
+ export interface TDomainKey {
50
58
  /** fixed64 */
51
59
  SchemeShard?: string;
52
60
  /** fixed64 */
@@ -1,7 +1,11 @@
1
1
  import type {IProcessSpeedStats} from '../../utils/bytesParsers';
2
2
  import type {ApiRequestAction} from '../../store/utils';
3
3
 
4
- import {FETCH_CONSUMER, setDataWasNotLoaded} from '../../store/reducers/consumer';
4
+ import {
5
+ FETCH_CONSUMER,
6
+ setDataWasNotLoaded,
7
+ setSelectedConsumer,
8
+ } from '../../store/reducers/consumer';
5
9
 
6
10
  import type {DescribeConsumerResult} from '../api/consumer';
7
11
  import type {IResponseError} from '../api/error';
@@ -38,6 +42,7 @@ export interface IPreparedPartitionData {
38
42
  export interface IConsumerState {
39
43
  loading: boolean;
40
44
  wasLoaded: boolean;
45
+ selectedConsumer?: string;
41
46
  data?: DescribeConsumerResult;
42
47
  error?: IResponseError;
43
48
  }
@@ -48,7 +53,10 @@ type IConsumerApiRequestAction = ApiRequestAction<
48
53
  IResponseError
49
54
  >;
50
55
 
51
- export type IConsumerAction = IConsumerApiRequestAction | ReturnType<typeof setDataWasNotLoaded>;
56
+ export type IConsumerAction =
57
+ | IConsumerApiRequestAction
58
+ | ReturnType<typeof setDataWasNotLoaded>
59
+ | ReturnType<typeof setSelectedConsumer>;
52
60
 
53
61
  export interface IConsumerRootStateSlice {
54
62
  consumer: IConsumerState;
@@ -0,0 +1,23 @@
1
+ import {FETCH_HOST} from '../../store/reducers/host';
2
+
3
+ import type {ApiRequestAction} from '../../store/utils';
4
+ import type {IResponseError} from '../api/error';
5
+ import type {TSystemStateInfo} from '../api/nodes';
6
+ import type {TEvSystemStateResponse} from '../api/systemState';
7
+
8
+ export interface IHostState {
9
+ loading: boolean;
10
+ wasLoaded: boolean;
11
+ data?: TSystemStateInfo;
12
+ error?: IResponseError;
13
+ }
14
+
15
+ export type IHostAction = ApiRequestAction<
16
+ typeof FETCH_HOST,
17
+ TEvSystemStateResponse,
18
+ IResponseError
19
+ >;
20
+
21
+ export interface IHostRootStateSlice {
22
+ host: IHostState;
23
+ }
@@ -0,0 +1,50 @@
1
+ import type {IResponseError} from '../api/error';
2
+ import type {ETabletState, TTabletStateInfo} from '../api/tablet';
3
+
4
+ import {FETCH_TABLET, FETCH_TABLET_DESCRIBE} from '../../store/reducers/tablet';
5
+ import {ApiRequestAction} from '../../store/utils';
6
+
7
+ export interface ITabletPreparedHistoryItem {
8
+ nodeId: string;
9
+ generation: number | undefined;
10
+ changeTime: string | undefined;
11
+ state: ETabletState | undefined;
12
+ leader: boolean | undefined;
13
+ followerId: number | undefined;
14
+ }
15
+
16
+ export interface ITabletState {
17
+ loading: boolean;
18
+ tenantPath: string;
19
+ error?: IResponseError;
20
+ id?: string;
21
+ history?: ITabletPreparedHistoryItem[];
22
+ data?: TTabletStateInfo;
23
+ }
24
+
25
+ export interface ITabletHandledResponse {
26
+ tabletData: TTabletStateInfo;
27
+ historyData: ITabletPreparedHistoryItem[];
28
+ }
29
+
30
+ export interface ITabletDescribeHandledResponse {
31
+ tenantPath: string;
32
+ }
33
+
34
+ type ITabletApiRequestAction = ApiRequestAction<
35
+ typeof FETCH_TABLET,
36
+ ITabletHandledResponse,
37
+ IResponseError
38
+ >;
39
+
40
+ type ITabletDescribeApiRequestAction = ApiRequestAction<
41
+ typeof FETCH_TABLET_DESCRIBE,
42
+ ITabletDescribeHandledResponse,
43
+ IResponseError
44
+ >;
45
+
46
+ export type ITabletAction = ITabletApiRequestAction | ITabletDescribeApiRequestAction;
47
+
48
+ export interface ITabletRootStateSlice {
49
+ tablet: ITabletState;
50
+ }
@@ -18,7 +18,9 @@ export interface ITooltipState {
18
18
  additionalData?: any;
19
19
  }
20
20
 
21
- export type ITooltipAction = ReturnType<typeof hideTooltip> | ReturnType<typeof showTooltip>;
21
+ export type ShowTooltipFunction = typeof showTooltip;
22
+
23
+ export type ITooltipAction = ReturnType<typeof hideTooltip> | ReturnType<ShowTooltipFunction>;
22
24
 
23
25
  export interface ITooltipRootStateSlice {
24
26
  tooltip: ITooltipState;