ydb-embedded-ui 14.2.0 → 14.3.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/TenantNameWrapper/TenantNameWrapper.d.ts +3 -1
- package/dist/components/TenantNameWrapper/TenantNameWrapper.js +105 -23
- package/dist/components/TenantNameWrapper/TenantNameWrapper.js.map +1 -1
- package/dist/components/TenantNameWrapper/TenantNameWrapper.scss +22 -0
- package/dist/components/TenantNameWrapper/i18n/en.json +3 -1
- package/dist/components/TenantNameWrapper/i18n/index.d.ts +1 -1
- package/dist/components/TenantNameWrapper/utils.d.ts +3 -0
- package/dist/components/TenantNameWrapper/utils.js +14 -0
- package/dist/components/TenantNameWrapper/utils.js.map +1 -0
- package/dist/containers/Clusters/Clusters.js +6 -3
- package/dist/containers/Clusters/Clusters.js.map +1 -1
- package/dist/containers/Clusters/Clusters.scss +8 -0
- package/dist/containers/Clusters/i18n/en.json +2 -2
- package/dist/containers/HomePage/HomePage.js +8 -6
- package/dist/containers/HomePage/HomePage.js.map +1 -1
- package/dist/containers/HomePage/HomePage.scss +1 -0
- package/dist/containers/HomePage/useDatabasesPageEnvironment.js +2 -2
- package/dist/containers/HomePage/useDatabasesPageEnvironment.js.map +1 -1
- package/dist/containers/Node/Node.js +10 -5
- package/dist/containers/Node/Node.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/DefaultEntityInfo.d.ts +8 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/DefaultEntityInfo.js +9 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/DefaultEntityInfo.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/DefaultEntityInfo.scss +7 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/index.d.ts +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/index.js +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/index.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +6 -4
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/ManagePartitioningDialog.d.ts +15 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/ManagePartitioningDialog.js +85 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/ManagePartitioningDialog.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/ManagePartitioningDialog.scss +28 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/SplitUnitSelect.d.ts +12 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/SplitUnitSelect.js +26 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/SplitUnitSelect.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/SplitUnitSelect.scss +14 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/constants.d.ts +10 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/constants.js +20 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/constants.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/en.json +18 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/index.js +5 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/index.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/types.d.ts +8 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/types.js +2 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/types.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/useManagePartitionForm.d.ts +5 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/useManagePartitionForm.js +15 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/useManagePartitionForm.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.d.ts +40 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.js +73 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/PartitionsProgress.js +5 -2
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/PartitionsProgress.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/PartitionsProgress.scss +2 -2
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/helpers.js +9 -5
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/helpers.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.d.ts +3 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js +36 -5
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.scss +12 -6
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/constants.d.ts +0 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/constants.js +0 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/constants.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/en.json +4 -2
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.d.ts +3 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js +37 -12
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/utils.d.ts +3 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/utils.js +15 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/utils.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TransferInfo/Credentials.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckIssues.js +1 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckIssues.js.map +1 -1
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckView.js +6 -2
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckView.js.map +1 -1
- package/dist/containers/Tenant/Healthcheck/i18n/en.json +1 -0
- package/dist/containers/Tenant/Healthcheck/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Healthcheck/shared.d.ts +2 -1
- package/dist/containers/Tenant/Healthcheck/shared.js +9 -2
- package/dist/containers/Tenant/Healthcheck/shared.js.map +1 -1
- package/dist/containers/Tenant/Query/Preview/components/TablePreview.js +5 -0
- package/dist/containers/Tenant/Query/Preview/components/TablePreview.js.map +1 -1
- package/dist/containers/Tenant/utils/schemaActions.js +2 -2
- package/dist/containers/Tenant/utils/schemaActions.js.map +1 -1
- package/dist/containers/Tenants/Tenants.scss +3 -1
- package/dist/containers/Tenants/TenantsClusterTab.js +1 -1
- package/dist/containers/Tenants/TenantsClusterTab.js.map +1 -1
- package/dist/containers/Tenants/TenantsTable.d.ts +4 -2
- package/dist/containers/Tenants/TenantsTable.js +83 -101
- package/dist/containers/Tenants/TenantsTable.js.map +1 -1
- package/dist/containers/Tenants/constants.d.ts +29 -0
- package/dist/containers/Tenants/constants.js +60 -0
- package/dist/containers/Tenants/constants.js.map +1 -0
- package/dist/containers/Tenants/i18n/en.json +10 -2
- package/dist/containers/Tenants/i18n/index.d.ts +1 -1
- package/dist/store/reducers/capabilities/hooks.js +1 -2
- package/dist/store/reducers/capabilities/hooks.js.map +1 -1
- package/dist/store/reducers/environments/utils.js +7 -3
- package/dist/store/reducers/environments/utils.js.map +1 -1
- package/dist/store/reducers/healthcheckInfo/types.d.ts +1 -1
- package/dist/store/reducers/healthcheckInfo/utils.js +19 -9
- package/dist/store/reducers/healthcheckInfo/utils.js.map +1 -1
- package/dist/store/reducers/preview.d.ts +1 -0
- package/dist/store/reducers/preview.js +2 -2
- package/dist/store/reducers/preview.js.map +1 -1
- package/dist/store/reducers/tablePartitioning/tablePartitioning.d.ts +4 -0
- package/dist/store/reducers/tablePartitioning/tablePartitioning.js +41 -0
- package/dist/store/reducers/tablePartitioning/tablePartitioning.js.map +1 -0
- package/dist/types/store/partitioning.d.ts +11 -0
- package/dist/types/store/partitioning.js +2 -0
- package/dist/types/store/partitioning.js.map +1 -0
- package/dist/uiFactory/types.d.ts +23 -2
- package/dist/utils/additionalProps.js +8 -5
- package/dist/utils/additionalProps.js.map +1 -1
- package/dist/utils/bytesParsers/formatBytes.d.ts +2 -2
- package/dist/utils/bytesParsers/formatBytes.js +2 -1
- package/dist/utils/bytesParsers/formatBytes.js.map +1 -1
- package/dist/utils/query.js +7 -8
- package/dist/utils/query.js.map +1 -1
- package/dist/utils/zod/zodParsers.d.ts +3 -0
- package/dist/utils/zod/zodParsers.js +5 -0
- package/dist/utils/zod/zodParsers.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DefaultEntityInfo';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/containers/Tenant/Diagnostics/Overview/DefaultEntityInfo/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -13,6 +13,7 @@ import { SystemViewInfo } from '../../Info/SystemView/SystemView';
|
|
|
13
13
|
import { ViewInfo } from '../../Info/View/View';
|
|
14
14
|
import { AsyncReplicationInfo } from './AsyncReplicationInfo';
|
|
15
15
|
import { ChangefeedInfo } from './ChangefeedInfo';
|
|
16
|
+
import { DefaultEntityInfo } from './DefaultEntityInfo';
|
|
16
17
|
import { StreamingQueryInfo } from './StreamingQueryInfo';
|
|
17
18
|
import { TableInfo } from './TableInfo';
|
|
18
19
|
import { TopicInfo } from './TopicInfo';
|
|
@@ -29,17 +30,18 @@ function Overview({ type, path, database, databaseFullPath }) {
|
|
|
29
30
|
const data = currentData !== null && currentData !== void 0 ? currentData : undefined;
|
|
30
31
|
// verbose mapping to guarantee a correct render for new path types
|
|
31
32
|
// TS will error when a new type is added but not mapped here
|
|
33
|
+
const renderTableInfo = () => (_jsx(TableInfo, { path: path, data: data, type: type, database: database }));
|
|
32
34
|
const pathTypeToComponent = {
|
|
33
35
|
[EPathType.EPathTypeInvalid]: undefined,
|
|
34
36
|
[EPathType.EPathTypeDir]: undefined,
|
|
35
37
|
[EPathType.EPathTypeResourcePool]: undefined,
|
|
36
|
-
[EPathType.EPathTypeTable]:
|
|
38
|
+
[EPathType.EPathTypeTable]: renderTableInfo,
|
|
37
39
|
[EPathType.EPathTypeSysView]: () => _jsx(SystemViewInfo, { data: data }),
|
|
38
40
|
[EPathType.EPathTypeSubDomain]: undefined,
|
|
39
41
|
[EPathType.EPathTypeTableIndex]: () => _jsx(TableIndexInfo, { data: data }),
|
|
40
42
|
[EPathType.EPathTypeExtSubDomain]: undefined,
|
|
41
|
-
[EPathType.EPathTypeColumnStore]:
|
|
42
|
-
[EPathType.EPathTypeColumnTable]:
|
|
43
|
+
[EPathType.EPathTypeColumnStore]: renderTableInfo,
|
|
44
|
+
[EPathType.EPathTypeColumnTable]: renderTableInfo,
|
|
43
45
|
[EPathType.EPathTypeCdcStream]: () => (_jsx(ChangefeedInfo, { path: path, database: database, databaseFullPath: databaseFullPath, data: data })),
|
|
44
46
|
[EPathType.EPathTypePersQueueGroup]: () => (_jsx(TopicInfo, { data: data, path: path, databaseFullPath: databaseFullPath, database: database })),
|
|
45
47
|
[EPathType.EPathTypeExternalTable]: () => _jsx(ExternalTableInfo, { data: data }),
|
|
@@ -49,7 +51,7 @@ function Overview({ type, path, database, databaseFullPath }) {
|
|
|
49
51
|
[EPathType.EPathTypeTransfer]: () => (_jsx(TransferInfo, { path: path, databaseFullPath: databaseFullPath, database: database, data: data })),
|
|
50
52
|
[EPathType.EPathTypeStreamingQuery]: () => (_jsx(StreamingQueryInfo, { path: path, database: database })),
|
|
51
53
|
};
|
|
52
|
-
return (type && ((_a = pathTypeToComponent[type]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent))) || _jsx(
|
|
54
|
+
return (type && ((_a = pathTypeToComponent[type]) === null || _a === void 0 ? void 0 : _a.call(pathTypeToComponent))) || _jsx(DefaultEntityInfo, { data: data });
|
|
53
55
|
};
|
|
54
56
|
if (loading) {
|
|
55
57
|
return _jsx(Loader, { size: "m" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overview.js","sourceRoot":"","sources":["../../../../../src/containers/Tenant/Diagnostics/Overview/Overview.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,aAAa,EAAC,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAC,c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,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,GACZ,CACL;YACD,CAAC,SAAS,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAE,CAAC,CACvC,KAAC,kBAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAI,CACzD;SACJ,CAAC;QAEF,OAAO,CAAC,IAAI,KAAI,MAAA,mBAAmB,CAAC,IAAI,CAAC,mEAAI,CAAA,CAAC,IAAI,KAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,GAAI,CAAC;IACxF,CAAC,CAAC;IAEF,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,KAAC,MAAM,IAAC,IAAI,EAAC,GAAG,GAAG,CAAC;IAC/B,CAAC;IAED,OAAO,CACH,MAAC,KAAK,CAAC,QAAQ,eACV,KAAK,CAAC,CAAC,CAAC,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,EAC9C,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE,IAClC,CACpB,CAAC;AACN,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as NiceModal from '@ebay/nice-modal-react';
|
|
3
|
+
import type { DialogFooterProps } from '@gravity-ui/uikit';
|
|
4
|
+
import type { ManagePartitioningFormState } from './types';
|
|
5
|
+
import './ManagePartitioningDialog.scss';
|
|
6
|
+
interface CommonDialogProps {
|
|
7
|
+
initialValue?: ManagePartitioningFormState;
|
|
8
|
+
onApply?: (value: ManagePartitioningFormState) => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
interface ManagePartitioningDialogNiceModalProps extends CommonDialogProps, DialogFooterProps {
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const ManagePartitioningDialogNiceModal: React.FC<ManagePartitioningDialogNiceModalProps & NiceModal.NiceModalHocProps>;
|
|
14
|
+
export declare function openManagePartitioningDialog(props?: Omit<ManagePartitioningDialogNiceModalProps, 'id'>): Promise<ManagePartitioningFormState | null>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import * as NiceModal from '@ebay/nice-modal-react';
|
|
4
|
+
import { Dialog, Flex, Switch, Text, TextInput } from '@gravity-ui/uikit';
|
|
5
|
+
import { Controller } from 'react-hook-form';
|
|
6
|
+
import { cn } from '../../../../../../utils/cn';
|
|
7
|
+
import { prepareErrorMessage } from '../../../../../../utils/prepareErrorMessage';
|
|
8
|
+
import { DEFAULT_PARTITION_SIZE_TO_SPLIT_BYTES } from '../constants';
|
|
9
|
+
import { SplitUnitSelect } from './SplitUnitSelect';
|
|
10
|
+
import { DEFAULT_MAX_SPLIT_SIZE_GB, MANAGE_PARTITIONING_DIALOG, UNIT_OPTIONS } from './constants';
|
|
11
|
+
import i18n from './i18n';
|
|
12
|
+
import { useManagePartitioningForm } from './useManagePartitionForm';
|
|
13
|
+
import './ManagePartitioningDialog.scss';
|
|
14
|
+
const b = cn(MANAGE_PARTITIONING_DIALOG);
|
|
15
|
+
function ManagePartitioningDialog({ onClose, open, renderButtons, initialValue, onApply, }) {
|
|
16
|
+
const [apiError, setApiError] = React.useState(null);
|
|
17
|
+
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
18
|
+
const { control, handleSubmit, trigger, formState: { errors, isValid }, } = useManagePartitioningForm({
|
|
19
|
+
initialValue,
|
|
20
|
+
maxSplitSizeBytes: DEFAULT_PARTITION_SIZE_TO_SPLIT_BYTES,
|
|
21
|
+
});
|
|
22
|
+
const handleApply = handleSubmit(async (data) => {
|
|
23
|
+
setApiError(null);
|
|
24
|
+
setIsSubmitting(true);
|
|
25
|
+
try {
|
|
26
|
+
await (onApply === null || onApply === void 0 ? void 0 : onApply(data));
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
setApiError(prepareErrorMessage(error));
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
setIsSubmitting(false);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return (_jsxs(Dialog, { size: "s", onClose: onClose, open: open, children: [_jsx(Dialog.Header, { caption: _jsx(Text, { variant: "subheader-3", children: i18n('title_manage-partitioning') }) }), _jsxs("form", { onSubmit: handleApply, children: [_jsx(Dialog.Body, { className: b('body'), children: _jsxs(Flex, { direction: "column", gap: "3", alignItems: "flex-start", children: [_jsx(Text, { variant: "subheader-1", children: i18n('title_partitioning') }), _jsxs(Flex, { className: b('row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "splitSize", className: b('label'), children: i18n('field_split-size') }), _jsx(Controller, { name: "splitSize", control: control, render: ({ field }) => {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_jsx(TextInput, { id: "splitSize", type: "number", value: field.value, onUpdate: field.onChange, className: b('input'), errorMessage: (_a = errors.splitSize) === null || _a === void 0 ? void 0 : _a.message, validationState: errors.splitSize ? 'invalid' : undefined, endContent: _jsx(Controller, { name: "splitUnit", control: control, render: ({ field: unitField }) => (_jsx(SplitUnitSelect, { value: unitField.value, options: UNIT_OPTIONS, onChange: (nextUnit) => {
|
|
38
|
+
unitField.onChange(nextUnit);
|
|
39
|
+
trigger('splitSize');
|
|
40
|
+
} })) }) }));
|
|
41
|
+
} }), _jsx(Text, { variant: "body-1", className: b('hint'), children: i18n('context_split-size-maximum', {
|
|
42
|
+
maxGb: DEFAULT_MAX_SPLIT_SIZE_GB,
|
|
43
|
+
}) })] }), _jsxs(Flex, { className: b('row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "loadEnabled", className: b('label'), children: i18n('field_load') }), _jsx(Controller, { name: "loadEnabled", control: control, render: ({ field }) => (_jsx(Switch, { id: "loadEnabled", checked: field.value, onUpdate: field.onChange })) })] }), _jsx(Text, { variant: "subheader-1", children: i18n('title_limits') }), _jsxs(Flex, { className: b('row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "minimum", className: b('label'), children: i18n('field_minimum') }), _jsx(Controller, { name: "minimum", control: control, render: ({ field }) => {
|
|
44
|
+
var _a;
|
|
45
|
+
return (_jsx(TextInput, { id: "minimum", type: "number", value: field.value, onUpdate: (next) => {
|
|
46
|
+
field.onChange(next);
|
|
47
|
+
trigger('maximum'); // revalidate dependent field to clear stale error
|
|
48
|
+
}, className: b('input'), errorMessage: (_a = errors.minimum) === null || _a === void 0 ? void 0 : _a.message, validationState: errors.minimum ? 'invalid' : undefined }));
|
|
49
|
+
} })] }), _jsxs(Flex, { className: b('row'), gap: "3", alignItems: "center", children: [_jsx("label", { htmlFor: "maximum", className: b('label'), children: i18n('field_maximum') }), _jsx(Controller, { name: "maximum", control: control, render: ({ field }) => {
|
|
50
|
+
var _a;
|
|
51
|
+
return (_jsx(TextInput, { id: "maximum", type: "number", value: field.value, onUpdate: (next) => {
|
|
52
|
+
field.onChange(next);
|
|
53
|
+
trigger('minimum'); // revalidate dependent field to clear stale error
|
|
54
|
+
}, className: b('input'), errorMessage: (_a = errors.maximum) === null || _a === void 0 ? void 0 : _a.message, validationState: errors.maximum ? 'invalid' : undefined }));
|
|
55
|
+
} })] }), apiError && (_jsx(Text, { color: "danger", title: apiError, children: _jsx("div", { children: apiError }) }))] }) }), _jsx(Dialog.Footer, { textButtonApply: i18n('action_apply'), textButtonCancel: i18n('action_cancel'), onClickButtonCancel: onClose, loading: isSubmitting, renderButtons: renderButtons, propsButtonApply: {
|
|
56
|
+
type: 'submit',
|
|
57
|
+
disabled: isSubmitting || !isValid,
|
|
58
|
+
} })] })] }));
|
|
59
|
+
}
|
|
60
|
+
export const ManagePartitioningDialogNiceModal = NiceModal.create((props) => {
|
|
61
|
+
const modal = NiceModal.useModal();
|
|
62
|
+
const handleClose = () => {
|
|
63
|
+
modal.hide();
|
|
64
|
+
modal.remove();
|
|
65
|
+
};
|
|
66
|
+
return (_jsx(ManagePartitioningDialog, { ...props, onApply: async (value) => {
|
|
67
|
+
var _a;
|
|
68
|
+
await ((_a = props.onApply) === null || _a === void 0 ? void 0 : _a.call(props, value));
|
|
69
|
+
modal.resolve(value);
|
|
70
|
+
handleClose();
|
|
71
|
+
}, onClose: () => {
|
|
72
|
+
var _a;
|
|
73
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
74
|
+
modal.resolve(null);
|
|
75
|
+
handleClose();
|
|
76
|
+
}, open: modal.visible }));
|
|
77
|
+
});
|
|
78
|
+
NiceModal.register(MANAGE_PARTITIONING_DIALOG, ManagePartitioningDialogNiceModal);
|
|
79
|
+
export function openManagePartitioningDialog(props) {
|
|
80
|
+
return NiceModal.show(MANAGE_PARTITIONING_DIALOG, {
|
|
81
|
+
id: MANAGE_PARTITIONING_DIALOG,
|
|
82
|
+
...props,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=ManagePartitioningDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManagePartitioningDialog.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/ManagePartitioningDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAC,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAC,EAAE,EAAC,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAC,qCAAqC,EAAC,MAAM,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;QAClB,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;;YACV,MAAA,KAAK,CAAC,OAAO,qDAAI,CAAC;YAClB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACpB,WAAW,EAAE,CAAC;QAClB,CAAC,EACD,IAAI,EAAE,KAAK,CAAC,OAAO,GACrB,CACL,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,iCAAiC,CAAC,CAAC;AAElF,MAAM,UAAU,4BAA4B,CACxC,KAA0D;IAE1D,OAAO,SAAS,CAAC,IAAI,CAAC,0BAA0B,EAAE;QAC9C,EAAE,EAAE,0BAA0B;QAC9B,GAAG,KAAK;KACX,CAAgD,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use '../../../../../../styles/mixins.scss';
|
|
2
|
+
|
|
3
|
+
.manage-partitioning-dialog {
|
|
4
|
+
&__body {
|
|
5
|
+
padding-top: var(--g-spacing-3);
|
|
6
|
+
padding-bottom: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&__row {
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__hint,
|
|
14
|
+
&__label {
|
|
15
|
+
color: var(--g-color-text-secondary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__label {
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: 80px;
|
|
21
|
+
|
|
22
|
+
@include mixins.body-1-typography();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__input {
|
|
26
|
+
max-width: 212px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SelectProps } from '@gravity-ui/uikit';
|
|
2
|
+
import type { UnitOptionsType } from './constants';
|
|
3
|
+
import './SplitUnitSelect.scss';
|
|
4
|
+
interface SplitUnitSelectProps {
|
|
5
|
+
value: string;
|
|
6
|
+
options: UnitOptionsType;
|
|
7
|
+
width?: number;
|
|
8
|
+
size?: SelectProps['size'];
|
|
9
|
+
onChange: (nextValue: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function SplitUnitSelect({ value, options, width, size, onChange, }: SplitUnitSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ArrowToggle, Button, Flex, Select, Text } from '@gravity-ui/uikit';
|
|
4
|
+
import { cn } from '../../../../../../utils/cn';
|
|
5
|
+
import './SplitUnitSelect.scss';
|
|
6
|
+
const b = cn('split-unit-select');
|
|
7
|
+
export function SplitUnitSelect({ value, options, width = 55, size = 's', onChange, }) {
|
|
8
|
+
var _a;
|
|
9
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
10
|
+
const selected = React.useMemo(() => options.find((option) => option.value === value), [options, value]);
|
|
11
|
+
const selectedLabel = (_a = selected === null || selected === void 0 ? void 0 : selected.content) !== null && _a !== void 0 ? _a : value;
|
|
12
|
+
const handleOpenChange = React.useCallback((nextOpen) => {
|
|
13
|
+
setIsOpen(nextOpen);
|
|
14
|
+
}, []);
|
|
15
|
+
const handleToggleOpen = React.useCallback(() => {
|
|
16
|
+
setIsOpen((open) => !open);
|
|
17
|
+
}, []);
|
|
18
|
+
const renderControl = React.useCallback(() => (_jsx(Button, { type: "button", className: b('button'), size: size, onClick: handleToggleOpen, children: _jsxs(Flex, { justifyContent: "space-between", alignItems: "center", gap: "1", className: b('button-content'), children: [_jsx(Text, { children: selectedLabel }), _jsx(ArrowToggle, { direction: "bottom" })] }) })), [handleToggleOpen, selectedLabel, size]);
|
|
19
|
+
return (_jsx(Select, { size: size, className: b('select'), options: options, value: [value], open: isOpen, width: width, onOpenChange: handleOpenChange, renderControl: renderControl, onUpdate: (next) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const nextUnit = (_a = next === null || next === void 0 ? void 0 : next[0]) !== null && _a !== void 0 ? _a : value;
|
|
22
|
+
onChange(nextUnit);
|
|
23
|
+
setIsOpen(false);
|
|
24
|
+
} }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=SplitUnitSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitUnitSelect.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/SplitUnitSelect.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAC,EAAE,EAAC,MAAM,4BAA4B,CAAC;AAI9C,OAAO,wBAAwB,CAAC;AAEhC,MAAM,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC;AAUlC,MAAM,UAAU,eAAe,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,KAAK,GAAG,EAAE,EACV,IAAI,GAAG,GAAG,EACV,QAAQ,GACW;;IACnB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,EACtD,CAAC,OAAO,EAAE,KAAK,CAAC,CACnB,CAAC;IACF,MAAM,aAAa,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,mCAAI,KAAK,CAAC;IAEjD,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAiB,EAAE,EAAE;QAC7D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AAC,GACH,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BytesSizes } from '../../../../../../utils/bytesParsers';
|
|
2
|
+
import type { ManagePartitioningFormState } from './types';
|
|
3
|
+
export type UnitOptionsType = Array<{
|
|
4
|
+
value: BytesSizes;
|
|
5
|
+
content: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const UNIT_OPTIONS: UnitOptionsType;
|
|
8
|
+
export declare const DEFAULT_MAX_SPLIT_SIZE_GB: string;
|
|
9
|
+
export declare const DEFAULT_MANAGE_PARTITIONING_VALUE: ManagePartitioningFormState;
|
|
10
|
+
export declare const MANAGE_PARTITIONING_DIALOG = "manage-partitioning-dialog";
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/constants.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatBytes, sizes } from '../../../../../../utils/bytesParsers';
|
|
2
|
+
import { DEFAULT_PARTITION_SIZE_TO_SPLIT_BYTES } from '../constants';
|
|
3
|
+
export const UNIT_OPTIONS = Object.keys(sizes).map((value) => ({
|
|
4
|
+
value,
|
|
5
|
+
content: sizes[value].label,
|
|
6
|
+
}));
|
|
7
|
+
export const DEFAULT_MAX_SPLIT_SIZE_GB = formatBytes({
|
|
8
|
+
value: DEFAULT_PARTITION_SIZE_TO_SPLIT_BYTES,
|
|
9
|
+
size: 'gb',
|
|
10
|
+
withSizeLabel: false,
|
|
11
|
+
});
|
|
12
|
+
export const DEFAULT_MANAGE_PARTITIONING_VALUE = {
|
|
13
|
+
splitSize: DEFAULT_MAX_SPLIT_SIZE_GB,
|
|
14
|
+
splitUnit: 'gb',
|
|
15
|
+
loadEnabled: true,
|
|
16
|
+
minimum: '40',
|
|
17
|
+
maximum: '1000',
|
|
18
|
+
};
|
|
19
|
+
export const MANAGE_PARTITIONING_DIALOG = 'manage-partitioning-dialog';
|
|
20
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,KAAK,EAAC,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAC,qCAAqC,EAAC,MAAM,cAAc,CAAC;AAMnE,MAAM,CAAC,MAAM,YAAY,GAAqB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAkB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9F,KAAK;IACL,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK;CAC9B,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;IACjD,KAAK,EAAE,qCAAqC;IAC5C,IAAI,EAAE,IAAI;IACV,aAAa,EAAE,KAAK;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAgC;IAC1E,SAAS,EAAE,yBAAyB;IACpC,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC"}
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/en.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title_manage-partitioning": "Manage partitioning",
|
|
3
|
+
"title_partitioning": "Partitioning",
|
|
4
|
+
"title_limits": "Limits",
|
|
5
|
+
"field_split-size": "Split Size",
|
|
6
|
+
"context_split-size-maximum": "{{maxGb}} GB maximum",
|
|
7
|
+
"field_load": "Load",
|
|
8
|
+
"field_minimum": "Minimum",
|
|
9
|
+
"field_maximum": "Maximum",
|
|
10
|
+
"action_cancel": "Cancel",
|
|
11
|
+
"action_apply": "Apply",
|
|
12
|
+
"error_invalid-unit": "Invalid unit",
|
|
13
|
+
"error_required": "The field is required",
|
|
14
|
+
"error_value-greater-maximum": "Value must not be greater than maximum",
|
|
15
|
+
"error_minimum-greater-maximum": "Minimum must not be greater than maximum",
|
|
16
|
+
"error_maximum-less-minimum": "Maximum must not be less than minimum",
|
|
17
|
+
"error_value-too-small": "Value must be at least 1 MB"
|
|
18
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: (key: "action_cancel" | "action_apply" | "title_manage-partitioning" | "title_partitioning" | "title_limits" | "field_split-size" | "context_split-size-maximum" | "field_load" | "field_minimum" | "field_maximum" | "error_invalid-unit" | "error_required" | "error_value-greater-maximum" | "error_minimum-greater-maximum" | "error_maximum-less-minimum" | "error_value-too-small", params?: import("@gravity-ui/i18n").Params) => string;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,MAAM,SAAS,GAAG,4BAA4B,CAAC;AAE/C,eAAe,eAAe,CAAC,SAAS,EAAE,EAAC,EAAE,EAAC,CAAC,CAAC"}
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ManagePartitioningFormState } from './types';
|
|
2
|
+
export declare function useManagePartitioningForm(params: {
|
|
3
|
+
initialValue?: ManagePartitioningFormState;
|
|
4
|
+
maxSplitSizeBytes: number;
|
|
5
|
+
}): import("react-hook-form").UseFormReturn<ManagePartitioningFormState, any, undefined>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
+
import { useForm } from 'react-hook-form';
|
|
4
|
+
import { getManagePartitioningInitialValues, managePartitioningSchema } from './utils';
|
|
5
|
+
export function useManagePartitioningForm(params) {
|
|
6
|
+
const { initialValue, maxSplitSizeBytes } = params;
|
|
7
|
+
const schema = React.useMemo(() => managePartitioningSchema(maxSplitSizeBytes), [maxSplitSizeBytes]);
|
|
8
|
+
const form = useForm({
|
|
9
|
+
defaultValues: getManagePartitioningInitialValues(initialValue),
|
|
10
|
+
resolver: zodResolver(schema),
|
|
11
|
+
mode: 'onChange',
|
|
12
|
+
});
|
|
13
|
+
return form;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=useManagePartitionForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useManagePartitionForm.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/useManagePartitionForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAGxC,OAAO,EAAC,kCAAkC,EAAE,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAErF,MAAM,UAAU,yBAAyB,CAAC,MAGzC;IACG,MAAM,EAAC,YAAY,EAAE,iBAAiB,EAAC,GAAG,MAAM,CAAC;IAEjD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CACxB,GAAG,EAAE,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,EACjD,CAAC,iBAAiB,CAAC,CACtB,CAAC;IAEF,MAAM,IAAI,GAAG,OAAO,CAA8B;QAC9C,aAAa,EAAE,kCAAkC,CAAC,YAAY,CAAC;QAC/D,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC;QAC7B,IAAI,EAAE,UAAU;KACnB,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BytesSizes } from '../../../../../../utils/bytesParsers';
|
|
3
|
+
import type { ManagePartitioningFormState } from './types';
|
|
4
|
+
export declare function splitToPartitionSizeMb(splitSize: number, splitUnit: BytesSizes): {
|
|
5
|
+
bytes: number;
|
|
6
|
+
partitionSizeMb: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function getManagePartitioningInitialValues(initialData?: Partial<ManagePartitioningFormState>): ManagePartitioningFormState;
|
|
9
|
+
export declare const splitUnitSchema: z.ZodType<"b" | "kb" | "mb" | "gb" | "tb", z.ZodTypeDef, "b" | "kb" | "mb" | "gb" | "tb">;
|
|
10
|
+
export declare const managePartitioningSchema: (maxSplitSizeBytes?: number) => z.ZodEffects<z.ZodObject<{
|
|
11
|
+
splitSize: z.ZodEffects<z.ZodNumber, number, unknown>;
|
|
12
|
+
splitUnit: z.ZodType<"b" | "kb" | "mb" | "gb" | "tb", z.ZodTypeDef, "b" | "kb" | "mb" | "gb" | "tb">;
|
|
13
|
+
loadEnabled: z.ZodBoolean;
|
|
14
|
+
minimum: z.ZodEffects<z.ZodNumber, number, unknown>;
|
|
15
|
+
maximum: z.ZodEffects<z.ZodNumber, number, unknown>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
minimum: number;
|
|
18
|
+
maximum: number;
|
|
19
|
+
splitSize: number;
|
|
20
|
+
splitUnit: "b" | "kb" | "mb" | "gb" | "tb";
|
|
21
|
+
loadEnabled: boolean;
|
|
22
|
+
}, {
|
|
23
|
+
splitUnit: "b" | "kb" | "mb" | "gb" | "tb";
|
|
24
|
+
loadEnabled: boolean;
|
|
25
|
+
minimum?: unknown;
|
|
26
|
+
maximum?: unknown;
|
|
27
|
+
splitSize?: unknown;
|
|
28
|
+
}>, {
|
|
29
|
+
minimum: number;
|
|
30
|
+
maximum: number;
|
|
31
|
+
splitSize: number;
|
|
32
|
+
splitUnit: "b" | "kb" | "mb" | "gb" | "tb";
|
|
33
|
+
loadEnabled: boolean;
|
|
34
|
+
}, {
|
|
35
|
+
splitUnit: "b" | "kb" | "mb" | "gb" | "tb";
|
|
36
|
+
loadEnabled: boolean;
|
|
37
|
+
minimum?: unknown;
|
|
38
|
+
maximum?: unknown;
|
|
39
|
+
splitSize?: unknown;
|
|
40
|
+
}>;
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { convertToBytes, sizes } from '../../../../../../utils/bytesParsers';
|
|
3
|
+
import { preprocessEmptyStringToUndefined } from '../../../../../../utils/zod/zodParsers';
|
|
4
|
+
import { DEFAULT_PARTITION_SIZE_TO_SPLIT_BYTES } from '../constants';
|
|
5
|
+
import { DEFAULT_MANAGE_PARTITIONING_VALUE } from './constants';
|
|
6
|
+
import i18n from './i18n';
|
|
7
|
+
export function splitToPartitionSizeMb(splitSize, splitUnit) {
|
|
8
|
+
const bytes = convertToBytes(splitSize, splitUnit);
|
|
9
|
+
const partitionSizeMb = Math.round(bytes / sizes.mb.value);
|
|
10
|
+
return { bytes, partitionSizeMb };
|
|
11
|
+
}
|
|
12
|
+
export function getManagePartitioningInitialValues(initialData = {}) {
|
|
13
|
+
return {
|
|
14
|
+
...DEFAULT_MANAGE_PARTITIONING_VALUE,
|
|
15
|
+
...initialData,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export const splitUnitSchema = z.custom((value) => {
|
|
19
|
+
return value in sizes;
|
|
20
|
+
}, i18n('error_invalid-unit'));
|
|
21
|
+
// Required positive number (> 0)
|
|
22
|
+
const requiredPositiveNumber = (requiredMessage) => preprocessEmptyStringToUndefined(z.coerce
|
|
23
|
+
.number({
|
|
24
|
+
required_error: requiredMessage,
|
|
25
|
+
invalid_type_error: requiredMessage,
|
|
26
|
+
})
|
|
27
|
+
.gt(0));
|
|
28
|
+
// Required positive integer (> 0)
|
|
29
|
+
const requiredPositiveInt = (requiredMessage) => preprocessEmptyStringToUndefined(z.coerce
|
|
30
|
+
.number({
|
|
31
|
+
required_error: requiredMessage,
|
|
32
|
+
invalid_type_error: requiredMessage,
|
|
33
|
+
})
|
|
34
|
+
.int()
|
|
35
|
+
.gt(0));
|
|
36
|
+
export const managePartitioningSchema = (maxSplitSizeBytes = DEFAULT_PARTITION_SIZE_TO_SPLIT_BYTES) => z
|
|
37
|
+
.object({
|
|
38
|
+
splitSize: requiredPositiveNumber(i18n('error_required')),
|
|
39
|
+
splitUnit: splitUnitSchema,
|
|
40
|
+
loadEnabled: z.boolean(),
|
|
41
|
+
minimum: requiredPositiveInt(i18n('error_required')),
|
|
42
|
+
maximum: requiredPositiveInt(i18n('error_required')),
|
|
43
|
+
})
|
|
44
|
+
.superRefine((data, ctx) => {
|
|
45
|
+
const { bytes, partitionSizeMb } = splitToPartitionSizeMb(data.splitSize, data.splitUnit);
|
|
46
|
+
if (bytes > maxSplitSizeBytes) {
|
|
47
|
+
ctx.addIssue({
|
|
48
|
+
code: z.ZodIssueCode.custom,
|
|
49
|
+
path: ['splitSize'],
|
|
50
|
+
message: i18n('error_value-greater-maximum'),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (partitionSizeMb < 1) {
|
|
54
|
+
ctx.addIssue({
|
|
55
|
+
code: z.ZodIssueCode.custom,
|
|
56
|
+
path: ['splitSize'],
|
|
57
|
+
message: i18n('error_value-too-small'),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (data.minimum > data.maximum) {
|
|
61
|
+
ctx.addIssue({
|
|
62
|
+
code: z.ZodIssueCode.custom,
|
|
63
|
+
path: ['minimum'],
|
|
64
|
+
message: i18n('error_minimum-greater-maximum'),
|
|
65
|
+
});
|
|
66
|
+
ctx.addIssue({
|
|
67
|
+
code: z.ZodIssueCode.custom,
|
|
68
|
+
path: ['maximum'],
|
|
69
|
+
message: i18n('error_maximum-less-minimum'),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=utils.js.map
|
package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/ManagePartitioningDialog/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAC,cAAc,EAAE,KAAK,EAAC,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAC,gCAAgC,EAAC,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAC,qCAAqC,EAAC,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAC,iCAAiC,EAAC,MAAM,aAAa,CAAC;AAC9D,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,MAAM,UAAU,sBAAsB,CAAC,SAAiB,EAAE,SAAqB;IAC3E,MAAM,KAAK,GAAG,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,kCAAkC,CAC9C,cAAoD,EAAE;IAEtD,OAAO;QACH,GAAG,iCAA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,CAAC,CAAC;IAExF,IAAI,KAAK,GAAG,iBAAiB,EAAE,CAAC;QAC5B,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,WAAW,CAAC;YACnB,OAAO,EAAE,IAAI,CAAC,6BAA6B,CAAC;SAC/C,CAAC,CAAC;IACP,CAAC;IAED,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;QACtB,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,WAAW,CAAC;YACnB,OAAO,EAAE,IAAI,CAAC,uBAAuB,CAAC;SACzC,CAAC,CAAC;IACP,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9B,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,SAAS,CAAC;YACjB,OAAO,EAAE,IAAI,CAAC,+BAA+B,CAAC;SACjD,CAAC,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,SAAS,CAAC;YACjB,OAAO,EAAE,IAAI,CAAC,4BAA4B,CAAC;SAC9C,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Flex, Popover, Text } from '@gravity-ui/uikit';
|
|
3
3
|
import { isNil } from 'lodash';
|
|
4
4
|
import { cn } from '../../../../../../utils/cn';
|
|
5
|
+
import { formatNumber } from '../../../../../../utils/dataFormatters/dataFormatters';
|
|
5
6
|
import { getPartitionsTooltip } from './helpers';
|
|
6
7
|
import i18n from './i18n';
|
|
7
8
|
import { FULL_FILL_VALUE, calcPartitionsProgress } from './utils';
|
|
@@ -24,9 +25,11 @@ export const PartitionsProgress = ({ minPartitions, maxPartitions, partitionsCou
|
|
|
24
25
|
isBelowMin: isBelowMin,
|
|
25
26
|
isAboveMax: isAboveMax,
|
|
26
27
|
});
|
|
27
|
-
const
|
|
28
|
+
const minLabel = formatNumber(min);
|
|
29
|
+
const maxLabel = isNil(max) ? i18n('value_no-limit') : formatNumber(max);
|
|
30
|
+
const currentLabel = formatNumber(partitionsCount);
|
|
28
31
|
const hasAdditionalSegments = isBelowMin || isAboveMax;
|
|
29
32
|
const withMinFill = !hasAdditionalSegments;
|
|
30
|
-
return (_jsx(Popover, { hasArrow: true, placement: "top", content: tooltip, className: b('segment-touched'), children: _jsxs(Flex, { alignItems: "center", gap: "0.5", className: b(null, className), children: [isBelowMin && (_jsxs(Flex, { style: { flexGrow: leftSegmentUnits }, direction: "column", gap: "2", className: b('segment', SEGMENT_MODS.additional), children: [_jsx(SegmentProgressBar, { position: "additional", value: FULL_FILL_VALUE }), _jsx(Flex, { justifyContent: "flex-start", children: _jsx(Text, { variant: "body-2", color: "secondary", children:
|
|
33
|
+
return (_jsx(Popover, { hasArrow: true, placement: "top", content: tooltip, className: b('segment-touched'), children: _jsxs(Flex, { alignItems: "center", gap: "0.5", className: b(null, className), children: [isBelowMin && (_jsxs(Flex, { style: { flexGrow: leftSegmentUnits }, direction: "column", gap: "2", className: b('segment', SEGMENT_MODS.additional), children: [_jsx(SegmentProgressBar, { position: "additional", value: FULL_FILL_VALUE }), _jsx(Flex, { justifyContent: "flex-start", children: _jsx(Text, { variant: "body-2", color: "secondary", children: currentLabel }) })] })), _jsxs(Flex, { direction: "column", className: b('segment', SEGMENT_MODS.main), style: { flexGrow: mainSegmentUnits }, gap: "2", children: [_jsx(SegmentProgressBar, { position: "main", value: mainProgressValue, withMinFill: withMinFill }), _jsxs(Flex, { justifyContent: "space-between", gap: "2", children: [_jsx(Text, { variant: "body-2", color: "secondary", children: minLabel }), _jsx(Text, { variant: "body-2", color: "secondary", children: maxLabel })] })] }), isAboveMax && (_jsxs(Flex, { direction: "column", gap: "2", className: b('segment', SEGMENT_MODS.additional), style: { flexGrow: rightSegmentUnits }, children: [_jsx(SegmentProgressBar, { position: "additional", value: FULL_FILL_VALUE }), _jsx(Flex, { justifyContent: "flex-end", children: _jsx(Text, { variant: "body-2", color: "secondary", children: currentLabel }) })] }))] }) }));
|
|
31
34
|
};
|
|
32
35
|
//# sourceMappingURL=PartitionsProgress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartitionsProgress.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/PartitionsProgress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,KAAK,EAAC,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAC,EAAE,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"PartitionsProgress.js","sourceRoot":"","sources":["../../../../../../../src/containers/Tenant/Diagnostics/Overview/TableInfo/PartitionsProgress/PartitionsProgress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,KAAK,EAAC,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAC,EAAE,EAAC,MAAM,4BAA4B,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,uDAAuD,CAAC;AAEnF,OAAO,EAAC,oBAAoB,EAAC,MAAM,WAAW,CAAC;AAC/C,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAEhE,OAAO,2BAA2B,CAAC;AAEnC,MAAM,CAAC,G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