ydb-embedded-ui 6.6.1 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. package/dist/package.json +31 -30
  2. package/dist/src/components/InfoViewer/InfoViewer.d.ts +1 -1
  3. package/dist/src/components/InfoViewer/InfoViewer.js +2 -1
  4. package/dist/src/components/InfoViewer/i18n/en.json +2 -1
  5. package/dist/src/components/InfoViewer/i18n/index.d.ts +1 -1
  6. package/dist/src/components/InfoViewer/i18n/index.js +1 -2
  7. package/dist/src/containers/App/App.d.ts +1 -1
  8. package/dist/src/containers/App/Content.js +1 -1
  9. package/dist/src/containers/App/appSlots.d.ts +1 -1
  10. package/dist/src/containers/AppWithClusters/AppWithClusters.js +1 -1
  11. package/dist/src/containers/AsideNavigation/Navigation.js +1 -3
  12. package/dist/src/containers/AsideNavigation/i18n/en.json +0 -2
  13. package/dist/src/containers/AsideNavigation/i18n/index.d.ts +1 -1
  14. package/dist/src/containers/AsideNavigation/i18n/index.js +1 -2
  15. package/dist/src/containers/Cluster/i18n/index.d.ts +1 -1
  16. package/dist/src/containers/Clusters/constants.d.ts +1 -1
  17. package/dist/src/containers/Header/Header.js +17 -21
  18. package/dist/src/containers/Header/Header.scss +14 -5
  19. package/dist/src/containers/Header/breadcrumbs.js +65 -71
  20. package/dist/src/containers/Heatmap/Heatmap.js +3 -3
  21. package/dist/src/containers/Nodes/Nodes.js +4 -4
  22. package/dist/src/containers/Nodes/VirtualNodes.js +2 -2
  23. package/dist/src/containers/Storage/Storage.js +2 -2
  24. package/dist/src/containers/Storage/StorageGroups/getStorageGroupsColumns.js +4 -3
  25. package/dist/src/containers/Tablets/Tablets.js +8 -8
  26. package/dist/src/containers/TabletsFilters/TabletsFilters.d.ts +2 -57
  27. package/dist/src/containers/TabletsFilters/TabletsFilters.js +70 -180
  28. package/dist/src/containers/Tenant/Acl/Acl.d.ts +3 -1
  29. package/dist/src/containers/Tenant/Acl/Acl.js +85 -69
  30. package/dist/src/containers/Tenant/Acl/Acl.scss +14 -9
  31. package/dist/src/containers/Tenant/Diagnostics/Autorefresh/AutorefreshControl.js +4 -5
  32. package/dist/src/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
  33. package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -2
  34. package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.js +5 -6
  35. package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.d.ts +1 -0
  36. package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +3 -5
  37. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.d.ts +2 -0
  38. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.js +26 -50
  39. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.scss +1 -1
  40. package/dist/src/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +19 -58
  41. package/dist/src/containers/Tenant/Diagnostics/Network/Network.d.ts +2 -2
  42. package/dist/src/containers/Tenant/Diagnostics/Network/Network.js +5 -5
  43. package/dist/src/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +1 -6
  44. package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.d.ts +2 -1
  45. package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.js +3 -8
  46. package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -2
  47. package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.js +19 -21
  48. package/dist/src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js +3 -3
  49. package/dist/src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.scss +0 -2
  50. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.d.ts +2 -1
  51. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.js +3 -8
  52. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.d.ts +3 -1
  53. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +5 -5
  54. package/dist/src/containers/Tenant/Diagnostics/Partitions/Partitions.js +4 -12
  55. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +48 -57
  56. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.d.ts +2 -5
  57. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.js +7 -2
  58. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.d.ts +1 -6
  59. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +22 -16
  60. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.d.ts +2 -8
  61. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.js +2 -2
  62. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.d.ts +2 -2
  63. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.js +2 -2
  64. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.d.ts +2 -2
  65. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +4 -4
  66. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.d.ts +2 -2
  67. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +4 -4
  68. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.d.ts +2 -2
  69. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +4 -4
  70. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.d.ts +2 -1
  71. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +5 -5
  72. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantDashboard/TenantDashboard.js +3 -3
  73. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.d.ts +2 -2
  74. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.js +2 -2
  75. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.d.ts +2 -2
  76. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +4 -4
  77. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +7 -9
  78. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +3 -3
  79. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +3 -3
  80. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
  81. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/useHealthcheck.js +1 -1
  82. package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.d.ts +2 -2
  83. package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +5 -5
  84. package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +3 -2
  85. package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -8
  86. package/dist/src/containers/Tenant/EntityTitle/EntityTitle.d.ts +6 -0
  87. package/dist/src/containers/Tenant/EntityTitle/EntityTitle.js +11 -0
  88. package/dist/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.js +0 -6
  89. package/dist/src/containers/Tenant/Info/ExternalTable/ExternalTable.js +0 -6
  90. package/dist/src/containers/Tenant/Info/View/View.js +0 -6
  91. package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.d.ts +2 -1
  92. package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.js +7 -13
  93. package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.d.ts +4 -4
  94. package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.js +159 -63
  95. package/dist/src/containers/Tenant/Query/Issues/Issues.js +6 -5
  96. package/dist/src/containers/Tenant/Query/Preview/Preview.d.ts +2 -1
  97. package/dist/src/containers/Tenant/Query/Preview/Preview.js +6 -6
  98. package/dist/src/containers/Tenant/Query/Query.d.ts +1 -0
  99. package/dist/src/containers/Tenant/Query/Query.scss +1 -1
  100. package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +2 -0
  101. package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.js +9 -22
  102. package/dist/src/containers/Tenant/Query/i18n/en.json +1 -1
  103. package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.d.ts +1 -0
  104. package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.js +11 -19
  105. package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +2 -2
  106. package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +13 -8
  107. package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
  108. package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.js +21 -2
  109. package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
  110. package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
  111. package/dist/src/containers/Tenant/Schema/SchemaViewer/prepareData.js +2 -1
  112. package/dist/src/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
  113. package/dist/src/containers/Tenant/Tenant.js +20 -36
  114. package/dist/src/containers/Tenant/Tenant.scss +4 -0
  115. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.d.ts +2 -0
  116. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.js +19 -0
  117. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.scss +18 -0
  118. package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.d.ts +9 -0
  119. package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.js +44 -0
  120. package/dist/src/containers/Tenant/i18n/en.json +22 -1
  121. package/dist/src/containers/Tenant/i18n/index.d.ts +1 -1
  122. package/dist/src/containers/Tenant/utils/index.d.ts +1 -0
  123. package/dist/src/containers/Tenant/utils/index.js +6 -0
  124. package/dist/src/containers/Tenant/utils/queryTemplates.d.ts +4 -0
  125. package/dist/src/containers/Tenant/utils/queryTemplates.js +32 -0
  126. package/dist/src/containers/Tenant/utils/schemaActions.js +18 -2
  127. package/dist/src/containers/UserSettings/Setting.d.ts +7 -9
  128. package/dist/src/containers/UserSettings/Setting.js +13 -28
  129. package/dist/src/containers/UserSettings/UserSettings.d.ts +0 -2
  130. package/dist/src/containers/UserSettings/UserSettings.js +3 -6
  131. package/dist/src/containers/UserSettings/i18n/en.json +2 -2
  132. package/dist/src/containers/UserSettings/settings.js +3 -3
  133. package/dist/src/lib.d.ts +1 -1
  134. package/dist/src/lib.js +1 -1
  135. package/dist/src/routes.d.ts +1 -1
  136. package/dist/src/routes.js +3 -1
  137. package/dist/src/services/api.d.ts +6 -1
  138. package/dist/src/services/api.js +24 -3
  139. package/dist/src/services/settings.d.ts +1 -0
  140. package/dist/src/services/settings.js +3 -2
  141. package/dist/src/store/configureStore.d.ts +36 -134
  142. package/dist/src/store/configureStore.js +2 -15
  143. package/dist/src/store/defaultStore.d.ts +17 -81
  144. package/dist/src/store/reducers/api.js +0 -1
  145. package/dist/src/store/reducers/authentication/authentication.d.ts +51 -243
  146. package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +196 -849
  147. package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.js +3 -3
  148. package/dist/src/store/reducers/hotKeys/hotKeys.d.ts +6 -25
  149. package/dist/src/store/reducers/hotKeys/hotKeys.js +36 -49
  150. package/dist/src/store/reducers/index.d.ts +23 -100
  151. package/dist/src/store/reducers/index.js +0 -8
  152. package/dist/src/store/reducers/node/selectors.d.ts +0 -40
  153. package/dist/src/store/reducers/nodesList.d.ts +0 -40
  154. package/dist/src/store/reducers/schema/schema.d.ts +13 -149
  155. package/dist/src/store/reducers/schema/schema.js +45 -90
  156. package/dist/src/store/reducers/schema/types.d.ts +2 -21
  157. package/dist/src/store/reducers/schemaAcl/schemaAcl.d.ts +8 -135
  158. package/dist/src/store/reducers/schemaAcl/schemaAcl.js +18 -44
  159. package/dist/src/store/reducers/settings/settings.d.ts +17 -23
  160. package/dist/src/store/reducers/settings/settings.js +40 -33
  161. package/dist/src/store/reducers/settings/types.d.ts +1 -12
  162. package/dist/src/store/reducers/tablets.d.ts +288 -41
  163. package/dist/src/store/reducers/tablets.js +8 -4
  164. package/dist/src/store/reducers/tabletsFilters.d.ts +11 -164
  165. package/dist/src/store/reducers/tabletsFilters.js +14 -76
  166. package/dist/src/store/reducers/tenants/selectors.d.ts +8 -362
  167. package/dist/src/store/reducers/topic.d.ts +0 -600
  168. package/dist/src/store/state-url-mapping.js +0 -3
  169. package/dist/src/styles/mixins.scss +5 -0
  170. package/dist/src/styles/themes.scss +1 -1
  171. package/dist/src/types/api/acl.d.ts +2 -1
  172. package/dist/src/types/api/schema/schema.d.ts +5 -0
  173. package/dist/src/utils/constants.d.ts +1 -1
  174. package/dist/src/utils/constants.js +1 -1
  175. package/dist/src/utils/dataFormatters/dataFormatters.d.ts +2 -1
  176. package/dist/src/utils/dataFormatters/dataFormatters.js +7 -3
  177. package/dist/src/utils/hooks/index.d.ts +1 -0
  178. package/dist/src/utils/hooks/index.js +1 -0
  179. package/dist/src/utils/hooks/useAutoRefreshInterval.d.ts +1 -0
  180. package/dist/src/utils/hooks/useAutoRefreshInterval.js +5 -0
  181. package/dist/src/utils/utils.js +2 -1
  182. package/package.json +31 -30
  183. package/dist/src/components/InfoViewer/i18n/ru.json +0 -4
  184. package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.d.ts +0 -6
  185. package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.js +0 -17
  186. package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.d.ts +0 -6
  187. package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.js +0 -20
  188. package/dist/src/components/InfoViewer/schemaOverview/index.d.ts +0 -2
  189. package/dist/src/components/InfoViewer/schemaOverview/index.js +0 -2
  190. package/dist/src/containers/AsideNavigation/i18n/ru.json +0 -10
  191. package/dist/src/containers/AsideNavigation/useNavigationMenuItems.d.ts +0 -2
  192. package/dist/src/containers/AsideNavigation/useNavigationMenuItems.js +0 -54
  193. package/dist/src/containers/UserSettings/UserSettings.scss +0 -9
  194. package/dist/src/store/reducers/host.d.ts +0 -130
  195. package/dist/src/store/reducers/host.js +0 -26
  196. package/dist/src/store/reducers/hotKeys/types.d.ts +0 -10
  197. package/dist/src/store/reducers/hotKeys/types.js +0 -1
  198. package/dist/src/store/reducers/schemaAcl/types.d.ts +0 -12
  199. package/dist/src/store/reducers/schemaAcl/types.js +0 -1
  200. package/dist/src/types/store/host.d.ts +0 -15
  201. package/dist/src/types/store/host.js +0 -1
