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
@@ -1,10 +1,68 @@
1
- export function getTabletsInfo(data: any): (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
1
+ export function getTabletsInfo(data: any): (dispatch: import("redux-thunk").ThunkDispatch<{
2
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
3
+ singleClusterMode: boolean;
4
+ cluster: import("./cluster/types").ClusterState;
5
+ tenant: import("./tenant/types").TenantState;
6
+ tooltip: import("../../types/store/tooltip").ITooltipState;
7
+ tablets: import("../../types/store/tablets").TabletsState;
8
+ schema: import("./schema/types").SchemaState;
9
+ host: import("../../types/store/host").IHostState;
10
+ tenants: import("./tenants/types").TenantsState;
11
+ partitions: import("./partitions/types").PartitionsState;
12
+ executeQuery: import("../../types/store/executeQuery").ExecuteQueryState;
13
+ tabletsFilters: {
14
+ loading: boolean;
15
+ requestTime: number;
16
+ data: undefined;
17
+ wasLoaded: boolean;
18
+ stateFilter: never[];
19
+ typeFilter: never[];
20
+ } | {
21
+ tabletsData: any;
22
+ nodes: any;
23
+ loading: boolean;
24
+ wasLoaded: boolean;
25
+ timeoutForRequest: number;
26
+ error: undefined;
27
+ data: undefined;
28
+ stateFilter: never[];
29
+ typeFilter: never[];
30
+ } | {
31
+ error: any;
32
+ loading: boolean;
33
+ data: undefined;
34
+ wasLoaded: boolean;
35
+ stateFilter: never[];
36
+ typeFilter: never[];
37
+ } | {
38
+ stateFilter: any;
39
+ data: undefined;
40
+ loading: boolean;
41
+ wasLoaded: boolean;
42
+ typeFilter: never[];
43
+ } | {
44
+ typeFilter: any;
45
+ data: undefined;
46
+ loading: boolean;
47
+ wasLoaded: boolean;
48
+ stateFilter: never[];
49
+ };
50
+ heatmap: import("../../types/store/heatmap").IHeatmapState;
51
+ settings: import("./settings/types").SettingsState;
52
+ schemaAcl: import("./schemaAcl/types").SchemaAclState;
53
+ executeTopQueries: import("./executeTopQueries/types").TopQueriesFilters;
54
+ shardsWorkload: import("./shardsWorkload/types").ShardsWorkloadFilters;
55
+ hotKeys: import("./hotKeys/types").HotKeysState;
56
+ authentication: import("./authentication/types").AuthenticationState;
57
+ header: import("./header/types").HeaderState;
58
+ saveQuery: string | null;
59
+ fullscreen: boolean;
60
+ clusters: import("./clusters/types").ClustersFilters;
61
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
2
62
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
3
63
  singleClusterMode: boolean;
4
- nodes: import("./nodes/types").NodesState;
5
64
  cluster: import("./cluster/types").ClusterState;
6
65
  tenant: import("./tenant/types").TenantState;
7
- storage: import("./storage/types").StorageState;
8
66
  tooltip: import("../../types/store/tooltip").ITooltipState;
9
67
  tablets: import("../../types/store/tablets").TabletsState;
10
68
  schema: import("./schema/types").SchemaState;
@@ -12,7 +70,6 @@ export function getTabletsInfo(data: any): (dispatch: import("redux").Dispatch<i
12
70
  tenants: import("./tenants/types").TenantsState;
13
71
  partitions: import("./partitions/types").PartitionsState;
14
72
  executeQuery: import("../../types/store/executeQuery").ExecuteQueryState;
15
- explainQuery: import("../../types/store/explainQuery").ExplainQueryState;
16
73
  tabletsFilters: {
17
74
  loading: boolean;
18
75
  requestTime: number;
@@ -1,7 +1,7 @@
1
- import type { TenantDiagnosticsTab, TenantMetricsTab, TenantPage, TenantQueryTab, TenantState, TenantSummaryTab } from './types';
1
+ import type { TenantDiagnosticsTab, TenantMetricsTab, TenantQueryTab, TenantState, TenantSummaryTab } from './types';
2
2
  declare const _default: import("redux").Reducer<TenantState>;
3
3
  export default _default;
4
- export declare const setTenantPage: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantPage, "tenant/setTenantPage">, setQueryTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantQueryTab, "tenant/setQueryTab">, setDiagnosticsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantDiagnosticsTab, "tenant/setDiagnosticsTab">, setSummaryTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantSummaryTab, "tenant/setSummaryTab">, setMetricsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantMetricsTab, "tenant/setMetricsTab">;
4
+ export declare const setTenantPage: import("@reduxjs/toolkit").ActionCreatorWithPayload<"query" | "diagnostics", "tenant/setTenantPage">, setQueryTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantQueryTab, "tenant/setQueryTab">, setDiagnosticsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantDiagnosticsTab, "tenant/setDiagnosticsTab">, setSummaryTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantSummaryTab, "tenant/setSummaryTab">, setMetricsTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantMetricsTab, "tenant/setMetricsTab">;
5
5
  export declare const tenantApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
6
6
  getTenantInfo: import("@reduxjs/toolkit/query").QueryDefinition<{
7
7
  path: string;
@@ -1,8 +1,17 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
+ import { DEFAULT_USER_SETTINGS, settingsManager } from '../../../services/settings';
3
+ import { TENANT_INITIAL_PAGE_KEY } from '../../../utils/constants';
2
4
  import { api } from '../api';
5
+ import { tenantPageSchema } from './types';
6
+ const tenantPage = tenantPageSchema
7
+ .catch(DEFAULT_USER_SETTINGS[TENANT_INITIAL_PAGE_KEY])
8
+ .parse(settingsManager.readUserSettingsValue(TENANT_INITIAL_PAGE_KEY));
9
+ const initialState = {
10
+ tenantPage,
11
+ };
3
12
  const slice = createSlice({
4
13
  name: 'tenant',
5
- initialState: {},
14
+ initialState,
6
15
  reducers: {
7
16
  setTenantPage: (state, action) => {
8
17
  state.tenantPage = action.payload;
@@ -1,12 +1,17 @@
1
+ import { z } from 'zod';
1
2
  import type { ValueOf } from '../../../types/common';
2
- import type { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_METRICS_TABS_IDS, TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID, TENANT_SUMMARY_TABS_IDS } from './constants';
3
- export type TenantPage = ValueOf<typeof TENANT_PAGES_IDS>;
3
+ import type { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_METRICS_TABS_IDS, TENANT_QUERY_TABS_ID, TENANT_SUMMARY_TABS_IDS } from './constants';
4
+ export declare const tenantPageSchema: z.ZodNativeEnum<{
5
+ readonly query: "query";
6
+ readonly diagnostics: "diagnostics";
7
+ }>;
8
+ export type TenantPage = z.infer<typeof tenantPageSchema>;
4
9
  export type TenantQueryTab = ValueOf<typeof TENANT_QUERY_TABS_ID>;
5
10
  export type TenantDiagnosticsTab = ValueOf<typeof TENANT_DIAGNOSTICS_TABS_IDS>;
6
11
  export type TenantSummaryTab = ValueOf<typeof TENANT_SUMMARY_TABS_IDS>;
7
12
  export type TenantMetricsTab = ValueOf<typeof TENANT_METRICS_TABS_IDS>;
8
13
  export interface TenantState {
9
- tenantPage?: TenantPage;
14
+ tenantPage: TenantPage;
10
15
  queryTab?: TenantQueryTab;
11
16
  diagnosticsTab?: TenantDiagnosticsTab;
12
17
  summaryTab?: TenantSummaryTab;
@@ -1 +1,3 @@
1
- export {};
1
+ import { z } from 'zod';
2
+ import { TENANT_PAGES_IDS } from './constants';
3
+ export const tenantPageSchema = z.nativeEnum(TENANT_PAGES_IDS);
@@ -1,5 +1,5 @@
1
1
  import { TENANT_OVERVIEW_TABLES_LIMIT } from '../../../../utils/constants';
2
- import { parseQueryAPIExecuteResponse } from '../../../../utils/query';
2
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../../../utils/query';
3
3
  import { api } from '../../api';
4
4
  const getQueryText = (path) => {
5
5
  return `
@@ -16,13 +16,16 @@ export const topTablesApi = api.injectEndpoints({
16
16
  getTopTables: builder.query({
17
17
  queryFn: async ({ path }, { signal }) => {
18
18
  try {
19
- const data = await window.api.sendQuery({
19
+ const response = await window.api.sendQuery({
20
20
  schema: 'modern',
21
21
  query: getQueryText(path),
22
22
  database: path,
23
23
  action: 'execute-scan',
24
24
  }, { signal });
25
- return { data: parseQueryAPIExecuteResponse(data) };
25
+ if (isQueryErrorResponse(response)) {
26
+ return { error: response };
27
+ }
28
+ return { data: parseQueryAPIExecuteResponse(response) };
26
29
  }
27
30
  catch (error) {
28
31
  return { error: error || 'Unauthorized' };
@@ -1,5 +1,5 @@
1
1
  import { TENANT_OVERVIEW_TABLES_LIMIT } from '../../../../utils/constants';
2
- import { parseQueryAPIExecuteResponse } from '../../../../utils/query';
2
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../../../utils/query';
3
3
  import { api } from '../../api';
4
4
  const getQueryText = (path) => {
5
5
  return `
@@ -16,13 +16,16 @@ export const topQueriesApi = api.injectEndpoints({
16
16
  getOverviewTopQueries: builder.query({
17
17
  queryFn: async ({ database }, { signal }) => {
18
18
  try {
19
- const data = await window.api.sendQuery({
19
+ const response = await window.api.sendQuery({
20
20
  schema: 'modern',
21
21
  query: getQueryText(database),
22
22
  database,
23
23
  action: 'execute-scan',
24
24
  }, { signal });
25
- return { data: parseQueryAPIExecuteResponse(data) };
25
+ if (isQueryErrorResponse(response)) {
26
+ return { error: response };
27
+ }
28
+ return { data: parseQueryAPIExecuteResponse(response) };
26
29
  }
27
30
  catch (error) {
28
31
  return { error: error || new Error('Unauthorized') };
@@ -1,5 +1,5 @@
1
1
  import { TENANT_OVERVIEW_TABLES_LIMIT } from '../../../../utils/constants';
2
- import { parseQueryAPIExecuteResponse } from '../../../../utils/query';
2
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../../../utils/query';
3
3
  import { api } from '../../api';
4
4
  function createShardQuery(path, tenantName) {
5
5
  const pathSelect = tenantName
@@ -22,13 +22,16 @@ export const topShardsApi = api.injectEndpoints({
22
22
  getTopShards: builder.query({
23
23
  queryFn: async ({ database, path = '' }, { signal }) => {
24
24
  try {
25
- const data = await window.api.sendQuery({
25
+ const response = await window.api.sendQuery({
26
26
  schema: 'modern',
27
27
  query: createShardQuery(path, database),
28
28
  database,
29
29
  action: queryAction,
30
30
  }, { signal });
31
- return { data: parseQueryAPIExecuteResponse(data) };
31
+ if (isQueryErrorResponse(response)) {
32
+ return { error: response };
33
+ }
34
+ return { data: parseQueryAPIExecuteResponse(response) };
32
35
  }
33
36
  catch (error) {
34
37
  return { error: error || new Error('Unauthorized') };
@@ -4,10 +4,8 @@ import type { PreparedTenant, TenantsStateSlice } from './types';
4
4
  export declare const selectTenants: ((state: {
5
5
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
6
6
  singleClusterMode: boolean;
7
- nodes: import("../nodes/types").NodesState;
8
7
  cluster: import("../cluster/types").ClusterState;
9
8
  tenant: import("../tenant/types").TenantState;
10
- storage: import("../storage/types").StorageState;
11
9
  tooltip: import("../../../types/store/tooltip").ITooltipState;
12
10
  tablets: import("../../../types/store/tablets").TabletsState;
13
11
  schema: import("../schema/types").SchemaState;
@@ -15,7 +13,6 @@ export declare const selectTenants: ((state: {
15
13
  tenants: import("./types").TenantsState;
16
14
  partitions: import("../partitions/types").PartitionsState;
17
15
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
18
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
19
16
  tabletsFilters: {
20
17
  loading: boolean;
21
18
  requestTime: number;
@@ -72,10 +69,8 @@ export declare const selectTenants: ((state: {
72
69
  resultFunc: (resultFuncArgs_0: {
73
70
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
74
71
  singleClusterMode: boolean;
75
- nodes: import("../nodes/types").NodesState;
76
72
  cluster: import("../cluster/types").ClusterState;
77
73
  tenant: import("../tenant/types").TenantState;
78
- storage: import("../storage/types").StorageState;
79
74
  tooltip: import("../../../types/store/tooltip").ITooltipState;
80
75
  tablets: import("../../../types/store/tablets").TabletsState;
81
76
  schema: import("../schema/types").SchemaState;
@@ -83,7 +78,6 @@ export declare const selectTenants: ((state: {
83
78
  tenants: import("./types").TenantsState;
84
79
  partitions: import("../partitions/types").PartitionsState;
85
80
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
86
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
87
81
  tabletsFilters: {
88
82
  loading: boolean;
89
83
  requestTime: number;
@@ -206,10 +200,8 @@ export declare const selectTenants: ((state: {
206
200
  memoizedResultFunc: ((resultFuncArgs_0: {
207
201
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
208
202
  singleClusterMode: boolean;
209
- nodes: import("../nodes/types").NodesState;
210
203
  cluster: import("../cluster/types").ClusterState;
211
204
  tenant: import("../tenant/types").TenantState;
212
- storage: import("../storage/types").StorageState;
213
205
  tooltip: import("../../../types/store/tooltip").ITooltipState;
214
206
  tablets: import("../../../types/store/tablets").TabletsState;
215
207
  schema: import("../schema/types").SchemaState;
@@ -217,7 +209,6 @@ export declare const selectTenants: ((state: {
217
209
  tenants: import("./types").TenantsState;
218
210
  partitions: import("../partitions/types").PartitionsState;
219
211
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
220
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
221
212
  tabletsFilters: {
222
213
  loading: boolean;
223
214
  requestTime: number;
@@ -345,10 +336,8 @@ export declare const selectTenants: ((state: {
345
336
  dependencies: [(state: RootState) => {
346
337
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
347
338
  singleClusterMode: boolean;
348
- nodes: import("../nodes/types").NodesState;
349
339
  cluster: import("../cluster/types").ClusterState;
350
340
  tenant: import("../tenant/types").TenantState;
351
- storage: import("../storage/types").StorageState;
352
341
  tooltip: import("../../../types/store/tooltip").ITooltipState;
353
342
  tablets: import("../../../types/store/tablets").TabletsState;
354
343
  schema: import("../schema/types").SchemaState;
@@ -356,7 +345,6 @@ export declare const selectTenants: ((state: {
356
345
  tenants: import("./types").TenantsState;
357
346
  partitions: import("../partitions/types").PartitionsState;
358
347
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
359
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
360
348
  tabletsFilters: {
361
349
  loading: boolean;
362
350
  requestTime: number;
@@ -488,10 +476,8 @@ export declare const selectTenantsSearchValue: (state: TenantsStateSlice) => str
488
476
  export declare const selectFilteredTenants: ((state: {
489
477
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
490
478
  singleClusterMode: boolean;
491
- nodes: import("../nodes/types").NodesState;
492
479
  cluster: import("../cluster/types").ClusterState;
493
480
  tenant: import("../tenant/types").TenantState;
494
- storage: import("../storage/types").StorageState;
495
481
  tooltip: import("../../../types/store/tooltip").ITooltipState;
496
482
  tablets: import("../../../types/store/tablets").TabletsState;
497
483
  schema: import("../schema/types").SchemaState;
@@ -499,7 +485,6 @@ export declare const selectFilteredTenants: ((state: {
499
485
  tenants: import("./types").TenantsState;
500
486
  partitions: import("../partitions/types").PartitionsState;
501
487
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
502
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
503
488
  tabletsFilters: {
504
489
  loading: boolean;
505
490
  requestTime: number;
@@ -563,10 +548,8 @@ export declare const selectFilteredTenants: ((state: {
563
548
  dependencies: [((state: {
564
549
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
565
550
  singleClusterMode: boolean;
566
- nodes: import("../nodes/types").NodesState;
567
551
  cluster: import("../cluster/types").ClusterState;
568
552
  tenant: import("../tenant/types").TenantState;
569
- storage: import("../storage/types").StorageState;
570
553
  tooltip: import("../../../types/store/tooltip").ITooltipState;
571
554
  tablets: import("../../../types/store/tablets").TabletsState;
572
555
  schema: import("../schema/types").SchemaState;
@@ -574,7 +557,6 @@ export declare const selectFilteredTenants: ((state: {
574
557
  tenants: import("./types").TenantsState;
575
558
  partitions: import("../partitions/types").PartitionsState;
576
559
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
577
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
578
560
  tabletsFilters: {
579
561
  loading: boolean;
580
562
  requestTime: number;
@@ -631,10 +613,8 @@ export declare const selectFilteredTenants: ((state: {
631
613
  resultFunc: (resultFuncArgs_0: {
632
614
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
633
615
  singleClusterMode: boolean;
634
- nodes: import("../nodes/types").NodesState;
635
616
  cluster: import("../cluster/types").ClusterState;
636
617
  tenant: import("../tenant/types").TenantState;
637
- storage: import("../storage/types").StorageState;
638
618
  tooltip: import("../../../types/store/tooltip").ITooltipState;
639
619
  tablets: import("../../../types/store/tablets").TabletsState;
640
620
  schema: import("../schema/types").SchemaState;
@@ -642,7 +622,6 @@ export declare const selectFilteredTenants: ((state: {
642
622
  tenants: import("./types").TenantsState;
643
623
  partitions: import("../partitions/types").PartitionsState;
644
624
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
645
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
646
625
  tabletsFilters: {
647
626
  loading: boolean;
648
627
  requestTime: number;
@@ -765,10 +744,8 @@ export declare const selectFilteredTenants: ((state: {
765
744
  memoizedResultFunc: ((resultFuncArgs_0: {
766
745
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
767
746
  singleClusterMode: boolean;
768
- nodes: import("../nodes/types").NodesState;
769
747
  cluster: import("../cluster/types").ClusterState;
770
748
  tenant: import("../tenant/types").TenantState;
771
- storage: import("../storage/types").StorageState;
772
749
  tooltip: import("../../../types/store/tooltip").ITooltipState;
773
750
  tablets: import("../../../types/store/tablets").TabletsState;
774
751
  schema: import("../schema/types").SchemaState;
@@ -776,7 +753,6 @@ export declare const selectFilteredTenants: ((state: {
776
753
  tenants: import("./types").TenantsState;
777
754
  partitions: import("../partitions/types").PartitionsState;
778
755
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
779
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
780
756
  tabletsFilters: {
781
757
  loading: boolean;
782
758
  requestTime: number;
@@ -904,10 +880,8 @@ export declare const selectFilteredTenants: ((state: {
904
880
  dependencies: [(state: RootState) => {
905
881
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
906
882
  singleClusterMode: boolean;
907
- nodes: import("../nodes/types").NodesState;
908
883
  cluster: import("../cluster/types").ClusterState;
909
884
  tenant: import("../tenant/types").TenantState;
910
- storage: import("../storage/types").StorageState;
911
885
  tooltip: import("../../../types/store/tooltip").ITooltipState;
912
886
  tablets: import("../../../types/store/tablets").TabletsState;
913
887
  schema: import("../schema/types").SchemaState;
@@ -915,7 +889,6 @@ export declare const selectFilteredTenants: ((state: {
915
889
  tenants: import("./types").TenantsState;
916
890
  partitions: import("../partitions/types").PartitionsState;
917
891
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
918
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
919
892
  tabletsFilters: {
920
893
  loading: boolean;
921
894
  requestTime: number;
@@ -11,13 +11,13 @@ export interface TenantMetricStats<T = string> {
11
11
  export type TenantPoolsStats = TenantMetricStats<PoolName>;
12
12
  export type TenantStorageStats = TenantMetricStats<EType>;
13
13
  export declare const calculateTenantMetrics: (tenant?: TTenant) => {
14
- memory: number | undefined;
15
- blobStorage: number | undefined;
16
- tabletStorage: number | undefined;
14
+ memory: number;
15
+ blobStorage: number;
16
+ tabletStorage: number;
17
17
  memoryLimit: number | undefined;
18
18
  blobStorageLimit: number | undefined;
19
19
  tabletStorageLimit: number | undefined;
20
- cpu: number | undefined;
20
+ cpu: number;
21
21
  poolsStats: TenantPoolsStats[] | undefined;
22
22
  memoryStats: TenantMetricStats<string>[];
23
23
  blobStorageStats: TenantStorageStats[];
@@ -25,7 +25,7 @@ const calculatePoolsStats = (poolsStats) => {
25
25
  return poolsStats
26
26
  .map((pool) => {
27
27
  if (pool.Name) {
28
- const usage = Number(pool.Usage);
28
+ const usage = Number(pool.Usage) || 0;
29
29
  const limit = Number(pool.Threads);
30
30
  const used = limit * usage;
31
31
  // Multiply usage by 100 to match with usage to status checkers
@@ -37,16 +37,16 @@ const calculatePoolsStats = (poolsStats) => {
37
37
  };
38
38
  export const calculateTenantMetrics = (tenant = {}) => {
39
39
  const { CoresUsed, MemoryUsed, StorageAllocatedSize, MemoryLimit, StorageAllocatedLimit, PoolStats, Metrics = {}, DatabaseQuotas = {}, StorageUsage, QuotaUsage, } = tenant;
40
- const cpu = isNumeric(CoresUsed) ? Number(CoresUsed) * 1000000 : undefined;
41
- const memory = isNumeric(MemoryUsed) ? Number(MemoryUsed) : undefined;
42
- const blobStorage = isNumeric(StorageAllocatedSize) ? Number(StorageAllocatedSize) : undefined;
43
- const tabletStorage = isNumeric(Metrics.Storage) ? Number(Metrics.Storage) : undefined;
40
+ const cpu = Number(CoresUsed) * 1000000 || 0;
41
+ const memory = Number(MemoryUsed) || 0;
42
+ const blobStorage = Number(StorageAllocatedSize) || 0;
43
+ const tabletStorage = Number(Metrics.Storage) || 0;
44
44
  const memoryLimit = isNumeric(MemoryLimit) ? Number(MemoryLimit) : undefined;
45
45
  const blobStorageLimit = isNumeric(StorageAllocatedLimit)
46
46
  ? Number(StorageAllocatedLimit)
47
47
  : undefined;
48
- const tabletStorageLimit = isNumeric(DatabaseQuotas.data_size_hard_quota)
49
- ? Number(DatabaseQuotas.data_size_hard_quota)
48
+ const tabletStorageLimit = isNumeric(DatabaseQuotas.data_size_soft_quota)
49
+ ? Number(DatabaseQuotas.data_size_soft_quota)
50
50
  : undefined;
51
51
  const poolsStats = calculatePoolsStats(PoolStats);
52
52
  let blobStorageStats;
@@ -87,7 +87,7 @@ export const calculateTenantMetrics = (tenant = {}) => {
87
87
  };
88
88
  });
89
89
  }
90
- else if (tabletStorage !== undefined && tabletStorageLimit) {
90
+ else if (tabletStorageLimit) {
91
91
  tabletStorageStats = [
92
92
  {
93
93
  name: EType.SSD,