ydb-embedded-ui 4.5.2 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +1 -1
  3. package/dist/containers/App/Content.js +3 -2
  4. package/dist/containers/AsideNavigation/AsideNavigation.tsx +4 -50
  5. package/dist/containers/Cluster/Cluster.scss +7 -48
  6. package/dist/containers/Cluster/Cluster.tsx +136 -20
  7. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +34 -17
  8. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +57 -91
  9. package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.scss +48 -0
  10. package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.tsx +34 -0
  11. package/dist/containers/Cluster/utils.ts +34 -0
  12. package/dist/containers/Header/Header.scss +0 -24
  13. package/dist/containers/Header/Header.tsx +14 -44
  14. package/dist/containers/Node/Node.tsx +22 -20
  15. package/dist/containers/Nodes/Nodes.tsx +0 -16
  16. package/dist/containers/Nodes/getNodesColumns.tsx +1 -1
  17. package/dist/containers/Storage/Storage.js +1 -11
  18. package/dist/containers/Tablet/Tablet.tsx +28 -0
  19. package/dist/containers/TabletsFilters/TabletsFilters.js +16 -1
  20. package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +1 -1
  21. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +3 -0
  22. package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +3 -3
  23. package/dist/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.tsx +4 -6
  24. package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +56 -53
  25. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +1 -1
  26. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
  27. package/dist/containers/Tenant/Preview/Preview.js +1 -1
  28. package/dist/containers/Tenant/QueryEditor/QueryEditor.js +26 -22
  29. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/OldQueryEditorControls.tsx +10 -3
  30. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/QueryEditorControls.tsx +8 -1
  31. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/shared.ts +1 -6
  32. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +1 -1
  33. package/dist/containers/Tenant/Tenant.tsx +7 -12
  34. package/dist/containers/Tenant/utils/schemaActions.ts +1 -1
  35. package/dist/containers/Tenants/Tenants.js +18 -28
  36. package/dist/containers/Tenants/Tenants.scss +2 -4
  37. package/dist/containers/UserSettings/i18n/en.json +2 -2
  38. package/dist/containers/UserSettings/i18n/ru.json +2 -2
  39. package/dist/containers/UserSettings/settings.ts +4 -4
  40. package/dist/containers/Versions/Versions.scss +0 -4
  41. package/dist/containers/Versions/Versions.tsx +74 -66
  42. package/dist/routes.ts +0 -7
  43. package/dist/services/api.ts +6 -2
  44. package/dist/store/reducers/clusterNodes/clusterNodes.tsx +4 -0
  45. package/dist/store/reducers/index.ts +3 -1
  46. package/dist/store/reducers/overview/overview.ts +109 -0
  47. package/dist/store/reducers/overview/types.ts +24 -0
  48. package/dist/store/reducers/{schema.ts → schema/schema.ts} +24 -50
  49. package/dist/{types/store/schema.ts → store/reducers/schema/types.ts} +16 -15
  50. package/dist/store/reducers/settings/settings.ts +5 -3
  51. package/dist/types/api/query.ts +78 -44
  52. package/dist/types/store/explainQuery.ts +2 -2
  53. package/dist/types/store/query.ts +4 -2
  54. package/dist/utils/constants.ts +3 -1
  55. package/dist/utils/nodes.ts +1 -1
  56. package/dist/utils/query.ts +3 -3
  57. package/package.json +1 -1
@@ -24,17 +24,17 @@ interface TKqpStatsCompile {}
24
24
  interface TDqTableStats {
25
25
  TablePath?: string;
26
26
  /** uint64 */
27
- ReadRows?: string;
27
+ ReadRows?: string | number;
28
28
  /** uint64 */
29
- ReadBytes?: string;
29
+ ReadBytes?: string | number;
30
30
  /** uint64 */
31
- WriteRows?: string;
31
+ WriteRows?: string | number;
32
32
  /** uint64 */
33
- WriteBytes?: string;
33
+ WriteBytes?: string | number;
34
34
  /** uint64 */
35
- EraseRows?: string;
35
+ EraseRows?: string | number;
36
36
  /** uint64 */
37
- EraseBytes?: string;
37
+ EraseBytes?: string | number;
38
38
  AffectedPartitions?: number;
39
39
  Extra?: unknown;
40
40
  }
