ydb-embedded-ui 5.0.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) 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/EntityStatus/EntityStatus.scss +1 -1
  4. package/dist/components/FullNodeViewer/FullNodeViewer.d.ts +2 -2
  5. package/dist/components/FullNodeViewer/FullNodeViewer.js +1 -1
  6. package/dist/components/LagImages/LagImages.js +2 -2
  7. package/dist/components/ProgressViewer/ProgressViewer.js +6 -5
  8. package/dist/components/ProgressViewer/ProgressViewer.scss +33 -17
  9. package/dist/components/TabletsOverall/TabletsOverall.js +6 -6
  10. package/dist/containers/App/App.js +2 -1
  11. package/dist/containers/App/Content.js +6 -12
  12. package/dist/containers/App/Providers.js +2 -1
  13. package/dist/containers/App/appSlots.d.ts +7 -7
  14. package/dist/containers/AppIcons/AppIcons.js +1 -1
  15. package/dist/containers/Cluster/Cluster.js +45 -27
  16. package/dist/containers/Cluster/Cluster.scss +15 -0
  17. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +4 -18
  18. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +0 -40
  19. package/dist/containers/Cluster/utils.d.ts +6 -1
  20. package/dist/containers/Cluster/utils.js +11 -3
  21. package/dist/containers/Clusters/Clusters.js +4 -3
  22. package/dist/containers/Clusters/columns.js +1 -1
  23. package/dist/containers/Clusters/constants.d.ts +1 -1
  24. package/dist/containers/Clusters/i18n/en.json +2 -1
  25. package/dist/containers/Clusters/i18n/index.d.ts +1 -1
  26. package/dist/containers/Clusters/i18n/index.js +2 -4
  27. package/dist/containers/Clusters/i18n/ru.json +2 -1
  28. package/dist/containers/Node/Node.js +11 -13
  29. package/dist/containers/Node/NodePages.js +4 -1
  30. package/dist/containers/Node/i18n/index.d.ts +1 -1
  31. package/dist/containers/Node/i18n/index.js +2 -4
  32. package/dist/containers/Nodes/getNodesColumns.js +2 -1
  33. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +1 -1
  34. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.d.ts +1 -1
  35. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js +2 -1
  36. package/dist/containers/Tablet/Tablet.js +24 -20
  37. package/dist/containers/Tablet/i18n/index.d.ts +1 -1
  38. package/dist/containers/Tablet/i18n/index.js +2 -4
  39. package/dist/containers/TabletsFilters/TabletsFilters.d.ts +2 -0
  40. package/dist/containers/TabletsFilters/TabletsFilters.js +25 -19
  41. package/dist/containers/TabletsFilters/i18n/en.json +3 -0
  42. package/dist/containers/TabletsFilters/i18n/index.d.ts +2 -0
  43. package/dist/containers/TabletsFilters/i18n/index.js +5 -0
  44. package/dist/containers/TabletsFilters/i18n/ru.json +3 -0
  45. package/dist/containers/Tenant/Diagnostics/Diagnostics.js +12 -11
  46. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +19 -0
  47. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -1
  48. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.d.ts +7 -25
  49. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +88 -92
  50. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +1 -33
  51. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/en.json +4 -0
  52. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.d.ts +2 -0
  53. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.js +5 -0
  54. package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricCard/MetricCard.js +4 -1
  55. package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.js +3 -4
  56. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +12 -5
  57. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.d.ts +2 -2
  58. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.js +7 -10
  59. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +7 -5
  60. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.js +0 -2
  61. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +10 -0
  62. package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.d.ts +1 -1
  63. package/dist/containers/Tenant/Query/Query.d.ts +2 -2
  64. package/dist/containers/Tenant/Query/Query.js +5 -2
  65. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +29 -31
  66. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +150 -167
  67. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +2 -2
  68. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +3 -3
  69. package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.d.ts +10 -0
  70. package/dist/containers/Tenant/Query/QueryTabs/QueryTabs.js +1 -1
  71. package/dist/containers/Tenant/Query/utils/getPreparedResult.d.ts +1 -1
  72. package/dist/containers/Tenant/Query/utils/getPreparedResult.js +18 -16
  73. package/dist/containers/Tenant/Tenant.js +4 -1
  74. package/dist/containers/Tenant/i18n/en.json +1 -0
  75. package/dist/containers/Tenant/i18n/index.d.ts +1 -1
  76. package/dist/containers/Tenant/i18n/index.js +2 -4
  77. package/dist/containers/Tenant/i18n/ru.json +1 -0
  78. package/dist/containers/Versions/NodesTreeTitle/NodesTreeTitle.scss +1 -1
  79. package/dist/routes.d.ts +5 -0
  80. package/dist/routes.js +4 -0
  81. package/dist/services/api.d.ts +2 -1
  82. package/dist/services/api.js +2 -2
  83. package/dist/services/settings.d.ts +0 -1
  84. package/dist/services/settings.js +1 -14
  85. package/dist/store/index.d.ts +1 -1
  86. package/dist/store/reducers/cluster/cluster.d.ts +8 -2
  87. package/dist/store/reducers/cluster/cluster.js +29 -1
  88. package/dist/store/reducers/cluster/types.d.ts +4 -2
  89. package/dist/store/reducers/executeQuery.d.ts +1 -10
  90. package/dist/store/reducers/executeQuery.js +26 -29
  91. package/dist/store/reducers/executeTopQueries/executeTopQueries.js +2 -1
  92. package/dist/store/reducers/executeTopQueries/utils.js +7 -4
  93. package/dist/store/reducers/hotKeys/hotKeys.d.ts +25 -0
  94. package/dist/store/reducers/hotKeys/hotKeys.js +49 -0
  95. package/dist/store/reducers/hotKeys/types.d.ts +10 -0
  96. package/dist/store/reducers/hotKeys/types.js +1 -0
  97. package/dist/store/reducers/index.d.ts +2 -6
  98. package/dist/store/reducers/index.js +1 -1
  99. package/dist/store/reducers/node/node.d.ts +1 -1
  100. package/dist/store/reducers/node/node.js +2 -0
  101. package/dist/store/reducers/node/selectors.js +1 -1
  102. package/dist/store/reducers/node/types.d.ts +7 -3
  103. package/dist/store/reducers/node/utils.d.ts +3 -0
  104. package/dist/store/reducers/node/utils.js +8 -0
  105. package/dist/store/reducers/nodes/types.d.ts +1 -1
  106. package/dist/store/reducers/nodes/utils.js +3 -3
  107. package/dist/store/reducers/storage/types.d.ts +2 -0
  108. package/dist/store/reducers/storage/utils.js +3 -3
  109. package/dist/store/reducers/tenants/utils.d.ts +4 -3
  110. package/dist/store/reducers/tenants/utils.js +17 -12
  111. package/dist/store/reducers/tooltip.d.ts +1 -1
  112. package/dist/types/api/hotkeys.d.ts +7 -0
  113. package/dist/types/api/hotkeys.js +1 -0
  114. package/dist/types/api/nodes.d.ts +2 -1
  115. package/dist/types/store/executeQuery.d.ts +3 -6
  116. package/dist/types/store/explainQuery.d.ts +1 -0
  117. package/dist/utils/constants.d.ts +1 -1
  118. package/dist/utils/constants.js +1 -1
  119. package/dist/utils/diagnostics.d.ts +1 -0
  120. package/dist/utils/diagnostics.js +1 -0
  121. package/dist/utils/i18n/i18n.d.ts +2 -1
  122. package/dist/utils/i18n/i18n.js +15 -2
  123. package/dist/utils/monitoring.js +1 -3
  124. package/dist/utils/versions/getVersionsColors.js +1 -1
  125. package/package.json +9 -8
  126. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/ru.json +0 -26
  127. package/dist/store/reducers/hotKeys.d.ts +0 -11
  128. package/dist/store/reducers/hotKeys.js +0 -34
