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
@@ -16,13 +16,71 @@ export declare const FETCH_USER: {
16
16
  readonly FAILURE: "authentication/FETCH_USER_FAILURE";
17
17
  };
18
18
  declare const authentication: Reducer<AuthenticationState, AuthenticationAction>;
19
- export declare const authenticate: (user: string, password: string) => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
19
+ export declare const authenticate: (user: string, password: string) => (dispatch: import("redux-thunk").ThunkDispatch<{
20
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
21
+ singleClusterMode: boolean;
22
+ cluster: import("../cluster/types").ClusterState;
23
+ tenant: import("../tenant/types").TenantState;
24
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
25
+ tablets: import("../../../types/store/tablets").TabletsState;
26
+ schema: import("../schema/types").SchemaState;
27
+ host: import("../../../types/store/host").IHostState;
28
+ tenants: import("../tenants/types").TenantsState;
29
+ partitions: import("../partitions/types").PartitionsState;
30
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
31
+ tabletsFilters: {
32
+ loading: boolean;
33
+ requestTime: number;
34
+ data: undefined;
35
+ wasLoaded: boolean;
36
+ stateFilter: never[];
37
+ typeFilter: never[];
38
+ } | {
39
+ tabletsData: any;
40
+ nodes: any;
41
+ loading: boolean;
42
+ wasLoaded: boolean;
43
+ timeoutForRequest: number;
44
+ error: undefined;
45
+ data: undefined;
46
+ stateFilter: never[];
47
+ typeFilter: never[];
48
+ } | {
49
+ error: any;
50
+ loading: boolean;
51
+ data: undefined;
52
+ wasLoaded: boolean;
53
+ stateFilter: never[];
54
+ typeFilter: never[];
55
+ } | {
56
+ stateFilter: any;
57
+ data: undefined;
58
+ loading: boolean;
59
+ wasLoaded: boolean;
60
+ typeFilter: never[];
61
+ } | {
62
+ typeFilter: any;
63
+ data: undefined;
64
+ loading: boolean;
65
+ wasLoaded: boolean;
66
+ stateFilter: never[];
67
+ };
68
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
69
+ settings: import("../settings/types").SettingsState;
70
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
71
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
72
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
73
+ hotKeys: import("../hotKeys/types").HotKeysState;
74
+ authentication: AuthenticationState;
75
+ header: import("../header/types").HeaderState;
76
+ saveQuery: string | null;
77
+ fullscreen: boolean;
78
+ clusters: import("../clusters/types").ClustersFilters;
79
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
20
80
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
21
81
  singleClusterMode: boolean;
22
- nodes: import("../nodes/types").NodesState;
23
82
  cluster: import("../cluster/types").ClusterState;
24
83
  tenant: import("../tenant/types").TenantState;
25
- storage: import("../storage/types").StorageState;
26
84
  tooltip: import("../../../types/store/tooltip").ITooltipState;
27
85
  tablets: import("../../../types/store/tablets").TabletsState;
28
86
  schema: import("../schema/types").SchemaState;
@@ -30,7 +88,6 @@ export declare const authenticate: (user: string, password: string) => (dispatch
30
88
  tenants: import("../tenants/types").TenantsState;
31
89
  partitions: import("../partitions/types").PartitionsState;
32
90
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
33
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
34
91
  tabletsFilters: {
35
92
  loading: boolean;
36
93
  requestTime: number;
@@ -80,13 +137,71 @@ export declare const authenticate: (user: string, password: string) => (dispatch
80
137
  fullscreen: boolean;
81
138
  clusters: import("../clusters/types").ClustersFilters;
82
139
  }) => Promise<unknown>;
83
- export declare const logout: () => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
140
+ export declare const logout: () => (dispatch: import("redux-thunk").ThunkDispatch<{
141
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
142
+ singleClusterMode: boolean;
143
+ cluster: import("../cluster/types").ClusterState;
144
+ tenant: import("../tenant/types").TenantState;
145
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
146
+ tablets: import("../../../types/store/tablets").TabletsState;
147
+ schema: import("../schema/types").SchemaState;
148
+ host: import("../../../types/store/host").IHostState;
149
+ tenants: import("../tenants/types").TenantsState;
150
+ partitions: import("../partitions/types").PartitionsState;
151
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
152
+ tabletsFilters: {
153
+ loading: boolean;
154
+ requestTime: number;
155
+ data: undefined;
156
+ wasLoaded: boolean;
157
+ stateFilter: never[];
158
+ typeFilter: never[];
159
+ } | {
160
+ tabletsData: any;
161
+ nodes: any;
162
+ loading: boolean;
163
+ wasLoaded: boolean;
164
+ timeoutForRequest: number;
165
+ error: undefined;
166
+ data: undefined;
167
+ stateFilter: never[];
168
+ typeFilter: never[];
169
+ } | {
170
+ error: any;
171
+ loading: boolean;
172
+ data: undefined;
173
+ wasLoaded: boolean;
174
+ stateFilter: never[];
175
+ typeFilter: never[];
176
+ } | {
177
+ stateFilter: any;
178
+ data: undefined;
179
+ loading: boolean;
180
+ wasLoaded: boolean;
181
+ typeFilter: never[];
182
+ } | {
183
+ typeFilter: any;
184
+ data: undefined;
185
+ loading: boolean;
186
+ wasLoaded: boolean;
187
+ stateFilter: never[];
188
+ };
189
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
190
+ settings: import("../settings/types").SettingsState;
191
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
192
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
193
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
194
+ hotKeys: import("../hotKeys/types").HotKeysState;
195
+ authentication: AuthenticationState;
196
+ header: import("../header/types").HeaderState;
197
+ saveQuery: string | null;
198
+ fullscreen: boolean;
199
+ clusters: import("../clusters/types").ClustersFilters;
200
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
84
201
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
85
202
  singleClusterMode: boolean;
86
- nodes: import("../nodes/types").NodesState;
87
203
  cluster: import("../cluster/types").ClusterState;
88
204
  tenant: import("../tenant/types").TenantState;
89
- storage: import("../storage/types").StorageState;
90
205
  tooltip: import("../../../types/store/tooltip").ITooltipState;
91
206
  tablets: import("../../../types/store/tablets").TabletsState;
92
207
  schema: import("../schema/types").SchemaState;
@@ -94,7 +209,6 @@ export declare const logout: () => (dispatch: import("redux").Dispatch<import("r
94
209
  tenants: import("../tenants/types").TenantsState;
95
210
  partitions: import("../partitions/types").PartitionsState;
96
211
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
97
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
98
212
  tabletsFilters: {
99
213
  loading: boolean;
100
214
  requestTime: number;
@@ -144,13 +258,71 @@ export declare const logout: () => (dispatch: import("redux").Dispatch<import("r
144
258
  fullscreen: boolean;
145
259
  clusters: import("../clusters/types").ClustersFilters;
146
260
  }) => Promise<unknown>;
147
- export declare const getUser: () => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
261
+ export declare const getUser: () => (dispatch: import("redux-thunk").ThunkDispatch<{
262
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
263
+ singleClusterMode: boolean;
264
+ cluster: import("../cluster/types").ClusterState;
265
+ tenant: import("../tenant/types").TenantState;
266
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
267
+ tablets: import("../../../types/store/tablets").TabletsState;
268
+ schema: import("../schema/types").SchemaState;
269
+ host: import("../../../types/store/host").IHostState;
270
+ tenants: import("../tenants/types").TenantsState;
271
+ partitions: import("../partitions/types").PartitionsState;
272
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
273
+ tabletsFilters: {
274
+ loading: boolean;
275
+ requestTime: number;
276
+ data: undefined;
277
+ wasLoaded: boolean;
278
+ stateFilter: never[];
279
+ typeFilter: never[];
280
+ } | {
281
+ tabletsData: any;
282
+ nodes: any;
283
+ loading: boolean;
284
+ wasLoaded: boolean;
285
+ timeoutForRequest: number;
286
+ error: undefined;
287
+ data: undefined;
288
+ stateFilter: never[];
289
+ typeFilter: never[];
290
+ } | {
291
+ error: any;
292
+ loading: boolean;
293
+ data: undefined;
294
+ wasLoaded: boolean;
295
+ stateFilter: never[];
296
+ typeFilter: never[];
297
+ } | {
298
+ stateFilter: any;
299
+ data: undefined;
300
+ loading: boolean;
301
+ wasLoaded: boolean;
302
+ typeFilter: never[];
303
+ } | {
304
+ typeFilter: any;
305
+ data: undefined;
306
+ loading: boolean;
307
+ wasLoaded: boolean;
308
+ stateFilter: never[];
309
+ };
310
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
311
+ settings: import("../settings/types").SettingsState;
312
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
313
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
314
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
315
+ hotKeys: import("../hotKeys/types").HotKeysState;
316
+ authentication: AuthenticationState;
317
+ header: import("../header/types").HeaderState;
318
+ saveQuery: string | null;
319
+ fullscreen: boolean;
320
+ clusters: import("../clusters/types").ClustersFilters;
321
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
148
322
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
149
323
  singleClusterMode: boolean;
150
- nodes: import("../nodes/types").NodesState;
151
324
  cluster: import("../cluster/types").ClusterState;
152
325
  tenant: import("../tenant/types").TenantState;
153
- storage: import("../storage/types").StorageState;
154
326
  tooltip: import("../../../types/store/tooltip").ITooltipState;
155
327
  tablets: import("../../../types/store/tablets").TabletsState;
156
328
  schema: import("../schema/types").SchemaState;
@@ -158,7 +330,6 @@ export declare const getUser: () => (dispatch: import("redux").Dispatch<import("
158
330
  tenants: import("../tenants/types").TenantsState;
159
331
  partitions: import("../partitions/types").PartitionsState;
160
332
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
161
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
162
333
  tabletsFilters: {
163
334
  loading: boolean;
164
335
  requestTime: number;
@@ -207,5 +378,8 @@ export declare const getUser: () => (dispatch: import("redux").Dispatch<import("
207
378
  saveQuery: string | null;
208
379
  fullscreen: boolean;
209
380
  clusters: import("../clusters/types").ClustersFilters;
210
- }) => Promise<string | undefined>;
381
+ }) => Promise<{
382
+ user: string | undefined;
383
+ isUserAllowedToMakeChanges: boolean;
384
+ } | undefined>;
211
385
  export default authentication;
@@ -19,7 +19,9 @@ const authentication = (state = initialState, action) => {
19
19
  return Object.assign(Object.assign({}, state), { error: action.error });
20
20
  }
21
21
  case FETCH_USER.SUCCESS: {
22
- return Object.assign(Object.assign({}, state), { user: action.data });
22
+ const { user, isUserAllowedToMakeChanges } = action.data;
23
+ return Object.assign(Object.assign({}, state), { user,
24
+ isUserAllowedToMakeChanges });
23
25
  }
24
26
  default:
25
27
  return Object.assign({}, state);
@@ -42,8 +44,15 @@ export const getUser = () => {
42
44
  request: window.api.whoami(),
43
45
  actions: FETCH_USER,
44
46
  dataHandler: (data) => {
45
- const { UserSID, AuthType } = data;
46
- return AuthType === 'Login' ? UserSID : undefined;
47
+ const { UserSID, AuthType, IsMonitoringAllowed } = data;
48
+ return {
49
+ user: AuthType === 'Login' ? UserSID : undefined,
50
+ // If ydb version supports this feature,
51
+ // There should be explicit flag in whoami response
52
+ // Otherwise every user is allowed to make changes
53
+ // Anyway there will be guards on backend
54
+ isUserAllowedToMakeChanges: IsMonitoringAllowed !== false,
55
+ };
47
56
  },
48
57
  });
49
58
  };
@@ -3,7 +3,11 @@ import type { ApiRequestAction } from '../../utils';
3
3
  import type { FETCH_USER, SET_AUTHENTICATED, SET_UNAUTHENTICATED } from './authentication';
4
4
  export interface AuthenticationState {
5
5
  isAuthenticated: boolean;
6
+ isUserAllowedToMakeChanges?: boolean;
6
7
  user: string | undefined;
7
8
  error: AuthErrorResponse | undefined;
8
9
  }
9
- export type AuthenticationAction = ApiRequestAction<typeof SET_UNAUTHENTICATED, unknown, unknown> | ApiRequestAction<typeof SET_AUTHENTICATED, unknown, AuthErrorResponse> | ApiRequestAction<typeof FETCH_USER, string | undefined, unknown>;
10
+ export type AuthenticationAction = ApiRequestAction<typeof SET_UNAUTHENTICATED, unknown, unknown> | ApiRequestAction<typeof SET_AUTHENTICATED, unknown, AuthErrorResponse> | ApiRequestAction<typeof FETCH_USER, {
11
+ user: string | undefined;
12
+ isUserAllowedToMakeChanges: boolean;
13
+ }, unknown>;
@@ -1,6 +1,7 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { clusterTabsIds, isClusterTab } from '../../../containers/Cluster/utils';
3
3
  import { DEFAULT_CLUSTER_TAB_KEY } from '../../../utils/constants';
4
+ import { isQueryErrorResponse } from '../../../utils/query';
4
5
  import { api } from '../api';
5
6
  import { createSelectClusterGroupsQuery, parseGroupsStatsQueryResponse } from './utils';
6
7
  const defaultClusterTabLS = localStorage.getItem(DEFAULT_CLUSTER_TAB_KEY);
@@ -54,6 +55,9 @@ export const clusterApi = api.injectEndpoints({
54
55
  database: clusterRoot,
55
56
  action: 'execute-scan',
56
57
  });
58
+ if (isQueryErrorResponse(groupsStatsResponse)) {
59
+ return { data: { clusterData } };
60
+ }
57
61
  return {
58
62
  data: {
59
63
  clusterData,
@@ -1,7 +1,7 @@
1
1
  import type { Reducer } from '@reduxjs/toolkit';
2
2
  import type { Schemas } from '../../types/api/query';
3
3
  import type { ExecuteQueryAction, ExecuteQueryState, ExecuteQueryStateSlice, QueryInHistory } from '../../types/store/executeQuery';
4
- import type { QueryMode, QueryRequestParams } from '../../types/store/query';
4
+ import type { IQueryResult, QueryMode, QueryRequestParams } from '../../types/store/query';
5
5
  export declare const SEND_QUERY: {
6
6
  readonly REQUEST: "query/SEND_QUERY_REQUEST";
7
7
  readonly SUCCESS: "query/SEND_QUERY_SUCCESS";
@@ -12,70 +12,9 @@ interface SendQueryParams extends QueryRequestParams {
12
12
  mode?: QueryMode;
13
13
  schema?: Schemas;
14
14
  }
15
- export declare const sendExecuteQuery: ({ query, database, mode, schema }: SendQueryParams) => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
16
- api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
17
- singleClusterMode: boolean;
18
- nodes: import("./nodes/types").NodesState;
19
- cluster: import("./cluster/types").ClusterState;
20
- tenant: import("./tenant/types").TenantState;
21
- storage: import("./storage/types").StorageState;
22
- tooltip: import("../../types/store/tooltip").ITooltipState;
23
- tablets: import("../../types/store/tablets").TabletsState;
24
- schema: import("./schema/types").SchemaState;
25
- host: import("../../types/store/host").IHostState;
26
- tenants: import("./tenants/types").TenantsState;
27
- partitions: import("./partitions/types").PartitionsState;
28
- executeQuery: ExecuteQueryState;
29
- explainQuery: import("../../types/store/explainQuery").ExplainQueryState;
30
- tabletsFilters: {
31
- loading: boolean;
32
- requestTime: number;
33
- data: undefined;
34
- wasLoaded: boolean;
35
- stateFilter: never[];
36
- typeFilter: never[];
37
- } | {
38
- tabletsData: any;
39
- nodes: any;
40
- loading: boolean;
41
- wasLoaded: boolean;
42
- timeoutForRequest: number;
43
- error: undefined;
44
- data: undefined;
45
- stateFilter: never[];
46
- typeFilter: never[];
47
- } | {
48
- error: any;
49
- loading: boolean;
50
- data: undefined;
51
- wasLoaded: boolean;
52
- stateFilter: never[];
53
- typeFilter: never[];
54
- } | {
55
- stateFilter: any;
56
- data: undefined;
57
- loading: boolean;
58
- wasLoaded: boolean;
59
- typeFilter: never[];
60
- } | {
61
- typeFilter: any;
62
- data: undefined;
63
- loading: boolean;
64
- wasLoaded: boolean;
65
- stateFilter: never[];
66
- };
67
- heatmap: import("../../types/store/heatmap").IHeatmapState;
68
- settings: import("./settings/types").SettingsState;
69
- schemaAcl: import("./schemaAcl/types").SchemaAclState;
70
- executeTopQueries: import("./executeTopQueries/types").TopQueriesFilters;
71
- shardsWorkload: import("./shardsWorkload/types").ShardsWorkloadFilters;
72
- hotKeys: import("./hotKeys/types").HotKeysState;
73
- authentication: import("./authentication/types").AuthenticationState;
74
- header: import("./header/types").HeaderState;
75
- saveQuery: string | null;
76
- fullscreen: boolean;
77
- clusters: import("./clusters/types").ClustersFilters;
78
- }) => Promise<import("../../types/store/query").IQueryResult | undefined>;
15
+ export declare const executeQueryApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, {
16
+ executeQuery: import("@reduxjs/toolkit/query").MutationDefinition<SendQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, "All", IQueryResult, "api">;
17
+ }, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
79
18
  export declare const saveQueryToHistory: (queryText: string, mode: QueryMode) => {
80
19
  readonly type: "query/SAVE_QUERY_TO_HISTORY";
81
20
  readonly data: {
@@ -1,8 +1,8 @@
1
1
  import { settingsManager } from '../../services/settings';
2
2
  import { QUERIES_HISTORY_KEY } from '../../utils/constants';
3
- import { parseQueryError } from '../../utils/error';
4
- import { QUERY_MODES, QUERY_SYNTAX, parseQueryAPIExecuteResponse } from '../../utils/query';
5
- import { createApiRequest, createRequestActionTypes } from '../utils';
3
+ import { QUERY_MODES, QUERY_SYNTAX, isQueryErrorResponse, parseQueryAPIExecuteResponse, } from '../../utils/query';
4
+ import { createRequestActionTypes } from '../utils';
5
+ import { api } from './api';
6
6
  const MAXIMUM_QUERIES_IN_HISTORY = 20;
7
7
  export const SEND_QUERY = createRequestActionTypes('query', 'SEND_QUERY');
8
8
  const CHANGE_USER_INPUT = 'query/CHANGE_USER_INPUT';
@@ -26,15 +26,6 @@ const initialState = {
26
26
  };
27
27
  const executeQuery = (state = initialState, action) => {
28
28
  switch (action.type) {
29
- case SEND_QUERY.REQUEST: {
30
- return Object.assign(Object.assign({}, state), { loading: true, data: undefined, error: undefined });
31
- }
32
- case SEND_QUERY.SUCCESS: {
33
- return Object.assign(Object.assign({}, state), { data: action.data, stats: action.data.stats, loading: false, error: undefined });
34
- }
35
- case SEND_QUERY.FAILURE: {
36
- return Object.assign(Object.assign({}, state), { error: parseQueryError(action.error), loading: false });
37
- }
38
29
  case CHANGE_USER_INPUT: {
39
30
  return Object.assign(Object.assign({}, state), { input: action.data.input });
40
31
  }
@@ -76,29 +67,42 @@ const executeQuery = (state = initialState, action) => {
76
67
  return state;
77
68
  }
78
69
  };
79
- export const sendExecuteQuery = ({ query, database, mode, schema = 'modern' }) => {
80
- let action = 'execute';
81
- let syntax = QUERY_SYNTAX.yql;
82
- if (mode === 'pg') {
83
- action = 'execute-query';
84
- syntax = QUERY_SYNTAX.pg;
85
- }
86
- else if (mode) {
87
- action = `execute-${mode}`;
88
- }
89
- return createApiRequest({
90
- request: window.api.sendQuery({
91
- schema,
92
- query,
93
- database,
94
- action,
95
- syntax,
96
- stats: 'full',
70
+ export const executeQueryApi = api.injectEndpoints({
71
+ endpoints: (build) => ({
72
+ executeQuery: build.mutation({
73
+ queryFn: async ({ query, database, mode, schema = 'modern' }) => {
74
+ let action = 'execute';
75
+ let syntax = QUERY_SYNTAX.yql;
76
+ if (mode === 'pg') {
77
+ action = 'execute-query';
78
+ syntax = QUERY_SYNTAX.pg;
79
+ }
80
+ else if (mode) {
81
+ action = `execute-${mode}`;
82
+ }
83
+ try {
84
+ const response = await window.api.sendQuery({
85
+ schema,
86
+ query,
87
+ database,
88
+ action,
89
+ syntax,
90
+ stats: 'full',
91
+ });
92
+ if (isQueryErrorResponse(response)) {
93
+ return { error: response };
94
+ }
95
+ const data = parseQueryAPIExecuteResponse(response);
96
+ return { data };
97
+ }
98
+ catch (error) {
99
+ return { error };
100
+ }
101
+ },
97
102
  }),
98
- actions: SEND_QUERY,
99
- dataHandler: parseQueryAPIExecuteResponse,
100
- });
101
- };
103
+ }),
104
+ overrideExisting: 'throw',
105
+ });
102
106
  export const saveQueryToHistory = (queryText, mode) => {
103
107
  return {
104
108
  type: SAVE_QUERY_TO_HISTORY,
@@ -1,6 +1,6 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { HOUR_IN_SECONDS } from '../../../utils/constants';
3
- import { parseQueryAPIExecuteResponse } from '../../../utils/query';
3
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../../utils/query';
4
4
  import { api } from '../api';
5
5
  import { getFiltersConditions } from './utils';
6
6
  const initialState = {};
@@ -43,6 +43,9 @@ export const topQueriesApi = api.injectEndpoints({
43
43
  database,
44
44
  action: 'execute-scan',
45
45
  }, { signal });
46
+ if (isQueryErrorResponse(response)) {
47
+ return { error: response };
48
+ }
46
49
  const data = parseQueryAPIExecuteResponse(response);
47
50
  // FIXME: do we really need this?
48
51
  if (!(filters === null || filters === void 0 ? void 0 : filters.from) && !(filters === null || filters === void 0 ? void 0 : filters.to)) {
@@ -0,0 +1,9 @@
1
+ import type { QueryMode, QueryRequestParams } from '../../../types/store/query';
2
+ import type { PreparedExplainResponse } from './types';
3
+ interface ExplainQueryParams extends QueryRequestParams {
4
+ mode?: QueryMode;
5
+ }
6
+ export declare const explainQueryApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
7
+ explainQuery: import("@reduxjs/toolkit/query").MutationDefinition<ExplainQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", PreparedExplainResponse, "api">;
8
+ }, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
9
+ export {};
@@ -0,0 +1,32 @@
1
+ import { QUERY_SYNTAX, isQueryErrorResponse } from '../../../utils/query';
2
+ import { api } from '../api';
3
+ import { prepareExplainResponse } from './utils';
4
+ export const explainQueryApi = api.injectEndpoints({
5
+ endpoints: (build) => ({
6
+ explainQuery: build.mutation({
7
+ queryFn: async ({ query, database, mode }) => {
8
+ let action = 'explain';
9
+ let syntax = QUERY_SYNTAX.yql;
10
+ if (mode === 'pg') {
11
+ action = 'explain-query';
12
+ syntax = QUERY_SYNTAX.pg;
13
+ }
14
+ else if (mode) {
15
+ action = `explain-${mode}`;
16
+ }
17
+ try {
18
+ const response = await window.api.getExplainQuery(query, database, action, syntax);
19
+ if (isQueryErrorResponse(response)) {
20
+ return { error: response };
21
+ }
22
+ const data = prepareExplainResponse(response);
23
+ return { data };
24
+ }
25
+ catch (error) {
26
+ return { error };
27
+ }
28
+ },
29
+ }),
30
+ }),
31
+ overrideExisting: 'throw',
32
+ });
@@ -0,0 +1,12 @@
1
+ import type { ExplainPlanNodeData, GraphNode, Link } from '@gravity-ui/paranoid';
2
+ import type { PlanTable, QueryPlan, ScriptPlan } from '../../../types/api/query';
3
+ export interface PreparedExplainResponse {
4
+ plan?: {
5
+ links?: Link[];
6
+ nodes?: GraphNode<ExplainPlanNodeData>[];
7
+ tables?: PlanTable[];
8
+ version?: string;
9
+ pristine?: QueryPlan | ScriptPlan;
10
+ };
11
+ ast?: string;
12
+ }
@@ -0,0 +1,6 @@
1
+ import type { ExplainQueryResponse, ExplainScriptResponse } from '../../../types/api/query';
2
+ import type { PreparedExplainResponse } from './types';
3
+ export declare const explainVersions: {
4
+ v2: string;
5
+ };
6
+ export declare const prepareExplainResponse: (response: ExplainScriptResponse | ExplainQueryResponse) => PreparedExplainResponse;
@@ -0,0 +1,40 @@
1
+ import { preparePlan } from '../../../utils/prepareQueryExplain';
2
+ import { parseQueryAPIExplainResponse, parseQueryExplainPlan } from '../../../utils/query';
3
+ export const explainVersions = {
4
+ v2: '0.2',
5
+ };
6
+ const supportedExplainQueryVersions = Object.values(explainVersions);
7
+ export const prepareExplainResponse = (response) => {
8
+ const { plan: rawPlan, ast } = parseQueryAPIExplainResponse(response);
9
+ if (!rawPlan) {
10
+ return { ast };
11
+ }
12
+ const { tables, meta, Plan } = parseQueryExplainPlan(rawPlan);
13
+ if (supportedExplainQueryVersions.indexOf(meta.version) === -1) {
14
+ // Do not prepare plan for not supported versions
15
+ return {
16
+ plan: {
17
+ pristine: rawPlan,
18
+ version: meta.version,
19
+ },
20
+ ast,
21
+ };
22
+ }
23
+ let links = [];
24
+ let nodes = [];
25
+ if (Plan) {
26
+ const preparedPlan = preparePlan(Plan);
27
+ links = preparedPlan.links;
28
+ nodes = preparedPlan.nodes;
29
+ }
30
+ return {
31
+ plan: {
32
+ links,
33
+ nodes,
34
+ tables,
35
+ version: meta.version,
36
+ pristine: rawPlan,
37
+ },
38
+ ast,
39
+ };
40
+ };