@@ -42,24 +42,24 @@ interface TDqTableStats {
42
42
  /** source: https://github.com/ydb-platform/ydb/blob/main/ydb/library/yql/dq/actors/protos/dq_stats.proto */
43
43
  interface TDqExecutionStats {
44
44
  /** uint64 */
45
- CpuTimeUs?: string;
45
+ CpuTimeUs?: string | number;
46
46
  /** uint64 */
47
- DurationUs?: string;
47
+ DurationUs?: string | number;
48
48
  /** uint64 */
49
- ResultRows?: string;
49
+ ResultRows?: string | number;
50
50
  /** uint64 */
51
- ResultBytes?: string;
51
+ ResultBytes?: string | number;
52
52
 
53
53
  Tables?: TDqTableStats[];
54
54
 
55
55
  /** uint64 */
56
- ExecuterCpuTimeUs?: string;
56
+ ExecuterCpuTimeUs?: string | number;
57
57
  /** uint64 */
58
- StartTimeMs?: string;
58
+ StartTimeMs?: string | number;
59
59
  /** uint64 */
60
- FinishTimeMs?: string;
60
+ FinishTimeMs?: string | number;
61
61
  /** uint64 */
62
- FirstRowTimeMs?: string;
62
+ FirstRowTimeMs?: string | number;
63
63
 
64
64
  Stages?: TDqStageStats[];
65
65
  TxPlansWithStats?: string[];
@@ -70,17 +70,17 @@ interface TDqExecutionStats {
70
70
  /** source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/kqp_stats.proto */
71
71
  export interface TKqpStatsQuery {
72
72
  /** uint64 */
73
- DurationUs?: string;
73
+ DurationUs?: string | number;
74
74
  Compilation?: TKqpStatsCompile;
75
75
 
76
76
  /** uint64 */
77
- WorkerCpuTimeUs?: string;
77
+ WorkerCpuTimeUs?: string | number;
78
78
  /** uint64 */
79
- ReadSetsCount?: string;
79
+ ReadSetsCount?: string | number;
80
80
  /** uint64 */
81
- MaxShardProgramSize?: string;
81
+ MaxShardProgramSize?: string | number;
82
82
  /** uint64 */
83
- MaxShardReplySize?: string;
83
+ MaxShardReplySize?: string | number;
84
84
 
85
85
  Executions?: TDqExecutionStats[];
86
86
  }
@@ -120,6 +120,10 @@ interface PlanNodeStats {
120
120
  TotalOutputBytes?: number;
121
121
  TotalDurationMs?: number;
122
122
  TotalOutputRows?: number;
123
+
124
+ ComputeNodes?: unknown[];
125
+ NodesScanShards?: unknown[];
126
+ UseLlvm?: unknown;
123
127
  }
124
128
 
125
129
  interface PlanNodeOperator {
@@ -128,6 +132,7 @@ interface PlanNodeOperator {
128
132
  ReadLimit?: string;
129
133
  ReadColumns?: string[];
130
134
  ReadRanges?: string[];
135
+ ReadRange?: string[];
131
136
  Table?: string;
132
137
  Iterator?: string;
133
138
  }
@@ -153,7 +158,7 @@ export interface ScriptPlan {
153
158
  meta: PlanMeta;
154
159
  }
155
160
 
156
- export interface ScanPlan {
161
+ export interface QueryPlan {
157
162
  Plan?: PlanNode;
158
163
  tables?: PlanTable[];
159
164
  meta: PlanMeta;
@@ -177,15 +182,22 @@ export interface ColumnType {
177
182
  /** undefined = 'classic' */
178
183
  export type Schemas = 'classic' | 'modern' | 'ydb' | undefined;
179
184
 
180
- /**
181
- * undefined = 'execute'
182
- *
183
- * execute and execute-script have similar responses
184
- */
185
- export type ExecuteActions = 'execute' | 'execute-scan' | 'execute-script' | undefined;
186
-
187
- /** explain, explain-scan and explain-ast have similar responses */
188
- export type ExplainActions = 'explain' | 'explain-scan' | 'explain-script' | 'explain-ast';
185
+ /** undefined = 'execute' */
186
+ export type ExecuteActions =
187
+ | 'execute'
188
+ | 'execute-scan'
189
+ | 'execute-script'
190
+ | 'execute-data'
191
+ | 'execute-query'
192
+ | undefined;
193
+
194
+ export type ExplainActions =
195
+ | 'explain'
196
+ | 'explain-scan'
197
+ | 'explain-script'
198
+ | 'explain-data'
199
+ | 'explain-query'
200
+ | 'explain-ast';
189
201
 
190
202
  export type Actions = ExecuteActions | ExplainActions;
191
203
 
@@ -197,19 +209,27 @@ export interface ErrorResponse {
197
209
  }
198
210
 
199
211
  // ==== Explain Responses ====
200
-
212
+ /**
213
+ * meta.type = 'script'
214
+ *
215
+ * explain-script
216
+ */
201
217
  export interface ExplainScriptResponse {
202
218
  plan?: ScriptPlan;
203
219
  }
204
-
205
- export interface ExplainScanResponse {
220
+ /**
221
+ * meta.type = 'query'
222
+ *
223
+ * explain, explain-scan, explain-data, explain-query, explain-ast
224
+ */
225
+ export interface ExplainQueryResponse {
206
226
  ast?: string;
207
- plan?: ScanPlan;
227
+ plan?: QueryPlan;
208
228
  }
209
229
 
210
230
  export type ExplainResponse<Action extends ExplainActions> = Action extends 'explain-script'
211
231
  ? ExplainScriptResponse
212
- : ExplainScanResponse;
232
+ : ExplainQueryResponse;
213
233
 
214
234
  // ==== Execute Responses ====
215
235
 
@@ -222,22 +242,34 @@ type ResultFields<Schema extends Schemas> = Schema extends 'modern'
222
242
  result?: KeyValueRow[];
223
243
  };
224
244
 
225
- export type ExecuteScanResponse<Schema extends Schemas> = {
226
- plan?: ScanPlan;
245
+ /**
246
+ * meta.type = 'query'
247
+ *
248
+ * execute-scan, execute-data, execute-query
249
+ */
250
+ export type ExecuteQueryResponse<Schema extends Schemas> = {
251
+ plan?: QueryPlan;
227
252
  ast?: string;
228
253
  stats?: TKqpStatsQuery;
229
254
  } & ResultFields<Schema>;
230
255
 
256
+ /**
257
+ * meta.type = 'script'
258
+ *
259
+ * execute, execute-script
260
+ */
231
261
  export type ExecuteScriptResponse<Schema extends Schemas> = {
232
262
  plan?: ScriptPlan;
233
263
  ast?: string;
234
264
  stats?: TKqpStatsQuery;
235
265
  } & ResultFields<Schema>;
236
266
 
237
- export type ExecuteResponse<
238
- Action extends ExecuteActions,
239
- Schema extends Schemas,
240
- > = Action extends 'execute-scan' ? ExecuteScanResponse<Schema> : ExecuteScriptResponse<Schema>;
267
+ export type ExecuteResponse<Action extends ExecuteActions, Schema extends Schemas> = Action extends
268
+ | 'execute-scan'
269
+ | 'execute-data'
270
+ | 'execute-query'
271
+ ? ExecuteQueryResponse<Schema>
272
+ : ExecuteScriptResponse<Schema>;
241
273
 
242
274
  // ==== Combined API response ====
243
275
  export type QueryAPIResponse<
@@ -250,13 +282,15 @@ export type QueryAPIResponse<
250
282
  : unknown;
251
283
 
252
284
  // ==== types to use in query result preparation ====
253
- export type AnyExplainResponse = ExplainScanResponse | ExplainScriptResponse;
285
+ export type AnyExplainResponse = ExplainQueryResponse | ExplainScriptResponse;
254
286
 
255
- export type ExecuteModernResponse = ExecuteScanResponse<'modern'> | ExecuteScriptResponse<'modern'>;
287
+ export type ExecuteModernResponse =
288
+ | ExecuteQueryResponse<'modern'>
289
+ | ExecuteScriptResponse<'modern'>;
256
290
  export type ExecuteClassicResponse =
257
- | ExecuteScanResponse<'classic'>
291
+ | ExecuteQueryResponse<'classic'>
258
292
  | ExecuteScriptResponse<'classic'>;
259
- export type ExecuteYdbResponse = ExecuteScanResponse<'ydb'> | ExecuteScriptResponse<'ydb'>;
293
+ export type ExecuteYdbResponse = ExecuteQueryResponse<'ydb'> | ExecuteScriptResponse<'ydb'>;
260
294
 
261
295
  export type AnyExecuteResponse =
262
296
  | ExecuteModernResponse
@@ -2,7 +2,7 @@ import type {ExplainPlanNodeData, GraphNode, Link} from '@gravity-ui/paranoid';
2
2
 
3
3
  import {GET_EXPLAIN_QUERY, GET_EXPLAIN_QUERY_AST} from '../../store/reducers/explainQuery';
4
4
  import type {ApiRequestAction} from '../../store/utils';
5
- import type {PlanTable, ErrorResponse, ScanPlan, ScriptPlan} from '../api/query';
5
+ import type {PlanTable, ErrorResponse, QueryPlan, ScriptPlan} from '../api/query';
6
6
  import type {IQueryResult, QueryError} from './query';
7
7
 
8
8
  export interface PreparedExplainResponse {
@@ -11,7 +11,7 @@ export interface PreparedExplainResponse {
11
11
  nodes?: GraphNode<ExplainPlanNodeData>[];
12
12
  tables?: PlanTable[];
13
13
  version?: string;
14
- pristine?: ScanPlan | ScriptPlan;
14
+ pristine?: QueryPlan | ScriptPlan;
15
15
  };
16
16
  ast?: string;
17
17
  }
@@ -4,7 +4,7 @@ import type {
4
4
  ColumnType,
5
5
  ErrorResponse,
6
6
  ScriptPlan,
7
- ScanPlan,
7
+ QueryPlan,
8
8
  TKqpStatsQuery,
9
9
  } from '../api/query';
10
10
 
@@ -12,7 +12,7 @@ export interface IQueryResult {
12
12
  result?: KeyValueRow[];
13
13
  columns?: ColumnType[];
14
14
  stats?: TKqpStatsQuery;
15
- plan?: ScriptPlan | ScanPlan;
15
+ plan?: ScriptPlan | QueryPlan;
16
16
  ast?: string;
17
17
  }
18
18
 
@@ -26,4 +26,6 @@ export type QueryError = NetworkError | ErrorResponse;
26
26
  export enum QueryModes {
27
27
  scan = 'scan',
28
28
  script = 'script',
29
+ data = 'data',
30
+ query = 'query',
29
31
  }
@@ -78,7 +78,7 @@ export const COLORS_PRIORITY = {
78
78
  export const THEME_KEY = 'theme';
79
79
  export const INVERTED_DISKS_KEY = 'invertedDisks';
80
80
  export const USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY = 'useNodesEndpointInDiagnostics';
81
- export const ENABLE_QUERY_MODES_FOR_EXPLAIN = 'enableQueryModesForExplain';
81
+ export const ENABLE_ADDITIONAL_QUERY_MODES = 'enableAdditionalQueryModes';
82
82
  export const SAVED_QUERIES_KEY = 'saved_queries';
83
83
  export const ASIDE_HEADER_COMPACT_KEY = 'asideHeaderCompact';
84
84
  export const QUERIES_HISTORY_KEY = 'queries_history';
@@ -106,3 +106,5 @@ export const TENANT_INITIAL_TAB_KEY = 'saved_tenant_initial_tab';
106
106
  export const QUERY_INITIAL_MODE_KEY = 'query_initial_mode';
107
107
 
108
108
  export const PARTITIONS_HIDDEN_COLUMNS_KEY = 'partitionsHiddenColumns';
109
+
110
+ export const CLUSTER_INFO_HIDDEN_KEY = 'clusterInfoHidden';
@@ -20,7 +20,7 @@ export const isUnavailableNode = (node: INodesPreparedEntity | TSystemStateInfo)
20
20
  export type NodeAddress = Pick<TSystemStateInfo, 'Host' | 'Endpoints'>;
21
21
 
22
22
  export interface AdditionalNodesInfo extends Record<string, unknown> {
23
- getNodeRef?: (node?: NodeAddress) => string;
23
+ getNodeRef?: (node?: NodeAddress) => string | null;
24
24
  }
25
25
 
26
26
  export const prepareNodesMap = (nodesList?: TNodeInfo[]) => {
@@ -4,7 +4,7 @@ import type {
4
4
  AnyExplainResponse,
5
5
  ExecuteModernResponse,
6
6
  KeyValueRow,
7
- ScanPlan,
7
+ QueryPlan,
8
8
  ScriptPlan,
9
9
  } from '../types/api/query';
10
10
  import type {IQueryResult} from '../types/store/query';
@@ -115,10 +115,10 @@ export const parseQueryAPIExplainResponse = (
115
115
  return data;
116
116
  };
117
117
 
118
- const isExplainScriptPlan = (plan: ScriptPlan | ScanPlan): plan is ScriptPlan =>
118
+ const isExplainScriptPlan = (plan: ScriptPlan | QueryPlan): plan is ScriptPlan =>
119
119
  Boolean(plan && 'queries' in plan);
120
120
 
121
- export const parseQueryExplainPlan = (plan: ScriptPlan | ScanPlan): ScanPlan => {
121
+ export const parseQueryExplainPlan = (plan: ScriptPlan | QueryPlan): QueryPlan => {
122
122
  if (isExplainScriptPlan(plan)) {
123
123
  if (!plan.queries || !plan.queries.length) {
124
124
  return {meta: plan.meta};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.5.2",
3
+ "version": "4.6.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],