ydb-embedded-ui 4.5.2 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +33 -0
- package/dist/assets/icons/versions.svg +3 -0
- package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +7 -2
- package/dist/components/Tablet/Tablet.tsx +17 -3
- package/dist/components/TabletsStatistic/TabletsStatistic.tsx +23 -16
- package/dist/containers/App/Content.js +8 -4
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +4 -50
- package/dist/containers/Cluster/Cluster.scss +7 -48
- package/dist/containers/Cluster/Cluster.tsx +129 -20
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +34 -17
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +58 -92
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.scss +48 -0
- package/dist/containers/Cluster/ClusterInfoSkeleton/ClusterInfoSkeleton.tsx +34 -0
- package/dist/containers/Cluster/utils.tsx +45 -0
- package/dist/containers/Header/Header.scss +4 -19
- package/dist/containers/Header/Header.tsx +72 -46
- package/dist/containers/Header/breadcrumbs.ts +146 -0
- package/dist/containers/Node/Node.tsx +25 -29
- package/dist/containers/Node/NodePages.ts +10 -6
- package/dist/containers/Nodes/Nodes.tsx +0 -16
- package/dist/containers/Nodes/getNodesColumns.tsx +1 -1
- package/dist/containers/Storage/Storage.js +1 -11
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +11 -3
- package/dist/containers/Tablet/Tablet.tsx +40 -4
- package/dist/containers/Tablet/TabletInfo/TabletInfo.tsx +2 -2
- package/dist/containers/TabletsFilters/TabletsFilters.js +15 -2
- package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +7 -0
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +4 -4
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss +5 -3
- package/dist/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.tsx +4 -6
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +56 -53
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +2 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +11 -13
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +1 -1
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +2 -2
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +7 -3
- package/dist/containers/Tenant/Preview/Preview.js +1 -1
- package/dist/containers/Tenant/{QueryEditor/QueryResult/QueryResult.js → Query/ExecuteResult/ExecuteResult.js} +3 -5
- package/dist/containers/Tenant/{QueryEditor/QueryResult/QueryResult.scss → Query/ExecuteResult/ExecuteResult.scss} +1 -1
- package/dist/containers/Tenant/{QueryEditor/QueryExplain/QueryExplain.js → Query/ExplainResult/ExplainResult.js} +3 -5
- package/dist/containers/Tenant/{QueryEditor/QueryExplain/QueryExplain.scss → Query/ExplainResult/ExplainResult.scss} +1 -1
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.scss +20 -0
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.tsx +60 -0
- package/dist/containers/Tenant/Query/Query.scss +16 -0
- package/dist/containers/Tenant/Query/Query.tsx +73 -0
- package/dist/containers/Tenant/{QueryEditor → Query/QueryEditor}/QueryEditor.js +43 -100
- package/dist/containers/Tenant/{QueryEditor → Query/QueryEditor}/QueryEditor.scss +7 -23
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/OldQueryEditorControls.tsx +10 -3
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/QueryEditorControls.scss +1 -4
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/QueryEditorControls.tsx +8 -1
- package/dist/containers/Tenant/{QueryEditor → Query}/QueryEditorControls/shared.ts +1 -6
- package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.tsx +59 -0
- package/dist/containers/Tenant/{QueryEditor → Query}/SaveQuery/SaveQuery.js +5 -5
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.scss +55 -0
- package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.tsx +150 -0
- package/dist/containers/Tenant/Query/i18n/en.json +12 -0
- package/dist/containers/Tenant/Query/i18n/ru.json +12 -0
- package/dist/containers/Tenant/Query/utils/getPreparedResult.ts +30 -0
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx +1 -1
- package/dist/containers/Tenant/Tenant.tsx +4 -25
- package/dist/containers/Tenant/TenantPages.tsx +8 -2
- package/dist/containers/Tenant/utils/constants.ts +10 -0
- package/dist/containers/Tenant/utils/schemaActions.ts +8 -3
- package/dist/containers/Tenants/Tenants.js +39 -37
- package/dist/containers/Tenants/Tenants.scss +2 -4
- package/dist/containers/UserSettings/i18n/en.json +2 -2
- package/dist/containers/UserSettings/i18n/ru.json +2 -2
- package/dist/containers/UserSettings/settings.ts +4 -4
- package/dist/containers/Versions/Versions.scss +0 -4
- package/dist/containers/Versions/Versions.tsx +74 -66
- package/dist/routes.ts +8 -6
- package/dist/services/api.ts +15 -7
- package/dist/store/reducers/clusterNodes/clusterNodes.tsx +4 -0
- package/dist/store/reducers/executeQuery.ts +1 -1
- package/dist/store/reducers/header/header.ts +31 -0
- package/dist/store/reducers/header/types.ts +54 -0
- package/dist/store/reducers/index.ts +4 -2
- package/dist/store/reducers/node/types.ts +2 -0
- package/dist/store/reducers/overview/overview.ts +109 -0
- package/dist/store/reducers/overview/types.ts +24 -0
- package/dist/store/reducers/{schema.ts → schema/schema.ts} +24 -50
- package/dist/{types/store/schema.ts → store/reducers/schema/types.ts} +16 -15
- package/dist/store/reducers/settings/settings.ts +5 -3
- package/dist/store/reducers/tablet.ts +18 -1
- package/dist/store/reducers/tenant/constants.ts +6 -0
- package/dist/store/reducers/tenant/tenant.ts +21 -2
- package/dist/store/reducers/tenant/types.ts +9 -2
- package/dist/store/reducers/topic.ts +1 -1
- package/dist/store/state-url-mapping.js +4 -1
- package/dist/types/api/query.ts +78 -44
- package/dist/types/store/explainQuery.ts +2 -2
- package/dist/types/store/query.ts +9 -2
- package/dist/types/store/tablet.ts +7 -4
- package/dist/utils/constants.ts +5 -1
- package/dist/utils/nodes.ts +1 -1
- package/dist/utils/query.ts +3 -3
- package/package.json +2 -1
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.scss +0 -85
- package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +0 -95
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.js +0 -161
- package/dist/containers/Tenant/QueryEditor/SavedQueries/SavedQueries.scss +0 -93
- package/dist/containers/Tenant/QueryEditor/i18n/en.json +0 -3
- package/dist/containers/Tenant/QueryEditor/i18n/ru.json +0 -3
- package/dist/store/reducers/header.ts +0 -26
- /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/Issues.scss +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/Issues.tsx +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/Issues/models.ts +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/QueryDuration/QueryDuration.scss +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/QueryDuration/QueryDuration.tsx +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/SaveQuery/SaveQuery.scss +0 -0
- /package/dist/containers/Tenant/{QueryEditor → Query}/i18n/index.ts +0 -0
package/dist/types/api/query.ts
CHANGED
@@ -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
|
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
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
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
|
-
|
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?:
|
227
|
+
plan?: QueryPlan;
|
208
228
|
}
|
209
229
|
|
210
230
|
export type ExplainResponse<Action extends ExplainActions> = Action extends 'explain-script'
|
211
231
|
? ExplainScriptResponse
|
212
|
-
:
|
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
|
-
|
226
|
-
|
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
|
-
|
239
|
-
|
240
|
-
|
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 =
|
285
|
+
export type AnyExplainResponse = ExplainQueryResponse | ExplainScriptResponse;
|
254
286
|
|
255
|
-
export type ExecuteModernResponse =
|
287
|
+
export type ExecuteModernResponse =
|
288
|
+
| ExecuteQueryResponse<'modern'>
|
289
|
+
| ExecuteScriptResponse<'modern'>;
|
256
290
|
export type ExecuteClassicResponse =
|
257
|
-
|
|
291
|
+
| ExecuteQueryResponse<'classic'>
|
258
292
|
| ExecuteScriptResponse<'classic'>;
|
259
|
-
export type ExecuteYdbResponse =
|
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,
|
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?:
|
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
|
-
|
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 |
|
15
|
+
plan?: ScriptPlan | QueryPlan;
|
16
16
|
ast?: string;
|
17
17
|
}
|
18
18
|
|
@@ -26,4 +26,11 @@ export type QueryError = NetworkError | ErrorResponse;
|
|
26
26
|
export enum QueryModes {
|
27
27
|
scan = 'scan',
|
28
28
|
script = 'script',
|
29
|
+
data = 'data',
|
30
|
+
query = 'query',
|
31
|
+
}
|
32
|
+
|
33
|
+
export interface SavedQuery {
|
34
|
+
name: string;
|
35
|
+
body: string;
|
29
36
|
}
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import type {ApiRequestAction} from '../../store/utils';
|
1
2
|
import type {IResponseError} from '../api/error';
|
2
3
|
import type {ETabletState, TTabletStateInfo} from '../api/tablet';
|
3
4
|
|
4
|
-
import {FETCH_TABLET, FETCH_TABLET_DESCRIBE} from '../../store/reducers/tablet';
|
5
|
-
import {ApiRequestAction} from '../../store/utils';
|
5
|
+
import {FETCH_TABLET, FETCH_TABLET_DESCRIBE, clearTabletData} from '../../store/reducers/tablet';
|
6
6
|
|
7
7
|
export interface ITabletPreparedHistoryItem {
|
8
8
|
nodeId: string;
|
@@ -16,7 +16,7 @@ export interface ITabletPreparedHistoryItem {
|
|
16
16
|
|
17
17
|
export interface ITabletState {
|
18
18
|
loading: boolean;
|
19
|
-
tenantPath
|
19
|
+
tenantPath?: string;
|
20
20
|
error?: IResponseError;
|
21
21
|
id?: string;
|
22
22
|
history?: ITabletPreparedHistoryItem[];
|
@@ -44,7 +44,10 @@ type ITabletDescribeApiRequestAction = ApiRequestAction<
|
|
44
44
|
IResponseError
|
45
45
|
>;
|
46
46
|
|
47
|
-
export type ITabletAction =
|
47
|
+
export type ITabletAction =
|
48
|
+
| ITabletApiRequestAction
|
49
|
+
| ITabletDescribeApiRequestAction
|
50
|
+
| ReturnType<typeof clearTabletData>;
|
48
51
|
|
49
52
|
export interface ITabletRootStateSlice {
|
50
53
|
tablet: ITabletState;
|
package/dist/utils/constants.ts
CHANGED
@@ -75,10 +75,12 @@ export const COLORS_PRIORITY = {
|
|
75
75
|
grey: 1,
|
76
76
|
};
|
77
77
|
|
78
|
+
export const DEVELOPER_UI = 'Developer UI';
|
79
|
+
|
78
80
|
export const THEME_KEY = 'theme';
|
79
81
|
export const INVERTED_DISKS_KEY = 'invertedDisks';
|
80
82
|
export const USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY = 'useNodesEndpointInDiagnostics';
|
81
|
-
export const
|
83
|
+
export const ENABLE_ADDITIONAL_QUERY_MODES = 'enableAdditionalQueryModes';
|
82
84
|
export const SAVED_QUERIES_KEY = 'saved_queries';
|
83
85
|
export const ASIDE_HEADER_COMPACT_KEY = 'asideHeaderCompact';
|
84
86
|
export const QUERIES_HISTORY_KEY = 'queries_history';
|
@@ -106,3 +108,5 @@ export const TENANT_INITIAL_TAB_KEY = 'saved_tenant_initial_tab';
|
|
106
108
|
export const QUERY_INITIAL_MODE_KEY = 'query_initial_mode';
|
107
109
|
|
108
110
|
export const PARTITIONS_HIDDEN_COLUMNS_KEY = 'partitionsHiddenColumns';
|
111
|
+
|
112
|
+
export const CLUSTER_INFO_HIDDEN_KEY = 'clusterInfoHidden';
|
package/dist/utils/nodes.ts
CHANGED
@@ -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[]) => {
|
package/dist/utils/query.ts
CHANGED
@@ -4,7 +4,7 @@ import type {
|
|
4
4
|
AnyExplainResponse,
|
5
5
|
ExecuteModernResponse,
|
6
6
|
KeyValueRow,
|
7
|
-
|
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 |
|
118
|
+
const isExplainScriptPlan = (plan: ScriptPlan | QueryPlan): plan is ScriptPlan =>
|
119
119
|
Boolean(plan && 'queries' in plan);
|
120
120
|
|
121
|
-
export const parseQueryExplainPlan = (plan: ScriptPlan |
|
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.
|
3
|
+
"version": "4.7.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -103,6 +103,7 @@
|
|
103
103
|
"@commitlint/cli": "^15.0.0",
|
104
104
|
"@commitlint/config-conventional": "^15.0.0",
|
105
105
|
"@gravity-ui/eslint-config": "^1.0.2",
|
106
|
+
"@gravity-ui/icons": "^2.2.0",
|
106
107
|
"@gravity-ui/prettier-config": "^1.0.1",
|
107
108
|
"@gravity-ui/stylelint-config": "^1.0.1",
|
108
109
|
"@gravity-ui/tsconfig": "^1.0.0",
|
@@ -1,85 +0,0 @@
|
|
1
|
-
$popup-width: 700px;
|
2
|
-
|
3
|
-
.kv-queries-history {
|
4
|
-
$block: &;
|
5
|
-
padding: 12px 16px;
|
6
|
-
|
7
|
-
&__empty {
|
8
|
-
font-weight: 600;
|
9
|
-
text-align: center;
|
10
|
-
}
|
11
|
-
&__popup-wrapper {
|
12
|
-
overflow: hidden;
|
13
|
-
|
14
|
-
width: $popup-width;
|
15
|
-
max-width: $popup-width !important;
|
16
|
-
|
17
|
-
border-radius: 4px;
|
18
|
-
:nth-child(2) {
|
19
|
-
overflow-y: auto;
|
20
|
-
|
21
|
-
max-height: 50vh;
|
22
|
-
}
|
23
|
-
|
24
|
-
&::before {
|
25
|
-
width: $popup-width;
|
26
|
-
|
27
|
-
border-radius: 4px;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
&__saved-queries-row {
|
31
|
-
display: flex;
|
32
|
-
align-items: center;
|
33
|
-
|
34
|
-
padding: 8px 5px;
|
35
|
-
|
36
|
-
border-bottom: 1px solid var(--yc-color-line-generic);
|
37
|
-
&:hover {
|
38
|
-
cursor: pointer;
|
39
|
-
|
40
|
-
color: var(--yc-color-text-link-hover);
|
41
|
-
background: var(--yc-color-base-simple-hover);
|
42
|
-
#{$block}__query-controls {
|
43
|
-
display: flex;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
&_header {
|
47
|
-
font-weight: 600;
|
48
|
-
&:hover {
|
49
|
-
cursor: auto;
|
50
|
-
|
51
|
-
color: var(--yc-color-text-primary);
|
52
|
-
background: var(--yc-color-base-background);
|
53
|
-
}
|
54
|
-
}
|
55
|
-
}
|
56
|
-
&__query-body {
|
57
|
-
overflow: hidden;
|
58
|
-
flex-grow: 1;
|
59
|
-
|
60
|
-
white-space: pre;
|
61
|
-
text-overflow: ellipsis;
|
62
|
-
&_header {
|
63
|
-
display: flex;
|
64
|
-
justify-content: center;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
&__query-controls {
|
68
|
-
display: none;
|
69
|
-
}
|
70
|
-
&__control-button {
|
71
|
-
display: flex;
|
72
|
-
justify-content: center;
|
73
|
-
align-items: center;
|
74
|
-
|
75
|
-
width: 24px;
|
76
|
-
|
77
|
-
color: var(--yc-color-text-hint);
|
78
|
-
&:hover {
|
79
|
-
color: var(--yc-color-text-secondary);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
&__dialog-query-name {
|
83
|
-
font-weight: 500;
|
84
|
-
}
|
85
|
-
}
|
@@ -1,95 +0,0 @@
|
|
1
|
-
import React, {useRef, useState} from 'react';
|
2
|
-
import cn from 'bem-cn-lite';
|
3
|
-
import _ from 'lodash';
|
4
|
-
import {Button, Popup} from '@gravity-ui/uikit';
|
5
|
-
|
6
|
-
import TruncatedQuery from '../../../../components/TruncatedQuery/TruncatedQuery';
|
7
|
-
import {useTypedSelector} from '../../../../utils/hooks';
|
8
|
-
|
9
|
-
import './QueriesHistory.scss';
|
10
|
-
|
11
|
-
const b = cn('kv-queries-history');
|
12
|
-
|
13
|
-
const MAX_QUERY_HEIGHT = 3;
|
14
|
-
|
15
|
-
interface QueriesHistoryProps {
|
16
|
-
changeUserInput: (value: {input: string}) => void;
|
17
|
-
}
|
18
|
-
|
19
|
-
function QueriesHistory(props: QueriesHistoryProps) {
|
20
|
-
const [isHistoryVisible, setIsHistoryVisible] = useState(false);
|
21
|
-
const history = useTypedSelector((state) => state.executeQuery.history.queries) ?? [];
|
22
|
-
const anchor = useRef(null);
|
23
|
-
|
24
|
-
const onShowHistoryClick = () => {
|
25
|
-
setIsHistoryVisible(true);
|
26
|
-
};
|
27
|
-
|
28
|
-
const onCloseHistory = () => {
|
29
|
-
setIsHistoryVisible(false);
|
30
|
-
};
|
31
|
-
|
32
|
-
const onQueryClick = (queryText: string) => {
|
33
|
-
const {changeUserInput} = props;
|
34
|
-
return () => {
|
35
|
-
changeUserInput({input: queryText});
|
36
|
-
onCloseHistory();
|
37
|
-
};
|
38
|
-
};
|
39
|
-
|
40
|
-
const renderSavedQueries = () => {
|
41
|
-
const reversedHistory = ([] as string[]).concat(history).reverse();
|
42
|
-
return (
|
43
|
-
<Popup
|
44
|
-
className={b('popup-wrapper')}
|
45
|
-
anchorRef={anchor}
|
46
|
-
open={isHistoryVisible}
|
47
|
-
placement={['bottom-end']}
|
48
|
-
onClose={onCloseHistory}
|
49
|
-
>
|
50
|
-
<div className={b()}>
|
51
|
-
{reversedHistory.length === 0 ? (
|
52
|
-
<div className={b('empty')}>History is empty</div>
|
53
|
-
) : (
|
54
|
-
<React.Fragment>
|
55
|
-
<div className={b('saved-queries-row', {header: true})}>
|
56
|
-
<div className={b('query-body', {header: true})}>
|
57
|
-
<span>QueryText</span>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
<div>
|
61
|
-
{reversedHistory.map((query, index) => {
|
62
|
-
return (
|
63
|
-
<div
|
64
|
-
className={b('saved-queries-row')}
|
65
|
-
onClick={onQueryClick(query)}
|
66
|
-
key={index}
|
67
|
-
>
|
68
|
-
<div className={b('query-body')}>
|
69
|
-
<TruncatedQuery
|
70
|
-
value={query}
|
71
|
-
maxQueryHeight={MAX_QUERY_HEIGHT}
|
72
|
-
/>
|
73
|
-
</div>
|
74
|
-
</div>
|
75
|
-
);
|
76
|
-
})}
|
77
|
-
</div>
|
78
|
-
</React.Fragment>
|
79
|
-
)}
|
80
|
-
</div>
|
81
|
-
</Popup>
|
82
|
-
);
|
83
|
-
};
|
84
|
-
|
85
|
-
return (
|
86
|
-
<React.Fragment>
|
87
|
-
<Button ref={anchor} onClick={onShowHistoryClick}>
|
88
|
-
Query history
|
89
|
-
</Button>
|
90
|
-
{isHistoryVisible && renderSavedQueries()}
|
91
|
-
</React.Fragment>
|
92
|
-
);
|
93
|
-
}
|
94
|
-
|
95
|
-
export default QueriesHistory;
|