ydb-embedded-ui 5.0.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. package/dist/components/BasicNodeViewer/BasicNodeViewer.d.ts +2 -2
  2. package/dist/components/BasicNodeViewer/BasicNodeViewer.js +1 -1
  3. package/dist/components/ComponentsProvider/ComponentsProvider.d.ts +4 -0
  4. package/dist/components/ComponentsProvider/componentsRegistry.d.ts +3 -0
  5. package/dist/components/ComponentsProvider/componentsRegistry.js +3 -1
  6. package/dist/components/EntityStatus/EntityStatus.scss +1 -1
  7. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +11 -1
  8. package/dist/components/ErrorBoundary/ErrorBoundary.js +11 -3
  9. package/dist/components/FullNodeViewer/FullNodeViewer.d.ts +2 -2
  10. package/dist/components/FullNodeViewer/FullNodeViewer.js +1 -1
  11. package/dist/components/LagImages/LagImages.js +2 -2
  12. package/dist/components/ProgressViewer/ProgressViewer.js +6 -5
  13. package/dist/components/ProgressViewer/ProgressViewer.scss +33 -17
  14. package/dist/components/TabletsOverall/TabletsOverall.js +6 -6
  15. package/dist/containers/App/App.js +2 -1
  16. package/dist/containers/App/Content.js +6 -12
  17. package/dist/containers/App/Providers.js +2 -1
  18. package/dist/containers/App/appSlots.d.ts +7 -7
  19. package/dist/containers/AppIcons/AppIcons.js +1 -1
  20. package/dist/containers/Cluster/Cluster.js +45 -27
  21. package/dist/containers/Cluster/Cluster.scss +15 -0
  22. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +4 -18
  23. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +0 -40
  24. package/dist/containers/Cluster/utils.d.ts +6 -1
  25. package/dist/containers/Cluster/utils.js +11 -3
  26. package/dist/containers/ClusterModeGuard/ClusterModeGuard.d.ts +6 -0
  27. package/dist/containers/ClusterModeGuard/ClusterModeGuard.js +6 -0
  28. package/dist/containers/ClusterModeGuard/index.d.ts +1 -0
  29. package/dist/containers/ClusterModeGuard/index.js +1 -0
  30. package/dist/containers/Clusters/Clusters.js +4 -3
  31. package/dist/containers/Clusters/columns.js +1 -1
  32. package/dist/containers/Clusters/constants.d.ts +1 -1
  33. package/dist/containers/Clusters/i18n/en.json +2 -1
  34. package/dist/containers/Clusters/i18n/index.d.ts +1 -1
  35. package/dist/containers/Clusters/i18n/index.js +2 -4
  36. package/dist/containers/Clusters/i18n/ru.json +2 -1
  37. package/dist/containers/Node/Node.js +11 -13
  38. package/dist/containers/Node/NodePages.js +4 -1
  39. package/dist/containers/Node/i18n/index.d.ts +1 -1
  40. package/dist/containers/Node/i18n/index.js +2 -4
  41. package/dist/containers/Nodes/getNodesColumns.js +2 -1
  42. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +1 -1
  43. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.d.ts +1 -1
  44. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js +2 -1
  45. package/dist/containers/Tablet/Tablet.js +24 -20
  46. package/dist/containers/Tablet/i18n/index.d.ts +1 -1
  47. package/dist/containers/Tablet/i18n/index.js +2 -4
  48. package/dist/containers/TabletsFilters/TabletsFilters.d.ts +2 -0
  49. package/dist/containers/TabletsFilters/TabletsFilters.js +25 -19
  50. package/dist/containers/TabletsFilters/i18n/en.json +3 -0
  51. package/dist/containers/TabletsFilters/i18n/index.d.ts +2 -0
  52. package/dist/containers/TabletsFilters/i18n/index.js +5 -0
  53. package/dist/containers/TabletsFilters/i18n/ru.json +3 -0
  54. package/dist/containers/Tenant/Diagnostics/Diagnostics.js +12 -11
  55. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +19 -0
  56. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -1
  57. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.d.ts +7 -25
  58. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +88 -92
  59. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +1 -33
  60. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/en.json +4 -0
  61. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.d.ts +2 -0
  62. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.js +5 -0
  63. package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricCard/MetricCard.js +4 -1
  64. package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.js +3 -4
  65. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +12 -5
  66. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.d.ts +2 -2
  67. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.js +7 -10
  68. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +7 -5
  69. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.js +0 -2
  70. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +10 -0
  71. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.d.ts +1 -1
  72. package/dist/containers/Tenant/Query/Query.d.ts +2 -2
  73. package/dist/containers/Tenant/Query/Query.js +5 -2
  74. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +29 -31
  75. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +150 -167
  76. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +2 -2
  77. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +3 -3
  78. package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.d.ts +10 -0
  79. package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.js +1 -1
  80. package/dist/containers/Tenant/Query/utils/getPreparedResult.d.ts +1 -1
  81. package/dist/containers/Tenant/Query/utils/getPreparedResult.js +18 -16
  82. package/dist/containers/Tenant/Tenant.js +4 -1
  83. package/dist/containers/Tenant/i18n/en.json +1 -0
  84. package/dist/containers/Tenant/i18n/index.d.ts +1 -1
  85. package/dist/containers/Tenant/i18n/index.js +2 -4
  86. package/dist/containers/Tenant/i18n/ru.json +1 -0
  87. package/dist/containers/UserSettings/Setting.d.ts +2 -1
  88. package/dist/containers/UserSettings/Setting.js +2 -2
  89. package/dist/containers/UserSettings/i18n/en.json +2 -0
  90. package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
  91. package/dist/containers/UserSettings/i18n/index.js +2 -6
  92. package/dist/containers/UserSettings/settings.d.ts +1 -0
  93. package/dist/containers/UserSettings/settings.js +9 -2
  94. package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.scss +1 -1
  95. package/dist/lib.d.ts +2 -1
  96. package/dist/lib.js +2 -1
  97. package/dist/routes.d.ts +5 -0
  98. package/dist/routes.js +4 -0
  99. package/dist/services/api.d.ts +2 -1
  100. package/dist/services/api.js +10 -3
  101. package/dist/services/settings.d.ts +0 -1
  102. package/dist/services/settings.js +2 -14
  103. package/dist/store/index.d.ts +1 -1
  104. package/dist/store/reducers/cluster/cluster.d.ts +8 -2
  105. package/dist/store/reducers/cluster/cluster.js +29 -1
  106. package/dist/store/reducers/cluster/types.d.ts +4 -2
  107. package/dist/store/reducers/executeQuery.d.ts +1 -10
  108. package/dist/store/reducers/executeQuery.js +26 -29
  109. package/dist/store/reducers/executeTopQueries/executeTopQueries.js +2 -1
  110. package/dist/store/reducers/executeTopQueries/utils.js +7 -4
  111. package/dist/store/reducers/hotKeys/hotKeys.d.ts +25 -0
  112. package/dist/store/reducers/hotKeys/hotKeys.js +49 -0
  113. package/dist/store/reducers/hotKeys/types.d.ts +10 -0
  114. package/dist/store/reducers/hotKeys/types.js +1 -0
  115. package/dist/store/reducers/index.d.ts +2 -6
  116. package/dist/store/reducers/index.js +1 -1
  117. package/dist/store/reducers/node/node.d.ts +1 -1
  118. package/dist/store/reducers/node/node.js +2 -0
  119. package/dist/store/reducers/node/selectors.js +1 -1
  120. package/dist/store/reducers/node/types.d.ts +7 -3
  121. package/dist/store/reducers/node/utils.d.ts +3 -0
  122. package/dist/store/reducers/node/utils.js +8 -0
  123. package/dist/store/reducers/nodes/types.d.ts +1 -1
  124. package/dist/store/reducers/nodes/utils.js +3 -3
  125. package/dist/store/reducers/storage/types.d.ts +2 -0
  126. package/dist/store/reducers/storage/utils.js +3 -3
  127. package/dist/store/reducers/tenants/utils.d.ts +4 -3
  128. package/dist/store/reducers/tenants/utils.js +17 -12
  129. package/dist/store/reducers/tooltip.d.ts +1 -1
  130. package/dist/types/api/hotkeys.d.ts +7 -0
  131. package/dist/types/api/hotkeys.js +1 -0
  132. package/dist/types/api/nodes.d.ts +2 -1
  133. package/dist/types/store/executeQuery.d.ts +3 -6
  134. package/dist/types/store/explainQuery.d.ts +1 -0
  135. package/dist/utils/constants.d.ts +2 -1
  136. package/dist/utils/constants.js +2 -1
  137. package/dist/utils/diagnostics.d.ts +1 -0
  138. package/dist/utils/diagnostics.js +1 -0
  139. package/dist/utils/i18n/i18n.d.ts +2 -1
  140. package/dist/utils/i18n/i18n.js +15 -2
  141. package/dist/utils/monitoring.js +1 -3
  142. package/dist/utils/versions/getVersionsColors.js +1 -1
  143. package/package.json +9 -8
  144. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/ru.json +0 -26
  145. package/dist/containers/UserSettings/i18n/ru.json +0 -20
  146. package/dist/store/reducers/hotKeys.d.ts +0 -11
  147. package/dist/store/reducers/hotKeys.js +0 -34