@@ -1,18 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { InfoViewer } from '../../../../../components/InfoViewer';
3
- import { useTypedSelector } from '../../../../../utils/hooks';
4
3
  import { getEntityName } from '../../../utils';
5
4
  import { TopicStats } from '../TopicStats';
6
5
  import { prepareTopicSchemaInfo } from '../utils';
7
6
  /** Displays overview for PersQueueGroup EPathType */
8
- export const TopicInfo = ({ data }) => {
7
+ export const TopicInfo = ({ data, path }) => {
9
8
  const entityName = getEntityName(data === null || data === void 0 ? void 0 : data.PathDescription);
10
- const { error: schemaError } = useTypedSelector((state) => state.schema);
11
- if (schemaError) {
12
- return _jsx("div", { className: "error", children: schemaError.statusText });
13
- }
14
9
  if (!data) {
15
10
  return _jsxs("div", { className: "error", children: ["No ", entityName, " data"] });
16
11
  }
17
- return (_jsxs("div", { children: [_jsx(InfoViewer, { title: entityName, info: prepareTopicSchemaInfo(data) }), _jsx(TopicStats, {})] }));
12
+ return (_jsxs("div", { children: [_jsx(InfoViewer, { title: entityName, info: prepareTopicSchemaInfo(data) }), _jsx(TopicStats, { path: path })] }));
18
13
  };
@@ -1,2 +1,4 @@
1
1
  import './TopicStats.scss';
2
- export declare const TopicStats: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const TopicStats: ({ path }: {
3
+ path: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ import { SpeedMultiMeter } from '../../../../../components/SpeedMultiMeter';
8
8
  import { selectPreparedTopicStats, topicApi } from '../../../../../store/reducers/topic';
9
9
  import { cn } from '../../../../../utils/cn';
10
10
  import { formatBps, formatBytes } from '../../../../../utils/dataFormatters/dataFormatters';
11
- import { useTypedSelector } from '../../../../../utils/hooks';
11
+ import { useAutoRefreshInterval, useTypedSelector } from '../../../../../utils/hooks';
12
12
  import { formatDurationToShortTimeFormat } from '../../../../../utils/timeParsers';
13
13
  import i18n from './i18n';
14
14
  import './TopicStats.scss';
@@ -47,11 +47,11 @@ const prepareBytesWrittenInfo = (data) => {
47
47
  },
48
48
  ];
49
49
  };
50
- export const TopicStats = () => {
51
- const { autorefresh, currentSchemaPath } = useTypedSelector((state) => state.schema);
52
- const { currentData, isFetching, error } = topicApi.useGetTopicQuery({ path: currentSchemaPath }, { pollingInterval: autorefresh });
50
+ export const TopicStats = ({ path }) => {
51
+ const [autoRefreshInterval] = useAutoRefreshInterval();
52
+ const { currentData, isFetching, error } = topicApi.useGetTopicQuery({ path }, { pollingInterval: autoRefreshInterval });
53
53
  const loading = isFetching && currentData === undefined;
54
- const data = useTypedSelector((state) => selectPreparedTopicStats(state, currentSchemaPath));
54
+ const data = useTypedSelector((state) => selectPreparedTopicStats(state, path));
55
55
  if (loading) {
56
56
  return (_jsx("div", { className: b(), children: _jsx(Loader, { size: "s" }) }));
57
57
  }
@@ -9,7 +9,7 @@ import { partitionsApi, setSelectedConsumer } from '../../../../store/reducers/p
9
9
  import { selectConsumersNames, topicApi } from '../../../../store/reducers/topic';
10
10
  import { cn } from '../../../../utils/cn';
11
11
  import { DEFAULT_TABLE_SETTINGS, PARTITIONS_HIDDEN_COLUMNS_KEY } from '../../../../utils/constants';
12
- import { useSetting, useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
12
+ import { useAutoRefreshInterval, useSetting, useTypedDispatch, useTypedSelector, } from '../../../../utils/hooks';
13
13
  import { PartitionsControls } from './PartitionsControls/PartitionsControls';
14
14
  import { PARTITIONS_COLUMNS_WIDTH_LS_KEY } from './columns';
15
15
  import i18n from './i18n';
@@ -19,12 +19,9 @@ import './Partitions.scss';
19
19
  export const b = cn('ydb-diagnostics-partitions');
20
20
  export const Partitions = ({ path }) => {
21
21
  const dispatch = useTypedDispatch();
22
- // Manual path control to ensure that topic state will be reset before data fetch
23
- // so no request with wrong params will be sent
24
- const [componentCurrentPath, setComponentCurrentPath] = React.useState(path);
25
22
  const [partitionsToRender, setPartitionsToRender] = React.useState([]);
26
23
  const consumers = useTypedSelector((state) => selectConsumersNames(state, path));
27
- const { autorefresh } = useTypedSelector((state) => state.schema);
24
+ const [autoRefreshInterval] = useAutoRefreshInterval();
28
25
  const { selectedConsumer } = useTypedSelector((state) => state.partitions);
29
26
  const { currentData: topicData, isFetching: topicIsFetching, error: topicError, } = topicApi.useGetTopicQuery({ path });
30
27
  const topicLoading = topicIsFetching && topicData === undefined;
@@ -33,13 +30,8 @@ export const Partitions = ({ path }) => {
33
30
  const nodesMap = useTypedSelector(selectNodesMap);
34
31
  const [hiddenColumns, setHiddenColumns] = useSetting(PARTITIONS_HIDDEN_COLUMNS_KEY);
35
32
  const [columns, columnsIdsForSelector] = useGetPartitionsColumns(selectedConsumer);
36
- React.useEffect(() => {
37
- setComponentCurrentPath(path);
38
- }, [dispatch, path]);
39
- const params = !topicLoading && componentCurrentPath
40
- ? { path: componentCurrentPath, consumerName: selectedConsumer }
41
- : skipToken;
42
- const { currentData: partitionsData, isFetching: partitionsIsFetching, error: partitionsError, } = partitionsApi.useGetPartitionsQuery(params, { pollingInterval: autorefresh });
33
+ const params = !topicLoading && path ? { path, consumerName: selectedConsumer } : skipToken;
34
+ const { currentData: partitionsData, isFetching: partitionsIsFetching, error: partitionsError, } = partitionsApi.useGetPartitionsQuery(params, { pollingInterval: autoRefreshInterval });
43
35
  const partitionsLoading = partitionsIsFetching && partitionsData === undefined;
44
36
  const rawPartitions = partitionsData;
45
37
  const partitionsWithHosts = React.useMemo(() => {
@@ -1,21 +1,7 @@
1
1
  @import '../../../../../styles/mixins.scss';
2
2
 
3
3
  .healthcheck {
4
- display: flex;
5
-
6
- &_expanded {
7
- // Since most of the inner containers have fixed width, we can set fixed width here as well
8
- // Thus we will get rid of unneeded layout shift when scrollbar appear
9
- min-width: 885px;
10
- }
11
-
12
- &__issue-preview {
13
- margin-bottom: 15px;
14
- }
15
-
16
- &__message-container {
17
- padding: 15px 0;
18
- }
4
+ $block: &;
19
5
 
20
6
  &__details {
21
7
  width: 872px;
@@ -26,13 +12,10 @@
26
12
  }
27
13
 
28
14
  &__preview {
29
- height: 100%;
30
- }
31
-
32
- &__preview-header {
33
- gap: 8px;
15
+ display: flex;
16
+ flex-direction: column;
34
17
 
35
- margin-bottom: var(--diagnostics-section-title-margin);
18
+ height: 100%;
36
19
  }
37
20
 
38
21
  &__preview-title {
@@ -44,9 +27,16 @@
44
27
  }
45
28
 
46
29
  &__preview-content {
30
+ margin: auto;
31
+
47
32
  line-height: 24px;
48
33
  }
49
34
 
35
+ &__preview-status-icon {
36
+ width: 64px;
37
+ height: 64px;
38
+ }
39
+
50
40
  &__preview-title-wrapper {
51
41
  display: flex;
52
42
  align-items: center;
@@ -55,13 +45,45 @@
55
45
  margin-bottom: 4px;
56
46
  }
57
47
 
58
- &__issues-statistics {
48
+ &__preview-issue {
49
+ position: relative;
50
+ top: -8px;
51
+
59
52
  display: flex;
60
- flex-wrap: wrap;
53
+ flex-direction: column;
61
54
  align-items: center;
62
- gap: 10px;
55
+ gap: 4px;
63
56
 
64
- margin: 8px 0;
57
+ &_good {
58
+ color: var(--g-color-text-positive);
59
+ & #{$block}__self-check-status-indicator {
60
+ background-color: var(--g-color-base-positive-light);
61
+ }
62
+ }
63
+ &_degraded {
64
+ color: var(--g-color-text-info);
65
+ & #{$block}__self-check-status-indicator {
66
+ background-color: var(--g-color-base-info-light);
67
+ }
68
+ }
69
+ &_emergency {
70
+ color: var(--g-color-text-danger);
71
+ & #{$block}__self-check-status-indicator {
72
+ background-color: var(--g-color-base-danger-light);
73
+ }
74
+ }
75
+ &_unspecified {
76
+ color: var(--g-color-text-misc);
77
+ & #{$block}__self-check-status-indicator {
78
+ background-color: var(--g-color-base-misc-light);
79
+ }
80
+ }
81
+ &_maintenance_required {
82
+ color: var(--g-color-text-warning-heavy);
83
+ & #{$block}__self-check-status-indicator {
84
+ background-color: var(--g-color-base-warning-light);
85
+ }
86
+ }
65
87
  }
66
88
 
67
89
  &__self-check-status-indicator {
@@ -71,39 +93,8 @@
71
93
 
72
94
  font-size: 13px;
73
95
  line-height: 24px;
96
+ text-wrap: nowrap;
74
97
 
75
98
  border-radius: 4px;
76
-
77
- &_good,
78
- &_green {
79
- color: var(--g-color-text-positive);
80
- background-color: var(--g-color-base-positive-light);
81
- }
82
- &_degraded,
83
- &_yellow {
84
- color: var(--g-color-text-warning);
85
- background-color: var(--g-color-base-warning-light);
86
- }
87
-
88
- &_blue {
89
- color: var(--g-color-text-info);
90
- background-color: var(--g-color-base-info-light);
91
- }
92
-
93
- &_emergency,
94
- &_red {
95
- color: var(--g-color-text-danger);
96
- background-color: var(--g-color-base-danger-light);
97
- }
98
- &_unspecified,
99
- &_grey {
100
- color: var(--g-color-text-misc);
101
- background-color: var(--g-color-base-misc-light);
102
- }
103
- &_maintenance_required,
104
- &_orange {
105
- color: var(--g-color-text-warning-heavy);
106
- background-color: var(--g-color-base-warning-light);
107
- }
108
99
  }
109
100
  }
@@ -1,9 +1,6 @@
1
- import type { IssuesTree } from '../../../../../store/reducers/healthcheckInfo/types';
2
1
  import './Healthcheck.scss';
3
2
  interface HealthcheckDetailsProps {
4
- issueTrees?: IssuesTree[];
5
- loading?: boolean;
6
- error?: unknown;
3
+ tenantName: string;
7
4
  }
8
- export declare function HealthcheckDetails(props: HealthcheckDetailsProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function HealthcheckDetails({ tenantName }: HealthcheckDetailsProps): import("react/jsx-runtime").JSX.Element;
9
6
  export {};
@@ -3,12 +3,17 @@ import React from 'react';
3
3
  import { ResponseError } from '../../../../../components/Errors/ResponseError';
4
4
  import { Loader } from '../../../../../components/Loader';
5
5
  import { cn } from '../../../../../utils/cn';
6
+ import { useAutoRefreshInterval } from '../../../../../utils/hooks';
7
+ import { useHealthcheck } from '../useHealthcheck';
6
8
  import IssueTree from './IssuesViewer/IssueTree';
7
9
  import i18n from './i18n';
8
10
  import './Healthcheck.scss';
9
11
  const b = cn('healthcheck');
10
- export function HealthcheckDetails(props) {
11
- const { issueTrees, loading, error } = props;
12
+ export function HealthcheckDetails({ tenantName }) {
13
+ const [autoRefreshInterval] = useAutoRefreshInterval();
14
+ const { issueTrees, loading, error } = useHealthcheck(tenantName, {
15
+ autorefresh: autoRefreshInterval,
16
+ });
12
17
  const renderContent = () => {
13
18
  if (error) {
14
19
  return _jsx(ResponseError, { error: error, defaultMessage: i18n('no-data') });
@@ -1,11 +1,6 @@
1
- import type { SelfCheckResult, StatusFlag } from '../../../../../types/api/healthcheck';
2
1
  import './Healthcheck.scss';
3
2
  interface HealthcheckPreviewProps {
4
- selfCheckResult: SelfCheckResult;
5
- issuesStatistics?: [StatusFlag, number][];
6
- loading?: boolean;
7
- onUpdate: VoidFunction;
8
- error?: unknown;
3
+ tenantName: string;
9
4
  active?: boolean;
10
5
  }
11
6
  export declare function HealthcheckPreview(props: HealthcheckPreviewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,28 +1,32 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { ArrowsRotateRight } from '@gravity-ui/icons';
4
- import { Button, Icon } from '@gravity-ui/uikit';
2
+ import { CircleCheck, CircleInfo, CircleQuestion, CircleXmark, TriangleExclamationFill, } from '@gravity-ui/icons';
3
+ import { Icon } from '@gravity-ui/uikit';
5
4
  import { DiagnosticCard } from '../../../../../components/DiagnosticCard/DiagnosticCard';
6
- import { EntityStatus } from '../../../../../components/EntityStatus/EntityStatus';
7
5
  import { ResponseError } from '../../../../../components/Errors/ResponseError';
8
6
  import { Loader } from '../../../../../components/Loader';
9
- import { hcStatusToColorFlag } from '../../../../../store/reducers/healthcheckInfo/utils';
7
+ import { healthcheckApi } from '../../../../../store/reducers/healthcheckInfo/healthcheckInfo';
8
+ import { SelfCheckResult } from '../../../../../types/api/healthcheck';
10
9
  import { cn } from '../../../../../utils/cn';
10
+ import { useAutoRefreshInterval } from '../../../../../utils/hooks';
11
11
  import i18n from './i18n';
12
12
  import './Healthcheck.scss';
13
13
  const b = cn('healthcheck');
14
+ const icons = {
15
+ [SelfCheckResult.UNSPECIFIED]: CircleQuestion,
16
+ [SelfCheckResult.GOOD]: CircleCheck,
17
+ [SelfCheckResult.DEGRADED]: CircleInfo,
18
+ [SelfCheckResult.MAINTENANCE_REQUIRED]: CircleXmark,
19
+ [SelfCheckResult.EMERGENCY]: TriangleExclamationFill,
20
+ };
14
21
  export function HealthcheckPreview(props) {
15
- const { selfCheckResult, issuesStatistics, loading, onUpdate, error, active } = props;
22
+ const { tenantName, active } = props;
23
+ const [autoRefreshInterval] = useAutoRefreshInterval();
24
+ const { currentData: data, isFetching, error, } = healthcheckApi.useGetHealthcheckInfoQuery({ database: tenantName }, {
25
+ pollingInterval: autoRefreshInterval,
26
+ });
27
+ const loading = isFetching && data === undefined;
16
28
  const renderHeader = () => {
17
- const modifier = selfCheckResult.toLowerCase();
18
- if (loading) {
19
- return null;
20
- }
21
- return (_jsxs("div", { className: b('preview-header'), children: [_jsxs("div", { className: b('preview-title-wrapper'), children: [_jsx("div", { className: b('preview-title'), children: i18n('title.healthcheck') }), _jsx(Button, { size: "s", onClick: (event) => {
22
- // FIXME: refactor card to remove the button from the anchor link.
23
- event.preventDefault();
24
- onUpdate();
25
- }, loading: loading, view: "flat-secondary", children: _jsx(Icon, { data: ArrowsRotateRight, size: 20 }) })] }), _jsx("div", { className: b('self-check-status-indicator', { [modifier]: true }), children: selfCheckResult })] }));
29
+ return (_jsx("div", { className: b('preview-header'), children: _jsx("div", { className: b('preview-title-wrapper'), children: _jsx("div", { className: b('preview-title'), children: i18n('title.healthcheck') }) }) }));
26
30
  };
27
31
  const renderContent = () => {
28
32
  if (error) {
@@ -31,7 +35,9 @@ export function HealthcheckPreview(props) {
31
35
  if (loading) {
32
36
  return _jsx(Loader, { size: "m" });
33
37
  }
34
- return (_jsx("div", { className: b('preview-content'), children: !issuesStatistics || !issuesStatistics.length ? (i18n('status_message.ok')) : (_jsxs(React.Fragment, { children: [_jsx("div", { children: i18n('label.issues') }), _jsx("div", { className: b('issues-statistics'), children: issuesStatistics.map(([status, count]) => (_jsx(EntityStatus, { mode: "icons", status: hcStatusToColorFlag[status], label: count.toString(), size: "l" }, status))) })] })) }));
38
+ const selfCheckResult = (data === null || data === void 0 ? void 0 : data.self_check_result) || SelfCheckResult.UNSPECIFIED;
39
+ const modifier = selfCheckResult.toLowerCase();
40
+ return (_jsx("div", { className: b('preview-content'), children: _jsxs("div", { className: b('preview-issue', { [modifier]: true }), children: [_jsx(Icon, { className: b('preview-status-icon'), data: icons[selfCheckResult] }), _jsx("div", { className: b('self-check-status-indicator'), children: selfCheckResult.replace(/_/g, ' ') })] }) }));
35
41
  };
36
42
  return (_jsxs(DiagnosticCard, { className: b('preview'), active: active, children: [renderHeader(), renderContent()] }));
37
43
  }
@@ -1,5 +1,4 @@
1
1
  import type { TenantMetricStats, TenantPoolsStats, TenantStorageStats } from '../../../../../store/reducers/tenants/utils';
2
- import type { SelfCheckResult, StatusFlag } from '../../../../../types/api/healthcheck';
3
2
  import './MetricsCards.scss';
4
3
  export interface TenantMetrics {
5
4
  memoryUsed?: number;
@@ -14,12 +13,7 @@ interface MetricsCardsProps {
14
13
  memoryStats?: TenantMetricStats[];
15
14
  blobStorageStats?: TenantStorageStats[];
16
15
  tabletStorageStats?: TenantStorageStats[];
17
- issuesStatistics?: [StatusFlag, number][];
18
- selfCheckResult: SelfCheckResult;
19
- fetchHealthcheck: VoidFunction;
20
- healthcheckLoading?: boolean;
21
- healthCheckWasLoaded?: boolean;
22
- healthcheckError?: unknown;
16
+ tenantName: string;
23
17
  }
24
- export declare function MetricsCards({ poolsCpuStats, memoryStats, blobStorageStats, tabletStorageStats, issuesStatistics, selfCheckResult, fetchHealthcheck, healthcheckLoading, healthcheckError, }: MetricsCardsProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function MetricsCards({ poolsCpuStats, memoryStats, blobStorageStats, tabletStorageStats, tenantName, }: MetricsCardsProps): import("react/jsx-runtime").JSX.Element;
25
19
  export {};
@@ -13,7 +13,7 @@ import i18n from '../i18n';
13
13
  import { MetricCard } from './MetricCard/MetricCard';
14
14
  import './MetricsCards.scss';
15
15
  const b = cn('metrics-cards');
16
- export function MetricsCards({ poolsCpuStats, memoryStats, blobStorageStats, tabletStorageStats, issuesStatistics, selfCheckResult, fetchHealthcheck, healthcheckLoading, healthcheckError, }) {
16
+ export function MetricsCards({ poolsCpuStats, memoryStats, blobStorageStats, tabletStorageStats, tenantName, }) {
17
17
  const location = useLocation();
18
18
  const { metricsTab } = useTypedSelector((state) => state.tenant);
19
19
  const queryParams = parseQuery(location);
@@ -30,7 +30,7 @@ export function MetricsCards({ poolsCpuStats, memoryStats, blobStorageStats, tab
30
30
  [TENANT_METRICS_TABS_IDS.memory]: getTenantPath(Object.assign(Object.assign({}, queryParams), { [TenantTabsGroups.metricsTab]: getTabIfNotActive(TENANT_METRICS_TABS_IDS.memory) })),
31
31
  [TENANT_METRICS_TABS_IDS.healthcheck]: getTenantPath(Object.assign(Object.assign({}, queryParams), { [TenantTabsGroups.metricsTab]: getTabIfNotActive(TENANT_METRICS_TABS_IDS.healthcheck) })),
32
32
  };
33
- return (_jsxs("div", { className: b(), children: [_jsx(Link, { to: tabLinks.cpu, className: b('tab'), children: _jsx(CPUCard, { poolsCpuStats: poolsCpuStats, active: metricsTab === TENANT_METRICS_TABS_IDS.cpu }) }), _jsx(Link, { to: tabLinks.storage, className: b('tab'), children: _jsx(StorageCard, { blobStorageStats: blobStorageStats, tabletStorageStats: tabletStorageStats, active: metricsTab === TENANT_METRICS_TABS_IDS.storage }) }), _jsx(Link, { to: tabLinks.memory, className: b('tab'), children: _jsx(MemoryCard, { memoryStats: memoryStats, active: metricsTab === TENANT_METRICS_TABS_IDS.memory }) }), _jsx(Link, { to: tabLinks.healthcheck, className: b('tab'), children: _jsx(HealthcheckPreview, { selfCheckResult: selfCheckResult, issuesStatistics: issuesStatistics, onUpdate: fetchHealthcheck, loading: healthcheckLoading, error: healthcheckError, active: metricsTab === TENANT_METRICS_TABS_IDS.healthcheck }) })] }));
33
+ return (_jsxs("div", { className: b(), children: [_jsx(Link, { to: tabLinks.cpu, className: b('tab'), children: _jsx(CPUCard, { poolsCpuStats: poolsCpuStats, active: metricsTab === TENANT_METRICS_TABS_IDS.cpu }) }), _jsx(Link, { to: tabLinks.storage, className: b('tab'), children: _jsx(StorageCard, { blobStorageStats: blobStorageStats, tabletStorageStats: tabletStorageStats, active: metricsTab === TENANT_METRICS_TABS_IDS.storage }) }), _jsx(Link, { to: tabLinks.memory, className: b('tab'), children: _jsx(MemoryCard, { memoryStats: memoryStats, active: metricsTab === TENANT_METRICS_TABS_IDS.memory }) }), _jsx(Link, { to: tabLinks.healthcheck, className: b('tab'), children: _jsx(HealthcheckPreview, { tenantName: tenantName, active: metricsTab === TENANT_METRICS_TABS_IDS.healthcheck }) })] }));
34
34
  }
35
35
  function CPUCard({ poolsCpuStats = [], active }) {
36
36
  let status = METRIC_STATUS.Unspecified;
@@ -1,7 +1,7 @@
1
1
  import type { AdditionalNodesProps } from '../../../../../types/additionalProps';
2
2
  interface TenantCpuProps {
3
- path: string;
3
+ tenantName: string;
4
4
  additionalNodesProps?: AdditionalNodesProps;
5
5
  }
6
- export declare function TenantCpu({ path, additionalNodesProps }: TenantCpuProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function TenantCpu({ tenantName, additionalNodesProps }: TenantCpuProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -6,6 +6,6 @@ import { TopNodesByLoad } from './TopNodesByLoad';
6
6
  import { TopQueries } from './TopQueries';
7
7
  import { TopShards } from './TopShards';
8
8
  import { cpuDashboardConfig } from './cpuDashboardConfig';
9
- export function TenantCpu({ path, additionalNodesProps }) {
10
- return (_jsxs(React.Fragment, { children: [_jsx(TenantDashboard, { database: path, charts: cpuDashboardConfig }), _jsx(TopNodesByLoad, { path: path, additionalNodesProps: additionalNodesProps }), _jsx(TopNodesByCpu, { path: path, additionalNodesProps: additionalNodesProps }), _jsx(TopShards, { path: path }), _jsx(TopQueries, { path: path })] }));
9
+ export function TenantCpu({ tenantName, additionalNodesProps }) {
10
+ return (_jsxs(React.Fragment, { children: [_jsx(TenantDashboard, { database: tenantName, charts: cpuDashboardConfig }), _jsx(TopNodesByLoad, { tenantName: tenantName, additionalNodesProps: additionalNodesProps }), _jsx(TopNodesByCpu, { tenantName: tenantName, additionalNodesProps: additionalNodesProps }), _jsx(TopShards, { tenantName: tenantName, path: tenantName }), _jsx(TopQueries, { tenantName: tenantName })] }));
11
11
  }
@@ -1,7 +1,7 @@
1
1
  import type { AdditionalNodesProps } from '../../../../../types/additionalProps';
2
2
  interface TopNodesByCpuProps {
3
- path: string;
3
+ tenantName: string;
4
4
  additionalNodesProps?: AdditionalNodesProps;
5
5
  }
6
- export declare function TopNodesByCpu({ path, additionalNodesProps }: TopNodesByCpuProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function TopNodesByCpu({ tenantName, additionalNodesProps }: TopNodesByCpuProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -1,17 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../../../store/reducers/tenant/constants';
3
3
  import { topNodesApi } from '../../../../../store/reducers/tenantOverview/topNodes/topNodes';
4
- import { useSearchQuery, useTypedSelector } from '../../../../../utils/hooks';
4
+ import { useAutoRefreshInterval, useSearchQuery } from '../../../../../utils/hooks';
5
5
  import { NODES_COLUMNS_WIDTH_LS_KEY, getTopNodesByCpuColumns, } from '../../../../Nodes/getNodesColumns';
6
6
  import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
7
7
  import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
8
8
  import { getSectionTitle } from '../getSectionTitle';
9
9
  import i18n from '../i18n';
10
- export function TopNodesByCpu({ path, additionalNodesProps }) {
10
+ export function TopNodesByCpu({ tenantName, additionalNodesProps }) {
11
11
  const query = useSearchQuery();
12
- const { autorefresh } = useTypedSelector((state) => state.schema);
12
+ const [autoRefreshInterval] = useAutoRefreshInterval();
13
13
  const columns = getTopNodesByCpuColumns(additionalNodesProps === null || additionalNodesProps === void 0 ? void 0 : additionalNodesProps.getNodeRef);
14
- const { currentData, isFetching, error } = topNodesApi.useGetTopNodesQuery({ tenant: path, sortValue: 'CPU' }, { pollingInterval: autorefresh });
14
+ const { currentData, isFetching, error } = topNodesApi.useGetTopNodesQuery({ tenant: tenantName, sortValue: 'CPU' }, { pollingInterval: autoRefreshInterval });
15
15
  const loading = isFetching && currentData === undefined;
16
16
  const topNodes = currentData;
17
17
  const title = getSectionTitle({
@@ -1,7 +1,7 @@
1
1
  import type { AdditionalNodesProps } from '../../../../../types/additionalProps';
2
2
  interface TopNodesByLoadProps {
3
- path: string;
3
+ tenantName: string;
4
4
  additionalNodesProps?: AdditionalNodesProps;
5
5
  }
6
- export declare function TopNodesByLoad({ path, additionalNodesProps }: TopNodesByLoadProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function TopNodesByLoad({ tenantName, additionalNodesProps }: TopNodesByLoadProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -1,17 +1,17 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../../../store/reducers/tenant/constants';
3
3
  import { topNodesApi } from '../../../../../store/reducers/tenantOverview/topNodes/topNodes';
4
- import { useSearchQuery, useTypedSelector } from '../../../../../utils/hooks';
4
+ import { useAutoRefreshInterval, useSearchQuery } from '../../../../../utils/hooks';
5
5
  import { NODES_COLUMNS_WIDTH_LS_KEY, getTopNodesByLoadColumns, } from '../../../../Nodes/getNodesColumns';
6
6
  import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
7
7
  import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
8
8
  import { getSectionTitle } from '../getSectionTitle';
9
9
  import i18n from '../i18n';
10
- export function TopNodesByLoad({ path, additionalNodesProps }) {
10
+ export function TopNodesByLoad({ tenantName, additionalNodesProps }) {
11
11
  const query = useSearchQuery();
12
- const { autorefresh } = useTypedSelector((state) => state.schema);
12
+ const [autoRefreshInterval] = useAutoRefreshInterval();
13
13
  const columns = getTopNodesByLoadColumns(additionalNodesProps === null || additionalNodesProps === void 0 ? void 0 : additionalNodesProps.getNodeRef);
14
- const { currentData, isFetching, error } = topNodesApi.useGetTopNodesQuery({ tenant: path, sortValue: 'LoadAverage' }, { pollingInterval: autorefresh });
14
+ const { currentData, isFetching, error } = topNodesApi.useGetTopNodesQuery({ tenant: tenantName, sortValue: 'LoadAverage' }, { pollingInterval: autoRefreshInterval });
15
15
  const loading = isFetching && currentData === undefined;
16
16
  const topNodes = currentData;
17
17
  const title = getSectionTitle({
@@ -1,5 +1,5 @@
1
1
  interface TopQueriesProps {
2
- path: string;
2
+ tenantName: string;
3
3
  }
4
- export declare function TopQueries({ path }: TopQueriesProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function TopQueries({ tenantName }: TopQueriesProps): import("react/jsx-runtime").JSX.Element;
5
5
  export {};
@@ -5,7 +5,7 @@ import { parseQuery } from '../../../../../routes';
5
5
  import { changeUserInput } from '../../../../../store/reducers/executeQuery';
6
6
  import { TENANT_DIAGNOSTICS_TABS_IDS, TENANT_PAGE, TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID, } from '../../../../../store/reducers/tenant/constants';
7
7
  import { topQueriesApi } from '../../../../../store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries';
8
- import { useTypedDispatch, useTypedSelector } from '../../../../../utils/hooks';
8
+ import { useAutoRefreshInterval, useTypedDispatch } from '../../../../../utils/hooks';
9
9
  import { parseQueryErrorToString } from '../../../../../utils/query';
10
10
  import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
11
11
  import { TOP_QUERIES_COLUMNS_WIDTH_LS_KEY, getTenantOverviewTopQueriesColumns, } from '../../TopQueries/getTopQueriesColumns';
@@ -13,14 +13,14 @@ import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
13
13
  import { getSectionTitle } from '../getSectionTitle';
14
14
  import i18n from '../i18n';
15
15
  import { b } from '../utils';
16
- export function TopQueries({ path }) {
16
+ export function TopQueries({ tenantName }) {
17
17
  const dispatch = useTypedDispatch();
18
18
  const location = useLocation();
19
19
  const history = useHistory();
20
20
  const query = parseQuery(location);
21
- const { autorefresh } = useTypedSelector((state) => state.schema);
21
+ const [autoRefreshInterval] = useAutoRefreshInterval();
22
22
  const columns = getTenantOverviewTopQueriesColumns();
23
- const { currentData, isFetching, error } = topQueriesApi.useGetOverviewTopQueriesQuery({ database: path }, { pollingInterval: autorefresh });
23
+ const { currentData, isFetching, error } = topQueriesApi.useGetOverviewTopQueriesQuery({ database: tenantName }, { pollingInterval: autoRefreshInterval });
24
24
  const loading = isFetching && currentData === undefined;
25
25
  const { result: data } = currentData || {};
26
26
  const handleRowClick = React.useCallback((row) => {
@@ -1,5 +1,6 @@
1
1
  interface TopShardsProps {
2
+ tenantName: string;
2
3
  path: string;
3
4
  }
4
- export declare const TopShards: ({ path }: TopShardsProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const TopShards: ({ tenantName, path }: TopShardsProps) => import("react/jsx-runtime").JSX.Element;
5
6
  export {};
@@ -3,21 +3,21 @@ import { useLocation } from 'react-router';
3
3
  import { parseQuery } from '../../../../../routes';
4
4
  import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../../../store/reducers/tenant/constants';
5
5
  import { topShardsApi } from '../../../../../store/reducers/tenantOverview/topShards/tenantOverviewTopShards';
6
- import { useTypedSelector } from '../../../../../utils/hooks';
6
+ import { useAutoRefreshInterval } from '../../../../../utils/hooks';
7
7
  import { parseQueryErrorToString } from '../../../../../utils/query';
8
8
  import { TenantTabsGroups, getTenantPath } from '../../../TenantPages';
9
9
  import { TOP_SHARDS_COLUMNS_WIDTH_LS_KEY, getTopShardsColumns, } from '../../TopShards/getTopShardsColumns';
10
10
  import { TenantOverviewTableLayout } from '../TenantOverviewTableLayout';
11
11
  import { getSectionTitle } from '../getSectionTitle';
12
12
  import i18n from '../i18n';
13
- export const TopShards = ({ path }) => {
13
+ export const TopShards = ({ tenantName, path }) => {
14
14
  const location = useLocation();
15
15
  const query = parseQuery(location);
16
- const { autorefresh, currentSchemaPath } = useTypedSelector((state) => state.schema);
17
- const { currentData, isFetching, error } = topShardsApi.useGetTopShardsQuery({ database: path, path: currentSchemaPath }, { pollingInterval: autorefresh });
16
+ const [autoRefreshInterval] = useAutoRefreshInterval();
17
+ const { currentData, isFetching, error } = topShardsApi.useGetTopShardsQuery({ database: tenantName, path }, { pollingInterval: autoRefreshInterval });
18
18
  const loading = isFetching && currentData === undefined;
19
19
  const { result: data } = currentData || {};
20
- const columns = getTopShardsColumns(path, location);
20
+ const columns = getTopShardsColumns(tenantName, location);
21
21
  const title = getSectionTitle({
22
22
  entity: i18n('shards'),
23
23
  postfix: i18n('by-cpu-usage'),
@@ -4,7 +4,7 @@ import { StringParam, useQueryParam } from 'use-query-params';
4
4
  import { MetricChart } from '../../../../../components/MetricChart';
5
5
  import { TimeFrameSelector } from '../../../../../components/TimeFrameSelector/TimeFrameSelector';
6
6
  import { cn } from '../../../../../utils/cn';
7
- import { useTypedSelector } from '../../../../../utils/hooks';
7
+ import { useAutoRefreshInterval } from '../../../../../utils/hooks';
8
8
  import './TenantDashboard.scss';
9
9
  const CHART_WIDTH = 428;
10
10
  const CHART_WIDTH_FULL = 872;
@@ -12,9 +12,9 @@ const b = cn('ydb-tenant-dashboard');
12
12
  export const TenantDashboard = ({ database, charts }) => {
13
13
  const [isDashboardHidden, setIsDashboardHidden] = React.useState(true);
14
14
  const [timeFrame = '1h', setTimeframe] = useQueryParam('timeframe', StringParam);
15
- const { autorefresh } = useTypedSelector((state) => state.schema);
15
+ const [autoRefreshInterval] = useAutoRefreshInterval();
16
16
  // Refetch data only if dashboard successfully loaded
17
- const shouldRefresh = isDashboardHidden ? 0 : autorefresh;
17
+ const shouldRefresh = isDashboardHidden ? 0 : autoRefreshInterval;
18
18
  /**
19
19
  * Charts should be hidden, if they are not enabled:
20
20
  * 1. GraphShard is not enabled
@@ -1,5 +1,5 @@
1
1
  interface TenantMemoryProps {
2
- path: string;
2
+ tenantName: string;
3
3
  }
4
- export declare function TenantMemory({ path }: TenantMemoryProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare function TenantMemory({ tenantName }: TenantMemoryProps): import("react/jsx-runtime").JSX.Element;
5
5
  export {};
@@ -3,6 +3,6 @@ import React from 'react';
3
3
  import { TenantDashboard } from '../TenantDashboard/TenantDashboard';
4
4
  import { TopNodesByMemory } from './TopNodesByMemory';
5
5
  import { memoryDashboardConfig } from './memoryDashboardConfig';
6
- export function TenantMemory({ path }) {
7
- return (_jsxs(React.Fragment, { children: [_jsx(TenantDashboard, { database: path, charts: memoryDashboardConfig }), _jsx(TopNodesByMemory, { path: path })] }));
6
+ export function TenantMemory({ tenantName }) {
7
+ return (_jsxs(React.Fragment, { children: [_jsx(TenantDashboard, { database: tenantName, charts: memoryDashboardConfig }), _jsx(TopNodesByMemory, { tenantName: tenantName })] }));
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import type { AdditionalNodesProps } from '../../../../../types/additionalProps';
2
2
  interface TopNodesByMemoryProps {
3
- path: string;
3
+ tenantName: string;
4
4
  additionalNodesProps?: AdditionalNodesProps;
5
5
  }
6
- export declare function TopNodesByMemory({ path, additionalNodesProps }: TopNodesByMemoryProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function TopNodesByMemory({ tenantName, additionalNodesProps }: TopNodesByMemoryProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};