ydb-embedded-ui 6.6.1 → 6.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/package.json +2 -1
- 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/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/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 +7 -17
- 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.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/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/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 +17 -0
- package/dist/src/containers/Tenant/i18n/index.d.ts +1 -1
- package/dist/src/containers/Tenant/utils/queryTemplates.d.ts +1 -0
- package/dist/src/containers/Tenant/utils/queryTemplates.js +12 -0
- package/dist/src/containers/Tenant/utils/schemaActions.js +3 -1
- 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 +23 -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/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 +2 -1
- 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/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
@@ -1,29 +1,25 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
3
|
import { NavigationTree } from 'ydb-ui-components';
|
4
|
-
import {
|
4
|
+
import { schemaApi } from '../../../../store/reducers/schema/schema';
|
5
5
|
import { useQueryModes, useTypedDispatch } from '../../../../utils/hooks';
|
6
6
|
import { isChildlessPathType, mapPathTypeToNavigationTreeType } from '../../utils/schema';
|
7
7
|
import { getActions } from '../../utils/schemaActions';
|
8
8
|
import { getControls } from '../../utils/schemaControls';
|
9
9
|
export function SchemaTree(props) {
|
10
|
-
const { rootPath, rootName, rootType, currentPath } = props;
|
10
|
+
const { rootPath, rootName, rootType, currentPath, onActivePathUpdate } = props;
|
11
11
|
const dispatch = useTypedDispatch();
|
12
12
|
const [_, setQueryMode] = useQueryModes();
|
13
|
-
const fetchPath = (path) =>
|
14
|
-
.getSchema({ path }, {
|
15
|
-
|
13
|
+
const fetchPath = async (path) => {
|
14
|
+
const promise = dispatch(schemaApi.endpoints.getSchema.initiate({ path }, { forceRefetch: true }));
|
15
|
+
const { data } = await promise;
|
16
|
+
promise.unsubscribe();
|
16
17
|
if (!data) {
|
17
18
|
throw new Error(`no describe data about path ${path}`);
|
18
19
|
}
|
19
20
|
const { PathDescription: { Children = [] } = {} } = data;
|
20
|
-
const preloadedData = {
|
21
|
-
[path]: data,
|
22
|
-
};
|
23
21
|
const childItems = Children.map((childData) => {
|
24
22
|
const { Name = '', PathType, PathSubType } = childData;
|
25
|
-
// not full data, but it contains PathType, which ensures seamless switch between nodes
|
26
|
-
preloadedData[`${path}/${Name}`] = { PathDescription: { Self: childData } };
|
27
23
|
return {
|
28
24
|
name: Name,
|
29
25
|
type: mapPathTypeToNavigationTreeType(PathType, PathSubType),
|
@@ -32,27 +28,23 @@ export function SchemaTree(props) {
|
|
32
28
|
expandable: !isChildlessPathType(PathType, PathSubType),
|
33
29
|
};
|
34
30
|
});
|
35
|
-
dispatch(preloadSchemas(preloadedData));
|
36
31
|
return childItems;
|
37
|
-
});
|
38
|
-
const handleActivePathUpdate = (activePath) => {
|
39
|
-
dispatch(setCurrentSchemaPath(activePath));
|
40
32
|
};
|
41
33
|
React.useEffect(() => {
|
42
34
|
// if the cached path is not in the current tree, show root
|
43
35
|
if (!(currentPath === null || currentPath === void 0 ? void 0 : currentPath.startsWith(rootPath))) {
|
44
|
-
|
36
|
+
onActivePathUpdate(rootPath);
|
45
37
|
}
|
46
|
-
}, []);
|
38
|
+
}, [currentPath, onActivePathUpdate, rootPath]);
|
47
39
|
return (_jsx(NavigationTree, { rootState: {
|
48
40
|
path: rootPath,
|
49
41
|
name: rootName,
|
50
42
|
type: mapPathTypeToNavigationTreeType(rootType),
|
51
43
|
collapsed: false,
|
52
44
|
}, fetchPath: fetchPath, getActions: getActions(dispatch, {
|
53
|
-
setActivePath:
|
45
|
+
setActivePath: onActivePathUpdate,
|
54
46
|
setQueryMode,
|
55
47
|
}), renderAdditionalNodeElements: getControls(dispatch, {
|
56
|
-
setActivePath:
|
57
|
-
}), activePath: currentPath, onActivePathUpdate:
|
48
|
+
setActivePath: onActivePathUpdate,
|
49
|
+
}), activePath: currentPath, onActivePathUpdate: onActivePathUpdate, cache: false, virtualize: true }));
|
58
50
|
}
|
@@ -2,8 +2,8 @@ import type { EPathType } from '../../../../types/api/schema';
|
|
2
2
|
import './SchemaViewer.scss';
|
3
3
|
interface SchemaViewerProps {
|
4
4
|
type?: EPathType;
|
5
|
-
path
|
6
|
-
tenantName
|
5
|
+
path: string;
|
6
|
+
tenantName: string;
|
7
7
|
extended?: boolean;
|
8
8
|
}
|
9
9
|
export declare const SchemaViewer: ({ type, path, tenantName, extended }: SchemaViewerProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -4,25 +4,30 @@ import DataTable from '@gravity-ui/react-data-table';
|
|
4
4
|
import { skipToken } from '@reduxjs/toolkit/query';
|
5
5
|
import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
|
6
6
|
import { TableSkeleton } from '../../../../components/TableSkeleton/TableSkeleton';
|
7
|
+
import { schemaApi } from '../../../../store/reducers/schema/schema';
|
7
8
|
import { viewSchemaApi } from '../../../../store/reducers/viewSchema/viewSchema';
|
8
9
|
import { DEFAULT_TABLE_SETTINGS } from '../../../../utils/constants';
|
9
|
-
import { useTypedSelector } from '../../../../utils/hooks';
|
10
10
|
import { isColumnEntityType, isExternalTableType, isRowTableType, isViewType, } from '../../utils/schema';
|
11
11
|
import { SCHEMA_COLUMNS_WIDTH_LS_KEY, SCHEMA_TABLE_COLUMS_IDS, getColumnTableColumns, getExternalTableColumns, getRowTableColumns, getViewColumns, } from './columns';
|
12
12
|
import { prepareSchemaData, prepareViewSchema } from './prepareData';
|
13
13
|
import { b } from './shared';
|
14
14
|
import './SchemaViewer.scss';
|
15
15
|
export const SchemaViewer = ({ type, path, tenantName, extended = false }) => {
|
16
|
-
const {
|
17
|
-
|
18
|
-
|
16
|
+
const { currentData: schemaData, isFetching } = schemaApi.endpoints.getSchema.useQueryState({
|
17
|
+
path,
|
18
|
+
});
|
19
|
+
const loading = isFetching && schemaData === undefined;
|
20
|
+
const viewSchemaRequestParams = isViewType(type) ? { path, database: tenantName } : skipToken;
|
19
21
|
const { data: viewColumnsData, isLoading: isViewSchemaLoading } = viewSchemaApi.useGetViewSchemaQuery(viewSchemaRequestParams);
|
20
22
|
const tableData = React.useMemo(() => {
|
21
23
|
if (isViewType(type)) {
|
22
24
|
return prepareViewSchema(viewColumnsData);
|
23
25
|
}
|
24
|
-
return prepareSchemaData(type,
|
25
|
-
}, [
|
26
|
+
return prepareSchemaData(type, schemaData);
|
27
|
+
}, [schemaData, type, viewColumnsData]);
|
28
|
+
const hasAutoIncrement = React.useMemo(() => {
|
29
|
+
return tableData.some((i) => i.autoIncrement);
|
30
|
+
}, [tableData]);
|
26
31
|
const columns = React.useMemo(() => {
|
27
32
|
if (isViewType(type)) {
|
28
33
|
return getViewColumns();
|
@@ -34,10 +39,10 @@ export const SchemaViewer = ({ type, path, tenantName, extended = false }) => {
|
|
34
39
|
return getColumnTableColumns();
|
35
40
|
}
|
36
41
|
if (isRowTableType(type)) {
|
37
|
-
return getRowTableColumns(extended);
|
42
|
+
return getRowTableColumns(extended, hasAutoIncrement);
|
38
43
|
}
|
39
44
|
return [];
|
40
|
-
}, [type, extended]);
|
45
|
+
}, [type, extended, hasAutoIncrement]);
|
41
46
|
const renderContent = () => {
|
42
47
|
if (loading || isViewSchemaLoading) {
|
43
48
|
return _jsx(TableSkeleton, {});
|
@@ -6,6 +6,7 @@ export declare const SCHEMA_TABLE_COLUMS_IDS: {
|
|
6
6
|
isKeyColumn: "isKeyColumn";
|
7
7
|
type: "type";
|
8
8
|
notNull: "notNull";
|
9
|
+
autoIncrement: "autoIncrement";
|
9
10
|
familyName: "familyName";
|
10
11
|
prefferedPoolKind: "prefferedPoolKind";
|
11
12
|
columnCodec: "columnCodec";
|
@@ -13,4 +14,4 @@ export declare const SCHEMA_TABLE_COLUMS_IDS: {
|
|
13
14
|
export declare function getViewColumns(): SchemaColumn[];
|
14
15
|
export declare function getExternalTableColumns(): SchemaColumn[];
|
15
16
|
export declare function getColumnTableColumns(): SchemaColumn[];
|
16
|
-
export declare function getRowTableColumns(extended: boolean): SchemaColumn[];
|
17
|
+
export declare function getRowTableColumns(extended: boolean, hasAutoIncrement: boolean): SchemaColumn[];
|
@@ -11,6 +11,7 @@ export const SCHEMA_TABLE_COLUMS_IDS = {
|
|
11
11
|
isKeyColumn: 'isKeyColumn',
|
12
12
|
type: 'type',
|
13
13
|
notNull: 'notNull',
|
14
|
+
autoIncrement: 'autoIncrement',
|
14
15
|
familyName: 'familyName',
|
15
16
|
prefferedPoolKind: 'prefferedPoolKind',
|
16
17
|
columnCodec: 'columnCodec',
|
@@ -68,6 +69,21 @@ const notNullColumn = {
|
|
68
69
|
return undefined;
|
69
70
|
},
|
70
71
|
};
|
72
|
+
const autoIncrementColumn = {
|
73
|
+
name: SCHEMA_TABLE_COLUMS_IDS.autoIncrement,
|
74
|
+
get header() {
|
75
|
+
return i18n('column-title.autoIncrement');
|
76
|
+
},
|
77
|
+
width: 100,
|
78
|
+
// Table should start with notNull columns on sort click
|
79
|
+
defaultOrder: DataTable.DESCENDING,
|
80
|
+
render: ({ row }) => {
|
81
|
+
if (row.autoIncrement) {
|
82
|
+
return '\u2713';
|
83
|
+
}
|
84
|
+
return undefined;
|
85
|
+
},
|
86
|
+
};
|
71
87
|
const familyColumn = {
|
72
88
|
name: SCHEMA_TABLE_COLUMS_IDS.familyName,
|
73
89
|
get header() {
|
@@ -101,10 +117,13 @@ export function getExternalTableColumns() {
|
|
101
117
|
export function getColumnTableColumns() {
|
102
118
|
return [idColumn, keyColumn, nameColumn, typeColumn, notNullColumn];
|
103
119
|
}
|
104
|
-
export function getRowTableColumns(extended) {
|
120
|
+
export function getRowTableColumns(extended, hasAutoIncrement) {
|
105
121
|
const rowTableColumns = [idColumn, keyColumn, nameColumn, typeColumn, notNullColumn];
|
106
122
|
if (extended) {
|
107
|
-
|
123
|
+
rowTableColumns.push(familyColumn, mediaColumn, compressionColumn);
|
124
|
+
}
|
125
|
+
if (hasAutoIncrement) {
|
126
|
+
rowTableColumns.push(autoIncrementColumn);
|
108
127
|
}
|
109
128
|
return rowTableColumns;
|
110
129
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "column-title.id" | "column-title.name" | "column-title.key" | "column-title.type" | "column-title.notNull" | "column-title.family" | "column-title.media" | "column-title.compression", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
1
|
+
declare const _default: (key: "column-title.id" | "column-title.name" | "column-title.key" | "column-title.type" | "column-title.notNull" | "column-title.autoIncrement" | "column-title.family" | "column-title.media" | "column-title.compression", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
2
2
|
export default _default;
|
@@ -31,7 +31,7 @@ function prepareRowTableSchema(data = {}) {
|
|
31
31
|
const keyAccessorsMap = getKeyColumnsSortAccessorMap(KeyColumnIds);
|
32
32
|
const preparedColumns = Columns === null || Columns === void 0 ? void 0 : Columns.map((column) => {
|
33
33
|
var _a, _b;
|
34
|
-
const { Id, Name, NotNull, Type, Family } = column;
|
34
|
+
const { Id, Name, NotNull, Type, Family, DefaultFromSequence } = column;
|
35
35
|
const isKeyColumn = Boolean(KeyColumnIds === null || KeyColumnIds === void 0 ? void 0 : KeyColumnIds.find((keyColumnId) => keyColumnId === Id));
|
36
36
|
// Values in keyAccessorsMap are always negative, so it will be 1 for not key columns
|
37
37
|
const keyAccessor = Id && keyAccessorsMap[Id] ? keyAccessorsMap[Id] : 1;
|
@@ -47,6 +47,7 @@ function prepareRowTableSchema(data = {}) {
|
|
47
47
|
keyAccessor,
|
48
48
|
type: Type,
|
49
49
|
notNull: NotNull,
|
50
|
+
autoIncrement: Boolean(DefaultFromSequence),
|
50
51
|
familyName,
|
51
52
|
prefferedPoolKind,
|
52
53
|
columnCodec,
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React from 'react';
|
3
|
-
import qs from 'qs';
|
4
3
|
import { Helmet } from 'react-helmet-async';
|
5
|
-
import {
|
4
|
+
import { StringParam, useQueryParams } from 'use-query-params';
|
6
5
|
import { AccessDenied } from '../../components/Errors/403';
|
6
|
+
import { Loader } from '../../components/Loader';
|
7
7
|
import SplitPane from '../../components/SplitPane';
|
8
8
|
import { setHeaderBreadcrumbs } from '../../store/reducers/header/header';
|
9
|
-
import {
|
9
|
+
import { schemaApi } from '../../store/reducers/schema/schema';
|
10
10
|
import { cn } from '../../utils/cn';
|
11
11
|
import { DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY } from '../../utils/constants';
|
12
|
-
import { useTypedDispatch
|
12
|
+
import { useTypedDispatch } from '../../utils/hooks';
|
13
13
|
import ObjectGeneral from './ObjectGeneral/ObjectGeneral';
|
14
14
|
import { ObjectSummary } from './ObjectSummary/ObjectSummary';
|
15
15
|
import i18n from './i18n';
|
@@ -27,25 +27,13 @@ const getTenantSummaryState = () => {
|
|
27
27
|
function Tenant(props) {
|
28
28
|
var _a;
|
29
29
|
const [summaryVisibilityState, dispatchSummaryVisibilityAction] = React.useReducer(paneVisibilityToggleReducerCreator(DEFAULT_IS_TENANT_SUMMARY_COLLAPSED), undefined, getTenantSummaryState);
|
30
|
+
const [{ name: tenantName, schema }] = useQueryParams({ name: StringParam, schema: StringParam });
|
31
|
+
if (!tenantName) {
|
32
|
+
throw new Error('Tenant name is not defined');
|
33
|
+
}
|
30
34
|
const previousTenant = React.useRef();
|
31
|
-
const { currentSchemaPath, currentSchema: currentItem = {} } = useTypedSelector((state) => state.schema);
|
32
|
-
const { PathType: preloadedPathType, PathSubType: preloadedPathSubType } = useTypedSelector((state) => {
|
33
|
-
var _a, _b;
|
34
|
-
return currentSchemaPath
|
35
|
-
? (_b = (_a = state.schema.data[currentSchemaPath]) === null || _a === void 0 ? void 0 : _a.PathDescription) === null || _b === void 0 ? void 0 : _b.Self
|
36
|
-
: undefined;
|
37
|
-
}) || {};
|
38
|
-
const { PathType: currentPathType, PathSubType: currentPathSubType } = ((_a = currentItem.PathDescription) === null || _a === void 0 ? void 0 : _a.Self) || {};
|
39
|
-
const { error: { status: schemaStatus = 200 } = {} } = useTypedSelector((state) => state.schema);
|
40
|
-
const dispatch = useTypedDispatch();
|
41
|
-
const location = useLocation();
|
42
|
-
const queryParams = qs.parse(location.search, {
|
43
|
-
ignoreQueryPrefix: true,
|
44
|
-
});
|
45
|
-
const { name } = queryParams;
|
46
|
-
const tenantName = name;
|
47
35
|
React.useEffect(() => {
|
48
|
-
if (
|
36
|
+
if (previousTenant.current !== tenantName) {
|
49
37
|
const register = async () => {
|
50
38
|
const { registerYQLCompletionItemProvider } = await import('../../utils/monaco/yql/yql.completionItemProvider');
|
51
39
|
registerYQLCompletionItemProvider(tenantName);
|
@@ -54,20 +42,17 @@ function Tenant(props) {
|
|
54
42
|
previousTenant.current = tenantName;
|
55
43
|
}
|
56
44
|
}, [tenantName]);
|
45
|
+
const dispatch = useTypedDispatch();
|
57
46
|
React.useEffect(() => {
|
58
|
-
dispatch(
|
59
|
-
}, [tenantName, dispatch]);
|
60
|
-
React.useEffect(() => {
|
61
|
-
//TODO: should be refactored when move to @reduxjs/toolkit/query
|
62
|
-
if (currentSchemaPath && currentSchemaPath !== tenantName) {
|
63
|
-
dispatch(getSchema({ path: currentSchemaPath }));
|
64
|
-
}
|
65
|
-
}, [currentSchemaPath, dispatch, tenantName]);
|
66
|
-
React.useEffect(() => {
|
67
|
-
if (tenantName) {
|
68
|
-
dispatch(setHeaderBreadcrumbs('tenant', { tenantName }));
|
69
|
-
}
|
47
|
+
dispatch(setHeaderBreadcrumbs('tenant', { tenantName }));
|
70
48
|
}, [tenantName, dispatch]);
|
49
|
+
const path = schema !== null && schema !== void 0 ? schema : tenantName;
|
50
|
+
const { currentData: currentItem, error, isLoading, } = schemaApi.useGetSchemaQuery({ path }, { refetchOnMountOrArgChange: true });
|
51
|
+
const { PathType: currentPathType, PathSubType: currentPathSubType } = ((_a = currentItem === null || currentItem === void 0 ? void 0 : currentItem.PathDescription) === null || _a === void 0 ? void 0 : _a.Self) || {};
|
52
|
+
let showBlockingError = false;
|
53
|
+
if (error && typeof error === 'object' && 'status' in error) {
|
54
|
+
showBlockingError = error.status === 403;
|
55
|
+
}
|
71
56
|
const onCollapseSummaryHandler = () => {
|
72
57
|
dispatchSummaryVisibilityAction(PaneVisibilityActionTypes.triggerCollapse);
|
73
58
|
};
|
@@ -77,8 +62,7 @@ function Tenant(props) {
|
|
77
62
|
const onSplitStartDragAdditional = () => {
|
78
63
|
dispatchSummaryVisibilityAction(PaneVisibilityActionTypes.clear);
|
79
64
|
};
|
80
|
-
const
|
81
|
-
|
82
|
-
return (_jsxs("div", { className: b(), children: [_jsx(Helmet, { defaultTitle: `${title} — YDB Monitoring`, titleTemplate: `%s — ${title} — YDB Monitoring` }), showBlockingError ? (_jsx(AccessDenied, {})) : (_jsxs(SplitPane, { defaultSizePaneKey: DEFAULT_SIZE_TENANT_KEY, defaultSizes: [25, 75], triggerCollapse: summaryVisibilityState.triggerCollapse, triggerExpand: summaryVisibilityState.triggerExpand, minSize: [36, 200], onSplitStartDragAdditional: onSplitStartDragAdditional, children: [_jsx(ObjectSummary, { type: preloadedPathType || currentPathType, subType: preloadedPathSubType || currentPathSubType, tenantName: tenantName, onCollapseSummary: onCollapseSummaryHandler, onExpandSummary: onExpandSummaryHandler, isCollapsed: summaryVisibilityState.collapsed }), _jsx(ObjectGeneral, { type: preloadedPathType || currentPathType, additionalTenantProps: props.additionalTenantProps, additionalNodesProps: props.additionalNodesProps, tenantName: tenantName })] }))] }));
|
65
|
+
const title = path || i18n('page.title');
|
66
|
+
return (_jsxs("div", { className: b(), children: [_jsx(Helmet, { defaultTitle: `${title} — YDB Monitoring`, titleTemplate: `%s — ${title} — YDB Monitoring` }), showBlockingError ? (_jsx(AccessDenied, {})) : (_jsxs(SplitPane, { defaultSizePaneKey: DEFAULT_SIZE_TENANT_KEY, defaultSizes: [25, 75], triggerCollapse: summaryVisibilityState.triggerCollapse, triggerExpand: summaryVisibilityState.triggerExpand, minSize: [36, 200], onSplitStartDragAdditional: onSplitStartDragAdditional, children: [_jsx(ObjectSummary, { type: currentPathType, subType: currentPathSubType, tenantName: tenantName, path: path, onCollapseSummary: onCollapseSummaryHandler, onExpandSummary: onExpandSummaryHandler, isCollapsed: summaryVisibilityState.collapsed }), _jsx("div", { className: b('main'), children: isLoading ? (_jsx(Loader, { size: "l" })) : (_jsx(ObjectGeneral, { type: currentPathType, additionalTenantProps: props.additionalTenantProps, additionalNodesProps: props.additionalNodesProps, tenantName: tenantName, path: path })) })] }))] }));
|
83
67
|
}
|
84
68
|
export default Tenant;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Icon, RadioButton } from '@gravity-ui/uikit';
|
3
|
+
import { cn } from '../../../utils/cn';
|
4
|
+
import { useTenantNavigation } from './useTenantNavigation';
|
5
|
+
import './TenantNavigation.scss';
|
6
|
+
const b = cn('ydb-tenant-navigation');
|
7
|
+
const transformItemToOption = ({ id, title, icon }) => {
|
8
|
+
const content = (_jsxs("span", { className: b('item'), children: [_jsx(Icon, { data: icon, size: 16, className: b('icon') }), _jsx("span", { className: b('text'), children: title })] }));
|
9
|
+
return { value: id, content };
|
10
|
+
};
|
11
|
+
export const TenantNavigation = () => {
|
12
|
+
const navigationItems = useTenantNavigation();
|
13
|
+
const handleUpdate = (value) => {
|
14
|
+
const nextItem = navigationItems.find((item) => item.id === value);
|
15
|
+
nextItem === null || nextItem === void 0 ? void 0 : nextItem.onForward();
|
16
|
+
};
|
17
|
+
const getCurrentItem = () => navigationItems.find((item) => item.current) || navigationItems[0];
|
18
|
+
return (_jsx("div", { className: b(), children: _jsx(RadioButton, { width: "auto", onUpdate: handleUpdate, size: "l", className: b('body'), defaultValue: getCurrentItem().id, options: navigationItems.map(transformItemToOption) }) }));
|
19
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare function useTenantNavigation(): {
|
3
|
+
id: "query" | "diagnostics";
|
4
|
+
title: string;
|
5
|
+
icon: ((props: React.SVGProps<SVGSVGElement>) => React.JSX.Element) | ((props: React.SVGProps<SVGSVGElement>) => React.JSX.Element);
|
6
|
+
path: string;
|
7
|
+
current: boolean;
|
8
|
+
onForward: () => void;
|
9
|
+
}[];
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Pulse, Terminal } from '@gravity-ui/icons';
|
3
|
+
import { useHistory, useLocation } from 'react-router';
|
4
|
+
import routes, { parseQuery } from '../../../routes';
|
5
|
+
import { TENANT_PAGE, TENANT_PAGES_IDS } from '../../../store/reducers/tenant/constants';
|
6
|
+
import { TENANT_INITIAL_PAGE_KEY } from '../../../utils/constants';
|
7
|
+
import { useSetting, useTypedSelector } from '../../../utils/hooks';
|
8
|
+
import { getTenantPath } from '../TenantPages';
|
9
|
+
import i18n from '../i18n';
|
10
|
+
const pagesList = ['query', 'diagnostics'];
|
11
|
+
const mapPageToIcon = {
|
12
|
+
query: Terminal,
|
13
|
+
diagnostics: Pulse,
|
14
|
+
};
|
15
|
+
export function useTenantNavigation() {
|
16
|
+
const history = useHistory();
|
17
|
+
const location = useLocation();
|
18
|
+
const queryParams = parseQuery(location);
|
19
|
+
const [, setInitialTenantPage] = useSetting(TENANT_INITIAL_PAGE_KEY);
|
20
|
+
const { tenantPage } = useTypedSelector((state) => state.tenant);
|
21
|
+
const menuItems = React.useMemo(() => {
|
22
|
+
if (location.pathname !== routes.tenant) {
|
23
|
+
return [];
|
24
|
+
}
|
25
|
+
const items = pagesList.map((key) => {
|
26
|
+
const pageId = TENANT_PAGES_IDS[key];
|
27
|
+
const pagePath = getTenantPath(Object.assign(Object.assign({}, queryParams), { [TENANT_PAGE]: pageId }));
|
28
|
+
const nextItem = {
|
29
|
+
id: pageId,
|
30
|
+
title: i18n(`pages.${key}`),
|
31
|
+
icon: mapPageToIcon[key],
|
32
|
+
path: pagePath,
|
33
|
+
current: tenantPage === pageId,
|
34
|
+
onForward: () => {
|
35
|
+
setInitialTenantPage(pageId);
|
36
|
+
history.push(pagePath);
|
37
|
+
},
|
38
|
+
};
|
39
|
+
return nextItem;
|
40
|
+
});
|
41
|
+
return items;
|
42
|
+
}, [tenantPage, setInitialTenantPage, location.pathname, history, queryParams]);
|
43
|
+
return menuItems;
|
44
|
+
}
|
@@ -1,10 +1,26 @@
|
|
1
1
|
{
|
2
2
|
"page.title": "Database",
|
3
|
+
"pages.query": "Query",
|
4
|
+
"pages.diagnostics": "Diagnostics",
|
3
5
|
"acl.owner": "Owner",
|
4
6
|
"acl.empty": "No Acl data",
|
5
7
|
"summary.navigation": "Navigation",
|
6
8
|
"summary.showPreview": "Show preview",
|
9
|
+
"summary.source-type": "Source Type",
|
10
|
+
"summary.data-source": "Data Source",
|
7
11
|
"summary.copySchemaPath": "Copy schema path",
|
12
|
+
"summary.type": "Type",
|
13
|
+
"summary.subtype": "SubType",
|
14
|
+
"summary.id": "Id",
|
15
|
+
"summary.version": "Version",
|
16
|
+
"summary.created": "Created",
|
17
|
+
"summary.partitions": "Partitions count",
|
18
|
+
"summary.paths": "Paths",
|
19
|
+
"summary.shards": "Shards",
|
20
|
+
"summary.state": "State",
|
21
|
+
"summary.mode": "Mode",
|
22
|
+
"summary.format": "Format",
|
23
|
+
"summary.retention": "Retention",
|
8
24
|
"actions.copied": "The path is copied to the clipboard",
|
9
25
|
"actions.notCopied": "Couldn’t copy the path",
|
10
26
|
"actions.copyPath": "Copy path",
|
@@ -12,6 +28,7 @@
|
|
12
28
|
"actions.createTable": "Create table...",
|
13
29
|
"actions.createExternalTable": "Create external table...",
|
14
30
|
"actions.createTopic": "Create topic...",
|
31
|
+
"actions.createColumnTable": "Create column table...",
|
15
32
|
"actions.createView": "Create view...",
|
16
33
|
"actions.dropTable": "Drop table...",
|
17
34
|
"actions.dropTopic": "Drop topic...",
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: (key: "page.title" | "acl.owner" | "acl.empty" | "summary.navigation" | "summary.showPreview" | "summary.copySchemaPath" | "actions.copied" | "actions.notCopied" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.createView" | "actions.dropTable" | "actions.dropTopic" | "actions.dropView" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
1
|
+
declare const _default: (key: "page.title" | "pages.query" | "pages.diagnostics" | "acl.owner" | "acl.empty" | "summary.navigation" | "summary.showPreview" | "summary.source-type" | "summary.data-source" | "summary.copySchemaPath" | "summary.type" | "summary.subtype" | "summary.id" | "summary.version" | "summary.created" | "summary.partitions" | "summary.paths" | "summary.shards" | "summary.state" | "summary.mode" | "summary.format" | "summary.retention" | "actions.copied" | "actions.notCopied" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.createColumnTable" | "actions.createView" | "actions.dropTable" | "actions.dropTopic" | "actions.dropView" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
2
2
|
export default _default;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare const createTableTemplate: (path: string) => string;
|
2
|
+
export declare const createColumnTableTemplate: (path: string) => string;
|
2
3
|
export declare const alterTableTemplate: (path: string) => string;
|
3
4
|
export declare const selectQueryTemplate: (path: string) => string;
|
4
5
|
export declare const upsertQueryTemplate: (path: string) => string;
|
@@ -30,6 +30,18 @@ WITH (
|
|
30
30
|
-- if some keys are missing in a table when making multiple single queries by the primary key.
|
31
31
|
)`;
|
32
32
|
};
|
33
|
+
export const createColumnTableTemplate = (path) => {
|
34
|
+
return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/create_table#olap-tables
|
35
|
+
CREATE TABLE \`${path}/ydb_column_table\` (
|
36
|
+
id Int64 NOT NULL,
|
37
|
+
author Text,
|
38
|
+
title Text,
|
39
|
+
body Text,
|
40
|
+
PRIMARY KEY (id)
|
41
|
+
)
|
42
|
+
PARTITION BY HASH(id)
|
43
|
+
WITH (STORE = COLUMN)`;
|
44
|
+
};
|
33
45
|
export const alterTableTemplate = (path) => {
|
34
46
|
return `ALTER TABLE \`${path}\`
|
35
47
|
ADD COLUMN is_deleted Bool;`;
|
@@ -4,7 +4,7 @@ import { TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID } from '../../../store/reducers/
|
|
4
4
|
import { setQueryTab, setTenantPage } from '../../../store/reducers/tenant/tenant';
|
5
5
|
import createToast from '../../../utils/createToast';
|
6
6
|
import i18n from '../i18n';
|
7
|
-
import { alterTableTemplate, alterTopicTemplate, createExternalTableTemplate, createTableTemplate, createTopicTemplate, createViewTemplate, dropExternalTableTemplate, dropTopicTemplate, dropViewTemplate, selectQueryTemplate, upsertQueryTemplate, } from './queryTemplates';
|
7
|
+
import { alterTableTemplate, alterTopicTemplate, createColumnTableTemplate, createExternalTableTemplate, createTableTemplate, createTopicTemplate, createViewTemplate, dropExternalTableTemplate, dropTopicTemplate, dropViewTemplate, selectQueryTemplate, upsertQueryTemplate, } from './queryTemplates';
|
8
8
|
const bindActions = (path, dispatch, additionalEffects) => {
|
9
9
|
const { setActivePath, setQueryMode } = additionalEffects;
|
10
10
|
const inputQuery = (tmpl, mode) => () => {
|
@@ -18,6 +18,7 @@ const bindActions = (path, dispatch, additionalEffects) => {
|
|
18
18
|
};
|
19
19
|
return {
|
20
20
|
createTable: inputQuery(createTableTemplate, 'script'),
|
21
|
+
createColumnTable: inputQuery(createColumnTableTemplate, 'script'),
|
21
22
|
alterTable: inputQuery(alterTableTemplate, 'script'),
|
22
23
|
selectQuery: inputQuery(selectQueryTemplate),
|
23
24
|
upsertQuery: inputQuery(upsertQueryTemplate),
|
@@ -55,6 +56,7 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
|
|
55
56
|
[copyItem],
|
56
57
|
[
|
57
58
|
{ text: i18n('actions.createTable'), action: actions.createTable },
|
59
|
+
{ text: i18n('actions.createColumnTable'), action: actions.createColumnTable },
|
58
60
|
{ text: i18n('actions.createTopic'), action: actions.createTopic },
|
59
61
|
{ text: i18n('actions.createView'), action: actions.createView },
|
60
62
|
],
|
package/dist/src/lib.d.ts
CHANGED
@@ -6,7 +6,7 @@ export { default as appRoutes } from './routes';
|
|
6
6
|
export { createApi, YdbEmbeddedAPI, YdbWebVersionAPI } from './services/api';
|
7
7
|
export { settingsManager } from './services/settings';
|
8
8
|
export { settings as userSettings } from './containers/UserSettings/settings';
|
9
|
-
export {
|
9
|
+
export { setSettingValue, getSettingValue } from './store/reducers/settings/settings';
|
10
10
|
export { componentsRegistry } from './components/ComponentsProvider/componentsRegistry';
|
11
11
|
export { useSetting, useTypedSelector } from './utils/hooks';
|
12
12
|
export { getMonitoringLink, getMonitoringClusterLink } from './utils/monitoring';
|
package/dist/src/lib.js
CHANGED
@@ -6,7 +6,7 @@ export { default as appRoutes } from './routes';
|
|
6
6
|
export { createApi, YdbEmbeddedAPI, YdbWebVersionAPI } from './services/api';
|
7
7
|
export { settingsManager } from './services/settings';
|
8
8
|
export { settings as userSettings } from './containers/UserSettings/settings';
|
9
|
-
export {
|
9
|
+
export { setSettingValue, getSettingValue } from './store/reducers/settings/settings';
|
10
10
|
export { componentsRegistry } from './components/ComponentsProvider/componentsRegistry';
|
11
11
|
export { useSetting, useTypedSelector } from './utils/hooks';
|
12
12
|
export { getMonitoringLink, getMonitoringClusterLink } from './utils/monitoring';
|
package/dist/src/routes.d.ts
CHANGED
@@ -20,7 +20,7 @@ declare const routes: {
|
|
20
20
|
};
|
21
21
|
export default routes;
|
22
22
|
export declare const parseQuery: (location: Location) => qs.ParsedQs;
|
23
|
-
export type Query =
|
23
|
+
export type Query = AnyRecord;
|
24
24
|
export declare function createHref(route: string, params?: Record<string, string | number>, query?: Query): string;
|
25
25
|
export declare const createExternalUILink: (query?: {}) => string;
|
26
26
|
export declare function getLocationObjectFromHref(href: string): {
|
package/dist/src/routes.js
CHANGED
@@ -50,7 +50,9 @@ export function createHref(route, params, query = {}) {
|
|
50
50
|
if (clusterName && !isClusterNameInQuery && webVersion) {
|
51
51
|
extendedQuery = Object.assign(Object.assign({}, extendedQuery), { clusterName });
|
52
52
|
}
|
53
|
-
const search = isEmpty(extendedQuery)
|
53
|
+
const search = isEmpty(extendedQuery)
|
54
|
+
? ''
|
55
|
+
: `?${qs.stringify(extendedQuery, { encode: false, arrayFormat: 'repeat' })}`;
|
54
56
|
const preparedRoute = prepareRoute(route);
|
55
57
|
return `${compile(preparedRoute)(params)}${search}`;
|
56
58
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import AxiosWrapper from '@gravity-ui/axios-wrapper';
|
2
|
+
import type { AxiosWrapperOptions } from '@gravity-ui/axios-wrapper';
|
2
3
|
import type { ComputeApiRequestParams, NodesApiRequestParams } from '../store/reducers/nodes/types';
|
3
4
|
import type { StorageApiRequestParams } from '../store/reducers/storage/types';
|
4
5
|
import type { TMetaInfo } from '../types/api/acl';
|
@@ -31,6 +32,7 @@ type AxiosOptions = {
|
|
31
32
|
signal?: AbortSignal;
|
32
33
|
};
|
33
34
|
export declare class YdbEmbeddedAPI extends AxiosWrapper {
|
35
|
+
constructor(options?: AxiosWrapperOptions);
|
34
36
|
getPath(path: string): string;
|
35
37
|
getClusterInfo(clusterName?: string, { concurrentId, signal }?: AxiosOptions): Promise<TClusterInfo>;
|
36
38
|
getClusterNodes({ concurrentId, signal }?: AxiosOptions): Promise<TEvSystemStateResponse>;
|
@@ -98,7 +100,10 @@ export declare class YdbEmbeddedAPI extends AxiosWrapper {
|
|
98
100
|
getExplainQuery<Action extends ExplainActions>(query: string, database: string, action: Action, syntax?: QuerySyntax): Promise<ErrorResponse | ExplainResponse<Action>>;
|
99
101
|
getExplainQueryAst(query: string, database: string): Promise<import("../types/api/query").ExplainQueryResponse>;
|
100
102
|
getHotKeys(path: string, enableSampling: boolean, { concurrentId, signal }?: AxiosOptions): Promise<JsonHotKeysResponse>;
|
101
|
-
getHealthcheckInfo(
|
103
|
+
getHealthcheckInfo({ database, maxLevel }: {
|
104
|
+
database: string;
|
105
|
+
maxLevel?: number;
|
106
|
+
}, { concurrentId, signal }?: AxiosOptions): Promise<HealthCheckAPIResponse>;
|
102
107
|
evictVDisk({ groupId, groupGeneration, failRealmIdx, failDomainIdx, vDiskIdx, }: {
|
103
108
|
groupId: string | number;
|
104
109
|
groupGeneration: string | number;
|