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.
- package/dist/package.json +31 -30
- package/dist/src/components/InfoViewer/InfoViewer.d.ts +1 -1
- package/dist/src/components/InfoViewer/InfoViewer.js +2 -1
- package/dist/src/components/InfoViewer/i18n/en.json +2 -1
- package/dist/src/components/InfoViewer/i18n/index.d.ts +1 -1
- package/dist/src/components/InfoViewer/i18n/index.js +1 -2
- package/dist/src/containers/App/App.d.ts +1 -1
- package/dist/src/containers/App/Content.js +1 -1
- package/dist/src/containers/App/appSlots.d.ts +1 -1
- package/dist/src/containers/AppWithClusters/AppWithClusters.js +1 -1
- package/dist/src/containers/AsideNavigation/Navigation.js +1 -3
- package/dist/src/containers/AsideNavigation/i18n/en.json +0 -2
- package/dist/src/containers/AsideNavigation/i18n/index.d.ts +1 -1
- package/dist/src/containers/AsideNavigation/i18n/index.js +1 -2
- package/dist/src/containers/Cluster/i18n/index.d.ts +1 -1
- package/dist/src/containers/Clusters/constants.d.ts +1 -1
- package/dist/src/containers/Header/Header.js +17 -21
- package/dist/src/containers/Header/Header.scss +14 -5
- package/dist/src/containers/Header/breadcrumbs.js +65 -71
- package/dist/src/containers/Heatmap/Heatmap.js +3 -3
- package/dist/src/containers/Nodes/Nodes.js +4 -4
- package/dist/src/containers/Nodes/VirtualNodes.js +2 -2
- package/dist/src/containers/Storage/Storage.js +2 -2
- package/dist/src/containers/Storage/StorageGroups/getStorageGroupsColumns.js +4 -3
- package/dist/src/containers/Tablets/Tablets.js +8 -8
- package/dist/src/containers/TabletsFilters/TabletsFilters.d.ts +2 -57
- package/dist/src/containers/TabletsFilters/TabletsFilters.js +70 -180
- package/dist/src/containers/Tenant/Acl/Acl.d.ts +3 -1
- package/dist/src/containers/Tenant/Acl/Acl.js +85 -69
- package/dist/src/containers/Tenant/Acl/Acl.scss +14 -9
- package/dist/src/containers/Tenant/Diagnostics/Autorefresh/AutorefreshControl.js +4 -5
- package/dist/src/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
- package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.js +5 -6
- package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.d.ts +1 -0
- package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +3 -5
- package/dist/src/containers/Tenant/Diagnostics/Diagnostics.d.ts +2 -0
- package/dist/src/containers/Tenant/Diagnostics/Diagnostics.js +26 -50
- package/dist/src/containers/Tenant/Diagnostics/Diagnostics.scss +1 -1
- package/dist/src/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +19 -58
- package/dist/src/containers/Tenant/Diagnostics/Network/Network.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/Network/Network.js +5 -5
- package/dist/src/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +1 -6
- package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.d.ts +2 -1
- package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.js +3 -8
- package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.js +19 -21
- package/dist/src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js +3 -3
- package/dist/src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.scss +0 -2
- package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.d.ts +2 -1
- package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.js +3 -8
- package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.d.ts +3 -1
- package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +5 -5
- package/dist/src/containers/Tenant/Diagnostics/Partitions/Partitions.js +4 -12
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +48 -57
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.d.ts +2 -5
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.js +7 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.d.ts +1 -6
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +22 -16
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.d.ts +2 -8
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.js +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.js +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +4 -4
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +4 -4
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +4 -4
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.d.ts +2 -1
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +5 -5
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantDashboard/TenantDashboard.js +3 -3
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.js +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +4 -4
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +7 -9
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +3 -3
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +3 -3
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/src/containers/Tenant/Diagnostics/TenantOverview/useHealthcheck.js +1 -1
- package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.d.ts +2 -2
- package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +5 -5
- package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +3 -2
- package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -8
- package/dist/src/containers/Tenant/EntityTitle/EntityTitle.d.ts +6 -0
- package/dist/src/containers/Tenant/EntityTitle/EntityTitle.js +11 -0
- package/dist/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.js +0 -6
- package/dist/src/containers/Tenant/Info/ExternalTable/ExternalTable.js +0 -6
- package/dist/src/containers/Tenant/Info/View/View.js +0 -6
- package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.d.ts +2 -1
- package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.js +7 -13
- package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.d.ts +4 -4
- package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.js +159 -63
- package/dist/src/containers/Tenant/Query/Issues/Issues.js +6 -5
- package/dist/src/containers/Tenant/Query/Preview/Preview.d.ts +2 -1
- package/dist/src/containers/Tenant/Query/Preview/Preview.js +6 -6
- package/dist/src/containers/Tenant/Query/Query.d.ts +1 -0
- package/dist/src/containers/Tenant/Query/Query.scss +1 -1
- package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +2 -0
- package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.js +9 -22
- package/dist/src/containers/Tenant/Query/i18n/en.json +1 -1
- package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.d.ts +1 -0
- package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.js +11 -19
- package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +2 -2
- package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +13 -8
- package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
- package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.js +21 -2
- package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
- package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
- package/dist/src/containers/Tenant/Schema/SchemaViewer/prepareData.js +2 -1
- package/dist/src/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
- package/dist/src/containers/Tenant/Tenant.js +20 -36
- package/dist/src/containers/Tenant/Tenant.scss +4 -0
- package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.d.ts +2 -0
- package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.js +19 -0
- package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.scss +18 -0
- package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.d.ts +9 -0
- package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.js +44 -0
- package/dist/src/containers/Tenant/i18n/en.json +22 -1
- package/dist/src/containers/Tenant/i18n/index.d.ts +1 -1
- package/dist/src/containers/Tenant/utils/index.d.ts +1 -0
- package/dist/src/containers/Tenant/utils/index.js +6 -0
- package/dist/src/containers/Tenant/utils/queryTemplates.d.ts +4 -0
- package/dist/src/containers/Tenant/utils/queryTemplates.js +32 -0
- package/dist/src/containers/Tenant/utils/schemaActions.js +18 -2
- package/dist/src/containers/UserSettings/Setting.d.ts +7 -9
- package/dist/src/containers/UserSettings/Setting.js +13 -28
- package/dist/src/containers/UserSettings/UserSettings.d.ts +0 -2
- package/dist/src/containers/UserSettings/UserSettings.js +3 -6
- package/dist/src/containers/UserSettings/i18n/en.json +2 -2
- package/dist/src/containers/UserSettings/settings.js +3 -3
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.js +1 -1
- package/dist/src/routes.d.ts +1 -1
- package/dist/src/routes.js +3 -1
- package/dist/src/services/api.d.ts +6 -1
- package/dist/src/services/api.js +24 -3
- package/dist/src/services/settings.d.ts +1 -0
- package/dist/src/services/settings.js +3 -2
- package/dist/src/store/configureStore.d.ts +36 -134
- package/dist/src/store/configureStore.js +2 -15
- package/dist/src/store/defaultStore.d.ts +17 -81
- package/dist/src/store/reducers/api.js +0 -1
- package/dist/src/store/reducers/authentication/authentication.d.ts +51 -243
- package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +196 -849
- package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.js +3 -3
- package/dist/src/store/reducers/hotKeys/hotKeys.d.ts +6 -25
- package/dist/src/store/reducers/hotKeys/hotKeys.js +36 -49
- package/dist/src/store/reducers/index.d.ts +23 -100
- package/dist/src/store/reducers/index.js +0 -8
- package/dist/src/store/reducers/node/selectors.d.ts +0 -40
- package/dist/src/store/reducers/nodesList.d.ts +0 -40
- package/dist/src/store/reducers/schema/schema.d.ts +13 -149
- package/dist/src/store/reducers/schema/schema.js +45 -90
- package/dist/src/store/reducers/schema/types.d.ts +2 -21
- package/dist/src/store/reducers/schemaAcl/schemaAcl.d.ts +8 -135
- package/dist/src/store/reducers/schemaAcl/schemaAcl.js +18 -44
- package/dist/src/store/reducers/settings/settings.d.ts +17 -23
- package/dist/src/store/reducers/settings/settings.js +40 -33
- package/dist/src/store/reducers/settings/types.d.ts +1 -12
- package/dist/src/store/reducers/tablets.d.ts +288 -41
- package/dist/src/store/reducers/tablets.js +8 -4
- package/dist/src/store/reducers/tabletsFilters.d.ts +11 -164
- package/dist/src/store/reducers/tabletsFilters.js +14 -76
- package/dist/src/store/reducers/tenants/selectors.d.ts +8 -362
- package/dist/src/store/reducers/topic.d.ts +0 -600
- package/dist/src/store/state-url-mapping.js +0 -3
- package/dist/src/styles/mixins.scss +5 -0
- package/dist/src/styles/themes.scss +1 -1
- package/dist/src/types/api/acl.d.ts +2 -1
- package/dist/src/types/api/schema/schema.d.ts +5 -0
- package/dist/src/utils/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +1 -1
- package/dist/src/utils/dataFormatters/dataFormatters.d.ts +2 -1
- package/dist/src/utils/dataFormatters/dataFormatters.js +7 -3
- package/dist/src/utils/hooks/index.d.ts +1 -0
- package/dist/src/utils/hooks/index.js +1 -0
- package/dist/src/utils/hooks/useAutoRefreshInterval.d.ts +1 -0
- package/dist/src/utils/hooks/useAutoRefreshInterval.js +5 -0
- package/dist/src/utils/utils.js +2 -1
- package/package.json +31 -30
- package/dist/src/components/InfoViewer/i18n/ru.json +0 -4
- package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.d.ts +0 -6
- package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.js +0 -17
- package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.d.ts +0 -6
- package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.js +0 -20
- package/dist/src/components/InfoViewer/schemaOverview/index.d.ts +0 -2
- package/dist/src/components/InfoViewer/schemaOverview/index.js +0 -2
- package/dist/src/containers/AsideNavigation/i18n/ru.json +0 -10
- package/dist/src/containers/AsideNavigation/useNavigationMenuItems.d.ts +0 -2
- package/dist/src/containers/AsideNavigation/useNavigationMenuItems.js +0 -54
- package/dist/src/containers/UserSettings/UserSettings.scss +0 -9
- package/dist/src/store/reducers/host.d.ts +0 -130
- package/dist/src/store/reducers/host.js +0 -26
- package/dist/src/store/reducers/hotKeys/types.d.ts +0 -10
- package/dist/src/store/reducers/hotKeys/types.js +0 -1
- package/dist/src/store/reducers/schemaAcl/types.d.ts +0 -12
- package/dist/src/store/reducers/schemaAcl/types.js +0 -1
- package/dist/src/types/store/host.d.ts +0 -15
- package/dist/src/types/store/host.js +0 -1
@@ -2,18 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowsRotateLeft } from '@gravity-ui/icons';
|
3
3
|
import { Button, Select } from '@gravity-ui/uikit';
|
4
4
|
import { api } from '../../../../store/reducers/api';
|
5
|
-
import { setAutorefreshInterval } from '../../../../store/reducers/schema/schema';
|
6
5
|
import { cn } from '../../../../utils/cn';
|
7
|
-
import {
|
6
|
+
import { useAutoRefreshInterval, useTypedDispatch } from '../../../../utils/hooks';
|
8
7
|
import i18n from './i18n';
|
9
8
|
import './AutorefreshControl.scss';
|
10
9
|
const b = cn('autorefresh-control');
|
11
10
|
export function AutorefreshControl({ className }) {
|
12
11
|
const dispatch = useTypedDispatch();
|
13
|
-
const
|
12
|
+
const [autoRefreshInterval, setAutoRefreshInterval] = useAutoRefreshInterval();
|
14
13
|
return (_jsxs("div", { className: b(null, className), children: [_jsx(Button, { view: "flat", onClick: () => {
|
15
14
|
dispatch(api.util.invalidateTags(['All']));
|
16
|
-
}, extraProps: { 'aria-label': i18n('Refresh') }, children: _jsx(Button.Icon, { children: _jsx(ArrowsRotateLeft, {}) }) }), _jsxs(Select, { value: [String(
|
17
|
-
|
15
|
+
}, extraProps: { 'aria-label': i18n('Refresh') }, children: _jsx(Button.Icon, { children: _jsx(ArrowsRotateLeft, {}) }) }), _jsxs(Select, { value: [String(autoRefreshInterval)], onUpdate: (v) => {
|
16
|
+
setAutoRefreshInterval(Number(v));
|
18
17
|
}, width: 85, children: [_jsx(Select.Option, { value: "0", children: i18n('None') }), _jsx(Select.Option, { value: "15000", children: i18n('15 sec') }), _jsx(Select.Option, { value: "60000", children: i18n('1 min') }), _jsx(Select.Option, { value: "120000", children: i18n('2 min') }), _jsx(Select.Option, { value: "300000", children: i18n('5 min') })] })] }));
|
19
18
|
}
|
@@ -8,7 +8,7 @@ import { Search } from '../../../../components/Search';
|
|
8
8
|
import { selectPreparedConsumersData, selectPreparedTopicStats, topicApi, } from '../../../../store/reducers/topic';
|
9
9
|
import { cn } from '../../../../utils/cn';
|
10
10
|
import { DEFAULT_TABLE_SETTINGS } from '../../../../utils/constants';
|
11
|
-
import { useTypedSelector } from '../../../../utils/hooks';
|
11
|
+
import { useAutoRefreshInterval, useTypedSelector } from '../../../../utils/hooks';
|
12
12
|
import { isCdcStreamEntityType } from '../../utils/schema';
|
13
13
|
import { ConsumersTopicStats } from './TopicStats';
|
14
14
|
import { CONSUMERS_COLUMNS_WIDTH_LS_KEY, columns } from './columns';
|
@@ -18,8 +18,8 @@ const b = cn('ydb-diagnostics-consumers');
|
|
18
18
|
export const Consumers = ({ path, type }) => {
|
19
19
|
const isCdcStream = isCdcStreamEntityType(type);
|
20
20
|
const [searchValue, setSearchValue] = React.useState('');
|
21
|
-
const
|
22
|
-
const { currentData, isFetching, error } = topicApi.useGetTopicQuery({ path }, { pollingInterval:
|
21
|
+
const [autoRefreshInterval] = useAutoRefreshInterval();
|
22
|
+
const { currentData, isFetching, error } = topicApi.useGetTopicQuery({ path }, { pollingInterval: autoRefreshInterval });
|
23
23
|
const loading = isFetching && currentData === undefined;
|
24
24
|
const consumers = useTypedSelector((state) => selectPreparedConsumersData(state, path));
|
25
25
|
const topic = useTypedSelector((state) => selectPreparedTopicStats(state, path));
|
@@ -2,8 +2,8 @@ import type { EPathType } from '../../../../types/api/schema';
|
|
2
2
|
import './Describe.scss';
|
3
3
|
import 'react-json-inspector/json-inspector.css';
|
4
4
|
interface IDescribeProps {
|
5
|
-
|
5
|
+
path: string;
|
6
6
|
type?: EPathType;
|
7
7
|
}
|
8
|
-
declare const Describe: ({
|
8
|
+
declare const Describe: ({ path, type }: IDescribeProps) => import("react/jsx-runtime").JSX.Element;
|
9
9
|
export default Describe;
|
@@ -7,17 +7,16 @@ import { Loader } from '../../../../components/Loader';
|
|
7
7
|
import { describeApi } from '../../../../store/reducers/describe';
|
8
8
|
import { selectSchemaMergedChildrenPaths } from '../../../../store/reducers/schema/schema';
|
9
9
|
import { cn } from '../../../../utils/cn';
|
10
|
-
import { useTypedSelector } from '../../../../utils/hooks';
|
10
|
+
import { useAutoRefreshInterval, useTypedSelector } from '../../../../utils/hooks';
|
11
11
|
import { isEntityWithMergedImplementation } from '../../utils/schema';
|
12
12
|
import './Describe.scss';
|
13
13
|
import 'react-json-inspector/json-inspector.css';
|
14
14
|
const b = cn('kv-describe');
|
15
15
|
const expandMap = new Map();
|
16
|
-
const Describe = ({
|
17
|
-
const
|
16
|
+
const Describe = ({ path, type }) => {
|
17
|
+
const [autoRefreshInterval] = useAutoRefreshInterval();
|
18
18
|
const isEntityWithMergedImpl = isEntityWithMergedImplementation(type);
|
19
|
-
const mergedChildrenPaths = useTypedSelector((state) => selectSchemaMergedChildrenPaths(state,
|
20
|
-
const path = currentSchemaPath || tenant;
|
19
|
+
const mergedChildrenPaths = useTypedSelector((state) => selectSchemaMergedChildrenPaths(state, path, type), shallowEqual);
|
21
20
|
let paths = skipToken;
|
22
21
|
if (!isEntityWithMergedImpl) {
|
23
22
|
paths = [path];
|
@@ -26,7 +25,7 @@ const Describe = ({ tenant, type }) => {
|
|
26
25
|
paths = [path, ...mergedChildrenPaths];
|
27
26
|
}
|
28
27
|
const { currentData, isFetching, error } = describeApi.useGetDescribeQuery(paths, {
|
29
|
-
pollingInterval:
|
28
|
+
pollingInterval: autoRefreshInterval,
|
30
29
|
});
|
31
30
|
const loading = isFetching && currentData === undefined;
|
32
31
|
const currentDescribe = currentData;
|
@@ -1,17 +1,15 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { useSelector } from 'react-redux';
|
3
2
|
import { cn } from '../../../../utils/cn';
|
4
3
|
import Overview from '../Overview/Overview';
|
5
4
|
import { TenantOverview } from '../TenantOverview/TenantOverview';
|
6
5
|
import './DetailedOverview.scss';
|
7
6
|
const b = cn('kv-detailed-overview');
|
8
7
|
function DetailedOverview(props) {
|
9
|
-
const { type, tenantName, additionalTenantProps, additionalNodesProps } = props;
|
10
|
-
const { currentSchemaPath } = useSelector((state) => state.schema);
|
8
|
+
const { type, tenantName, path, additionalTenantProps, additionalNodesProps } = props;
|
11
9
|
const renderTenantOverview = () => {
|
12
10
|
return (_jsx("div", { className: b('section'), children: _jsx(TenantOverview, { tenantName: tenantName, additionalTenantProps: additionalTenantProps, additionalNodesProps: additionalNodesProps }) }));
|
13
11
|
};
|
14
|
-
const isTenant = tenantName ===
|
15
|
-
return (_jsx("div", { className: b(), children: isTenant ? renderTenantOverview() : _jsx(Overview, { type: type,
|
12
|
+
const isTenant = tenantName === path;
|
13
|
+
return (_jsx("div", { className: b(), children: isTenant ? renderTenantOverview() : _jsx(Overview, { type: type, path: path }) }));
|
16
14
|
}
|
17
15
|
export default DetailedOverview;
|
@@ -3,6 +3,8 @@ import type { EPathType } from '../../../types/api/schema';
|
|
3
3
|
import './Diagnostics.scss';
|
4
4
|
interface DiagnosticsProps {
|
5
5
|
type?: EPathType;
|
6
|
+
tenantName: string;
|
7
|
+
path: string;
|
6
8
|
additionalTenantProps?: AdditionalTenantsProps;
|
7
9
|
additionalNodesProps?: AdditionalNodesProps;
|
8
10
|
}
|
@@ -4,7 +4,6 @@ import { Tabs } from '@gravity-ui/uikit';
|
|
4
4
|
import { Helmet } from 'react-helmet-async';
|
5
5
|
import { Link } from 'react-router-dom';
|
6
6
|
import { StringParam, useQueryParams } from 'use-query-params';
|
7
|
-
import { Loader } from '../../../components/Loader';
|
8
7
|
import routes, { createHref } from '../../../routes';
|
9
8
|
import { TENANT_DIAGNOSTICS_TABS_IDS } from '../../../store/reducers/tenant/constants';
|
10
9
|
import { setDiagnosticsTab } from '../../../store/reducers/tenant/tenant';
|
@@ -32,83 +31,66 @@ const b = cn('kv-tenant-diagnostics');
|
|
32
31
|
function Diagnostics(props) {
|
33
32
|
const container = React.useRef(null);
|
34
33
|
const dispatch = useTypedDispatch();
|
35
|
-
const { currentSchemaPath, wasLoaded } = useTypedSelector((state) => state.schema);
|
36
34
|
const { diagnosticsTab = TENANT_DIAGNOSTICS_TABS_IDS.overview } = useTypedSelector((state) => state.tenant);
|
37
35
|
const [queryParams] = useQueryParams({
|
38
36
|
name: StringParam,
|
37
|
+
schema: StringParam,
|
39
38
|
backend: StringParam,
|
40
39
|
clusterName: StringParam,
|
41
40
|
});
|
42
|
-
const
|
43
|
-
const
|
44
|
-
const
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
dispatch(setDiagnosticsTab(tab));
|
53
|
-
};
|
54
|
-
const activeTab = React.useMemo(() => {
|
55
|
-
if (wasLoaded) {
|
56
|
-
let page = pages.find((el) => el.id === diagnosticsTab);
|
57
|
-
if (!page) {
|
58
|
-
page = pages[0];
|
59
|
-
}
|
60
|
-
if (page && page.id !== diagnosticsTab) {
|
61
|
-
forwardToDiagnosticTab(page.id);
|
62
|
-
}
|
63
|
-
return page;
|
41
|
+
const tenantName = isDatabaseEntityType(props.type) ? props.path : props.tenantName;
|
42
|
+
const isDatabase = isDatabaseEntityType(props.type) || props.path === props.tenantName;
|
43
|
+
const pages = isDatabase ? DATABASE_PAGES : getPagesByType(props.type);
|
44
|
+
let activeTab = pages.find((el) => el.id === diagnosticsTab);
|
45
|
+
if (!activeTab) {
|
46
|
+
activeTab = pages[0];
|
47
|
+
}
|
48
|
+
React.useEffect(() => {
|
49
|
+
if (activeTab && activeTab.id !== diagnosticsTab) {
|
50
|
+
dispatch(setDiagnosticsTab(activeTab.id));
|
64
51
|
}
|
65
|
-
|
66
|
-
}, [pages, diagnosticsTab, wasLoaded]);
|
52
|
+
}, [activeTab, diagnosticsTab, dispatch]);
|
67
53
|
const renderTabContent = () => {
|
68
|
-
const { type } = props;
|
69
|
-
const tenantNameString = tenantName;
|
54
|
+
const { type, path } = props;
|
70
55
|
switch (activeTab === null || activeTab === void 0 ? void 0 : activeTab.id) {
|
71
56
|
case TENANT_DIAGNOSTICS_TABS_IDS.overview: {
|
72
|
-
return (_jsx(DetailedOverview, { type: type, tenantName:
|
57
|
+
return (_jsx(DetailedOverview, { type: type, tenantName: tenantName, path: path, additionalTenantProps: props.additionalTenantProps, additionalNodesProps: props.additionalNodesProps }));
|
73
58
|
}
|
74
59
|
case TENANT_DIAGNOSTICS_TABS_IDS.schema: {
|
75
|
-
return
|
60
|
+
return _jsx(SchemaViewer, { path: path, tenantName: tenantName, type: type, extended: true });
|
76
61
|
}
|
77
62
|
case TENANT_DIAGNOSTICS_TABS_IDS.topQueries: {
|
78
|
-
return _jsx(TopQueries, {
|
63
|
+
return _jsx(TopQueries, { tenantName: tenantName, type: type });
|
79
64
|
}
|
80
65
|
case TENANT_DIAGNOSTICS_TABS_IDS.topShards: {
|
81
|
-
return _jsx(TopShards, {
|
66
|
+
return _jsx(TopShards, { tenantName: tenantName, path: path, type: type });
|
82
67
|
}
|
83
68
|
case TENANT_DIAGNOSTICS_TABS_IDS.nodes: {
|
84
|
-
return (_jsx(NodesWrapper, { path:
|
69
|
+
return (_jsx(NodesWrapper, { path: path, additionalNodesProps: props.additionalNodesProps, parentContainer: container.current }));
|
85
70
|
}
|
86
71
|
case TENANT_DIAGNOSTICS_TABS_IDS.tablets: {
|
87
|
-
return _jsx(Tablets, { path:
|
72
|
+
return _jsx(Tablets, { path: path });
|
88
73
|
}
|
89
74
|
case TENANT_DIAGNOSTICS_TABS_IDS.storage: {
|
90
|
-
return
|
75
|
+
return _jsx(StorageWrapper, { tenant: tenantName, parentContainer: container.current });
|
91
76
|
}
|
92
77
|
case TENANT_DIAGNOSTICS_TABS_IDS.network: {
|
93
|
-
return _jsx(Network, {
|
78
|
+
return _jsx(Network, { tenantName: tenantName });
|
94
79
|
}
|
95
80
|
case TENANT_DIAGNOSTICS_TABS_IDS.describe: {
|
96
|
-
return _jsx(Describe, {
|
81
|
+
return _jsx(Describe, { path: path, type: type });
|
97
82
|
}
|
98
83
|
case TENANT_DIAGNOSTICS_TABS_IDS.hotKeys: {
|
99
|
-
|
100
|
-
return _jsx(HotKeys, { path: currentSchemaPath });
|
84
|
+
return _jsx(HotKeys, { path: path });
|
101
85
|
}
|
102
86
|
case TENANT_DIAGNOSTICS_TABS_IDS.graph: {
|
103
|
-
|
104
|
-
return _jsx(Heatmap, { path: currentSchemaPath });
|
87
|
+
return _jsx(Heatmap, { path: path });
|
105
88
|
}
|
106
89
|
case TENANT_DIAGNOSTICS_TABS_IDS.consumers: {
|
107
|
-
|
108
|
-
return _jsx(Consumers, { path: currentSchemaPath, type: type });
|
90
|
+
return _jsx(Consumers, { path: path, type: type });
|
109
91
|
}
|
110
92
|
case TENANT_DIAGNOSTICS_TABS_IDS.partitions: {
|
111
|
-
return _jsx(Partitions, { path:
|
93
|
+
return _jsx(Partitions, { path: path });
|
112
94
|
}
|
113
95
|
default: {
|
114
96
|
return _jsx("div", { children: "No data..." });
|
@@ -121,12 +103,6 @@ function Diagnostics(props) {
|
|
121
103
|
return (_jsx(Link, { to: path, className: b('tab'), children: node }, id));
|
122
104
|
}, allowNotSelected: true }), _jsx(AutorefreshControl, {})] }) }));
|
123
105
|
};
|
124
|
-
// Loader prevents incorrect loading of tabs
|
125
|
-
// After tabs are initially loaded it is no longer needed
|
126
|
-
// Thus there is no also "loading" check as in other parts of the project
|
127
|
-
if (!wasLoaded) {
|
128
|
-
return _jsx(Loader, { size: "l" });
|
129
|
-
}
|
130
106
|
return (_jsxs("div", { className: b(), ref: container, children: [activeTab ? (_jsx(Helmet, { children: _jsx("title", { children: activeTab.title }) })) : null, renderTabs(), _jsx("div", { className: b('page-wrapper'), children: renderTabContent() })] }));
|
131
107
|
}
|
132
108
|
export default Diagnostics;
|
@@ -5,10 +5,11 @@ import DataTable from '@gravity-ui/react-data-table';
|
|
5
5
|
import { Button, Card, Icon } from '@gravity-ui/uikit';
|
6
6
|
import { ResponseError } from '../../../../components/Errors/ResponseError';
|
7
7
|
import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
|
8
|
-
import {
|
8
|
+
import { hotKeysApi } from '../../../../store/reducers/hotKeys/hotKeys';
|
9
|
+
import { schemaApi } from '../../../../store/reducers/schema/schema';
|
9
10
|
import { cn } from '../../../../utils/cn';
|
10
|
-
import { DEFAULT_TABLE_SETTINGS,
|
11
|
-
import { useSetting
|
11
|
+
import { DEFAULT_TABLE_SETTINGS, IS_HOTKEYS_HELP_HIDDEN_KEY } from '../../../../utils/constants';
|
12
|
+
import { useSetting } from '../../../../utils/hooks';
|
12
13
|
import i18n from './i18n';
|
13
14
|
import keyIcon from '../../../../assets/icons/key.svg';
|
14
15
|
import './HotKeys.scss';
|
@@ -37,59 +38,18 @@ const getHotKeysColumns = (keyColumnsIds = []) => {
|
|
37
38
|
];
|
38
39
|
};
|
39
40
|
export function HotKeys({ path }) {
|
40
|
-
var _a, _b
|
41
|
-
const
|
42
|
-
const
|
43
|
-
const
|
44
|
-
const
|
45
|
-
const
|
46
|
-
const keyColumnsIds = (_c = (_b = (_a = schemaData[path]) === null || _a === void 0 ? void 0 : _a.PathDescription) === null || _b === void 0 ? void 0 : _b.Table) === null || _c === void 0 ? void 0 : _c.KeyColumnNames;
|
41
|
+
var _a, _b;
|
42
|
+
const { currentData: data, isFetching, error } = hotKeysApi.useGetHotKeysQuery({ path });
|
43
|
+
const loading = isFetching && data === undefined;
|
44
|
+
const { currentData: schemaData, isFetching: schemaIsFetching } = schemaApi.endpoints.getSchema.useQueryState({ path });
|
45
|
+
const schemaLoading = schemaIsFetching && schemaData === undefined;
|
46
|
+
const keyColumnsIds = (_b = (_a = schemaData === null || schemaData === void 0 ? void 0 : schemaData.PathDescription) === null || _a === void 0 ? void 0 : _a.Table) === null || _b === void 0 ? void 0 : _b.KeyColumnNames;
|
47
47
|
const tableColumns = React.useMemo(() => {
|
48
48
|
return getHotKeysColumns(keyColumnsIds);
|
49
49
|
}, [keyColumnsIds]);
|
50
|
-
React.useEffect(() => {
|
51
|
-
const fetchHotkeys = async (enableSampling) => {
|
52
|
-
// Set hotkeys error, but not data, since data is set conditionally
|
53
|
-
try {
|
54
|
-
const response = await window.api.getHotKeys(path, enableSampling);
|
55
|
-
return response;
|
56
|
-
}
|
57
|
-
catch (err) {
|
58
|
-
dispatch(setHotKeysError(err));
|
59
|
-
return undefined;
|
60
|
-
}
|
61
|
-
};
|
62
|
-
const fetchData = async () => {
|
63
|
-
// If there is previous pending request for samples, cancel it
|
64
|
-
if (collectSamplesTimerRef.current !== undefined) {
|
65
|
-
window.clearInterval(collectSamplesTimerRef.current);
|
66
|
-
}
|
67
|
-
dispatch(setHotKeysDataWasNotLoaded());
|
68
|
-
dispatch(setHotKeysLoading());
|
69
|
-
// Send request that will trigger hot keys sampling (enable_sampling = true)
|
70
|
-
const initialResponse = await fetchHotkeys(true);
|
71
|
-
// If there are hotkeys in the initial request (hotkeys was collected before)
|
72
|
-
// we could just use colleted samples (collected hotkeys are stored only for 30 seconds)
|
73
|
-
if (initialResponse && initialResponse.hotkeys) {
|
74
|
-
dispatch(setHotKeysData(initialResponse));
|
75
|
-
}
|
76
|
-
else if (initialResponse) {
|
77
|
-
// Else wait for 5 seconds, while hot keys are being collected
|
78
|
-
// And request these samples (enable_sampling = false)
|
79
|
-
const timer = setTimeout(async () => {
|
80
|
-
const responseWithSamples = await fetchHotkeys(false);
|
81
|
-
if (responseWithSamples) {
|
82
|
-
dispatch(setHotKeysData(responseWithSamples));
|
83
|
-
}
|
84
|
-
}, 5000);
|
85
|
-
collectSamplesTimerRef.current = timer;
|
86
|
-
}
|
87
|
-
};
|
88
|
-
fetchData();
|
89
|
-
}, [dispatch, path]);
|
90
50
|
const renderContent = () => {
|
91
51
|
// It takes a while to collect hot keys. Display explicit status message, while collecting
|
92
|
-
if (
|
52
|
+
if (loading || schemaLoading) {
|
93
53
|
return _jsx("div", { children: i18n('hot-keys-collecting') });
|
94
54
|
}
|
95
55
|
if (error) {
|
@@ -103,11 +63,12 @@ export function HotKeys({ path }) {
|
|
103
63
|
order: DataTable.DESCENDING,
|
104
64
|
} }));
|
105
65
|
};
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
66
|
+
return (_jsxs(React.Fragment, { children: [_jsx(HelpCard, {}), renderContent()] }));
|
67
|
+
}
|
68
|
+
function HelpCard() {
|
69
|
+
const [helpHidden, setHelpHidden] = useSetting(IS_HOTKEYS_HELP_HIDDEN_KEY);
|
70
|
+
if (helpHidden) {
|
71
|
+
return null;
|
72
|
+
}
|
73
|
+
return (_jsxs(Card, { theme: "info", view: "filled", type: "container", className: b('help-card'), children: [i18n('help'), _jsx(Button, { className: b('help-card__close-button'), view: "flat", onClick: () => setHelpHidden(true), children: _jsx(Icon, { data: Xmark, size: 18 }) })] }));
|
113
74
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import './Network.scss';
|
2
2
|
interface NetworkProps {
|
3
|
-
|
3
|
+
tenantName: string;
|
4
4
|
}
|
5
|
-
export declare function Network({
|
5
|
+
export declare function Network({ tenantName }: NetworkProps): import("react/jsx-runtime").JSX.Element;
|
6
6
|
export {};
|
@@ -9,23 +9,23 @@ import { networkApi } from '../../../../store/reducers/network/network';
|
|
9
9
|
import { ProblemFilterValues, changeFilter, selectProblemFilter, } from '../../../../store/reducers/settings/settings';
|
10
10
|
import { hideTooltip, showTooltip } from '../../../../store/reducers/tooltip';
|
11
11
|
import { cn } from '../../../../utils/cn';
|
12
|
-
import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
12
|
+
import { useAutoRefreshInterval, useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
|
13
13
|
import { getDefaultNodePath } from '../../../Node/NodePages';
|
14
14
|
import { NodeNetwork } from './NodeNetwork/NodeNetwork';
|
15
15
|
import { getConnectedNodesCount } from './utils';
|
16
16
|
import networkIcon from '../../../../assets/icons/network.svg';
|
17
17
|
import './Network.scss';
|
18
18
|
const b = cn('network');
|
19
|
-
export function Network({
|
19
|
+
export function Network({ tenantName }) {
|
20
20
|
var _a, _b;
|
21
|
-
const
|
21
|
+
const [autoRefreshInterval] = useAutoRefreshInterval();
|
22
22
|
const filter = useTypedSelector(selectProblemFilter);
|
23
23
|
const dispatch = useTypedDispatch();
|
24
24
|
const [clickedNode, setClickedNode] = React.useState();
|
25
25
|
const [showId, setShowId] = React.useState(false);
|
26
26
|
const [showRacks, setShowRacks] = React.useState(false);
|
27
|
-
const { currentData, isFetching, error } = networkApi.useGetNetworkInfoQuery(
|
28
|
-
pollingInterval:
|
27
|
+
const { currentData, isFetching, error } = networkApi.useGetNetworkInfoQuery(tenantName, {
|
28
|
+
pollingInterval: autoRefreshInterval,
|
29
29
|
});
|
30
30
|
const loading = isFetching && currentData === undefined;
|
31
31
|
if (loading) {
|
package/dist/src/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Flex, Text } from '@gravity-ui/uikit';
|
3
3
|
import { AsyncReplicationState } from '../../../../../components/AsyncReplicationState';
|
4
4
|
import { InfoViewer } from '../../../../../components/InfoViewer';
|
5
|
-
import { useTypedSelector } from '../../../../../utils/hooks';
|
6
5
|
import { getEntityName } from '../../../utils';
|
7
6
|
import { AsyncReplicationPaths } from '../AsyncReplicationPaths';
|
8
7
|
import { Credentials } from './Credentials';
|
@@ -11,10 +10,6 @@ import i18n from './i18n';
|
|
11
10
|
export function AsyncReplicationInfo({ data }) {
|
12
11
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
13
12
|
const entityName = getEntityName(data === null || data === void 0 ? void 0 : data.PathDescription);
|
14
|
-
const { error: schemaError } = useTypedSelector((state) => state.schema);
|
15
|
-
if (schemaError) {
|
16
|
-
return _jsx("div", { className: "error", children: schemaError.statusText });
|
17
|
-
}
|
18
13
|
if (!data) {
|
19
14
|
return (_jsxs("div", { className: "error", children: [i18n('noData'), " ", entityName] }));
|
20
15
|
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import type { TEvDescribeSchemeResult } from '../../../../../types/api/schema';
|
2
2
|
interface ChangefeedProps {
|
3
|
+
path: string;
|
3
4
|
data?: TEvDescribeSchemeResult;
|
4
5
|
topic?: TEvDescribeSchemeResult;
|
5
6
|
}
|
6
7
|
/** Displays overview for CDCStream EPathType */
|
7
|
-
export declare const ChangefeedInfo: ({ data, topic }: ChangefeedProps) => import("react/jsx-runtime").JSX.Element;
|
8
|
+
export declare const ChangefeedInfo: ({ path, data, topic }: ChangefeedProps) => import("react/jsx-runtime").JSX.Element;
|
8
9
|
export {};
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { InfoViewer, formatObject } from '../../../../../components/InfoViewer';
|
3
3
|
import { formatCdcStreamItem, formatCommonItem, } from '../../../../../components/InfoViewer/formatters';
|
4
|
-
import { useTypedSelector } from '../../../../../utils/hooks';
|
5
4
|
import { getEntityName } from '../../../utils';
|
6
5
|
import { TopicStats } from '../TopicStats';
|
7
6
|
import { prepareTopicSchemaInfo } from '../utils';
|
@@ -21,14 +20,10 @@ const prepareChangefeedInfo = (changefeedData, topicData) => {
|
|
21
20
|
return [created, ...changefeedInfo, ...topicInfo];
|
22
21
|
};
|
23
22
|
/** Displays overview for CDCStream EPathType */
|
24
|
-
export const ChangefeedInfo = ({ data, topic }) => {
|
23
|
+
export const ChangefeedInfo = ({ path, data, topic }) => {
|
25
24
|
const entityName = getEntityName(data === null || data === void 0 ? void 0 : data.PathDescription);
|
26
|
-
const { error: schemaError } = useTypedSelector((state) => state.schema);
|
27
|
-
if (schemaError) {
|
28
|
-
return _jsx("div", { className: "error", children: schemaError.statusText });
|
29
|
-
}
|
30
25
|
if (!data || !topic) {
|
31
26
|
return _jsxs("div", { className: "error", children: ["No ", entityName, " data"] });
|
32
27
|
}
|
33
|
-
return (_jsxs("div", { children: [_jsx(InfoViewer, { title: entityName, info: prepareChangefeedInfo(data, topic) }), _jsx(TopicStats, {})] }));
|
28
|
+
return (_jsxs("div", { children: [_jsx(InfoViewer, { title: entityName, info: prepareChangefeedInfo(data, topic) }), _jsx(TopicStats, { path: path })] }));
|
34
29
|
};
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { EPathType } from '../../../../types/api/schema';
|
3
3
|
interface OverviewProps {
|
4
4
|
type?: EPathType;
|
5
|
-
|
5
|
+
path: string;
|
6
6
|
}
|
7
|
-
declare function Overview({ type,
|
7
|
+
declare function Overview({ type, path }: OverviewProps): string | number | true | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element;
|
8
8
|
export default Overview;
|
@@ -6,9 +6,9 @@ import { TableIndexInfo } from '../../../../components/InfoViewer/schemaInfo';
|
|
6
6
|
import { Loader } from '../../../../components/Loader';
|
7
7
|
import { olapApi } from '../../../../store/reducers/olapStats';
|
8
8
|
import { overviewApi } from '../../../../store/reducers/overview/overview';
|
9
|
-
import { selectSchemaMergedChildrenPaths } from '../../../../store/reducers/schema/schema';
|
9
|
+
import { schemaApi, selectSchemaMergedChildrenPaths } from '../../../../store/reducers/schema/schema';
|
10
10
|
import { EPathType } from '../../../../types/api/schema';
|
11
|
-
import { useTypedSelector } from '../../../../utils/hooks';
|
11
|
+
import { useAutoRefreshInterval, useTypedSelector } from '../../../../utils/hooks';
|
12
12
|
import { ExternalDataSourceInfo } from '../../Info/ExternalDataSource/ExternalDataSource';
|
13
13
|
import { ExternalTableInfo } from '../../Info/ExternalTable/ExternalTable';
|
14
14
|
import { ViewInfo } from '../../Info/View/View';
|
@@ -17,30 +17,28 @@ import { AsyncReplicationInfo } from './AsyncReplicationInfo';
|
|
17
17
|
import { ChangefeedInfo } from './ChangefeedInfo';
|
18
18
|
import { TableInfo } from './TableInfo';
|
19
19
|
import { TopicInfo } from './TopicInfo';
|
20
|
-
function Overview({ type,
|
21
|
-
const
|
22
|
-
const
|
23
|
-
const
|
24
|
-
const { currentData: olapData, isFetching: olapIsFetching } = olapApi.useGetOlapStatsQuery(olapParams, { pollingInterval: autorefresh });
|
20
|
+
function Overview({ type, path }) {
|
21
|
+
const [autoRefreshInterval] = useAutoRefreshInterval();
|
22
|
+
const olapParams = isTableType(type) && isColumnEntityType(type) ? { path } : skipToken;
|
23
|
+
const { currentData: olapData, isFetching: olapIsFetching } = olapApi.useGetOlapStatsQuery(olapParams, { pollingInterval: autoRefreshInterval });
|
25
24
|
const olapStatsLoading = olapIsFetching && olapData === undefined;
|
26
25
|
const { result: olapStats } = olapData || { result: undefined };
|
27
26
|
const isEntityWithMergedImpl = isEntityWithMergedImplementation(type);
|
28
|
-
//
|
29
|
-
const mergedChildrenPaths = useTypedSelector((state) => selectSchemaMergedChildrenPaths(state,
|
27
|
+
// shallowEqual prevents rerenders when new schema data is loaded
|
28
|
+
const mergedChildrenPaths = useTypedSelector((state) => selectSchemaMergedChildrenPaths(state, path, type), shallowEqual);
|
30
29
|
let paths = skipToken;
|
31
|
-
if (
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
paths = [schemaPath, ...mergedChildrenPaths];
|
37
|
-
}
|
30
|
+
if (!isEntityWithMergedImpl) {
|
31
|
+
paths = [path];
|
32
|
+
}
|
33
|
+
else if (mergedChildrenPaths) {
|
34
|
+
paths = [path, ...mergedChildrenPaths];
|
38
35
|
}
|
39
36
|
const { currentData, isFetching, error: overviewError, } = overviewApi.useGetOverviewQuery(paths, {
|
40
|
-
pollingInterval:
|
37
|
+
pollingInterval: autoRefreshInterval,
|
41
38
|
});
|
42
39
|
const overviewLoading = isFetching && currentData === undefined;
|
43
40
|
const { data: rawData, additionalData } = currentData || {};
|
41
|
+
const { error: schemaError } = schemaApi.endpoints.getSchema.useQueryState({ path });
|
44
42
|
const entityLoading = overviewLoading || olapStatsLoading;
|
45
43
|
const entityNotReady = isEntityWithMergedImpl && !mergedChildrenPaths;
|
46
44
|
const renderContent = () => {
|
@@ -59,9 +57,9 @@ function Overview({ type, tenantName }) {
|
|
59
57
|
[EPathType.EPathTypeColumnTable]: undefined,
|
60
58
|
[EPathType.EPathTypeCdcStream]: () => {
|
61
59
|
var _a;
|
62
|
-
return (_jsx(ChangefeedInfo, { data: data, topic: (_a = additionalData === null || additionalData === void 0 ? void 0 : additionalData[0]) !== null && _a !== void 0 ? _a : undefined }));
|
60
|
+
return (_jsx(ChangefeedInfo, { path: path, data: data, topic: (_a = additionalData === null || additionalData === void 0 ? void 0 : additionalData[0]) !== null && _a !== void 0 ? _a : undefined }));
|
63
61
|
},
|
64
|
-
[EPathType.EPathTypePersQueueGroup]: () => _jsx(TopicInfo, { data: data }),
|
62
|
+
[EPathType.EPathTypePersQueueGroup]: () => _jsx(TopicInfo, { data: data, path: path }),
|
65
63
|
[EPathType.EPathTypeExternalTable]: () => _jsx(ExternalTableInfo, { data: data }),
|
66
64
|
[EPathType.EPathTypeExternalDataSource]: () => _jsx(ExternalDataSourceInfo, { data: data }),
|
67
65
|
[EPathType.EPathTypeView]: () => _jsx(ViewInfo, { data: data }),
|
@@ -72,8 +70,8 @@ function Overview({ type, tenantName }) {
|
|
72
70
|
if (entityLoading || entityNotReady) {
|
73
71
|
return _jsx(Loader, { size: "m" });
|
74
72
|
}
|
75
|
-
if (overviewError) {
|
76
|
-
return _jsx(ResponseError, { error: overviewError });
|
73
|
+
if (schemaError || overviewError) {
|
74
|
+
return _jsx(ResponseError, { error: schemaError || overviewError });
|
77
75
|
}
|
78
76
|
return renderContent();
|
79
77
|
}
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { InfoViewer } from '../../../../../components/InfoViewer';
|
4
4
|
import { cn } from '../../../../../utils/cn';
|
5
|
-
import {
|
5
|
+
import { EntityTitle } from '../../../EntityTitle/EntityTitle';
|
6
6
|
import i18n from './i18n';
|
7
7
|
import { prepareTableInfo } from './prepareTableInfo';
|
8
8
|
import './TableInfo.scss';
|
9
9
|
const b = cn('ydb-diagnostics-table-info');
|
10
10
|
export const TableInfo = ({ data, type, olapStats }) => {
|
11
|
-
const
|
11
|
+
const title = _jsx(EntityTitle, { data: data === null || data === void 0 ? void 0 : data.PathDescription });
|
12
12
|
const { generalInfo = [], tableStatsInfo = [], tabletMetricsInfo = [], partitionConfigInfo = [], } = React.useMemo(() => prepareTableInfo(data, type, olapStats), [data, type, olapStats]);
|
13
|
-
return (_jsxs("div", { className: b(), children: [_jsx(InfoViewer, { info: generalInfo, title:
|
13
|
+
return (_jsxs("div", { className: b(), children: [_jsx(InfoViewer, { info: generalInfo, title: title, className: b('info-block'), renderEmptyState: () => _jsx("div", { className: b('title'), children: title }) }), _jsxs("div", { className: b('row'), children: [_jsx("div", { className: b('col'), children: tableStatsInfo.map((info, index) => (_jsx(InfoViewer, { info: info, title: index === 0 ? i18n('tableStats') : undefined, className: b('info-block'), renderEmptyState: () => null }, index))) }), tabletMetricsInfo.length > 0 || partitionConfigInfo.length > 0 ? (_jsxs("div", { className: b('col'), children: [_jsx(InfoViewer, { info: tabletMetricsInfo, title: i18n('tabletMetrics'), className: b('info-block'), renderEmptyState: () => null }), _jsx(InfoViewer, { info: partitionConfigInfo, title: i18n('partitionConfig'), className: b('info-block'), renderEmptyState: () => null })] })) : null] })] }));
|
14
14
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import type { TEvDescribeSchemeResult } from '../../../../../types/api/schema';
|
2
2
|
interface TopicInfoProps {
|
3
|
+
path: string;
|
3
4
|
data?: TEvDescribeSchemeResult;
|
4
5
|
}
|
5
6
|
/** Displays overview for PersQueueGroup EPathType */
|
6
|
-
export declare const TopicInfo: ({ data }: TopicInfoProps) => import("react/jsx-runtime").JSX.Element;
|
7
|
+
export declare const TopicInfo: ({ data, path }: TopicInfoProps) => import("react/jsx-runtime").JSX.Element;
|
7
8
|
export {};
|