@@ -34,7 +34,7 @@ import executeTopTables from './tenantOverview/executeTopTables/executeTopTables
34
34
  import healthcheckInfo from './healthcheckInfo';
35
35
  import shardsWorkload from './shardsWorkload/shardsWorkload';
36
36
  import { tenantOverviewTopShards } from './tenantOverview/topShards/tenantOverviewTopShards';
37
- import hotKeys from './hotKeys';
37
+ import hotKeys from './hotKeys/hotKeys';
38
38
  import olapStats from './olapStats';
39
39
  import authentication from './authentication/authentication';
40
40
  import header from './header/header';
@@ -11,7 +11,7 @@ export declare const FETCH_NODE_STRUCTURE: {
11
11
  readonly FAILURE: "node/FETCH_NODE_STRUCTURE_FAILURE";
12
12
  };
13
13
  declare const node: Reducer<NodeState, NodeAction>;
14
- export declare const getNodeInfo: (id: string) => (dispatch: import("redux").Dispatch<import("redux").AnyAction>, getState: import("..").GetState) => Promise<unknown>;
14
+ export declare const getNodeInfo: (id: string) => (dispatch: import("redux").Dispatch<import("redux").AnyAction>, getState: import("..").GetState) => Promise<import("./types").PreparedNode | undefined>;
15
15
  export declare const getNodeStructure: (nodeId: string) => (dispatch: import("redux").Dispatch<import("redux").AnyAction>, getState: import("..").GetState) => Promise<unknown>;
