ydb-embedded-ui 6.3.0 → 6.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. package/README.md +39 -17
  2. package/dist/assets/icons/disableFullscreen.svg +4 -0
  3. package/dist/assets/icons/emptyState.svg +13 -0
  4. package/dist/assets/icons/key.svg +6 -0
  5. package/dist/assets/icons/monitoring.svg +9 -0
  6. package/dist/assets/icons/network.svg +21 -0
  7. package/dist/components/AsyncReplicationState/AsyncReplicationState.d.ts +6 -0
  8. package/dist/components/AsyncReplicationState/AsyncReplicationState.js +20 -0
  9. package/dist/components/AsyncReplicationState/index.d.ts +1 -0
  10. package/dist/components/AsyncReplicationState/index.js +1 -0
  11. package/dist/components/BasicNodeViewer/BasicNodeViewer.js +11 -5
  12. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +6 -2
  13. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +12 -3
  14. package/dist/components/CriticalActionDialog/CriticalActionDialog.js +3 -4
  15. package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +2 -0
  16. package/dist/components/EmptyState/EmptyState.js +3 -2
  17. package/dist/components/EnableFullscreenButton/EnableFullscreenButton.js +3 -3
  18. package/dist/components/Errors/ResponseError/ResponseError.js +3 -0
  19. package/dist/components/Fullscreen/Fullscreen.js +3 -3
  20. package/dist/components/MonitoringButton/MonitoringButton.js +3 -3
  21. package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -3
  22. package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
  23. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.d.ts +1 -2
  24. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +6 -6
  25. package/dist/components/StatusIcon/StatusIcon.js +5 -7
  26. package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
  27. package/dist/containers/App/App.js +1 -2
  28. package/dist/containers/AsideNavigation/AsideNavigation.js +4 -9
  29. package/dist/containers/AsideNavigation/YdbInternalUser/YdbInternalUser.js +2 -3
  30. package/dist/containers/AsideNavigation/useNavigationMenuItems.js +5 -6
  31. package/dist/containers/Authentication/Authentication.js +2 -4
  32. package/dist/containers/Clusters/Clusters.js +7 -2
  33. package/dist/containers/Clusters/constants.d.ts +1 -3
  34. package/dist/containers/Clusters/constants.js +0 -18
  35. package/dist/containers/Node/NodeStructure/Pdisk.js +4 -4
  36. package/dist/containers/Nodes/Nodes.js +19 -15
  37. package/dist/containers/Nodes/VirtualNodes.js +23 -6
  38. package/dist/containers/PDiskPage/PDiskPage.js +3 -2
  39. package/dist/containers/PDiskPage/i18n/en.json +2 -1
  40. package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
  41. package/dist/containers/Storage/Storage.js +50 -22
  42. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +2 -2
  43. package/dist/containers/Storage/VirtualStorage.js +32 -10
  44. package/dist/containers/Storage/utils/index.d.ts +4 -1
  45. package/dist/containers/Storage/utils/index.js +29 -0
  46. package/dist/containers/Tablet/Tablet.js +3 -3
  47. package/dist/containers/Tablet/TabletControls/TabletControls.js +3 -1
  48. package/dist/containers/Tablet/i18n/en.json +3 -0
  49. package/dist/containers/Tablet/i18n/index.d.ts +1 -1
  50. package/dist/containers/Tablet/i18n/index.js +1 -2
  51. package/dist/containers/Tablets/Tablets.d.ts +1 -2
  52. package/dist/containers/Tablets/Tablets.js +113 -53
  53. package/dist/containers/Tablets/i18n/en.json +10 -4
  54. package/dist/containers/Tablets/i18n/index.d.ts +1 -1
  55. package/dist/containers/Tablets/i18n/index.js +1 -2
  56. package/dist/containers/Tenant/Diagnostics/Diagnostics.js +5 -5
  57. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +7 -0
  58. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -0
  59. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +31 -19
  60. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +14 -4
  61. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/en.json +2 -1
  62. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.d.ts +1 -1
  63. package/dist/containers/Tenant/Diagnostics/Network/Network.js +3 -3
  64. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.d.ts +7 -0
  65. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +39 -0
  66. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.d.ts +6 -0
  67. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.js +14 -0
  68. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/en.json +7 -0
  69. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.d.ts +2 -0
  70. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.js +4 -0
  71. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.d.ts +1 -0
  72. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.js +1 -0
  73. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.d.ts +7 -0
  74. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.js +34 -0
  75. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.scss +7 -0
  76. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/en.json +7 -0
  77. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.d.ts +2 -0
  78. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.js +4 -0
  79. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.d.ts +1 -0
  80. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.js +1 -0
  81. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +2 -0
  82. package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +2 -2
  83. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +2 -1
  84. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -1
  85. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +2 -1
  86. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
  87. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +3 -3
  88. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
  89. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.js +2 -8
  90. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +23 -9
  91. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
  92. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +5 -6
  93. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +6 -14
  94. package/dist/containers/Tenant/Query/Issues/Issues.js +6 -9
  95. package/dist/containers/Tenant/Query/Preview/Preview.js +5 -5
  96. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +2 -8
  97. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +18 -19
  98. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +4 -4
  99. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.js +3 -3
  100. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.js +3 -2
  101. package/dist/containers/Tenant/Tenant.js +3 -2
  102. package/dist/containers/Tenant/utils/ToggleButton.scss +0 -2
  103. package/dist/containers/Tenant/utils/paneVisibilityToggleHelpers.js +4 -4
  104. package/dist/containers/Tenant/utils/schema.js +8 -0
  105. package/dist/containers/Tenant/utils/schemaActions.js +1 -0
  106. package/dist/containers/Tenant/utils/schemaControls.js +4 -3
  107. package/dist/containers/VDiskPage/VDiskPage.js +3 -2
  108. package/dist/containers/VDiskPage/i18n/en.json +2 -1
  109. package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
  110. package/dist/routes.d.ts +1 -1
  111. package/dist/services/api.d.ts +3 -3
  112. package/dist/services/settings.d.ts +19 -1
  113. package/dist/services/settings.js +2 -1
  114. package/dist/store/configureStore.d.ts +0 -12
  115. package/dist/store/defaultStore.d.ts +0 -6
  116. package/dist/store/reducers/authentication/authentication.d.ts +187 -13
  117. package/dist/store/reducers/authentication/authentication.js +12 -3
  118. package/dist/store/reducers/authentication/types.d.ts +5 -1
  119. package/dist/store/reducers/cluster/cluster.js +4 -0
  120. package/dist/store/reducers/executeQuery.d.ts +4 -65
  121. package/dist/store/reducers/executeQuery.js +38 -34
  122. package/dist/store/reducers/executeTopQueries/executeTopQueries.js +4 -1
  123. package/dist/store/reducers/explainQuery/explainQuery.d.ts +9 -0
  124. package/dist/store/reducers/explainQuery/explainQuery.js +32 -0
  125. package/dist/store/reducers/explainQuery/types.d.ts +12 -0
  126. package/dist/store/reducers/explainQuery/utils.d.ts +6 -0
  127. package/dist/store/reducers/explainQuery/utils.js +40 -0
  128. package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +0 -60
  129. package/dist/store/reducers/host.d.ts +61 -4
  130. package/dist/store/reducers/index.d.ts +0 -9
  131. package/dist/store/reducers/index.js +0 -6
  132. package/dist/store/reducers/node/selectors.d.ts +0 -3
  133. package/dist/store/reducers/nodes/nodes.d.ts +1 -5
  134. package/dist/store/reducers/nodes/nodes.js +0 -27
  135. package/dist/store/reducers/nodes/types.d.ts +4 -13
  136. package/dist/store/reducers/nodesList.d.ts +0 -3
  137. package/dist/store/reducers/olapStats.js +4 -1
  138. package/dist/store/reducers/preview.js +4 -1
  139. package/dist/store/reducers/schema/schema.d.ts +61 -4
  140. package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +61 -4
  141. package/dist/store/reducers/shardsWorkload/shardsWorkload.js +4 -1
  142. package/dist/store/reducers/storage/selectors.d.ts +2 -17
  143. package/dist/store/reducers/storage/selectors.js +1 -36
  144. package/dist/store/reducers/storage/storage.d.ts +2 -6
  145. package/dist/store/reducers/storage/storage.js +0 -44
  146. package/dist/store/reducers/storage/types.d.ts +15 -22
  147. package/dist/store/reducers/storage/types.js +4 -1
  148. package/dist/store/reducers/tablets.d.ts +91 -1
  149. package/dist/store/reducers/tablets.js +16 -1
  150. package/dist/store/reducers/tabletsFilters.d.ts +61 -4
  151. package/dist/store/reducers/tenant/tenant.d.ts +2 -2
  152. package/dist/store/reducers/tenant/tenant.js +10 -1
  153. package/dist/store/reducers/tenant/types.d.ts +8 -3
  154. package/dist/store/reducers/tenant/types.js +3 -1
  155. package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +6 -3
  156. package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +6 -3
  157. package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +6 -3
  158. package/dist/store/reducers/tenants/selectors.d.ts +0 -27
  159. package/dist/store/reducers/tenants/utils.d.ts +4 -4
  160. package/dist/store/reducers/tenants/utils.js +8 -8
  161. package/dist/store/reducers/topic.d.ts +0 -45
  162. package/dist/store/state-url-mapping.js +0 -22
  163. package/dist/store/utils.d.ts +2 -3
  164. package/dist/store/utils.js +1 -1
  165. package/dist/types/api/schema/replication.d.ts +74 -0
  166. package/dist/types/api/schema/replication.js +7 -0
  167. package/dist/types/api/schema/schema.d.ts +4 -1
  168. package/dist/types/api/schema/schema.js +1 -0
  169. package/dist/types/api/whoami.d.ts +6 -0
  170. package/dist/types/store/executeQuery.d.ts +2 -9
  171. package/dist/utils/constants.d.ts +1 -0
  172. package/dist/utils/constants.js +1 -0
  173. package/dist/utils/monaco/yql/constants.d.ts +2 -0
  174. package/dist/utils/monaco/yql/constants.js +33 -0
  175. package/dist/utils/monaco/yql/generateSuggestions.d.ts +1 -0
  176. package/dist/utils/monaco/yql/generateSuggestions.js +28 -11
  177. package/dist/utils/monaco/yql/yqlSuggestions.js +6 -1
  178. package/dist/utils/nodes.d.ts +2 -0
  179. package/dist/utils/nodes.js +4 -0
  180. package/dist/utils/query.d.ts +5 -3
  181. package/dist/utils/query.js +27 -4
  182. package/dist/utils/response.d.ts +4 -0
  183. package/dist/utils/response.js +9 -0
  184. package/dist/utils/tablet.d.ts +2 -0
  185. package/dist/utils/tablet.js +14 -0
  186. package/package.json +4 -3
  187. package/dist/assets/icons/bug.svg +0 -1
  188. package/dist/assets/icons/circle-exclamation.svg +0 -1
  189. package/dist/assets/icons/circle-info.svg +0 -1
  190. package/dist/assets/icons/circle-xmark.svg +0 -1
  191. package/dist/assets/icons/close.svg +0 -1
  192. package/dist/assets/icons/control-menu-button.svg +0 -1
  193. package/dist/assets/icons/dots.svg +0 -1
  194. package/dist/assets/icons/hide.svg +0 -1
  195. package/dist/assets/icons/question.svg +0 -1
  196. package/dist/assets/icons/server.svg +0 -1
  197. package/dist/assets/icons/settings-with-dot.svg +0 -1
  198. package/dist/assets/icons/settings.svg +0 -1
  199. package/dist/assets/icons/shield.svg +0 -3
  200. package/dist/assets/icons/show.svg +0 -1
  201. package/dist/assets/icons/signIn.svg +0 -1
  202. package/dist/assets/icons/signOut.svg +0 -1
  203. package/dist/assets/icons/storage.svg +0 -1
  204. package/dist/assets/icons/support.svg +0 -1
  205. package/dist/assets/icons/triangle-exclamation.svg +0 -1
  206. package/dist/assets/icons/update-arrow.svg +0 -6
  207. package/dist/components/Icon/Icon.d.ts +0 -14
  208. package/dist/components/Icon/Icon.js +0 -16
  209. package/dist/components/Icon/index.d.ts +0 -1
  210. package/dist/components/Icon/index.js +0 -1
  211. package/dist/containers/AppIcons/AppIcons.d.ts +0 -2
  212. package/dist/containers/AppIcons/AppIcons.js +0 -9
  213. package/dist/containers/Tablet/i18n/ru.json +0 -10
  214. package/dist/containers/Tablets/Tablets.scss +0 -35
  215. package/dist/containers/Tablets/i18n/ru.json +0 -6
  216. package/dist/store/reducers/explainQuery.d.ts +0 -149
  217. package/dist/store/reducers/explainQuery.js +0 -94
  218. package/dist/types/store/explainQuery.d.ts +0 -27
  219. package/dist/utils/error.d.ts +0 -2
  220. package/dist/utils/error.js +0 -13
  221. /package/dist/{types/store/explainQuery.js → store/reducers/explainQuery/types.js} +0 -0