@@ -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;
@@ -62,6 +62,7 @@ export declare const DEFAULT_SIZE_TENANT_KEY = "default-size-tenant-pane";
62
62
  export declare const DEFAULT_IS_TENANT_SUMMARY_COLLAPSED = "default-is-tenant-summary-collapsed";
63
63
  export declare const DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED = "default-is-tenant-common-info-collapsed";
64
64
  export declare const DEFAULT_IS_QUERY_RESULT_COLLAPSED = "default-is-query-result-collapsed";
65
+ export declare const DEFAULT_CLUSTER_TAB_KEY = "default-cluster-tab";
65
66
  export declare const DEFAULT_TABLE_SETTINGS: {
66
67
  readonly displayIndices: false;
67
68
  readonly stickyHead: "moving";
@@ -79,7 +80,6 @@ export declare const TENANT_OVERVIEW_TABLES_SETTINGS: {
79
80
  export declare const QUERY_INITIAL_MODE_KEY = "query_initial_mode";
80
81
  export declare const LAST_USED_QUERY_ACTION_KEY = "last_used_query_action";
81
82
  export declare const PARTITIONS_HIDDEN_COLUMNS_KEY = "partitionsHiddenColumns";
82
- export declare const CLUSTER_INFO_HIDDEN_KEY = "clusterInfoHidden";
83
83
  export declare const TENANT_INITIAL_PAGE_KEY = "saved_tenant_initial_tab";
84
84
  export declare const USE_BACKEND_PARAMS_FOR_TABLES_KEY = "useBackendParamsForTables";
85
85
  export declare const QUERY_USE_MULTI_SCHEMA_KEY = "queryUseMultiSchema";
@@ -78,6 +78,7 @@ export const DEFAULT_SIZE_TENANT_KEY = 'default-size-tenant-pane';
78
78
  export const DEFAULT_IS_TENANT_SUMMARY_COLLAPSED = 'default-is-tenant-summary-collapsed';
79
79
  export const DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED = 'default-is-tenant-common-info-collapsed';
80
80
  export const DEFAULT_IS_QUERY_RESULT_COLLAPSED = 'default-is-query-result-collapsed';
81
+ export const DEFAULT_CLUSTER_TAB_KEY = 'default-cluster-tab';
81
82
  export const DEFAULT_TABLE_SETTINGS = {
82
83
  displayIndices: false,
83
84
  stickyHead: DataTable.MOVING,
@@ -89,7 +90,6 @@ export const TENANT_OVERVIEW_TABLES_SETTINGS = Object.assign(Object.assign({}, D
89
90
  export const QUERY_INITIAL_MODE_KEY = 'query_initial_mode';
90
91
  export const LAST_USED_QUERY_ACTION_KEY = 'last_used_query_action';
91
92
  export const PARTITIONS_HIDDEN_COLUMNS_KEY = 'partitionsHiddenColumns';
92
- export const CLUSTER_INFO_HIDDEN_KEY = 'clusterInfoHidden';
93
93
  // Remain "tab" in key name for backward compatibility
94
94
  export const TENANT_INITIAL_PAGE_KEY = 'saved_tenant_initial_tab';
95
95
  // 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.1.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,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;