ydb-embedded-ui 5.2.0 → 5.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/FullNodeViewer/FullNodeViewer.js +1 -2
- package/dist/containers/Cluster/Cluster.scss +3 -0
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +5 -4
- package/dist/containers/Tenant/Query/i18n/en.json +5 -1
- package/dist/containers/Tenant/Query/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Query/i18n/index.js +2 -5
- package/dist/store/reducers/node/types.d.ts +2 -4
- package/dist/store/reducers/node/utils.js +3 -2
- package/dist/store/reducers/nodes/utils.js +3 -2
- package/dist/store/reducers/storage/utils.js +4 -17
- package/dist/utils/nodes.d.ts +6 -0
- package/dist/utils/nodes.js +11 -0
- package/package.json +1 -1
- package/dist/containers/Tenant/Query/i18n/ru.json +0 -21
@@ -1,7 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import cn from 'bem-cn-lite';
|
3
3
|
import { LOAD_AVERAGE_TIME_INTERVALS } from '../../utils/constants';
|
4
|
-
import { calcUptime } from '../../utils/dataFormatters/dataFormatters';
|
5
4
|
import InfoViewer from '../InfoViewer/InfoViewer';
|
6
5
|
import { ProgressViewer } from '../ProgressViewer/ProgressViewer';
|
7
6
|
import { PoolUsage } from '../PoolUsage/PoolUsage';
|
@@ -18,7 +17,7 @@ export const FullNodeViewer = ({ node, className }) => {
|
|
18
17
|
if ((_b = node === null || node === void 0 ? void 0 : node.Tenants) === null || _b === void 0 ? void 0 : _b.length) {
|
19
18
|
commonInfo.push({ label: 'Database', value: node.Tenants[0] });
|
20
19
|
}
|
21
|
-
commonInfo.push({ label: 'Version', value: node === null || node === void 0 ? void 0 : node.Version }, { label: 'Uptime', value:
|
20
|
+
commonInfo.push({ label: 'Version', value: node === null || node === void 0 ? void 0 : node.Version }, { label: 'Uptime', value: node === null || node === void 0 ? void 0 : node.Uptime }, { label: 'DC', value: (node === null || node === void 0 ? void 0 : node.DataCenterDescription) || (node === null || node === void 0 ? void 0 : node.DC) }, { label: 'Rack', value: node === null || node === void 0 ? void 0 : node.Rack });
|
22
21
|
const averageInfo = (_c = node === null || node === void 0 ? void 0 : node.LoadAverage) === null || _c === void 0 ? void 0 : _c.map((load, loadIndex) => ({
|
23
22
|
label: LOAD_AVERAGE_TIME_INTERVALS[loadIndex],
|
24
23
|
value: (_jsx(ProgressViewer, { value: load, percents: true, colorizeProgress: true, capacity: 100 })),
|
@@ -17,6 +17,7 @@ import { Preview } from '../Preview/Preview';
|
|
17
17
|
import { ExecuteResult } from '../ExecuteResult/ExecuteResult';
|
18
18
|
import { ExplainResult } from '../ExplainResult/ExplainResult';
|
19
19
|
import { QueryEditorControls } from '../QueryEditorControls/QueryEditorControls';
|
20
|
+
import i18n from '../i18n';
|
20
21
|
import './QueryEditor.scss';
|
21
22
|
const EDITOR_OPTIONS = {
|
22
23
|
automaticLayout: true,
|
@@ -196,7 +197,7 @@ function QueryEditor(props) {
|
|
196
197
|
editor.focus();
|
197
198
|
editor.addAction({
|
198
199
|
id: 'sendQuery',
|
199
|
-
label: '
|
200
|
+
label: i18n('action.send-query'),
|
200
201
|
keybindings: [
|
201
202
|
// eslint-disable-next-line no-bitwise
|
202
203
|
monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter,
|
@@ -220,7 +221,7 @@ function QueryEditor(props) {
|
|
220
221
|
});
|
221
222
|
editor.addAction({
|
222
223
|
id: 'sendSelectedQuery',
|
223
|
-
label: '
|
224
|
+
label: i18n('action.send-selected-query'),
|
224
225
|
keybindings: [
|
225
226
|
// eslint-disable-next-line no-bitwise
|
226
227
|
monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.Enter,
|
@@ -232,7 +233,7 @@ function QueryEditor(props) {
|
|
232
233
|
});
|
233
234
|
editor.addAction({
|
234
235
|
id: 'previous-query',
|
235
|
-
label: '
|
236
|
+
label: i18n('action.previous-query'),
|
236
237
|
keybindings: [
|
237
238
|
// eslint-disable-next-line no-bitwise
|
238
239
|
monaco.KeyMod.CtrlCmd | monaco.KeyCode.UpArrow,
|
@@ -245,7 +246,7 @@ function QueryEditor(props) {
|
|
245
246
|
});
|
246
247
|
editor.addAction({
|
247
248
|
id: 'next-query',
|
248
|
-
label: '
|
249
|
+
label: i18n('action.next-query'),
|
249
250
|
keybindings: [
|
250
251
|
// eslint-disable-next-line no-bitwise
|
251
252
|
monaco.KeyMod.CtrlCmd | monaco.KeyCode.DownArrow,
|
@@ -17,5 +17,9 @@
|
|
17
17
|
"method-description.data": "DML queries for changing and fetching data in serialization mode.\nAPI call: table.executeDataQuery",
|
18
18
|
"method-description.query": "Any query. An experimental API call supposed to replace all existing methods.\nAPI Call: query.ExecuteScript",
|
19
19
|
"method-description.pg": "Queries in postgresql syntax.\nAPI call: query.ExecuteScript",
|
20
|
-
"query-duration.description": "Duration of server-side query execution"
|
20
|
+
"query-duration.description": "Duration of server-side query execution",
|
21
|
+
"action.send-query": "Send query",
|
22
|
+
"action.send-selected-query": "Send selected query",
|
23
|
+
"action.previous-query": "Previous query in history",
|
24
|
+
"action.next-query": "Next query in history"
|
21
25
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key:
|
1
|
+
declare const _default: (key: "controls.query-mode-selector_type" | "tabs.newQuery" | "tabs.history" | "tabs.saved" | "history.empty" | "saved.empty" | "delete-dialog.header" | "delete-dialog.question" | "delete-dialog.delete" | "delete-dialog.cancel" | "preview.title" | "preview.not-available" | "preview.close" | "method-description.script" | "method-description.scan" | "method-description.data" | "method-description.query" | "method-description.pg" | "query-duration.description" | "action.send-query" | "action.send-selected-query" | "action.previous-query" | "action.next-query", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
2
2
|
export default _default;
|
@@ -1,7 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { registerKeysets } from '../../../../utils/i18n';
|
2
2
|
import en from './en.json';
|
3
|
-
import ru from './ru.json';
|
4
3
|
const COMPONENT = 'ydb-query-editor';
|
5
|
-
|
6
|
-
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
|
7
|
-
export default i18n.keyset(COMPONENT);
|
4
|
+
export default registerKeysets(COMPONENT, { en });
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { IResponseError } from '../../../types/api/error';
|
2
|
-
import type { TSystemStateInfo } from '../../../types/api/nodes';
|
3
2
|
import type { TPDiskStateInfo } from '../../../types/api/pdisk';
|
4
3
|
import type { TStorageInfo } from '../../../types/api/storage';
|
5
4
|
import type { TVDiskStateInfo } from '../../../types/api/vdisk';
|
5
|
+
import type { PreparedNodeSystemState } from '../../../utils/nodes';
|
6
6
|
import type { ApiRequestAction } from '../../utils';
|
7
7
|
import { FETCH_NODE, FETCH_NODE_STRUCTURE, resetNode } from './node';
|
8
8
|
interface RawStructurePDisk extends TPDiskStateInfo {
|
@@ -17,9 +17,7 @@ export interface PreparedStructurePDisk extends TPDiskStateInfo {
|
|
17
17
|
vDisks: PreparedStructureVDisk[];
|
18
18
|
}
|
19
19
|
export declare type PreparedNodeStructure = Record<string, PreparedStructurePDisk>;
|
20
|
-
export interface PreparedNode extends
|
21
|
-
DC?: string;
|
22
|
-
Rack?: string;
|
20
|
+
export interface PreparedNode extends Partial<PreparedNodeSystemState> {
|
23
21
|
}
|
24
22
|
export interface NodeState {
|
25
23
|
data: PreparedNode;
|
@@ -1,8 +1,9 @@
|
|
1
|
+
import { prepareNodeSystemState } from '../../../utils/nodes';
|
1
2
|
export const prepareNodeData = (data) => {
|
2
|
-
var _a
|
3
|
+
var _a;
|
3
4
|
if (!((_a = data.SystemStateInfo) === null || _a === void 0 ? void 0 : _a.length)) {
|
4
5
|
return {};
|
5
6
|
}
|
6
7
|
const nodeData = data.SystemStateInfo[0];
|
7
|
-
return
|
8
|
+
return prepareNodeSystemState(nodeData);
|
8
9
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { calcUptime } from '../../../utils/dataFormatters/dataFormatters';
|
2
2
|
import { generateEvaluator } from '../../../utils/generateEvaluator';
|
3
|
+
import { prepareNodeSystemState } from '../../../utils/nodes';
|
3
4
|
const prepareComputeNode = (node, tenantName) => {
|
4
5
|
var _a;
|
5
6
|
return Object.assign(Object.assign({}, node), {
|
@@ -36,10 +37,10 @@ export const prepareComputeNodesData = (data) => {
|
|
36
37
|
export const prepareNodesData = (data) => {
|
37
38
|
const rawNodes = data.Nodes || [];
|
38
39
|
const preparedNodes = rawNodes.map((node) => {
|
39
|
-
var _a, _b, _c, _d
|
40
|
+
var _a, _b, _c, _d;
|
40
41
|
// 0 limit means that limit is not set, so it should be undefined
|
41
42
|
const sharedCacheLimit = Number((_a = node.SystemState.SharedCacheStats) === null || _a === void 0 ? void 0 : _a.LimitBytes) || undefined;
|
42
|
-
return Object.assign(Object.assign({}, node.SystemState), { Tablets: node.Tablets, NodeId: node.NodeId,
|
43
|
+
return Object.assign(Object.assign({}, prepareNodeSystemState(node.SystemState)), { Tablets: node.Tablets, NodeId: node.NodeId, TenantName: (_c = (_b = node.SystemState) === null || _b === void 0 ? void 0 : _b.Tenants) === null || _c === void 0 ? void 0 : _c[0], SharedCacheUsed: (_d = node.SystemState.SharedCacheStats) === null || _d === void 0 ? void 0 : _d.UsedBytes, SharedCacheLimit: sharedCacheLimit });
|
43
44
|
});
|
44
45
|
return {
|
45
46
|
Nodes: preparedNodes,
|
@@ -3,7 +3,7 @@ import { TPDiskState } from '../../../types/api/pdisk';
|
|
3
3
|
import { EFlag } from '../../../types/api/enums';
|
4
4
|
import { getPDiskType } from '../../../utils/pdisk';
|
5
5
|
import { getUsage } from '../../../utils/storage';
|
6
|
-
import {
|
6
|
+
import { prepareNodeSystemState } from '../../../utils/nodes';
|
7
7
|
// ==== Constants ====
|
8
8
|
const FLAGS_POINTS = {
|
9
9
|
[EFlag.Green]: 1,
|
@@ -85,24 +85,11 @@ export const prepareStorageGroups = (StorageGroups, StoragePools) => {
|
|
85
85
|
};
|
86
86
|
// ==== Prepare nodes ====
|
87
87
|
const prepareStorageNodeData = (node) => {
|
88
|
-
var _a
|
89
|
-
const
|
90
|
-
const missing = ((_b = node.PDisks) === null || _b === void 0 ? void 0 : _b.filter((pDisk) => {
|
88
|
+
var _a;
|
89
|
+
const missing = ((_a = node.PDisks) === null || _a === void 0 ? void 0 : _a.filter((pDisk) => {
|
91
90
|
return pDisk.State !== TPDiskState.Normal;
|
92
91
|
}).length) || 0;
|
93
|
-
return {
|
94
|
-
NodeId: node.NodeId,
|
95
|
-
SystemState: systemState.SystemState,
|
96
|
-
DC: (_c = systemState.Location) === null || _c === void 0 ? void 0 : _c.DataCenter,
|
97
|
-
Rack: (_d = systemState.Location) === null || _d === void 0 ? void 0 : _d.Rack,
|
98
|
-
Host: systemState.Host,
|
99
|
-
Endpoints: systemState.Endpoints,
|
100
|
-
Uptime: calcUptime(systemState.StartTime),
|
101
|
-
StartTime: systemState.StartTime,
|
102
|
-
PDisks: node.PDisks,
|
103
|
-
VDisks: node.VDisks,
|
104
|
-
Missing: missing,
|
105
|
-
};
|
92
|
+
return Object.assign(Object.assign({}, prepareNodeSystemState(node.SystemState)), { NodeId: node.NodeId, PDisks: node.PDisks, VDisks: node.VDisks, Missing: missing });
|
106
93
|
};
|
107
94
|
// ==== Prepare responses ====
|
108
95
|
export const prepareStorageNodesResponse = (data) => {
|
package/dist/utils/nodes.d.ts
CHANGED
@@ -14,6 +14,12 @@ export declare const NodesUptimeFilterTitles: {
|
|
14
14
|
};
|
15
15
|
export declare const isUnavailableNode: (node: NodesPreparedEntity | TSystemStateInfo) => boolean;
|
16
16
|
export declare const prepareNodesMap: (nodesList?: TNodeInfo[] | undefined) => NodesMap | undefined;
|
17
|
+
export interface PreparedNodeSystemState extends TSystemStateInfo {
|
18
|
+
Rack?: string;
|
19
|
+
DC?: string;
|
20
|
+
Uptime: string;
|
21
|
+
}
|
22
|
+
export declare const prepareNodeSystemState: (systemState?: TSystemStateInfo) => PreparedNodeSystemState;
|
17
23
|
export declare const getProblemParamValue: (problemFilter: ProblemFilterValue | undefined) => boolean;
|
18
24
|
export declare const getUptimeParamValue: (nodesUptimeFilter: NodesUptimeFilterValues | undefined) => number | undefined;
|
19
25
|
/**
|
package/dist/utils/nodes.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ProblemFilterValues } from '../store/reducers/settings/settings';
|
2
2
|
import { EFlag } from '../types/api/enums';
|
3
|
+
import { calcUptime } from './dataFormatters/dataFormatters';
|
3
4
|
import { HOUR_IN_SECONDS } from './constants';
|
4
5
|
export var NodesUptimeFilterValues;
|
5
6
|
(function (NodesUptimeFilterValues) {
|
@@ -19,6 +20,16 @@ export const prepareNodesMap = (nodesList) => {
|
|
19
20
|
return nodesMap;
|
20
21
|
}, new Map());
|
21
22
|
};
|
23
|
+
export const prepareNodeSystemState = (systemState = {}) => {
|
24
|
+
var _a, _b;
|
25
|
+
// There is no Rack in Location field for din nodes
|
26
|
+
const Rack = ((_a = systemState.Location) === null || _a === void 0 ? void 0 : _a.Rack) || systemState.Rack;
|
27
|
+
const DC = ((_b = systemState.Location) === null || _b === void 0 ? void 0 : _b.DataCenter) || systemState.DataCenter;
|
28
|
+
const Uptime = calcUptime(systemState.StartTime);
|
29
|
+
return Object.assign(Object.assign({}, systemState), { Rack,
|
30
|
+
DC,
|
31
|
+
Uptime });
|
32
|
+
};
|
22
33
|
export const getProblemParamValue = (problemFilter) => {
|
23
34
|
return problemFilter === ProblemFilterValues.PROBLEMS;
|
24
35
|
};
|
package/package.json
CHANGED
@@ -1,21 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"controls.query-mode-selector_type": "Тип запроса:",
|
3
|
-
"tabs.newQuery": "Запрос",
|
4
|
-
"tabs.history": "История",
|
5
|
-
"tabs.saved": "Сохраненные",
|
6
|
-
"history.empty": "История пуста",
|
7
|
-
"saved.empty": "Нет сохраненных запросов",
|
8
|
-
"delete-dialog.header": "Удалить запрос",
|
9
|
-
"delete-dialog.question": "Вы уверены что хотите удалить запрос",
|
10
|
-
"delete-dialog.delete": "Удалить",
|
11
|
-
"delete-dialog.cancel": "Отменить",
|
12
|
-
"preview.title": "Предпросмотр",
|
13
|
-
"preview.not-available": "Предпросмотр недоступен",
|
14
|
-
"preview.close": "Закрыть предпросмотр",
|
15
|
-
"method-description.script": "Для скриптов, совмещающих DDL и DML-конструкции.\nAPI call: schema.scripting",
|
16
|
-
"method-description.scan": "Только читающие запросы, потенциально читающие много данных.\nAPI call: table.ExecuteScan",
|
17
|
-
"method-description.data": "DML-запросы для изменения и выборки данных в режиме изоляции Serializable.\nAPI call: table.executeDataQuery",
|
18
|
-
"method-description.query": "Любые запросы. Экспериментальный перспективный метод, который в будущем заменит все остальные.\nAPI call: query.ExecuteScript",
|
19
|
-
"method-description.pg": "Запросы в синтаксисе postgresql.\nAPI call: query.ExecuteScript",
|
20
|
-
"query-duration.description": "Время выполнения запроса на стороне сервера"
|
21
|
-
}
|