@@ -3,7 +3,7 @@ import type { EVersion, TTabletStateInfo as TComputeTabletStateInfo } from '../.
3
3
  import type { EFlag } from '../../../types/api/enums';
4
4
  import type { TEndpoint, TPoolStats } from '../../../types/api/nodes';
5
5
  import type { TTabletStateInfo as TFullTabletStateInfo } from '../../../types/api/tablet';
6
- import type { NodesSortValue, NodesUptimeFilterValues } from '../../../utils/nodes';
6
+ import type { NodesSortValue } from '../../../utils/nodes';
7
7
  import type { VisibleEntities } from '../storage/types';
8
8
  export interface NodesPreparedEntity {
9
9
  NodeId: number;
@@ -27,18 +27,12 @@ export interface NodesPreparedEntity {
27
27
  Endpoints?: TEndpoint[];
28
28
  TotalSessions?: number;
29
29
  }
30
- export interface NodesState {
31
- uptimeFilter: NodesUptimeFilterValues;
32
- searchValue: string;
33
- sortValue?: NodesSortValue;
34
- sortOrder?: OrderType;
35
- }
36
30
  export type NodeType = 'static' | 'dynamic' | 'any';
37
31
  export interface NodesSortParams {
38
- sortOrder?: OrderType;
39
- sortValue?: NodesSortValue;
32
+ sortOrder: OrderType | undefined;
33
+ sortValue: NodesSortValue | undefined;
40
34
  }
41
- export interface NodesGeneralRequestParams extends NodesSortParams {
35
+ export interface NodesGeneralRequestParams extends Partial<NodesSortParams> {
42
36
  filter?: string;
43
37
  uptime?: number;
44
38
  problems_only?: boolean;
@@ -63,6 +57,3 @@ export interface NodesHandledResponse {
63
57
  TotalNodes: number;
64
58
  FoundNodes?: number;
65
59
  }
66
- export interface NodesStateSlice {
67
- nodes: NodesState;
68
- }
@@ -5,10 +5,8 @@ export declare const nodesListApi: import("@reduxjs/toolkit/query").Api<import("
5
5
  export declare const selectNodesMap: ((state: {
6
6
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
7
7
  singleClusterMode: boolean;
8
- nodes: import("./nodes/types").NodesState;
9
8
  cluster: import("./cluster/types").ClusterState;
10
9
  tenant: import("./tenant/types").TenantState;
11
- storage: import("./storage/types").StorageState;
12
10
  tooltip: import("../../types/store/tooltip").ITooltipState;
13
11
  tablets: import("../../types/store/tablets").TabletsState;
14
12
  schema: import("./schema/types").SchemaState;
@@ -16,7 +14,6 @@ export declare const selectNodesMap: ((state: {
16
14
  tenants: import("./tenants/types").TenantsState;
17
15
  partitions: import("./partitions/types").PartitionsState;
18
16
  executeQuery: import("../../types/store/executeQuery").ExecuteQueryState;
19
- explainQuery: import("../../types/store/explainQuery").ExplainQueryState;
20
17
  tabletsFilters: {
21
18
  loading: boolean;
22
19
  requestTime: number;
@@ -1,4 +1,4 @@
1
- import { parseQueryAPIExecuteResponse } from '../../utils/query';
1
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../utils/query';
2
2
  import { api } from './api';
3
3
  function createOlatStatsQuery(path) {
4
4
  return `SELECT * FROM \`${path}/.sys/primary_index_stats\``;
@@ -15,6 +15,9 @@ export const olapApi = api.injectEndpoints({
15
15
  database: path,
16
16
  action: queryAction,
17
17
  }, { signal });
18
+ if (isQueryErrorResponse(response)) {
19
+ return { error: response };
20
+ }
18
21
  return { data: parseQueryAPIExecuteResponse(response) };
19
22
  }
20
23
  catch (error) {
@@ -1,4 +1,4 @@
1
- import { parseQueryAPIExecuteResponse } from '../../utils/query';
1
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../utils/query';
2
2
  import { api } from './api';
3
3
  export const previewApi = api.injectEndpoints({
4
4
  endpoints: (build) => ({
@@ -6,6 +6,9 @@ export const previewApi = api.injectEndpoints({
6
6
  queryFn: async ({ query, database, action }, { signal }) => {
7
7
  try {
8
8
  const response = await window.api.sendQuery({ schema: 'modern', query, database, action }, { signal });
9
+ if (isQueryErrorResponse(response)) {
10
+ return { error: response };
11
+ }
9
12
  return { data: parseQueryAPIExecuteResponse(response) };
10
13
  }
11
14
  catch (error) {
@@ -18,13 +18,71 @@ export declare const initialState: {
18
18
  declare const schema: Reducer<SchemaState, SchemaAction>;
19
19
  export declare function getSchema({ path }: {
20
20
  path: string;
21
- }): (dispatch: Dispatch<import("redux").UnknownAction>, getState: () => {
21
+ }): (dispatch: import("redux-thunk").ThunkDispatch<{
22
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
23
+ singleClusterMode: boolean;
24
+ cluster: import("../cluster/types").ClusterState;
25
+ tenant: import("../tenant/types").TenantState;
26
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
27
+ tablets: import("../../../types/store/tablets").TabletsState;
28
+ schema: SchemaState;
29
+ host: import("../../../types/store/host").IHostState;
30
+ tenants: import("../tenants/types").TenantsState;
31
+ partitions: import("../partitions/types").PartitionsState;
32
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
33
+ tabletsFilters: {
34
+ loading: boolean;
35
+ requestTime: number;
36
+ data: undefined;
37
+ wasLoaded: boolean;
38
+ stateFilter: never[];
39
+ typeFilter: never[];
40
+ } | {
41
+ tabletsData: any;
42
+ nodes: any;
43
+ loading: boolean;
44
+ wasLoaded: boolean;
45
+ timeoutForRequest: number;
46
+ error: undefined;
47
+ data: undefined;
48
+ stateFilter: never[];
49
+ typeFilter: never[];
50
+ } | {
51
+ error: any;
52
+ loading: boolean;
53
+ data: undefined;
54
+ wasLoaded: boolean;
55
+ stateFilter: never[];
56
+ typeFilter: never[];
57
+ } | {
58
+ stateFilter: any;
59
+ data: undefined;
60
+ loading: boolean;
61
+ wasLoaded: boolean;
62
+ typeFilter: never[];
63
+ } | {
64
+ typeFilter: any;
65
+ data: undefined;
66
+ loading: boolean;
67
+ wasLoaded: boolean;
68
+ stateFilter: never[];
69
+ };
70
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
71
+ settings: import("../settings/types").SettingsState;
72
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
73
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
74
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
75
+ hotKeys: import("../hotKeys/types").HotKeysState;
76
+ authentication: import("../authentication/types").AuthenticationState;
77
+ header: import("../header/types").HeaderState;
78
+ saveQuery: string | null;
79
+ fullscreen: boolean;
80
+ clusters: import("../clusters/types").ClustersFilters;
81
+ }, undefined, import("redux").UnknownAction> & Dispatch<any>, getState: () => {
22
82
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
23
83
  singleClusterMode: boolean;
24
- nodes: import("../nodes/types").NodesState;
25
84
  cluster: import("../cluster/types").ClusterState;
26
85
  tenant: import("../tenant/types").TenantState;
27
- storage: import("../storage/types").StorageState;
28
86
  tooltip: import("../../../types/store/tooltip").ITooltipState;
29
87
  tablets: import("../../../types/store/tablets").TabletsState;
30
88
  schema: SchemaState;
@@ -32,7 +90,6 @@ export declare function getSchema({ path }: {
32
90
  tenants: import("../tenants/types").TenantsState;
33
91
  partitions: import("../partitions/types").PartitionsState;
34
92
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
35
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
36
93
  tabletsFilters: {
37
94
  loading: boolean;
38
95
  requestTime: number;
@@ -8,13 +8,71 @@ export declare const FETCH_SCHEMA_ACL: {
8
8
  declare const schemaAcl: Reducer<SchemaAclState, SchemaAclAction>;
9
9
  export declare function getSchemaAcl({ path }: {
10
10
  path: string;
11
- }): (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
11
+ }): (dispatch: import("redux-thunk").ThunkDispatch<{
12
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
13
+ singleClusterMode: boolean;
14
+ cluster: import("../cluster/types").ClusterState;
15
+ tenant: import("../tenant/types").TenantState;
16
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
17
+ tablets: import("../../../types/store/tablets").TabletsState;
18
+ schema: import("../schema/types").SchemaState;
19
+ host: import("../../../types/store/host").IHostState;
20
+ tenants: import("../tenants/types").TenantsState;
21
+ partitions: import("../partitions/types").PartitionsState;
22
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
23
+ tabletsFilters: {
24
+ loading: boolean;
25
+ requestTime: number;
26
+ data: undefined;
27
+ wasLoaded: boolean;
28
+ stateFilter: never[];
29
+ typeFilter: never[];
30
+ } | {
31
+ tabletsData: any;
32
+ nodes: any;
33
+ loading: boolean;
34
+ wasLoaded: boolean;
35
+ timeoutForRequest: number;
36
+ error: undefined;
37
+ data: undefined;
38
+ stateFilter: never[];
39
+ typeFilter: never[];
40
+ } | {
41
+ error: any;
42
+ loading: boolean;
43
+ data: undefined;
44
+ wasLoaded: boolean;
45
+ stateFilter: never[];
46
+ typeFilter: never[];
47
+ } | {
48
+ stateFilter: any;
49
+ data: undefined;
50
+ loading: boolean;
51
+ wasLoaded: boolean;
52
+ typeFilter: never[];
53
+ } | {
54
+ typeFilter: any;
55
+ data: undefined;
56
+ loading: boolean;
57
+ wasLoaded: boolean;
58
+ stateFilter: never[];
59
+ };
60
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
61
+ settings: import("../settings/types").SettingsState;
62
+ schemaAcl: SchemaAclState;
63
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
64
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
65
+ hotKeys: import("../hotKeys/types").HotKeysState;
66
+ authentication: import("../authentication/types").AuthenticationState;
67
+ header: import("../header/types").HeaderState;
68
+ saveQuery: string | null;
69
+ fullscreen: boolean;
70
+ clusters: import("../clusters/types").ClustersFilters;
71
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
12
72
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
13
73
  singleClusterMode: boolean;
14
- nodes: import("../nodes/types").NodesState;
15
74
  cluster: import("../cluster/types").ClusterState;
16
75
  tenant: import("../tenant/types").TenantState;
17
- storage: import("../storage/types").StorageState;
18
76
  tooltip: import("../../../types/store/tooltip").ITooltipState;
19
77
  tablets: import("../../../types/store/tablets").TabletsState;
20
78
  schema: import("../schema/types").SchemaState;
@@ -22,7 +80,6 @@ export declare function getSchemaAcl({ path }: {
22
80
  tenants: import("../tenants/types").TenantsState;
23
81
  partitions: import("../partitions/types").PartitionsState;
24
82
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
25
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
26
83
  tabletsFilters: {
27
84
  loading: boolean;
28
85
  requestTime: number;
@@ -1,5 +1,5 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
- import { parseQueryAPIExecuteResponse } from '../../../utils/query';
2
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../../utils/query';
3
3
  import { api } from '../api';
4
4
  import { EShardsWorkloadMode } from './types';
5
5
  const initialState = {};
@@ -92,6 +92,9 @@ export const shardApi = api.injectEndpoints({
92
92
  }, {
93
93
  signal,
94
94
  });
95
+ if (isQueryErrorResponse(response)) {
96
+ return { error: response };
97
+ }
95
98
  const data = parseQueryAPIExecuteResponse(response);
96
99
  return { data };
97
100
  }
@@ -1,20 +1,5 @@
1
- import type { OrderType } from '@gravity-ui/react-data-table';
2
- import type { NodesSortValue, NodesUptimeFilterValues } from '../../../utils/nodes';
3
- import type { StorageSortValue } from '../../../utils/storage';
4
- import type { PreparedStorageGroup, PreparedStorageNode, StorageStateSlice, UsageFilter } from './types';
1
+ import type { NodesUptimeFilterValues } from '../../../utils/nodes';
2
+ import type { PreparedStorageGroup, PreparedStorageNode, UsageFilter } from './types';
5
3
  export declare function filterNodes(storageNodes: PreparedStorageNode[], textFilter: string, uptimeFilter: NodesUptimeFilterValues): PreparedStorageNode[];
6
4
  export declare function filterGroups(storageGroups: PreparedStorageGroup[], textFilter: string, usageFilter: string[]): PreparedStorageGroup[];
7
- export declare const selectStorageFilter: (state: StorageStateSlice) => string;
8
- export declare const selectUsageFilter: (state: StorageStateSlice) => string[];
9
- export declare const selectVisibleEntities: (state: StorageStateSlice) => import("./types").VisibleEntities;
10
- export declare const selectNodesUptimeFilter: (state: StorageStateSlice) => NodesUptimeFilterValues;
11
- export declare const selectStorageType: (state: StorageStateSlice) => import("./types").StorageType;
12
- export declare const selectNodesSortParams: (state: StorageStateSlice) => {
13
- sortValue: NodesSortValue;
14
- sortOrder: OrderType;
15
- };
16
- export declare const selectGroupsSortParams: (state: StorageStateSlice) => {
17
- sortValue: StorageSortValue;
18
- sortOrder: OrderType;
19
- };
20
5
  export declare function getUsageFilterOptions(groups: PreparedStorageGroup[]): UsageFilter[];
@@ -1,8 +1,5 @@
1
- import { ASCENDING, DESCENDING } from '@gravity-ui/react-data-table/build/esm/lib/constants';
2
- import { NODES_SORT_VALUES } from '../../../utils/nodes';
3
- import { STORAGE_SORT_VALUES, getUsage } from '../../../utils/storage';
1
+ import { getUsage } from '../../../utils/storage';
4
2
  import { filterNodesByUptime } from '../nodes/selectors';
5
- import { VISIBLE_ENTITIES } from './constants';
6
3
  // ==== Filters ====
7
4
  const prepareSearchText = (text) => text.trim().toLowerCase();
8
5
  const filterNodesByText = (entities, text) => {
@@ -48,38 +45,6 @@ export function filterGroups(storageGroups, textFilter, usageFilter) {
48
45
  result = filterGroupsByUsage(result, usageFilter);
49
46
  return result;
50
47
  }
51
- // ==== Simple selectors ====
52
- export const selectStorageFilter = (state) => state.storage.filter;
53
- export const selectUsageFilter = (state) => state.storage.usageFilter;
54
- export const selectVisibleEntities = (state) => state.storage.visible;
55
- export const selectNodesUptimeFilter = (state) => state.storage.uptimeFilter;
56
- export const selectStorageType = (state) => state.storage.type;
57
- // ==== Sort params selectors ====
58
- export const selectNodesSortParams = (state) => {
59
- const defaultSortValue = NODES_SORT_VALUES.NodeId;
60
- const defaultSortOrder = ASCENDING;
61
- return {
62
- sortValue: state.storage.nodesSortValue || defaultSortValue,
63
- sortOrder: state.storage.nodesSortOrder || defaultSortOrder,
64
- };
65
- };
66
- export const selectGroupsSortParams = (state) => {
67
- const visibleEntities = state.storage.visible;
68
- let defaultSortValue = STORAGE_SORT_VALUES.PoolName;
69
- let defaultSortOrder = ASCENDING;
70
- if (visibleEntities === VISIBLE_ENTITIES.missing) {
71
- defaultSortValue = STORAGE_SORT_VALUES.Degraded;
72
- defaultSortOrder = DESCENDING;
73
- }
74
- if (visibleEntities === VISIBLE_ENTITIES.space) {
75
- defaultSortValue = STORAGE_SORT_VALUES.Usage;
76
- defaultSortOrder = DESCENDING;
77
- }
78
- return {
79
- sortValue: state.storage.groupsSortValue || defaultSortValue,
80
- sortOrder: state.storage.groupsSortOrder || defaultSortOrder,
81
- };
82
- };
83
48
  // ==== Complex selectors ====
84
49
  export function getUsageFilterOptions(groups) {
85
50
  const items = {};
@@ -1,9 +1,5 @@
1
- import { NodesUptimeFilterValues } from '../../../utils/nodes';
2
- import type { NodesApiRequestParams, NodesSortParams } from '../nodes/types';
3
- import type { StorageApiRequestParams, StorageSortParams, StorageState, StorageType, VisibleEntities } from './types';
4
- declare const _default: import("redux").Reducer<StorageState>;
5
- export default _default;
6
- export declare const setInitialState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"storage/setInitialState">, setStorageTextFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "storage/setStorageTextFilter">, setUsageFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "storage/setUsageFilter">, setVisibleEntities: import("@reduxjs/toolkit").ActionCreatorWithPayload<VisibleEntities, "storage/setVisibleEntities">, setStorageType: import("@reduxjs/toolkit").ActionCreatorWithPayload<StorageType, "storage/setStorageType">, setUptimeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<NodesUptimeFilterValues, "storage/setUptimeFilter">, setNodesSortParams: import("@reduxjs/toolkit").ActionCreatorWithPayload<NodesSortParams, "storage/setNodesSortParams">, setGroupsSortParams: import("@reduxjs/toolkit").ActionCreatorWithPayload<StorageSortParams, "storage/setGroupsSortParams">;
1
+ import type { NodesApiRequestParams } from '../nodes/types';
2
+ import type { StorageApiRequestParams } from './types';
7
3
  export declare const storageApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
8
4
  getStorageNodesInfo: import("@reduxjs/toolkit/query").QueryDefinition<Omit<NodesApiRequestParams, "type">, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", import("./types").PreparedStorageResponse | undefined, "api">;
9
5
  getStorageGroupsInfo: import("@reduxjs/toolkit/query").QueryDefinition<StorageApiRequestParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", import("./types").PreparedStorageResponse | undefined, "api">;
@@ -1,50 +1,6 @@
1
- import { createSlice } from '@reduxjs/toolkit';
2
1
  import { EVersion } from '../../../types/api/storage';
3
- import { NodesUptimeFilterValues } from '../../../utils/nodes';
4
2
  import { api } from '../api';
5
- import { STORAGE_TYPES, VISIBLE_ENTITIES } from './constants';
6
3
  import { prepareStorageGroupsResponse, prepareStorageNodesResponse } from './utils';
7
- const initialState = {
8
- filter: '',
9
- usageFilter: [],
10
- visible: VISIBLE_ENTITIES.all,
11
- uptimeFilter: NodesUptimeFilterValues.All,
12
- type: STORAGE_TYPES.groups,
13
- };
14
- const slice = createSlice({
15
- name: 'storage',
16
- initialState,
17
- reducers: {
18
- setUptimeFilter: (state, action) => {
19
- state.uptimeFilter = action.payload;
20
- },
21
- setStorageType: (state, action) => {
22
- state.type = action.payload;
23
- },
24
- setStorageTextFilter: (state, action) => {
25
- state.filter = action.payload;
26
- },
27
- setUsageFilter: (state, action) => {
28
- state.usageFilter = action.payload;
29
- },
30
- setVisibleEntities: (state, action) => {
31
- state.visible = action.payload;
32
- },
33
- setNodesSortParams: (state, action) => {
34
- state.nodesSortValue = action.payload.sortValue;
35
- state.nodesSortOrder = action.payload.sortOrder;
36
- },
37
- setGroupsSortParams: (state, action) => {
38
- state.groupsSortValue = action.payload.sortValue;
39
- state.groupsSortOrder = action.payload.sortOrder;
40
- },
41
- setInitialState: () => {
42
- return initialState;
43
- },
44
- },
45
- });
46
- export default slice.reducer;
47
- export const { setInitialState, setStorageTextFilter, setUsageFilter, setVisibleEntities, setStorageType, setUptimeFilter, setNodesSortParams, setGroupsSortParams, } = slice.actions;
48
4
  export const storageApi = api.injectEndpoints({
49
5
  endpoints: (builder) => ({
50
6
  getStorageNodesInfo: builder.query({
@@ -1,13 +1,20 @@
1
1
  import type { OrderType } from '@gravity-ui/react-data-table';
2
+ import { z } from 'zod';
2
3
  import type { TSystemStateInfo } from '../../../types/api/nodes';
3
4
  import type { EVersion, TStorageGroupInfo } from '../../../types/api/storage';
4
- import type { ValueOf } from '../../../types/common';
5
5
  import type { PreparedPDisk, PreparedVDisk } from '../../../utils/disks/types';
6
- import type { NodesSortValue, NodesUptimeFilterValues } from '../../../utils/nodes';
7
6
  import type { StorageSortValue } from '../../../utils/storage';
8
- import type { STORAGE_TYPES, VISIBLE_ENTITIES } from './constants';
9
- export type VisibleEntities = ValueOf<typeof VISIBLE_ENTITIES>;
10
- export type StorageType = ValueOf<typeof STORAGE_TYPES>;
7
+ export declare const visibleEntitiesSchema: z.ZodCatch<z.ZodNativeEnum<{
8
+ readonly all: "all";
9
+ readonly missing: "missing";
10
+ readonly space: "space";
11
+ }>>;
12
+ export type VisibleEntities = z.infer<typeof visibleEntitiesSchema>;
13
+ export declare const storageTypeSchema: z.ZodCatch<z.ZodNativeEnum<{
14
+ readonly groups: "groups";
15
+ readonly nodes: "nodes";
16
+ }>>;
17
+ export type StorageType = z.infer<typeof storageTypeSchema>;
11
18
  export interface PreparedStorageNode extends TSystemStateInfo {
12
19
  NodeId: number;
13
20
  PDisks?: PreparedPDisk[];
@@ -34,10 +41,10 @@ export interface UsageFilter {
34
41
  count: number;
35
42
  }
36
43
  export interface StorageSortParams {
37
- sortOrder?: OrderType;
38
- sortValue?: StorageSortValue;
44
+ sortOrder: OrderType | undefined;
45
+ sortValue: StorageSortValue | undefined;
39
46
  }
40
- export interface StorageSortAndFilterParams extends StorageSortParams {
47
+ export interface StorageSortAndFilterParams extends Partial<StorageSortParams> {
41
48
  filter?: string;
42
49
  offset?: number;
43
50
  limit?: number;
@@ -50,23 +57,9 @@ export interface StorageApiRequestParams extends StorageSortAndFilterParams {
50
57
  visibleEntities?: VisibleEntities;
51
58
  version?: EVersion;
52
59
  }
53
- export interface StorageState {
54
- filter: string;
55
- usageFilter: string[];
56
- visible: VisibleEntities;
57
- uptimeFilter: NodesUptimeFilterValues;
58
- groupsSortValue?: StorageSortValue;
59
- groupsSortOrder?: OrderType;
60
- nodesSortValue?: NodesSortValue;
61
- nodesSortOrder?: OrderType;
62
- type: StorageType;
63
- }
64
60
  export interface PreparedStorageResponse {
65
61
  nodes?: PreparedStorageNode[];
66
62
  groups?: PreparedStorageGroup[];
67
63
  found: number | undefined;
68
64
  total: number | undefined;
69
65
  }
70
- export interface StorageStateSlice {
71
- storage: StorageState;
72
- }
@@ -1 +1,4 @@
1
- export {};
1
+ import { z } from 'zod';
2
+ import { STORAGE_TYPES, VISIBLE_ENTITIES } from './constants';
3
+ export const visibleEntitiesSchema = z.nativeEnum(VISIBLE_ENTITIES).catch(VISIBLE_ENTITIES.all);
4
+ export const storageTypeSchema = z.nativeEnum(STORAGE_TYPES).catch(STORAGE_TYPES.groups);
@@ -1,8 +1,98 @@
1
- import type { ETabletState, EType } from '../../types/api/tablet';
1
+ import type { ETabletState, EType, TTabletStateInfo } from '../../types/api/tablet';
2
2
  import type { TabletsApiRequestParams, TabletsState } from '../../types/store/tablets';
3
+ import type { RootState } from '../defaultStore';
3
4
  export declare const setStateFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<ETabletState[], "tablets/setStateFilter">, setTypeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<EType[], "tablets/setTypeFilter">;
4
5
  declare const _default: import("redux").Reducer<TabletsState>;
5
6
  export default _default;
6
7
  export declare const tabletsApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, {
7
8
  getTabletsInfo: import("@reduxjs/toolkit/query").QueryDefinition<TabletsApiRequestParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, "All", import("../../types/api/tablet").TEvTabletStateResponse | undefined, "api">;
8
9
  }, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
10
+ export declare const selectTabletsWithFqdn: ((state: {
11
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
12
+ singleClusterMode: boolean;
13
+ cluster: import("./cluster/types").ClusterState;
14
+ tenant: import("./tenant/types").TenantState;
15
+ tooltip: import("../../types/store/tooltip").ITooltipState;
16
+ tablets: TabletsState;
17
+ schema: import("./schema/types").SchemaState;
18
+ host: import("../../types/store/host").IHostState;
19
+ tenants: import("./tenants/types").TenantsState;
20
+ partitions: import("./partitions/types").PartitionsState;
21
+ executeQuery: import("../../types/store/executeQuery").ExecuteQueryState;
22
+ tabletsFilters: {
23
+ loading: boolean;
24
+ requestTime: number;
25
+ data: undefined;
26
+ wasLoaded: boolean;
27
+ stateFilter: never[];
28
+ typeFilter: never[];
29
+ } | {
30
+ tabletsData: any;
31
+ nodes: any;
32
+ loading: boolean;
33
+ wasLoaded: boolean;
34
+ timeoutForRequest: number;
35
+ error: undefined;
36
+ data: undefined;
37
+ stateFilter: never[];
38
+ typeFilter: never[];
39
+ } | {
40
+ error: any;
41
+ loading: boolean;
42
+ data: undefined;
43
+ wasLoaded: boolean;
44
+ stateFilter: never[];
45
+ typeFilter: never[];
46
+ } | {
47
+ stateFilter: any;
48
+ data: undefined;
49
+ loading: boolean;
50
+ wasLoaded: boolean;
51
+ typeFilter: never[];
52
+ } | {
53
+ typeFilter: any;
54
+ data: undefined;
55
+ loading: boolean;
56
+ wasLoaded: boolean;
57
+ stateFilter: never[];
58
+ };
59
+ heatmap: import("../../types/store/heatmap").IHeatmapState;
60
+ settings: import("./settings/types").SettingsState;
61
+ schemaAcl: import("./schemaAcl/types").SchemaAclState;
62
+ executeTopQueries: import("./executeTopQueries/types").TopQueriesFilters;
63
+ shardsWorkload: import("./shardsWorkload/types").ShardsWorkloadFilters;
64
+ hotKeys: import("./hotKeys/types").HotKeysState;
65
+ authentication: import("./authentication/types").AuthenticationState;
66
+ header: import("./header/types").HeaderState;
67
+ saveQuery: string | null;
68
+ fullscreen: boolean;
69
+ clusters: import("./clusters/types").ClustersFilters;
70
+ }, nodeId: string | undefined, path: string | undefined) => (TTabletStateInfo & {
71
+ fqdn?: string | undefined;
72
+ })[]) & {
73
+ clearCache: () => void;
74
+ resultsCount: () => number;
75
+ resetResultsCount: () => void;
76
+ } & {
77
+ resultFunc: (resultFuncArgs_0: import("../../types/api/tablet").TEvTabletStateResponse | undefined, resultFuncArgs_1: import("../../types/store/nodesList").NodesMap | undefined) => (TTabletStateInfo & {
78
+ fqdn?: string | undefined;
79
+ })[];
80
+ memoizedResultFunc: ((resultFuncArgs_0: import("../../types/api/tablet").TEvTabletStateResponse | undefined, resultFuncArgs_1: import("../../types/store/nodesList").NodesMap | undefined) => (TTabletStateInfo & {
81
+ fqdn?: string | undefined;
82
+ })[]) & {
83
+ clearCache: () => void;
84
+ resultsCount: () => number;
85
+ resetResultsCount: () => void;
86
+ };
87
+ lastResult: () => (TTabletStateInfo & {
88
+ fqdn?: string | undefined;
89
+ })[];
90
+ dependencies: [(state: RootState, nodeId: string | undefined, path: string | undefined) => import("../../types/api/tablet").TEvTabletStateResponse | undefined, (state: RootState) => import("../../types/store/nodesList").NodesMap | undefined];
91
+ recomputations: () => number;
92
+ resetRecomputations: () => void;
93
+ dependencyRecomputations: () => number;
94
+ resetDependencyRecomputations: () => void;
95
+ } & {
96
+ argsMemoize: typeof import("reselect").weakMapMemoize;
97
+ memoize: typeof import("reselect").weakMapMemoize;
98
+ };
@@ -1,5 +1,6 @@
1
- import { createSlice } from '@reduxjs/toolkit';
1
+ import { createSelector, createSlice } from '@reduxjs/toolkit';
2
2
  import { api } from './api';
3
+ import { selectNodesMap } from './nodesList';
3
4
  const initialState = {
4
5
  stateFilter: [],
5
6
  typeFilter: [],
@@ -35,3 +36,17 @@ export const tabletsApi = api.injectEndpoints({
35
36
  }),
36
37
  overrideExisting: 'throw',
37
38
  });
39
+ const getTabletsInfoSelector = createSelector((nodeId, path) => ({ nodeId, path }), ({ nodeId, path }) => tabletsApi.endpoints.getTabletsInfo.select(nodeId === undefined ? { path } : { nodes: [nodeId] }));
40
+ const selectGetTabletsInfo = createSelector((state) => state, (_state, nodeId, path) => getTabletsInfoSelector(nodeId, path), (state, selectTabletsInfo) => selectTabletsInfo(state).data);
41
+ export const selectTabletsWithFqdn = createSelector((state, nodeId, path) => selectGetTabletsInfo(state, nodeId, path), (state) => selectNodesMap(state), (data, nodesMap) => {
42
+ if (!(data === null || data === void 0 ? void 0 : data.TabletStateInfo)) {
43
+ return [];
44
+ }
45
+ if (!nodesMap) {
46
+ return data.TabletStateInfo;
47
+ }
48
+ return data.TabletStateInfo.map((tablet) => {
49
+ const fqdn = tablet.NodeId === undefined ? undefined : nodesMap.get(tablet.NodeId);
50
+ return Object.assign(Object.assign({}, tablet), { fqdn });
51
+ });
52
+ });