16
16
  export declare function resetNode(): {
17
17
  readonly type: "node/RESET_NODE";
@@ -1,4 +1,5 @@
1
1
  import { createRequestActionTypes, createApiRequest } from '../../utils';
2
+ import { prepareNodeData } from './utils';
2
3
  export const FETCH_NODE = createRequestActionTypes('node', 'FETCH_NODE');
3
4
  export const FETCH_NODE_STRUCTURE = createRequestActionTypes('node', 'FETCH_NODE_STRUCTURE');
4
5
  const RESET_NODE = 'node/RESET_NODE';
@@ -41,6 +42,7 @@ export const getNodeInfo = (id) => {
41
42
  return createApiRequest({
42
43
  request: window.api.getNodeInfo(id),
43
44
  actions: FETCH_NODE,
45
+ dataHandler: prepareNodeData,
44
46
  });
45
47
  };
46
48
  export const getNodeStructure = (nodeId) => {
@@ -1,6 +1,6 @@
1
1
  import { createSelector } from 'reselect';
2
2
  import { stringifyVdiskId } from '../../../utils/dataFormatters/dataFormatters';
3
- const selectNodeId = (state) => { var _a, _b, _c; return (_c = (_b = (_a = state.node) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.SystemStateInfo) === null || _c === void 0 ? void 0 : _c[0].NodeId; };
3
+ const selectNodeId = (state) => { var _a, _b; return (_b = (_a = state.node) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.NodeId; };
4
4
  const selectRawNodeStructure = (state) => { var _a; return (_a = state.node) === null || _a === void 0 ? void 0 : _a.nodeStructure; };
5
5
  export const selectNodeStructure = createSelector([selectNodeId, selectRawNodeStructure], (nodeId, storageInfo) => {
6
6
  const pools = storageInfo === null || storageInfo === void 0 ? void 0 : storageInfo.StoragePools;
@@ -1,7 +1,7 @@
1
1
  import type { IResponseError } from '../../../types/api/error';
2
+ import type { TSystemStateInfo } from '../../../types/api/nodes';
2
3
  import type { TPDiskStateInfo } from '../../../types/api/pdisk';
3
4
  import type { TStorageInfo } from '../../../types/api/storage';
4
- import type { TEvSystemStateResponse } from '../../../types/api/systemState';
5
5
  import type { TVDiskStateInfo } from '../../../types/api/vdisk';
6
6
  import type { ApiRequestAction } from '../../utils';
7
7
  import { FETCH_NODE, FETCH_NODE_STRUCTURE, resetNode } from './node';
@@ -17,8 +17,12 @@ 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 TSystemStateInfo {
21
+ DC?: string;
22
+ Rack?: string;
23
+ }
20
24
  export interface NodeState {
21
- data: TEvSystemStateResponse;
25
+ data: PreparedNode;
22
26
  loading: boolean;
23
27
  wasLoaded: boolean;
24
28
  error?: IResponseError;
@@ -27,7 +31,7 @@ export interface NodeState {
27
31
  wasLoadedStructure: boolean;
28
32
  errorStructure?: IResponseError;
29
33
  }
30
- export declare type NodeAction = ApiRequestAction<typeof FETCH_NODE, TEvSystemStateResponse, IResponseError> | ApiRequestAction<typeof FETCH_NODE_STRUCTURE, TStorageInfo, IResponseError> | ReturnType<typeof resetNode>;
34
+ export declare type NodeAction = ApiRequestAction<typeof FETCH_NODE, PreparedNode, IResponseError> | ApiRequestAction<typeof FETCH_NODE_STRUCTURE, TStorageInfo, IResponseError> | ReturnType<typeof resetNode>;
31
35
  export interface NodeStateSlice {
32
36
  node: NodeState;
33
37
  }
@@ -0,0 +1,3 @@
1
+ import type { TEvSystemStateResponse } from '../../../types/api/systemState';
2
+ import type { PreparedNode } from './types';
3
+ export declare const prepareNodeData: (data: TEvSystemStateResponse) => PreparedNode;
@@ -0,0 +1,8 @@
1
+ export const prepareNodeData = (data) => {
2
+ var _a, _b, _c;
3
+ if (!((_a = data.SystemStateInfo) === null || _a === void 0 ? void 0 : _a.length)) {
4
+ return {};
5
+ }
6
+ const nodeData = data.SystemStateInfo[0];
7
+ return Object.assign(Object.assign({}, nodeData), { DC: (_b = nodeData.Location) === null || _b === void 0 ? void 0 : _b.DataCenter, Rack: (_c = nodeData.Location) === null || _c === void 0 ? void 0 : _c.Rack });
8
+ };
@@ -12,7 +12,7 @@ export interface NodesPreparedEntity {
12
12
  NodeId: number;
13
13
  Host?: string;
14
14
  SystemState?: EFlag;
15
- DataCenter?: string;
15
+ DC?: string;
16
16
  Rack?: string;
17
17
  Version?: string;
18
18
  TenantName?: string;
@@ -4,7 +4,7 @@ const prepareComputeNode = (node, tenantName) => {
4
4
  var _a;
5
5
  return Object.assign(Object.assign({}, node), {
6
6
  // v2 response has tenant name, v1 - doesn't
7
- TenantName: (_a = node.Tenant) !== null && _a !== void 0 ? _a : tenantName, SystemState: node === null || node === void 0 ? void 0 : node.Overall, Uptime: calcUptime(node === null || node === void 0 ? void 0 : node.StartTime) });
7
+ TenantName: (_a = node.Tenant) !== null && _a !== void 0 ? _a : tenantName, SystemState: node === null || node === void 0 ? void 0 : node.Overall, Uptime: calcUptime(node === null || node === void 0 ? void 0 : node.StartTime), DC: node.DataCenter });
8
8
  };
9
9
  export const prepareComputeNodes = (nodes, tenants) => {
10
10
  var _a;
@@ -36,10 +36,10 @@ export const prepareComputeNodesData = (data) => {
36
36
  export const prepareNodesData = (data) => {
37
37
  const rawNodes = data.Nodes || [];
38
38
  const preparedNodes = rawNodes.map((node) => {
39
- var _a, _b, _c, _d, _e;
39
+ var _a, _b, _c, _d, _e, _f, _g;
40
40
  // 0 limit means that limit is not set, so it should be undefined
41
41
  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, Uptime: calcUptime((_b = node.SystemState) === null || _b === void 0 ? void 0 : _b.StartTime), TenantName: (_d = (_c = node.SystemState) === null || _c === void 0 ? void 0 : _c.Tenants) === null || _d === void 0 ? void 0 : _d[0], SharedCacheUsed: (_e = node.SystemState.SharedCacheStats) === null || _e === void 0 ? void 0 : _e.UsedBytes, SharedCacheLimit: sharedCacheLimit });
42
+ return Object.assign(Object.assign({}, node.SystemState), { Tablets: node.Tablets, NodeId: node.NodeId, Uptime: calcUptime((_b = node.SystemState) === null || _b === void 0 ? void 0 : _b.StartTime), TenantName: (_d = (_c = node.SystemState) === null || _c === void 0 ? void 0 : _c.Tenants) === null || _d === void 0 ? void 0 : _d[0], DC: (_e = node.SystemState.Location) === null || _e === void 0 ? void 0 : _e.DataCenter, Rack: (_f = node.SystemState.Location) === null || _f === void 0 ? void 0 : _f.Rack, SharedCacheUsed: (_g = node.SystemState.SharedCacheStats) === null || _g === void 0 ? void 0 : _g.UsedBytes, SharedCacheLimit: sharedCacheLimit });
43
43
  });
44
44
  return {
45
45
  Nodes: preparedNodes,
@@ -16,6 +16,8 @@ export interface PreparedStorageNode extends TSystemStateInfo {
16
16
  NodeId: number;
17
17
  PDisks: TPDiskStateInfo[] | undefined;
18
18
  VDisks: TVDiskStateInfo[] | undefined;
19
+ DC?: string;
20
+ Rack?: string;
19
21
  Missing: number;
20
22
  Uptime: string;
21
23
  }
@@ -85,7 +85,7 @@ export const prepareStorageGroups = (StorageGroups, StoragePools) => {
85
85
  };
86
86
  // ==== Prepare nodes ====
87
87
  const prepareStorageNodeData = (node) => {
88
- var _a, _b;
88
+ var _a, _b, _c, _d;
89
89
  const systemState = (_a = node.SystemState) !== null && _a !== void 0 ? _a : {};
90
90
  const missing = ((_b = node.PDisks) === null || _b === void 0 ? void 0 : _b.filter((pDisk) => {
91
91
  return pDisk.State !== TPDiskState.Normal;
@@ -93,8 +93,8 @@ const prepareStorageNodeData = (node) => {
93
93
  return {
94
94
  NodeId: node.NodeId,
95
95
  SystemState: systemState.SystemState,
96
- DataCenter: systemState.DataCenter,
97
- Rack: systemState.Rack,
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
98
  Host: systemState.Host,
99
99
  Endpoints: systemState.Endpoints,
100
100
  Uptime: calcUptime(systemState.StartTime),
@@ -1,13 +1,14 @@
1
+ import type { TPoolStats } from '../../../types/api/nodes';
1
2
  import type { TTenant } from '../../../types/api/tenant';
2
3
  export declare const calculateTenantMetrics: (tenant?: TTenant | undefined) => {
3
4
  cpu: number | undefined;
4
5
  memory: number | undefined;
5
6
  blobStorage: number | undefined;
6
- tableStorage: number | undefined;
7
+ tabletStorage: number | undefined;
7
8
  cpuUsage: number | undefined;
8
9
  memoryLimit: number | undefined;
9
10
  blobStorageLimit: number | undefined;
10
- tableStorageLimit: number | undefined;
11
+ tabletStorageLimit: number | undefined;
11
12
  };
12
13
  export declare const prepareTenants: (tenants: TTenant[], useNodeAsBackend: boolean) => {
13
14
  backend: string | undefined;
@@ -30,7 +31,7 @@ export declare const prepareTenants: (tenants: TTenant[], useNodeAsBackend: bool
30
31
  CreateTime?: string | undefined;
31
32
  Owner?: string | undefined;
32
33
  Users?: string[] | undefined;
33
- PoolStats?: import("../../../types/api/nodes").TPoolStats[] | undefined;
34
+ PoolStats?: TPoolStats[] | undefined;
34
35
  UserAttributes?: Record<string, string> | undefined;
35
36
  Overall?: import("../../../types/api/enums").EFlag | undefined;
36
37
  SystemTablets?: import("../../../types/api/tablet").TTabletStateInfo[] | undefined;
@@ -17,36 +17,41 @@ const getTenantBackend = (tenant) => {
17
17
  : undefined;
18
18
  return node.Host ? `${node.Host}${address ? address : ''}` : undefined;
19
19
  };
20
+ const calculateCpuUsage = (poolsStats) => {
21
+ var _a, _b, _c;
22
+ if (!poolsStats) {
23
+ return undefined;
24
+ }
25
+ const systemPoolUsage = ((_a = poolsStats === null || poolsStats === void 0 ? void 0 : poolsStats.find(({ Name }) => Name === 'System')) === null || _a === void 0 ? void 0 : _a.Usage) || 0;
26
+ const userPoolUsage = ((_b = poolsStats === null || poolsStats === void 0 ? void 0 : poolsStats.find(({ Name }) => Name === 'User')) === null || _b === void 0 ? void 0 : _b.Usage) || 0;
27
+ const icPoolUsage = ((_c = poolsStats === null || poolsStats === void 0 ? void 0 : poolsStats.find(({ Name }) => Name === 'IC')) === null || _c === void 0 ? void 0 : _c.Usage) || 0;
28
+ // We use max of system, user and ic pools usage to calculate cpu usage because
29
+ // only these pools directly indicate resources available to perform user queries
30
+ return Math.max(Number(systemPoolUsage), Number(userPoolUsage), Number(icPoolUsage)) * 100;
31
+ };
20
32
  export const calculateTenantMetrics = (tenant) => {
21
- var _a, _b;
22
33
  const { CoresUsed, MemoryUsed, StorageAllocatedSize, MemoryLimit, StorageAllocatedLimit, PoolStats, Metrics = {}, DatabaseQuotas = {}, } = tenant || {};
23
- const systemPoolUsage = (_a = PoolStats === null || PoolStats === void 0 ? void 0 : PoolStats.find(({ Name }) => Name === 'System')) === null || _a === void 0 ? void 0 : _a.Usage;
24
- const userPoolUsage = (_b = PoolStats === null || PoolStats === void 0 ? void 0 : PoolStats.find(({ Name }) => Name === 'User')) === null || _b === void 0 ? void 0 : _b.Usage;
25
34
  const cpu = isNumeric(CoresUsed) ? Number(CoresUsed) * 1000000 : undefined;
26
35
  const memory = isNumeric(MemoryUsed) ? Number(MemoryUsed) : undefined;
27
36
  const blobStorage = isNumeric(StorageAllocatedSize) ? Number(StorageAllocatedSize) : undefined;
28
- const tableStorage = isNumeric(Metrics.Storage) ? Number(Metrics.Storage) : undefined;
29
- // We use system pool usage and user pool usage to calculate cpu usage because
30
- // only these pools directly indicate resources available to perform user queries
31
- const cpuUsage = isNumeric(systemPoolUsage) || isNumeric(userPoolUsage)
32
- ? Math.max(Number(systemPoolUsage), Number(userPoolUsage)) * 100
33
- : undefined;
37
+ const tabletStorage = isNumeric(Metrics.Storage) ? Number(Metrics.Storage) : undefined;
38
+ const cpuUsage = calculateCpuUsage(PoolStats);
34
39
  const memoryLimit = isNumeric(MemoryLimit) ? Number(MemoryLimit) : undefined;
35
40
  const blobStorageLimit = isNumeric(StorageAllocatedLimit)
36
41
  ? Number(StorageAllocatedLimit)
37
42
  : undefined;
38
- const tableStorageLimit = isNumeric(DatabaseQuotas.data_size_hard_quota)
43
+ const tabletStorageLimit = isNumeric(DatabaseQuotas.data_size_hard_quota)
39
44
  ? Number(DatabaseQuotas.data_size_hard_quota)
40
45
  : undefined;
41
46
  return {
42
47
  cpu,
43
48
  memory,
44
49
  blobStorage,
45
- tableStorage,
50
+ tabletStorage,
46
51
  cpuUsage,
47
52
  memoryLimit,
48
53
  blobStorageLimit,
49
- tableStorageLimit,
54
+ tabletStorageLimit,
50
55
  };
51
56
  };
52
57
  const calculateTenantEntities = (tenant) => {
@@ -8,7 +8,7 @@ export declare const showTooltip: (node: EventTarget | null, data: any, template
8
8
  type: string;
9
9
  node: EventTarget | null;
10
10
  data: any;
11
- templateType: "node" | "pool" | "tablet" | "nodeEndpoints" | "tabletsOverall" | "histogram" | "cell" | "json";
11
+ templateType: "node" | "tablet" | "pool" | "nodeEndpoints" | "tabletsOverall" | "histogram" | "cell" | "json";
12
12
  additionalData: any;
13
13
  positions: ITooltipPositions | undefined;
14
14
  };
@@ -0,0 +1,7 @@
1
+ export interface JsonHotKeysResponse {
2
+ hotkeys: HotKey[] | null;
3
+ }
4
+ export interface HotKey {
5
+ accessSample: number;
6
+ keyValues: string[];
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -73,8 +73,9 @@ export interface TSystemStateInfo {
73
73
  SharedCacheStats?: TNodeSharedCache;
74
74
  TotalSessions?: number;
75
75
  }
76
+ export declare type PoolName = 'System' | 'User' | 'Batch' | 'IO' | 'IC';
76
77
  export interface TPoolStats {
77
- Name?: string;
78
+ Name?: PoolName;
78
79
  /** double */
79
80
  Usage?: number;
80
81
  Threads?: number;
@@ -1,8 +1,6 @@
1
- import { SEND_QUERY, changeUserInput, saveQueryToHistory, goToPreviousQuery, setMonacoHotKey, goToNextQuery, setTenantPath, MONACO_HOT_KEY_ACTIONS } from '../../store/reducers/executeQuery';
1
+ import { SEND_QUERY, changeUserInput, saveQueryToHistory, goToPreviousQuery, goToNextQuery, setTenantPath } from '../../store/reducers/executeQuery';
2
2
  import type { ApiRequestAction } from '../../store/utils';
3
- import type { ValueOf } from '../common';
4
3
  import type { IQueryResult, QueryError, QueryErrorResponse } from './query';
5
- export declare type MonacoHotKeyAction = ValueOf<typeof MONACO_HOT_KEY_ACTIONS>;
6
4
  export interface QueryInHistory {
7
5
  queryText: string;
8
6
  syntax?: string;
@@ -11,17 +9,16 @@ export interface ExecuteQueryState {
11
9
  loading: boolean;
12
10
  input: string;
13
11
  history: {
14
- queries: (QueryInHistory | string)[];
12
+ queries: QueryInHistory[];
15
13
  currentIndex: number;
16
14
  };
17
- monacoHotKey: null | MonacoHotKeyAction;
18
15
  tenantPath?: string;
19
16
  data?: IQueryResult;
20
17
  stats?: IQueryResult['stats'];
21
18
  error?: string | QueryErrorResponse;
22
19
  }
23
20
  declare type SendQueryAction = ApiRequestAction<typeof SEND_QUERY, IQueryResult, QueryError>;
24
- export declare type ExecuteQueryAction = SendQueryAction | ReturnType<typeof goToNextQuery> | ReturnType<typeof goToPreviousQuery> | ReturnType<typeof changeUserInput> | ReturnType<typeof saveQueryToHistory> | ReturnType<typeof setMonacoHotKey> | ReturnType<typeof setTenantPath>;
21
+ export declare type ExecuteQueryAction = SendQueryAction | ReturnType<typeof goToNextQuery> | ReturnType<typeof goToPreviousQuery> | ReturnType<typeof changeUserInput> | ReturnType<typeof saveQueryToHistory> | ReturnType<typeof setTenantPath>;
25
22
  export interface ExecuteQueryStateSlice {
26
23
  executeQuery: ExecuteQueryState;
27
24
  }
@@ -15,6 +15,7 @@ export interface PreparedExplainResponse {
15
15
  }
16
16
  export interface ExplainQueryState {
17
17
  loading: boolean;
18
+ loadingAst?: boolean;
18
19
  data?: PreparedExplainResponse['plan'];
19
20
  dataAst?: PreparedExplainResponse['ast'];
20
21
  error?: string | QueryErrorResponse;
@@ -56,12 +56,14 @@ export declare const SAVED_QUERIES_KEY = "saved_queries";
56
56
  export declare const ASIDE_HEADER_COMPACT_KEY = "asideHeaderCompact";
57
57
  export declare const QUERIES_HISTORY_KEY = "queries_history";
58
58
  export declare const DATA_QA_TUNE_COLUMNS_POPUP = "tune-columns-popup";
59
+ export declare const BINARY_DATA_IN_PLAIN_TEXT_DISPLAY = "binaryDataInPlainTextDisplay";
59
60
  export declare const DEFAULT_SIZE_RESULT_PANE_KEY = "default-size-result-pane";
60
61
  export declare const DEFAULT_SIZE_TENANT_SUMMARY_KEY = "default-size-tenant-summary-pane";
61
62
  export declare const DEFAULT_SIZE_TENANT_KEY = "default-size-tenant-pane";
62
63
  export declare const DEFAULT_IS_TENANT_SUMMARY_COLLAPSED = "default-is-tenant-summary-collapsed";
63
64
  export declare const DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED = "default-is-tenant-common-info-collapsed";
64
65
  export declare const DEFAULT_IS_QUERY_RESULT_COLLAPSED = "default-is-query-result-collapsed";
66
+ export declare const DEFAULT_CLUSTER_TAB_KEY = "default-cluster-tab";
65
67
  export declare const DEFAULT_TABLE_SETTINGS: {
66
68
  readonly displayIndices: false;
67
69
  readonly stickyHead: "moving";
@@ -79,7 +81,6 @@ export declare const TENANT_OVERVIEW_TABLES_SETTINGS: {
79
81
  export declare const QUERY_INITIAL_MODE_KEY = "query_initial_mode";
80
82
  export declare const LAST_USED_QUERY_ACTION_KEY = "last_used_query_action";
81
83
  export declare const PARTITIONS_HIDDEN_COLUMNS_KEY = "partitionsHiddenColumns";
82
- export declare const CLUSTER_INFO_HIDDEN_KEY = "clusterInfoHidden";
83
84
  export declare const TENANT_INITIAL_PAGE_KEY = "saved_tenant_initial_tab";
84
85
  export declare const USE_BACKEND_PARAMS_FOR_TABLES_KEY = "useBackendParamsForTables";
85
86
  export declare const QUERY_USE_MULTI_SCHEMA_KEY = "queryUseMultiSchema";
@@ -72,12 +72,14 @@ export const SAVED_QUERIES_KEY = 'saved_queries';
72
72
  export const ASIDE_HEADER_COMPACT_KEY = 'asideHeaderCompact';
73
73
  export const QUERIES_HISTORY_KEY = 'queries_history';
74
74
  export const DATA_QA_TUNE_COLUMNS_POPUP = 'tune-columns-popup';
75
+ export const BINARY_DATA_IN_PLAIN_TEXT_DISPLAY = 'binaryDataInPlainTextDisplay';
75
76
  export const DEFAULT_SIZE_RESULT_PANE_KEY = 'default-size-result-pane';
76
77
  export const DEFAULT_SIZE_TENANT_SUMMARY_KEY = 'default-size-tenant-summary-pane';
77
78
  export const DEFAULT_SIZE_TENANT_KEY = 'default-size-tenant-pane';
78
79
  export const DEFAULT_IS_TENANT_SUMMARY_COLLAPSED = 'default-is-tenant-summary-collapsed';
79
80
  export const DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED = 'default-is-tenant-common-info-collapsed';
80
81
  export const DEFAULT_IS_QUERY_RESULT_COLLAPSED = 'default-is-query-result-collapsed';
82
+ export const DEFAULT_CLUSTER_TAB_KEY = 'default-cluster-tab';
81
83
  export const DEFAULT_TABLE_SETTINGS = {
82
84
  displayIndices: false,
83
85
  stickyHead: DataTable.MOVING,
@@ -89,7 +91,6 @@ export const TENANT_OVERVIEW_TABLES_SETTINGS = Object.assign(Object.assign({}, D
89
91
  export const QUERY_INITIAL_MODE_KEY = 'query_initial_mode';
90
92
  export const LAST_USED_QUERY_ACTION_KEY = 'last_used_query_action';
91
93
  export const PARTITIONS_HIDDEN_COLUMNS_KEY = 'partitionsHiddenColumns';
92
- export const CLUSTER_INFO_HIDDEN_KEY = 'clusterInfoHidden';
93
94
  // Remain "tab" in key name for backward compatibility
94
95
  export const TENANT_INITIAL_PAGE_KEY = 'saved_tenant_initial_tab';
95
96
  // Send filters and sort params to backend for Nodes and Storage tables
@@ -10,6 +10,7 @@ declare const TOP_QUERIES_SORT_VALUES: {
10
10
  readonly ReadRows: "ReadRows";
11
11
  readonly ReadBytes: "ReadBytes";
12
12
  readonly UserSID: "UserSID";
13
+ readonly Duration: "Duration";
13
14
  };
14
15
  declare type TopShardsSortValue = ValueOf<typeof TOP_SHARDS_SORT_VALUES>;
15
16
  declare type TopQueriesSortValue = ValueOf<typeof TOP_QUERIES_SORT_VALUES>;
@@ -9,6 +9,7 @@ const TOP_QUERIES_SORT_VALUES = {
9
9
  ReadRows: 'ReadRows',
10
10
  ReadBytes: 'ReadBytes',
11
11
  UserSID: 'UserSID',
12
+ Duration: 'Duration',
12
13
  };
13
14
  export const isSortableTopShardsProperty = (value) => Object.values(TOP_SHARDS_SORT_VALUES).includes(value);
14
15
  export const isSortableTopQueriesProperty = (value) => Object.values(TOP_QUERIES_SORT_VALUES).includes(value);
@@ -1,4 +1,4 @@
1
- import { I18N } from '@gravity-ui/i18n';
1
+ import { I18N, KeysData } from '@gravity-ui/i18n';
2
2
  declare enum Lang {
3
3
  En = "en",
4
4
  Ru = "ru"
@@ -6,4 +6,5 @@ declare enum Lang {
6
6
  declare const defaultLang = Lang.En;
7
7
  declare const currentLang: Lang;
8
8
  declare const i18n: I18N;
9
+ export declare function registerKeysets<Keyset extends KeysData>(id: string, data: Record<string, Keyset>): (key: Extract<keyof Keyset, string>, params?: import("@gravity-ui/i18n").Params | undefined) => string;
9
10
  export { i18n, Lang, currentLang, defaultLang };
@@ -1,5 +1,7 @@
1
1
  import { I18N } from '@gravity-ui/i18n';
2
2
  import { configure as configureUiKit } from '@gravity-ui/uikit';
3
+ import { configure as configureUiKitComponents } from '@gravity-ui/components';
4
+ import { configure as configureUiKitNavigation } from '@gravity-ui/navigation';
3
5
  import { configure as configureYdbUiComponents } from 'ydb-ui-components';
4
6
  import { LANGUAGE_KEY } from '../constants';
5
7
  import { settingsManager } from '../../services/settings';
@@ -10,8 +12,19 @@ var Lang;
10
12
  })(Lang || (Lang = {}));
11
13
  const defaultLang = Lang.En;
12
14
  const currentLang = settingsManager.readUserSettingsValue(LANGUAGE_KEY, defaultLang);
13
- const i18n = new I18N();
14
- i18n.setLang(currentLang);
15
+ const i18n = new I18N({
16
+ lang: currentLang,
17
+ // Enable keysets with only en lang
18
+ fallbackLang: Lang.En,
19
+ });
15
20
  configureYdbUiComponents({ lang: currentLang });
16
21
  configureUiKit({ lang: currentLang });
22
+ configureUiKitComponents({ lang: currentLang });
23
+ configureUiKitNavigation({ lang: currentLang });
24
+ export function registerKeysets(id, data) {
25
+ for (const lang of Object.keys(data)) {
26
+ i18n.registerKeyset(lang, id, data[lang]);
27
+ }
28
+ return i18n.keyset(id);
29
+ }
17
30
  export { i18n, Lang, currentLang, defaultLang };
@@ -38,8 +38,6 @@ export function parseMonitoringData(monitoring) {
38
38
  return data;
39
39
  }
40
40
  }
41
- catch (error) {
42
- console.log(error);
43
- }
41
+ catch (_a) { }
44
42
  return undefined;
45
43
  }
@@ -20,7 +20,7 @@ export const COLORS = [
20
20
  '#3cb371',
21
21
  '#b22222', // firebrick
22
22
  ];
23
- export const GRAY_COLOR = '#bfbfbf'; // --yc-color-base-neutral-hover
23
+ export const GRAY_COLOR = '#bfbfbf';
24
24
  export const getVersionsMap = (versions, initialMap = new Map()) => {
25
25
  versions.forEach((version) => {
26
26
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -11,15 +11,15 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@gravity-ui/axios-wrapper": "^1.3.0",
14
- "@gravity-ui/chartkit": "^4.15.0",
15
- "@gravity-ui/components": "^2.9.1",
16
- "@gravity-ui/date-utils": "^1.1.1",
17
- "@gravity-ui/i18n": "^1.0.0",
14
+ "@gravity-ui/chartkit": "^4.20.1",
15
+ "@gravity-ui/components": "^2.12.0",
16
+ "@gravity-ui/date-utils": "^1.4.2",
17
+ "@gravity-ui/i18n": "^1.2.0",
18
18
  "@gravity-ui/icons": "^2.8.1",
19
- "@gravity-ui/navigation": "^1.8.0",
19
+ "@gravity-ui/navigation": "^1.9.0",
20
20
  "@gravity-ui/paranoid": "^1.4.0",
21
- "@gravity-ui/react-data-table": "^1.0.3",
22
- "@gravity-ui/uikit": "^5.24.0",
21
+ "@gravity-ui/react-data-table": "^1.2.0",
22
+ "@gravity-ui/uikit": "^5.30.1",
23
23
  "axios": "^0.21.2",
24
24
  "bem-cn-lite": "^4.1.0",
25
25
  "copy-to-clipboard": "^3.3.3",
@@ -32,6 +32,7 @@
32
32
  "qs": "^6.11.0",
33
33
  "react-error-boundary": "^4.0.12",
34
34
  "react-json-inspector": "^7.1.1",
35
+ "react-helmet-async": "2.0.4",
35
36
  "react-list": "^0.8.11",
36
37
  "react-monaco-editor": "^0.47.0",
37
38
  "react-redux": "^7.2.6",
@@ -1,26 +0,0 @@
1
- {
2
- "no-data": "Нет данных",
3
- "no-pools-data": "Нет данных о пулах",
4
- "top-nodes.empty-data": "Нет узлов",
5
- "title.pools": "Пулы",
6
- "title.metrics": "Метрики",
7
- "top-groups.empty-data": "Нет групп",
8
- "top": "Топ",
9
- "nodes": "узлов",
10
- "shards": "шардов",
11
- "groups": "групп",
12
- "queries": "запросов",
13
- "tables": "таблиц",
14
- "by-pools-usage": "по использованию пулов",
15
- "by-cpu-time": "по времени cpu",
16
- "by-cpu-usage": "по использованию cpu",
17
- "by-load": "по нагрузке",
18
- "by-memory": "по памяти",
19
- "by-usage": "по потреблению",
20
- "by-size": "по размеру",
21
- "charts.queries-per-second": "Количество запросов в секунду",
22
- "charts.transaction-latency": "Задержка транзакций {{percentile}}",
23
- "charts.cpu-usage": "Использование CPU",
24
- "charts.storage-usage": "Использование хранилища",
25
- "charts.memory-usage": "Использование памяти"
26
- }
@@ -1,20 +0,0 @@
1
- {
2
- "page.general": "Общие",
3
- "section.appearance": "Внешний вид",
4
- "page.experiments": "Эксперименты",
5
- "section.experiments": "Эксперименты",
6
- "settings.theme.title": "Тема",
7
- "settings.theme.option-dark": "Тёмная",
8
- "settings.theme.option-light": "Светлая",
9
- "settings.theme.option-system": "Системная",
10
- "settings.language.title": "Язык интерфейса",
11
- "settings.language.option-russian": "Русский",
12
- "settings.language.option-english": "English",
13
- "settings.invertedDisks.title": "Инвертированные индикаторы места на дисках",
14
- "settings.useNodesEndpoint.title": "Сломать вкладку Nodes в диагностике",
15
- "settings.useNodesEndpoint.popover": "Использовать эндпоинт /viewer/json/nodes для вкладки Nodes в диагностике. Может возвращать некорректные данные на некоторых версиях",
16
- "settings.useVirtualTables.title": "Использовать таблицу с загрузкой данных по скроллу для вкладок Nodes и Storage",
17
- "settings.useVirtualTables.popover": "Это улучшит производительность, но может работать нестабильно",
18
- "settings.queryUseMultiSchema.title": "Разрешить запросы с несколькими результатами",
19
- "settings.queryUseMultiSchema.popover": "Использовать для запросов схему 'multi', которая позволяет выполнять запросы с несколькими результатами. На версиях 23-3 и старше результат не возвращается вообще"
20
- }
@@ -1,11 +0,0 @@
1
- export function getHotKeys(currentSchemaPath: any, enableSampling: any): (dispatch: import("redux").Dispatch<import("redux").AnyAction>, getState: import(".").GetState) => Promise<any>;
2
- export function setHotKeysOptions(options: any): {
3
- type: string;
4
- data: any;
5
- };
6
- export default hotKeys;
7
- declare function hotKeys(state: {
8
- loading: boolean;
9
- data: {};
10
- wasLoaded: boolean;
11
- } | undefined, action: any): any;
@@ -1,34 +0,0 @@
1
- import { createRequestActionTypes, createApiRequest } from '../utils';
2
- const FETCH_HOT_KEYS = createRequestActionTypes('hot_keys', 'FETCH_HOT_KEYS');
3
- const SET_HOT_KEYS_OPTIONS = 'hot_keys/SET_HOT_KEYS_OPTIONS';
4
- const initialState = { loading: true, data: {}, wasLoaded: false };
5
- const hotKeys = function (state = initialState, action) {
6
- switch (action.type) {
7
- case FETCH_HOT_KEYS.REQUEST: {
8
- return Object.assign(Object.assign({}, state), { loading: true });
9
- }
10
- case FETCH_HOT_KEYS.SUCCESS: {
11
- return Object.assign(Object.assign({}, state), { data: action.data.hotkeys, loading: false, error: undefined, wasLoaded: true });
12
- }
13
- case FETCH_HOT_KEYS.FAILURE: {
14
- return Object.assign(Object.assign({}, state), { error: action.error, loading: false });
15
- }
16
- case SET_HOT_KEYS_OPTIONS:
17
- return Object.assign(Object.assign({}, state), action.data);
18
- default:
19
- return state;
20
- }
21
- };
22
- export function getHotKeys(currentSchemaPath, enableSampling) {
23
- return createApiRequest({
24
- request: window.api.getHotKeys(currentSchemaPath, enableSampling),
25
- actions: FETCH_HOT_KEYS,
26
- });
27
- }
28
- export function setHotKeysOptions(options) {
29
- return {
30
- type: SET_HOT_KEYS_OPTIONS,
31
- data: options,
32
- };
33
- }
34
- export default hotKeys;