ydb-embedded-ui 16.0.0 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MetricChart/reducer.d.ts +2 -2
- package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.js +148 -29
- package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.js.map +1 -1
- package/dist/containers/Cluster/ClusterOverview/components/BridgeInfoTable.scss +106 -10
- package/dist/containers/Cluster/i18n/en.json +23 -0
- package/dist/containers/Cluster/i18n/index.d.ts +1 -1
- package/dist/containers/Operations/Operations.js +2 -2
- package/dist/containers/Operations/Operations.js.map +1 -1
- package/dist/containers/Operations/columns.d.ts +1 -2
- package/dist/containers/Operations/columns.js +3 -5
- package/dist/containers/Operations/columns.js.map +1 -1
- package/dist/containers/Operations/useOperationsInfiniteQuery.d.ts +0 -5
- package/dist/containers/Operations/useOperationsInfiniteQuery.js +14 -11
- package/dist/containers/Operations/useOperationsInfiniteQuery.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/CompactTableAction/CompactTableAction.d.ts +15 -3
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/CompactTableAction/CompactTableAction.js +41 -22
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/CompactTableAction/CompactTableAction.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js +36 -45
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/components/TableInfoSection.d.ts +17 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/components/TableInfoSection.js +19 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/components/TableInfoSection.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTableCompaction.d.ts +16 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTableCompaction.js +33 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTableCompaction.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTablePartitioning.d.ts +14 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTablePartitioning.js +39 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTablePartitioning.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/en.json +6 -3
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/index.d.ts +27 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/index.js +64 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/index.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareColumnTableInfo.d.ts +6 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareColumnTableInfo.js +38 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareColumnTableInfo.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareCommonTableInfo.d.ts +32 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareCommonTableInfo.js +94 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareCommonTableInfo.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/preparePartitionConfig.d.ts +11 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/preparePartitionConfig.js +45 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/preparePartitionConfig.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareRowTableInfo.d.ts +10 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareRowTableInfo.js +53 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareRowTableInfo.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareTTL.d.ts +10 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareTTL.js +19 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/prepareTTL.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/renderHelpers.d.ts +18 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/renderHelpers.js +41 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo/renderHelpers.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/useTenantStorageNewData.d.ts +5 -5
- package/dist/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.js +39 -1
- package/dist/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.js.map +1 -1
- package/dist/containers/Tenant/i18n/en.json +1 -0
- package/dist/containers/Tenant/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/utils/schema.d.ts +1 -0
- package/dist/containers/Tenant/utils/schema.js +3 -0
- package/dist/containers/Tenant/utils/schema.js.map +1 -1
- package/dist/containers/Tenant/utils/schemaActions.d.ts +3 -0
- package/dist/containers/Tenant/utils/schemaActions.js +23 -6
- package/dist/containers/Tenant/utils/schemaActions.js.map +1 -1
- package/dist/store/configureStore.d.ts +4 -4
- package/dist/store/defaultStore.d.ts +2 -2
- package/dist/store/reducers/api.d.ts +1 -1
- package/dist/store/reducers/api.js +1 -1
- package/dist/store/reducers/api.js.map +1 -1
- package/dist/store/reducers/authentication/authentication.d.ts +4 -4
- package/dist/store/reducers/cancelQuery.d.ts +2 -2
- package/dist/store/reducers/capabilities/capabilities.d.ts +39 -39
- package/dist/store/reducers/capabilities/hooks.d.ts +5 -5
- package/dist/store/reducers/cluster/cluster.d.ts +5 -5
- package/dist/store/reducers/cluster/cluster.js +3 -2
- package/dist/store/reducers/cluster/cluster.js.map +1 -1
- package/dist/store/reducers/cluster/utils.d.ts +2 -1
- package/dist/store/reducers/cluster/utils.js +28 -0
- package/dist/store/reducers/cluster/utils.js.map +1 -1
- package/dist/store/reducers/clusters/clusters.d.ts +2 -2
- package/dist/store/reducers/codeAssist/codeAssist.d.ts +6 -6
- package/dist/store/reducers/configs.d.ts +3 -3
- package/dist/store/reducers/environments/environments.d.ts +2 -2
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +4 -4
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +111 -111
- package/dist/store/reducers/heatmap.d.ts +2 -2
- package/dist/store/reducers/hotKeys/hotKeys.d.ts +2 -2
- package/dist/store/reducers/index.d.ts +3 -3
- package/dist/store/reducers/network/network.d.ts +2 -2
- package/dist/store/reducers/node/node.d.ts +3 -3
- package/dist/store/reducers/node/selectors.d.ts +1 -1
- package/dist/store/reducers/nodes/nodes.d.ts +2 -2
- package/dist/store/reducers/nodesList.d.ts +12 -12
- package/dist/store/reducers/operations.d.ts +6 -9
- package/dist/store/reducers/operations.js +5 -24
- package/dist/store/reducers/operations.js.map +1 -1
- package/dist/store/reducers/overview/overview.d.ts +2 -2
- package/dist/store/reducers/partitions/partitions.d.ts +3 -3
- package/dist/store/reducers/pdisk/pdisk.d.ts +2 -2
- package/dist/store/reducers/planToSvg.d.ts +2 -2
- package/dist/store/reducers/preview.d.ts +2 -2
- package/dist/store/reducers/query/api.d.ts +4 -4
- package/dist/store/reducers/replication.d.ts +2 -2
- package/dist/store/reducers/schema/schema.d.ts +16 -16
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +39 -39
- package/dist/store/reducers/settings/api.d.ts +4 -4
- package/dist/store/reducers/settings/settings.d.ts +1 -1
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +2 -2
- package/dist/store/reducers/showCreateTable/showCreateTable.d.ts +2 -2
- package/dist/store/reducers/storage/storage.d.ts +3 -3
- package/dist/store/reducers/storageUsage/StorageUsage.d.ts +2 -2
- package/dist/store/reducers/streamingQuery/streamingQuery.d.ts +2 -2
- package/dist/store/reducers/tableData.d.ts +1 -1
- package/dist/store/reducers/tablePartitioning/tablePartitioning.d.ts +2 -2
- package/dist/store/reducers/tableSchemaData.d.ts +2 -2
- package/dist/store/reducers/tablet.d.ts +7 -7
- package/dist/store/reducers/tablets.d.ts +3 -3
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/storage/tenantOverviewStorage.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
- package/dist/store/reducers/tenants/tenants.d.ts +2 -2
- package/dist/store/reducers/topic.d.ts +45 -45
- package/dist/store/reducers/vdisk/vdisk.d.ts +3 -3
- package/dist/store/reducers/viewSchema/viewSchema.d.ts +2 -2
- package/dist/types/api/cluster.d.ts +10 -1
- package/dist/types/api/cluster.js +8 -0
- package/dist/types/api/cluster.js.map +1 -1
- package/dist/utils/clusterLinks/resolveClusterLinks.d.ts +6 -4
- package/dist/utils/clusterLinks/resolveClusterLinks.js +14 -6
- package/dist/utils/clusterLinks/resolveClusterLinks.js.map +1 -1
- package/dist/utils/hooks/index.d.ts +1 -0
- package/dist/utils/hooks/index.js +1 -0
- package/dist/utils/hooks/index.js.map +1 -1
- package/dist/utils/hooks/useCompactionFeature.d.ts +13 -0
- package/dist/utils/hooks/useCompactionFeature.js +20 -0
- package/dist/utils/hooks/useCompactionFeature.js.map +1 -0
- package/dist/utils/hooks/useStartCompaction.d.ts +7 -0
- package/dist/utils/hooks/useStartCompaction.js +22 -0
- package/dist/utils/hooks/useStartCompaction.js.map +1 -0
- package/package.json +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.d.ts +0 -42
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js +0 -252
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js.map +0 -1
|
@@ -1,16 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as NiceModal from '@ebay/nice-modal-react';
|
|
1
3
|
import type { TOperation } from '../../../../../../types/api/operations';
|
|
2
4
|
import './CompactTableAction.scss';
|
|
3
5
|
interface CompactTableActionProps {
|
|
4
6
|
runningCompaction?: TOperation;
|
|
5
7
|
isFetching: boolean;
|
|
6
|
-
isStarting: boolean;
|
|
7
8
|
onApply: (value: {
|
|
8
9
|
cascade: boolean;
|
|
9
10
|
parallel?: number;
|
|
10
11
|
}) => Promise<void>;
|
|
11
12
|
}
|
|
12
|
-
export declare function CompactTableStatusBanner({ operation }: {
|
|
13
|
+
export declare function CompactTableStatusBanner({ operation, onCancel, isCancelling, }: {
|
|
13
14
|
operation: TOperation;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
isCancelling: boolean;
|
|
14
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function CompactTableAction({ runningCompaction, isFetching,
|
|
18
|
+
export declare function CompactTableAction({ runningCompaction, isFetching, onApply, }: CompactTableActionProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
interface CompactTableDialogProps {
|
|
20
|
+
onApply: (value: {
|
|
21
|
+
cascade: boolean;
|
|
22
|
+
parallel?: number;
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
hasRunningCompaction: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const CompactTableDialogNiceModal: React.FC<CompactTableDialogProps & NiceModal.NiceModalHocProps>;
|
|
27
|
+
export declare function openCompactTableDialog(props: CompactTableDialogProps): void;
|
|
16
28
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import * as NiceModal from '@ebay/nice-modal-react';
|
|
4
|
+
import { CircleStop, GearPlay } from '@gravity-ui/icons';
|
|
4
5
|
import { ActionTooltip, Button, Dialog, Flex, Icon, Popover, Switch, Text, TextInput, } from '@gravity-ui/uikit';
|
|
5
6
|
import { CompactState } from '../../../../../../types/api/operations';
|
|
6
7
|
import { cn } from '../../../../../../utils/cn';
|
|
@@ -11,6 +12,7 @@ import i18n from '../i18n';
|
|
|
11
12
|
import './CompactTableAction.scss';
|
|
12
13
|
const b = cn('ydb-diagnostics-table-info');
|
|
13
14
|
const DEFAULT_PARALLEL_SHARDS = '1';
|
|
15
|
+
const COMPACT_TABLE_DIALOG = 'compact-table-dialog';
|
|
14
16
|
function parseParallel(value) {
|
|
15
17
|
if (!value.trim()) {
|
|
16
18
|
return undefined;
|
|
@@ -50,33 +52,32 @@ function CompactTableStatusDetails({ operation }) {
|
|
|
50
52
|
total: shardProgress.shardsTotal,
|
|
51
53
|
}) }))] }));
|
|
52
54
|
}
|
|
53
|
-
export function CompactTableStatusBanner({ operation }) {
|
|
55
|
+
export function CompactTableStatusBanner({ operation, onCancel, isCancelling, }) {
|
|
54
56
|
const progress = getProgress(operation);
|
|
55
57
|
const progressWidth = `${progress}%`;
|
|
56
|
-
return (_jsxs(Flex, { className: b('compaction-banner'), gap: "3", alignItems: "flex-start", children: [_jsx(Icon, { className: b('compaction-banner-icon'), data: GearPlay, size: 20 }), _jsxs(Flex, { direction: "column", gap: "2", className: b('compaction-banner-content'), children: [_jsx(Text, { variant: "subheader-2", children: i18n('title_compaction-in-progress') }), _jsx(Text, { variant: "body-1", children: i18n('context_compaction-in-progress') }), _jsx("div", { className: b('compaction-progress'), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": progress, children: _jsx("div", { className: b('compaction-progress-fill'), style: { width: progressWidth } }) }), _jsx(Text, { variant: "body-1", color: "secondary", children: i18n('context_compaction-progress', {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
return (_jsxs(Flex, { className: b('compaction-banner'), gap: "3", alignItems: "flex-start", children: [_jsx(Icon, { className: b('compaction-banner-icon'), data: GearPlay, size: 20 }), _jsxs(Flex, { gap: "5", alignItems: "center", grow: true, children: [_jsxs(Flex, { direction: "column", gap: "2", className: b('compaction-banner-content'), children: [_jsx(Text, { variant: "subheader-2", children: i18n('title_compaction-in-progress') }), _jsx(Text, { variant: "body-1", children: i18n('context_compaction-in-progress') }), _jsx("div", { className: b('compaction-progress'), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": progress, children: _jsx("div", { className: b('compaction-progress-fill'), style: { width: progressWidth } }) }), _jsx(Text, { variant: "body-1", color: "secondary", children: i18n('context_compaction-progress', {
|
|
59
|
+
progress,
|
|
60
|
+
status: getCompactionProgressDescription(operation),
|
|
61
|
+
}) })] }), _jsxs(Button, { view: "normal-contrast", onClick: onCancel, loading: isCancelling, disabled: isCancelling, "aria-label": i18n('action_stop-compaction'), children: [_jsx(Icon, { data: CircleStop, size: 16 }), i18n('action_stop')] })] })] }));
|
|
60
62
|
}
|
|
61
|
-
export function CompactTableAction({ runningCompaction, isFetching,
|
|
62
|
-
const [dialogOpen, setDialogOpen] = React.useState(false);
|
|
63
|
-
const handleCloseDialog = React.useCallback(() => {
|
|
64
|
-
setDialogOpen(false);
|
|
65
|
-
}, []);
|
|
63
|
+
export function CompactTableAction({ runningCompaction, isFetching, onApply, }) {
|
|
66
64
|
const handleOpenDialog = React.useCallback(() => {
|
|
67
65
|
reachMetricaGoal('openCompactionDialog');
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
openCompactTableDialog({
|
|
67
|
+
onApply,
|
|
68
|
+
hasRunningCompaction: Boolean(runningCompaction),
|
|
69
|
+
});
|
|
70
|
+
}, [onApply, runningCompaction]);
|
|
71
|
+
const button = (_jsxs(Button, { view: "normal", size: "s", onClick: handleOpenDialog, disabled: Boolean(runningCompaction), loading: isFetching && !runningCompaction, "aria-label": i18n('action_compaction'), children: [_jsx(Icon, { data: GearPlay, size: 16 }), i18n('action_compaction')] }));
|
|
72
|
+
return runningCompaction ? (_jsx(Popover, { content: _jsx(CompactTableStatusDetails, { operation: runningCompaction }), placement: "bottom-end", children: _jsx("span", { className: b('compaction-disabled-button-wrapper'), children: button }) })) : (_jsx(ActionTooltip, { title: i18n('action_run-compaction'), children: button }));
|
|
72
73
|
}
|
|
73
|
-
function CompactTableDialog({ open, onClose, onApply,
|
|
74
|
+
function CompactTableDialog({ open, onClose, onApply, hasRunningCompaction, }) {
|
|
74
75
|
const [cascade, setCascade] = React.useState(true);
|
|
75
76
|
const [parallel, setParallel] = React.useState(DEFAULT_PARALLEL_SHARDS);
|
|
76
77
|
const [parallelError, setParallelError] = React.useState('');
|
|
77
78
|
const [requestErrorMessage, setRequestErrorMessage] = React.useState('');
|
|
78
|
-
const
|
|
79
|
-
const submitDisabled =
|
|
79
|
+
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
80
|
+
const submitDisabled = isSubmitting || hasRunningCompaction;
|
|
80
81
|
const resetFormState = React.useCallback(() => {
|
|
81
82
|
setCascade(true);
|
|
82
83
|
setParallel(DEFAULT_PARALLEL_SHARDS);
|
|
@@ -98,7 +99,7 @@ function CompactTableDialog({ open, onClose, onApply, loading, hasRunningCompact
|
|
|
98
99
|
}, []);
|
|
99
100
|
const handleSubmit = React.useCallback(async (event) => {
|
|
100
101
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
101
|
-
if (submitDisabled
|
|
102
|
+
if (submitDisabled) {
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
const parsedParallel = parseParallel(parallel);
|
|
@@ -107,7 +108,7 @@ function CompactTableDialog({ open, onClose, onApply, loading, hasRunningCompact
|
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
110
|
setRequestErrorMessage('');
|
|
110
|
-
|
|
111
|
+
setIsSubmitting(true);
|
|
111
112
|
try {
|
|
112
113
|
reachMetricaGoal('startCompaction');
|
|
113
114
|
await onApply({
|
|
@@ -120,12 +121,30 @@ function CompactTableDialog({ open, onClose, onApply, loading, hasRunningCompact
|
|
|
120
121
|
setRequestErrorMessage(prepareErrorMessage(error));
|
|
121
122
|
}
|
|
122
123
|
finally {
|
|
123
|
-
|
|
124
|
+
setIsSubmitting(false);
|
|
124
125
|
}
|
|
125
126
|
}, [cascade, handleClose, onApply, parallel, submitDisabled]);
|
|
126
|
-
return (_jsxs(Dialog, { open: open, size: "s", onClose: handleClose, children: [_jsx(Dialog.Header, { caption: _jsx(Text, { variant: "subheader-3", children: i18n('title_run-table-compaction') }) }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsx(Dialog.Body, { className: b('compaction-dialog-body'), children: _jsxs(Flex, { direction: "column", gap: "4", alignItems: "flex-start", children: [_jsxs(Flex, { className: b('compaction-dialog-row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "tableCompactionCascade", className: b('compaction-label'), children: i18n('field_cascade') }), _jsx(Switch, { id: "tableCompactionCascade", checked: cascade, onUpdate: handleCascadeUpdate })] }), _jsxs(Flex, { className: b('compaction-dialog-row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "tableCompactionParallel", className: b('compaction-label'), children: i18n('field_parallel-shards') }), _jsx(TextInput, { id: "tableCompactionParallel", type: "number", value: parallel, onUpdate: handleParallelUpdate, className: b('compaction-input'), errorMessage: parallelError, validationState: parallelError ? 'invalid' : undefined, hasClear: true })] }), requestErrorMessage && (_jsx(Text, { color: "danger", className: b('compaction-error'), title: requestErrorMessage, children: requestErrorMessage }))] }) }), _jsx(Dialog.Footer, { textButtonCancel: i18n('action_cancel'), textButtonApply: i18n('action_start-compaction'), onClickButtonCancel: handleClose, loading:
|
|
127
|
+
return (_jsxs(Dialog, { open: open, size: "s", onClose: handleClose, children: [_jsx(Dialog.Header, { caption: _jsx(Text, { variant: "subheader-3", children: i18n('title_run-table-compaction') }) }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsx(Dialog.Body, { className: b('compaction-dialog-body'), children: _jsxs(Flex, { direction: "column", gap: "4", alignItems: "flex-start", children: [_jsxs(Flex, { className: b('compaction-dialog-row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "tableCompactionCascade", className: b('compaction-label'), children: i18n('field_cascade') }), _jsx(Switch, { id: "tableCompactionCascade", checked: cascade, onUpdate: handleCascadeUpdate })] }), _jsxs(Flex, { className: b('compaction-dialog-row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "tableCompactionParallel", className: b('compaction-label'), children: i18n('field_parallel-shards') }), _jsx(TextInput, { id: "tableCompactionParallel", type: "number", value: parallel, onUpdate: handleParallelUpdate, className: b('compaction-input'), errorMessage: parallelError, validationState: parallelError ? 'invalid' : undefined, hasClear: true })] }), requestErrorMessage && (_jsx(Text, { color: "danger", className: b('compaction-error'), title: requestErrorMessage, children: requestErrorMessage }))] }) }), _jsx(Dialog.Footer, { textButtonCancel: i18n('action_cancel'), textButtonApply: i18n('action_start-compaction'), onClickButtonCancel: handleClose, loading: isSubmitting, propsButtonApply: {
|
|
127
128
|
type: 'submit',
|
|
128
129
|
disabled: submitDisabled,
|
|
129
130
|
} })] })] }));
|
|
130
131
|
}
|
|
132
|
+
export const CompactTableDialogNiceModal = NiceModal.create((props) => {
|
|
133
|
+
const modal = NiceModal.useModal();
|
|
134
|
+
const handleClose = () => {
|
|
135
|
+
modal.hide();
|
|
136
|
+
modal.remove();
|
|
137
|
+
};
|
|
138
|
+
return (_jsx(CompactTableDialog, { ...props, onApply: async (value) => {
|
|
139
|
+
await props.onApply(value);
|
|
140
|
+
handleClose();
|
|
141
|
+
}, onClose: handleClose, open: modal.visible }));
|
|
142
|
+
});
|
|
143
|
+
NiceModal.register(COMPACT_TABLE_DIALOG, CompactTableDialogNiceModal);
|
|
144
|
+
export function openCompactTableDialog(props) {
|
|
145
|
+
NiceModal.show(COMPACT_TABLE_DIALOG, {
|
|
146
|
+
id: COMPACT_TABLE_DIALOG,
|
|
147
|
+
...props,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
131
150
|
//# sourceMappingURL=CompactTableAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactTableAction.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/CompactTableAction/CompactTableAction.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CompactTableAction.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/CompactTableAction/CompactTableAction.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACH,aAAa,EACb,MAAM,EACN,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,GACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAC,YAAY,EAAC,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAC,EAAE,EAAC,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,6CAA6C,CAAC;AAChF,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AACnE,OAAO,IAAI,MAAM,SAAS,CA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AAO,EAAE,YAAY,EACrB,gBAAgB,EAAE;4BACd,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,cAAc;yBAC3B,GACH,IACC,IACF,CACZ,CAAC;AACN,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,KAA8B,EAAE,EAAE;IAC3F,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;IAEnC,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,KAAK,CAAC,MAAM,EAAE,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,kBAAkB,OACX,KAAK,EACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACrB,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC3B,WAAW,EAAE,CAAC;QAClB,CAAC,EACD,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,CAAC,OAAO,GACrB,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,CAAC;AAEtE,MAAM,UAAU,sBAAsB,CAAC,KAA8B;IACjE,SAAS,CAAC,IAAI,CAAC,oBAAoB,EAAE;QACjC,EAAE,EAAE,oBAAoB;QACxB,GAAG,KAAK;KACX,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -2,25 +2,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ChevronDown, ChevronUp, Gear } from '@gravity-ui/icons';
|
|
4
4
|
import { ActionTooltip, Button, Disclosure, Flex, Icon } from '@gravity-ui/uikit';
|
|
5
|
-
import { YDBDefinitionList } from '../../../../../components/YDBDefinitionList/YDBDefinitionList';
|
|
6
|
-
import { useFeatureFlagsAvailable } from '../../../../../store/reducers/capabilities/hooks';
|
|
7
|
-
import { configsApi } from '../../../../../store/reducers/configs';
|
|
8
5
|
import { operationsApi } from '../../../../../store/reducers/operations';
|
|
9
|
-
import { tablePartitioningApi } from '../../../../../store/reducers/tablePartitioning/tablePartitioning';
|
|
10
6
|
import { EPathType } from '../../../../../types/api/schema';
|
|
11
7
|
import { cn } from '../../../../../utils/cn';
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import { findRunningTableCompactionOperation, isForcedCompactionEnabled, } from '../../../../../utils/tableCompaction';
|
|
15
|
-
import { reachMetricaGoal } from '../../../../../utils/yaMetrica';
|
|
8
|
+
import { useCompactionFeature } from '../../../../../utils/hooks/useCompactionFeature';
|
|
9
|
+
import { useStartCompaction } from '../../../../../utils/hooks/useStartCompaction';
|
|
16
10
|
import { EntityTitle } from '../../../EntityTitle/EntityTitle';
|
|
17
11
|
import { isRowTableType } from '../../../utils/schema';
|
|
18
12
|
import { CompactTableAction, CompactTableStatusBanner, } from './CompactTableAction/CompactTableAction';
|
|
19
|
-
import { openManagePartitioningDialog } from './ManagePartitioningDialog/ManagePartitioningDialog';
|
|
20
13
|
import { PartitionsProgress } from './PartitionsProgress/PartitionsProgress';
|
|
14
|
+
import { TableInfoSection } from './components/TableInfoSection';
|
|
15
|
+
import { useTableCompaction } from './hooks/useTableCompaction';
|
|
16
|
+
import { useTablePartitioning } from './hooks/useTablePartitioning';
|
|
21
17
|
import i18n from './i18n';
|
|
22
18
|
import { prepareTableInfo } from './prepareTableInfo';
|
|
23
|
-
import { prepareUpdatePartitioningRequest } from './utils';
|
|
24
19
|
import './TableInfo.scss';
|
|
25
20
|
export const b = cn('ydb-diagnostics-table-info');
|
|
26
21
|
const TableInfoHeader = ({ data }) => {
|
|
@@ -31,45 +26,41 @@ const TableInfoHeader = ({ data }) => {
|
|
|
31
26
|
return _jsx("div", { className: b('title'), children: title });
|
|
32
27
|
};
|
|
33
28
|
export const TableInfo = ({ data, type, database, path }) => {
|
|
34
|
-
const [autoRefreshInterval] = useAutoRefreshInterval();
|
|
35
29
|
const isRowTable = type === EPathType.EPathTypeTable;
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
const [
|
|
39
|
-
|
|
30
|
+
// Prepare all table information
|
|
31
|
+
const tableInfo = React.useMemo(() => prepareTableInfo(data, type), [data, type]);
|
|
32
|
+
const { generalInfoLeft = [], generalInfoRight = [], generalStats = [], tableStatsInfo = [], generalMetrics = [], tabletMetricsInfo = [], partitionConfigInfo = [], partitionProgressConfig, managePartitioningDialogConfig, } = tableInfo;
|
|
33
|
+
// Calculate if there's expandable content
|
|
40
34
|
const hasMoreLeft = tableStatsInfo.some((items) => items.length > 0);
|
|
41
35
|
const hasMoreRight = tabletMetricsInfo.length > 0 || partitionConfigInfo.length > 0;
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
skip: !compactionEnabled,
|
|
49
|
-
});
|
|
50
|
-
const runningCompaction = React.useMemo(() => findRunningTableCompactionOperation(compactionOperations, path), [compactionOperations, path]);
|
|
51
|
-
const [startTableCompaction, { isLoading: isCompactionStarting }] = operationsApi.useStartTableCompactionMutation();
|
|
52
|
-
const handleOpenManagePartitioning = React.useCallback(() => {
|
|
53
|
-
reachMetricaGoal('openManagePartitioning');
|
|
54
|
-
openManagePartitioningDialog({
|
|
55
|
-
initialValue: managePartitioningDialogConfig,
|
|
56
|
-
onApply: async (value) => {
|
|
57
|
-
reachMetricaGoal('applyManagePartitioning');
|
|
58
|
-
await updatePartitioning(prepareUpdatePartitioningRequest(value, database, path)).unwrap();
|
|
59
|
-
createToast({
|
|
60
|
-
name: 'updateTablePartitioning',
|
|
61
|
-
content: i18n('toast_partitioning-updated'),
|
|
62
|
-
autoHiding: 3000,
|
|
63
|
-
isClosable: true,
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
}, [managePartitioningDialogConfig, database, path, updatePartitioning]);
|
|
36
|
+
// Compaction logic (only for row tables)
|
|
37
|
+
const { compactionEnabled } = useCompactionFeature(database, isRowTable);
|
|
38
|
+
const compactionEnabledForTable = isRowTable && compactionEnabled;
|
|
39
|
+
const { runningCompaction, isFetching: isCompactionFetching } = useTableCompaction(database, path, compactionEnabledForTable);
|
|
40
|
+
const startCompaction = useStartCompaction();
|
|
41
|
+
const [cancelOperation, { isLoading: isCancellingOperation }] = operationsApi.useCancelOperationMutation();
|
|
68
42
|
const handleStartCompaction = React.useCallback(async ({ cascade, parallel }) => {
|
|
69
|
-
await
|
|
70
|
-
|
|
71
|
-
|
|
43
|
+
await startCompaction({
|
|
44
|
+
database,
|
|
45
|
+
path,
|
|
46
|
+
cascade,
|
|
47
|
+
parallel,
|
|
48
|
+
});
|
|
49
|
+
}, [database, path, startCompaction]);
|
|
50
|
+
const handleCancelCompaction = React.useCallback(async () => {
|
|
51
|
+
if (!(runningCompaction === null || runningCompaction === void 0 ? void 0 : runningCompaction.id)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await cancelOperation({ database, id: runningCompaction.id }).unwrap();
|
|
55
|
+
}, [database, cancelOperation, runningCompaction === null || runningCompaction === void 0 ? void 0 : runningCompaction.id]);
|
|
56
|
+
// Partitioning logic
|
|
57
|
+
const { handleOpenManagePartitioning } = useTablePartitioning(database, path, managePartitioningDialogConfig);
|
|
58
|
+
// UI state
|
|
59
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
60
|
+
const handleExpandedChange = React.useCallback((value) => setExpanded(value), []);
|
|
61
|
+
const hasMore = React.useMemo(() => hasMoreLeft || hasMoreRight, [hasMoreLeft, hasMoreRight]);
|
|
62
|
+
return (_jsxs("div", { className: b(), children: [compactionEnabledForTable && runningCompaction && (_jsx(CompactTableStatusBanner, { operation: runningCompaction, onCancel: handleCancelCompaction, isCancelling: isCancellingOperation })), _jsxs(Flex, { className: b('header'), justifyContent: "space-between", alignItems: "center", gap: "2", children: [_jsx(TableInfoHeader, { data: data }), _jsxs(Flex, { gap: "2", alignItems: "center", children: [managePartitioningDialogConfig && (_jsx(ActionTooltip, { title: i18n('action_manage-partition-config'), children: _jsxs(Button, { view: "normal", size: "s", onClick: handleOpenManagePartitioning, "aria-label": i18n('action_manage-partition-config'), children: [_jsx(Icon, { data: Gear, size: 16 }), i18n('action_manage-partitioning')] }) })), compactionEnabledForTable && (_jsx(CompactTableAction, { runningCompaction: runningCompaction, isFetching: isCompactionFetching, onApply: handleStartCompaction }, `${database}/${path}`))] })] }), partitionProgressConfig && (_jsx("div", { className: b('progress-bar'), children: _jsx(PartitionsProgress, { minPartitions: partitionProgressConfig.minPartitions, partitionsCount: partitionProgressConfig.partitionsCount, maxPartitions: partitionProgressConfig.maxPartitions }) })), _jsxs("div", { className: b('row', { 'general-info': true }), children: [_jsx("div", { className: b('col'), children: _jsx(TableInfoSection, { items: generalInfoLeft, className: b('info-block') }) }), _jsx("div", { className: b('col'), children: _jsx(TableInfoSection, { items: generalInfoRight, className: b('info-block') }) })] }), _jsxs("div", { className: b('row'), children: [_jsx("div", { className: b('col'), children: _jsx(TableInfoSection, { items: generalStats, title: i18n('title_table-stats'), className: b('info-block') }) }), _jsx("div", { className: b('col'), children: _jsx(TableInfoSection, { items: generalMetrics, title: i18n('title_tablet-metrics'), className: b('info-block') }) })] }), hasMore ? (_jsxs(Disclosure, { className: b('show-more-disclosure'), expanded: expanded, onUpdate: handleExpandedChange, children: [_jsx(Disclosure.Summary, { children: (props) => (_jsxs(Button, { onClick: props.onClick, view: "normal", size: "s", children: [expanded ? i18n('button_show-less') : i18n('button_show-more'), _jsx(Icon, { data: expanded ? ChevronUp : ChevronDown, size: 16 })] })) }), _jsx(Disclosure.Details, { children: _jsxs("div", { className: b('row'), children: [_jsx("div", { className: b('col'), children: tableStatsInfo
|
|
72
63
|
.filter((items) => items.length > 0)
|
|
73
|
-
.map((items, index) => (_jsx(
|
|
64
|
+
.map((items, index) => (_jsx(TableInfoSection, { items: items, className: b('info-block') }, index))) }), _jsxs("div", { className: b('col'), children: [_jsx(TableInfoSection, { items: tabletMetricsInfo, className: b('info-block') }), _jsx(TableInfoSection, { items: partitionConfigInfo, title: i18n('title_partition-config'), className: b('info-block') })] })] }) })] })) : null] }));
|
|
74
65
|
};
|
|
75
66
|
//# sourceMappingURL=TableInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableInfo.js","sourceRoot":"","sources":["../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"TableInfo.js","sourceRoot":"","sources":["../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEhF,OAAO,EAAC,aAAa,EAAC,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAC,SAAS,EAAC,MAAM,iCAAiC,CAAC;AAE1D,OAAO,EAAC,EAAE,EAAC,MAAM,yBAAyB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAC,kBAAkB,EAAC,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAC,cAAc,EAAC,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KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;yCACnC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACnB,KAAC,gBAAgB,IAEb,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,IAFrB,KAAK,CAGZ,CACL,CAAC,GACJ,EAEN,eAAK,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,aACpB,KAAC,gBAAgB,IACb,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,GAC5B,EACF,KAAC,gBAAgB,IACb,KAAK,EAAE,mBAAmB,EAC1B,KAAK,EAAE,IAAI,CAAC,wBAAwB,CAAC,EACrC,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,GAC5B,IACA,IACJ,GACW,IACZ,CAChB,CAAC,CAAC,CAAC,IAAI,IACN,CACT,CAAC;AACN,CAAC,CAAC"}
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/components/TableInfoSection.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { YDBDefinitionListItem } from '../../../../../../components/YDBDefinitionList/YDBDefinitionList';
|
|
3
|
+
interface TableInfoSectionProps {
|
|
4
|
+
items: YDBDefinitionListItem[];
|
|
5
|
+
title?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Reusable component for rendering a section of table information.
|
|
10
|
+
* Displays a YDBDefinitionList with consistent styling and behavior.
|
|
11
|
+
* Returns null if items array is empty.
|
|
12
|
+
* @param items - Array of definition list items to display
|
|
13
|
+
* @param title - Optional section title
|
|
14
|
+
* @param className - Optional additional CSS class
|
|
15
|
+
*/
|
|
16
|
+
export declare const TableInfoSection: React.NamedExoticComponent<TableInfoSectionProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { YDBDefinitionList } from '../../../../../../components/YDBDefinitionList/YDBDefinitionList';
|
|
4
|
+
/**
|
|
5
|
+
* Reusable component for rendering a section of table information.
|
|
6
|
+
* Displays a YDBDefinitionList with consistent styling and behavior.
|
|
7
|
+
* Returns null if items array is empty.
|
|
8
|
+
* @param items - Array of definition list items to display
|
|
9
|
+
* @param title - Optional section title
|
|
10
|
+
* @param className - Optional additional CSS class
|
|
11
|
+
*/
|
|
12
|
+
export const TableInfoSection = React.memo(({ items, title, className }) => {
|
|
13
|
+
if (items.length === 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(YDBDefinitionList, { items: items, title: title, className: className, nameMaxWidth: "auto", responsive: true }));
|
|
17
|
+
});
|
|
18
|
+
TableInfoSection.displayName = 'TableInfoSection';
|
|
19
|
+
//# sourceMappingURL=TableInfoSection.js.map
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/components/TableInfoSection.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableInfoSection.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/components/TableInfoSection.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,iBAAiB,EAAC,MAAM,kEAAkE,CAAC;AAQnG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CAAwB,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,EAAE,EAAE;IAC5F,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,KAAC,iBAAiB,IACd,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAC,MAAM,EACnB,UAAU,SACZ,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TOperation } from '../../../../../../types/api/operations';
|
|
2
|
+
interface UseTableCompactionResult {
|
|
3
|
+
operations: TOperation[] | undefined;
|
|
4
|
+
runningCompaction: TOperation | undefined;
|
|
5
|
+
isFetching: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hook for managing table compaction operations.
|
|
9
|
+
* Automatically fetches all pages of compaction operations and tracks running compaction.
|
|
10
|
+
* @param database - Database path
|
|
11
|
+
* @param path - Table path
|
|
12
|
+
* @param enabled - Whether compaction feature is enabled
|
|
13
|
+
* @returns Compaction operations data and loading state
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTableCompaction(database: string, path: string, enabled: boolean): UseTableCompactionResult;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { operationsApi } from '../../../../../../store/reducers/operations';
|
|
3
|
+
import { useAutoRefreshInterval } from '../../../../../../utils/hooks';
|
|
4
|
+
import { TABLE_COMPACTION_OPERATION_PAGE_SIZE, findRunningTableCompactionOperation, } from '../../../../../../utils/tableCompaction';
|
|
5
|
+
/**
|
|
6
|
+
* Hook for managing table compaction operations.
|
|
7
|
+
* Automatically fetches all pages of compaction operations and tracks running compaction.
|
|
8
|
+
* @param database - Database path
|
|
9
|
+
* @param path - Table path
|
|
10
|
+
* @param enabled - Whether compaction feature is enabled
|
|
11
|
+
* @returns Compaction operations data and loading state
|
|
12
|
+
*/
|
|
13
|
+
export function useTableCompaction(database, path, enabled) {
|
|
14
|
+
const [autoRefreshInterval] = useAutoRefreshInterval();
|
|
15
|
+
const { currentData: compactionData, isFetching, hasNextPage, fetchNextPage, } = operationsApi.useGetOperationListInfiniteQuery({ database, kind: 'compaction', page_size: TABLE_COMPACTION_OPERATION_PAGE_SIZE }, {
|
|
16
|
+
pollingInterval: autoRefreshInterval,
|
|
17
|
+
skip: !enabled,
|
|
18
|
+
});
|
|
19
|
+
// Automatically fetch all pages to get complete list of operations
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (hasNextPage && !isFetching) {
|
|
22
|
+
fetchNextPage();
|
|
23
|
+
}
|
|
24
|
+
}, [hasNextPage, isFetching, fetchNextPage]);
|
|
25
|
+
const operations = React.useMemo(() => { var _a; return (_a = compactionData === null || compactionData === void 0 ? void 0 : compactionData.pages) === null || _a === void 0 ? void 0 : _a.flatMap((page) => { var _a; return (_a = page.operations) !== null && _a !== void 0 ? _a : []; }); }, [compactionData]);
|
|
26
|
+
const runningCompaction = React.useMemo(() => findRunningTableCompactionOperation(operations, path), [operations, path]);
|
|
27
|
+
return {
|
|
28
|
+
operations,
|
|
29
|
+
runningCompaction,
|
|
30
|
+
isFetching,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=useTableCompaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTableCompaction.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTableCompaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,6CAA6C,CAAC;AAE1E,OAAO,EAAC,sBAAsB,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACH,oCAAoC,EACpC,mCAAmC,GACtC,MAAM,yCAAyC,CAAC;AAQjD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAC9B,QAAgB,EAChB,IAAY,EACZ,OAAgB;IAEhB,MAAM,CAAC,mBAAmB,CAAC,GAAG,sBAAsB,EAAE,CAAC;IAEvD,MAAM,EACF,WAAW,EAAE,cAAc,EAC3B,UAAU,EACV,WAAW,EACX,aAAa,GAChB,GAAG,aAAa,CAAC,gCAAgC,CAC9C,EAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,oCAAoC,EAAC,EAC/E;QACI,eAAe,EAAE,mBAAmB;QACpC,IAAI,EAAE,CAAC,OAAO;KACjB,CACJ,CAAC;IAEF,mEAAmE;IACnE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,WAAW,IAAI,CAAC,UAAU,EAAE,CAAC;YAC7B,aAAa,EAAE,CAAC;QACpB,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAE7C,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAC5B,GAAG,EAAE,WAAC,OAAA,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,KAAK,0CAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,UAAU,mCAAI,EAAE,CAAA,EAAA,CAAC,CAAA,EAAA,EACrE,CAAC,cAAc,CAAC,CACnB,CAAC;IAEF,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CACnC,GAAG,EAAE,CAAC,mCAAmC,CAAC,UAAU,EAAE,IAAI,CAAC,EAC3D,CAAC,UAAU,EAAE,IAAI,CAAC,CACrB,CAAC;IAEF,OAAO;QACH,UAAU;QACV,iBAAiB;QACjB,UAAU;KACb,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ManagePartitioningFormState } from '../ManagePartitioningDialog/types';
|
|
2
|
+
interface UseTablePartitioningResult {
|
|
3
|
+
handleOpenManagePartitioning: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Hook for managing table partitioning configuration.
|
|
7
|
+
* Handles opening the partitioning dialog and applying changes.
|
|
8
|
+
* @param database - Database path
|
|
9
|
+
* @param path - Table path
|
|
10
|
+
* @param managePartitioningDialogConfig - Initial configuration for the dialog
|
|
11
|
+
* @returns Handler for opening the manage partitioning dialog
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTablePartitioning(database: string, path: string, managePartitioningDialogConfig?: ManagePartitioningFormState): UseTablePartitioningResult;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { tablePartitioningApi } from '../../../../../../store/reducers/tablePartitioning/tablePartitioning';
|
|
3
|
+
import createToast from '../../../../../../utils/createToast';
|
|
4
|
+
import { reachMetricaGoal } from '../../../../../../utils/yaMetrica';
|
|
5
|
+
import { openManagePartitioningDialog } from '../ManagePartitioningDialog/ManagePartitioningDialog';
|
|
6
|
+
import i18n from '../i18n';
|
|
7
|
+
import { prepareUpdatePartitioningRequest } from '../utils';
|
|
8
|
+
/**
|
|
9
|
+
* Hook for managing table partitioning configuration.
|
|
10
|
+
* Handles opening the partitioning dialog and applying changes.
|
|
11
|
+
* @param database - Database path
|
|
12
|
+
* @param path - Table path
|
|
13
|
+
* @param managePartitioningDialogConfig - Initial configuration for the dialog
|
|
14
|
+
* @returns Handler for opening the manage partitioning dialog
|
|
15
|
+
*/
|
|
16
|
+
export function useTablePartitioning(database, path, managePartitioningDialogConfig) {
|
|
17
|
+
const [updatePartitioning] = tablePartitioningApi.useUpdateTablePartitioningMutation();
|
|
18
|
+
const handleOpenManagePartitioning = React.useCallback(() => {
|
|
19
|
+
if (!managePartitioningDialogConfig) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
reachMetricaGoal('openManagePartitioning');
|
|
23
|
+
openManagePartitioningDialog({
|
|
24
|
+
initialValue: managePartitioningDialogConfig,
|
|
25
|
+
onApply: async (value) => {
|
|
26
|
+
reachMetricaGoal('applyManagePartitioning');
|
|
27
|
+
await updatePartitioning(prepareUpdatePartitioningRequest(value, database, path)).unwrap();
|
|
28
|
+
createToast({
|
|
29
|
+
name: 'updateTablePartitioning',
|
|
30
|
+
content: i18n('toast_partitioning-updated'),
|
|
31
|
+
autoHiding: 3000,
|
|
32
|
+
isClosable: true,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}, [managePartitioningDialogConfig, database, path, updatePartitioning]);
|
|
37
|
+
return { handleOpenManagePartitioning };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=useTablePartitioning.js.map
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTablePartitioning.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTablePartitioning.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/hooks/useTablePartitioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,oBAAoB,EAAC,MAAM,sEAAsE,CAAC;AAC1G,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAC,4BAA4B,EAAC,MAAM,sDAAsD,CAAC;AAElG,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAC,gCAAgC,EAAC,MAAM,UAAU,CAAC;AAM1D;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAChC,QAAgB,EAChB,IAAY,EACZ,8BAA4D;IAE5D,MAAM,CAAC,kBAAkB,CAAC,GAAG,oBAAoB,CAAC,kCAAkC,EAAE,CAAC;IAEvF,MAAM,4BAA4B,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxD,IAAI,CAAC,8BAA8B,EAAE,CAAC;YAClC,OAAO;QACX,CAAC;QAED,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;QAC3C,4BAA4B,CAAC;YACzB,YAAY,EAAE,8BAA8B;YAC5C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;gBACrB,gBAAgB,CAAC,yBAAyB,CAAC,CAAC;gBAC5C,MAAM,kBAAkB,CACpB,gCAAgC,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAC1D,CAAC,MAAM,EAAE,CAAC;gBAEX,WAAW,CAAC;oBACR,IAAI,EAAE,yBAAyB;oBAC/B,OAAO,EAAE,IAAI,CAAC,4BAA4B,CAAC;oBAC3C,UAAU,EAAE,IAAI;oBAChB,UAAU,EAAE,IAAI;iBACnB,CAAC,CAAC;YACP,CAAC;SACJ,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEzE,OAAO,EAAC,4BAA4B,EAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
"title_tablet-metrics": "Metrics",
|
|
5
5
|
"title_partition-config": "Partition config",
|
|
6
6
|
"action_cancel": "Cancel",
|
|
7
|
-
"
|
|
7
|
+
"action_stop": "Stop",
|
|
8
|
+
"action_manage-partitioning": "Manage partitioning",
|
|
8
9
|
"action_manage-partition-config": "Manage partition config",
|
|
9
10
|
"action_compaction": "Compaction",
|
|
10
11
|
"action_run-compaction": "Run table compaction",
|
|
12
|
+
"action_stop-compaction": "Stop compaction",
|
|
11
13
|
"button_show-more": "Show more",
|
|
12
14
|
"button_show-less": "Show less",
|
|
13
15
|
"field_current-partitions": "Current partitions",
|
|
14
|
-
"field_ttl-for-rows": "TTL
|
|
16
|
+
"field_ttl-for-rows": "TTL for rows",
|
|
15
17
|
"field_standalone": "Standalone",
|
|
16
18
|
"field_partitioning": "Partitioning",
|
|
17
19
|
"field_partitioning-by-size": "Partitioning by size",
|
|
@@ -46,5 +48,6 @@
|
|
|
46
48
|
"field_compaction-state": "State: {{state}}",
|
|
47
49
|
"field_compaction-progress": "Progress: {{progress}}%",
|
|
48
50
|
"field_compaction-shards": "Shards: {{done}} / {{total}}",
|
|
49
|
-
"toast_partitioning-updated": "Partitioning settings applied"
|
|
51
|
+
"toast_partitioning-updated": "Partitioning settings applied",
|
|
52
|
+
"toast_compaction-started": "Table compaction started"
|
|
50
53
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (key: "
|
|
1
|
+
declare const _default: (key: "action_cancel" | "title_partitioning" | "title_table-stats" | "title_tablet-metrics" | "title_partition-config" | "action_stop" | "action_manage-partitioning" | "action_manage-partition-config" | "action_compaction" | "action_run-compaction" | "action_stop-compaction" | "button_show-more" | "button_show-less" | "field_current-partitions" | "field_ttl-for-rows" | "field_standalone" | "field_partitioning" | "field_partitioning-by-size" | "field_partitioning-by-load" | "field_min-partitions-count" | "field_max-partitions-count" | "field_read-replicas" | "field_bloom-filter" | "field_compression-groups" | "value_ttl-config" | "value_partitioning-by-size-enabled" | "value_enabled" | "value_disabled" | "value_no" | "value_some-groups" | "value_default" | "hint_current-partitions-below-limits" | "hint_current-partitions-exceeds-limits" | "action_start-compaction" | "title_run-table-compaction" | "field_cascade" | "field_parallel-shards" | "alert_positive-integer" | "title_compaction-in-progress" | "context_compaction-in-progress" | "context_compaction-progress" | "value_compaction-starting" | "value_compaction-running" | "value_compaction-done" | "value_compaction-cancelled" | "title_compaction" | "field_compaction-state" | "field_compaction-progress" | "field_compaction-shards" | "toast_partitioning-updated" | "toast_compaction-started", params?: import("@gravity-ui/i18n").Params) => string;
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { YDBDefinitionListItem } from '../../../../../../components/YDBDefinitionList/YDBDefinitionList';
|
|
2
|
+
import { EPathType } from '../../../../../../types/api/schema';
|
|
3
|
+
import type { TEvDescribeSchemeResult } from '../../../../../../types/api/schema';
|
|
4
|
+
import type { ManagePartitioningFormState } from '../ManagePartitioningDialog/types';
|
|
5
|
+
import type { PartitionProgressConfig } from './renderHelpers';
|
|
6
|
+
export type { PartitionProgressConfig } from './renderHelpers';
|
|
7
|
+
export interface PreparedTableInfo {
|
|
8
|
+
generalInfoLeft: YDBDefinitionListItem[];
|
|
9
|
+
generalInfoRight: YDBDefinitionListItem[];
|
|
10
|
+
generalStats: YDBDefinitionListItem[];
|
|
11
|
+
tableStatsInfo: YDBDefinitionListItem[][];
|
|
12
|
+
generalMetrics: YDBDefinitionListItem[];
|
|
13
|
+
tabletMetricsInfo: YDBDefinitionListItem[];
|
|
14
|
+
partitionConfigInfo: YDBDefinitionListItem[];
|
|
15
|
+
partitionProgressConfig?: PartitionProgressConfig;
|
|
16
|
+
managePartitioningDialogConfig?: ManagePartitioningFormState;
|
|
17
|
+
hasMoreLeft: boolean;
|
|
18
|
+
hasMoreRight: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Prepares all table information for display.
|
|
22
|
+
* Handles different table types: Table, ColumnTable, and ColumnStore.
|
|
23
|
+
* @param data - Schema description result from YDB API
|
|
24
|
+
* @param type - Path type (Table, ColumnTable, ColumnStore)
|
|
25
|
+
* @returns Prepared table information organized by sections
|
|
26
|
+
*/
|
|
27
|
+
export declare function prepareTableInfo(data?: TEvDescribeSchemeResult, type?: EPathType): Partial<PreparedTableInfo> & Pick<PreparedTableInfo, 'hasMoreLeft' | 'hasMoreRight'>;
|