ydb-embedded-ui 20.4.0 → 20.5.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/InfoViewer/formatters/pqGroup.d.ts +5 -1
- package/dist/components/InfoViewer/formatters/pqGroup.js +24 -2
- package/dist/components/InfoViewer/formatters/pqGroup.js.map +1 -1
- package/dist/components/InfoViewer/i18n/en.json +8 -1
- package/dist/components/InfoViewer/i18n/index.d.ts +1 -1
- package/dist/containers/App/Content.js +9 -2
- package/dist/containers/App/Content.js.map +1 -1
- package/dist/containers/App/clusterRouteGuard.d.ts +5 -0
- package/dist/containers/App/clusterRouteGuard.js +13 -0
- package/dist/containers/App/clusterRouteGuard.js.map +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.js +17 -3
- package/dist/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.js.map +1 -1
- package/dist/types/api/schema/persQueueGroup.d.ts +16 -0
- package/dist/types/api/schema/persQueueGroup.js +7 -0
- package/dist/types/api/schema/persQueueGroup.js.map +1 -1
- package/package.json +2 -2
- package/src/components/InfoViewer/formatters/pqGroup.ts +30 -2
- package/src/components/InfoViewer/i18n/en.json +8 -1
- package/src/containers/App/Content.tsx +9 -1
- package/src/containers/App/clusterRouteGuard.ts +24 -0
- package/src/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.ts +23 -2
- package/src/types/api/schema/persQueueGroup.ts +19 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TPQPartitionConfig, TPQTabletConfig, TPersQueueGroupDescription } from '../../../types/api/schema';
|
|
1
|
+
import type { TPQPartitionConfig, TPQPartitionStrategy, TPQTabletConfig, TPersQueueGroupDescription } from '../../../types/api/schema';
|
|
2
2
|
export declare const formatPQGroupItem: <Key extends keyof TPersQueueGroupDescription>(label: Key, value: TPersQueueGroupDescription[Key]) => {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | TPersQueueGroupDescription[Key] | null | undefined;
|
|
@@ -11,3 +11,7 @@ export declare const formatPQPartitionConfig: <Key extends keyof TPQPartitionCon
|
|
|
11
11
|
label: string;
|
|
12
12
|
value: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | TPQPartitionConfig[Key] | null | undefined;
|
|
13
13
|
};
|
|
14
|
+
export declare const formatPQPartitionStrategy: <Key extends keyof TPQPartitionStrategy>(label: Key, value: TPQPartitionStrategy[Key]) => {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | TPQPartitionStrategy[Key] | null | undefined;
|
|
17
|
+
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { EMeteringMode } from '../../../types/api/schema';
|
|
2
|
-
import { HOUR_IN_SECONDS } from '../../../utils/constants';
|
|
1
|
+
import { EMeteringMode, EPQPartitionStrategyType } from '../../../types/api/schema';
|
|
2
|
+
import { EMPTY_DATA_PLACEHOLDER, HOUR_IN_SECONDS } from '../../../utils/constants';
|
|
3
3
|
import { formatBps, formatBytes, formatNumber } from '../../../utils/dataFormatters/dataFormatters';
|
|
4
|
+
import i18n from '../i18n';
|
|
4
5
|
import { createInfoFormatter } from '../utils';
|
|
5
6
|
const EMeteringModeToNames = {
|
|
6
7
|
[EMeteringMode.METERING_MODE_REQUEST_UNITS]: 'request-units',
|
|
7
8
|
[EMeteringMode.METERING_MODE_RESERVED_CAPACITY]: 'reserved-capacity',
|
|
8
9
|
};
|
|
10
|
+
const EPQPartitionStrategyTypeToNames = {
|
|
11
|
+
[EPQPartitionStrategyType.DISABLED]: i18n('value_autopartitioning-disabled'),
|
|
12
|
+
[EPQPartitionStrategyType.CAN_SPLIT]: i18n('value_autopartitioning-up'),
|
|
13
|
+
[EPQPartitionStrategyType.CAN_SPLIT_AND_MERGE]: i18n('value_autopartitioning-up-and-down'),
|
|
14
|
+
[EPQPartitionStrategyType.PAUSED]: i18n('value_autopartitioning-paused'),
|
|
15
|
+
};
|
|
9
16
|
export const formatPQGroupItem = createInfoFormatter({
|
|
10
17
|
values: {
|
|
11
18
|
Partitions: (value) => formatNumber((value === null || value === void 0 ? void 0 : value.length) || 0),
|
|
@@ -38,4 +45,19 @@ export const formatPQPartitionConfig = createInfoFormatter({
|
|
|
38
45
|
WriteSpeedInBytesPerSecond: 'Partitions write speed',
|
|
39
46
|
},
|
|
40
47
|
});
|
|
48
|
+
const formatPartitionCount = (value) => value === undefined ? EMPTY_DATA_PLACEHOLDER : formatNumber(value);
|
|
49
|
+
export const formatPQPartitionStrategy = createInfoFormatter({
|
|
50
|
+
values: {
|
|
51
|
+
// Fall back to the raw enum value so a strategy introduced by a newer YDB
|
|
52
|
+
// version still renders the Autopartitioning row instead of being dropped.
|
|
53
|
+
PartitionStrategyType: (value) => { var _a; return value && ((_a = EPQPartitionStrategyTypeToNames[value]) !== null && _a !== void 0 ? _a : value); },
|
|
54
|
+
MinPartitionCount: formatPartitionCount,
|
|
55
|
+
MaxPartitionCount: formatPartitionCount,
|
|
56
|
+
},
|
|
57
|
+
labels: {
|
|
58
|
+
PartitionStrategyType: i18n('field_autopartitioning'),
|
|
59
|
+
MinPartitionCount: i18n('field_min-partitions-count'),
|
|
60
|
+
MaxPartitionCount: i18n('field_max-partitions-count'),
|
|
61
|
+
},
|
|
62
|
+
});
|
|
41
63
|
//# sourceMappingURL=pqGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pqGroup.js","sourceRoot":"","sources":["../../../../src/components/InfoViewer/formatters/pqGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pqGroup.js","sourceRoot":"","sources":["../../../../src/components/Info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,IAAI,CAAC,wBAAwB,CAAC;QACrD,iBAAiB,EAAE,IAAI,CAAC,4BAA4B,CAAC;QACrD,iBAAiB,EAAE,IAAI,CAAC,4BAA4B,CAAC;KACxD;CACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common.created": "Created",
|
|
3
3
|
"common.type": "Type",
|
|
4
|
-
"no-data": "No data"
|
|
4
|
+
"no-data": "No data",
|
|
5
|
+
"field_autopartitioning": "Autopartitioning",
|
|
6
|
+
"field_min-partitions-count": "Min partitions count",
|
|
7
|
+
"field_max-partitions-count": "Max partitions count",
|
|
8
|
+
"value_autopartitioning-disabled": "Disabled",
|
|
9
|
+
"value_autopartitioning-up": "Up",
|
|
10
|
+
"value_autopartitioning-up-and-down": "Up and down",
|
|
11
|
+
"value_autopartitioning-paused": "Paused"
|
|
5
12
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (key: "no-data" | "common.created" | "common.type", params?: import("@gravity-ui/i18n").Params) => string;
|
|
1
|
+
declare const _default: (key: "no-data" | "common.created" | "common.type" | "field_autopartitioning" | "field_min-partitions-count" | "field_max-partitions-count" | "value_autopartitioning-disabled" | "value_autopartitioning-up" | "value_autopartitioning-up-and-down" | "value_autopartitioning-paused", params?: import("@gravity-ui/i18n").Params) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
|
-
import { Redirect, Route, Switch } from 'react-router-dom';
|
|
4
|
+
import { Redirect, Route, Switch, useLocation } from 'react-router-dom';
|
|
5
5
|
import { Unauthenticated } from '../../components/Errors/401';
|
|
6
6
|
import { AccessDenied } from '../../components/Errors/403';
|
|
7
7
|
import { LoaderWrapper } from '../../components/LoaderWrapper/LoaderWrapper';
|
|
@@ -18,6 +18,7 @@ import Authentication from '../Authentication/Authentication';
|
|
|
18
18
|
import { GetUser } from '../GetUserWrapper/GetUserWrapper';
|
|
19
19
|
import { Header } from '../Header/Header';
|
|
20
20
|
import { ClusterSlot, HomePageSlot, NodeSlot, PDiskPageSlot, RedirectSlot, RoutesSlot, StorageGroupSlot, TabletSlot, TenantSlot, VDiskPageSlot, } from './appSlots';
|
|
21
|
+
import { shouldRedirectClusterRouteToRoot } from './clusterRouteGuard';
|
|
21
22
|
import { getLegacyClusterTenantsRedirect, getLegacyTenantRedirect } from './legacyRedirects';
|
|
22
23
|
import './App.scss';
|
|
23
24
|
const b = cn('app');
|
|
@@ -97,10 +98,16 @@ export function Content(props) {
|
|
|
97
98
|
var _a;
|
|
98
99
|
const { singleClusterMode } = props;
|
|
99
100
|
const slots = useSlots(props);
|
|
101
|
+
const currentLocation = useLocation();
|
|
102
|
+
const shouldRedirectToRoot = shouldRedirectClusterRouteToRoot({
|
|
103
|
+
singleClusterMode,
|
|
104
|
+
pathname: currentLocation.pathname,
|
|
105
|
+
search: currentLocation.search,
|
|
106
|
+
});
|
|
100
107
|
const additionalRoutes = slots.get(RoutesSlot);
|
|
101
108
|
const redirect = slots.get(RedirectSlot);
|
|
102
109
|
const redirectProps = (_a = redirect === null || redirect === void 0 ? void 0 : redirect.props) !== null && _a !== void 0 ? _a : (singleClusterMode ? { to: getClusterPath() } : { to: routes.homePage });
|
|
103
|
-
return (_jsxs(Switch, { children: [additionalRoutes === null || additionalRoutes === void 0 ? void 0 : additionalRoutes.rendered, _jsxs(Route, { children: [_jsx(Header, {}), _jsxs(Switch, { children: [_jsx(Route, { path: `/:environment?/${CLUSTER}/tenants`, exact: true, render: ({ location }) => (_jsx(Redirect, { to: getLegacyClusterTenantsRedirect(location) })) }), _jsx(Route, { path: routes.legacyTenant, render: ({ location }) => _jsx(Redirect, { to: getLegacyTenantRedirect(location) }) }), singleClusterMode
|
|
110
|
+
return (_jsxs(Switch, { children: [additionalRoutes === null || additionalRoutes === void 0 ? void 0 : additionalRoutes.rendered, shouldRedirectToRoot ? _jsx(Redirect, { to: "/" }) : null, _jsxs(Route, { children: [_jsx(Header, {}), _jsxs(Switch, { children: [_jsx(Route, { path: `/:environment?/${CLUSTER}/tenants`, exact: true, render: ({ location }) => (_jsx(Redirect, { to: getLegacyClusterTenantsRedirect(location) })) }), _jsx(Route, { path: routes.legacyTenant, render: ({ location }) => _jsx(Redirect, { to: getLegacyTenantRedirect(location) }) }), singleClusterMode
|
|
104
111
|
? null
|
|
105
112
|
: multiClusterRoutes.map((route) => {
|
|
106
113
|
return renderRouteSlot(slots, route);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../src/containers/App/Content.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../src/containers/App/Content.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,8CAA8C,CAAC;AAC3E,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAGhD,OAAO,MAAM,EAAE,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAE7D,OAAO,EACH,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,E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ChB,KAAC,cAAc,IAAC,QAAQ,SAAG,GACT,GAClB,CACX,EACD,KAAC,KAAK,cACF,cAAK,SAAS,EAAE,CAAC,CAAC,EAAC,QAAQ,EAAE,iBAAiB,EAAC,CAAC,YAC3C,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAsB,EAAE,GAC1D,GACF,IACH,CACZ,CAAC;AACN,CAAC;AAED,SAAS,eAAe,CAAC,KAAgB;IACrC,OAAO;QACH,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe;QACrD,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC7C,CAAC;AACN,CAAC;AAED,eAAe,OAAO,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { matchPath } from 'react-router-dom';
|
|
2
|
+
import routes from '../../routes';
|
|
3
|
+
export function shouldRedirectClusterRouteToRoot({ singleClusterMode, pathname, search, }) {
|
|
4
|
+
const clusterRouteMatch = matchPath(pathname, {
|
|
5
|
+
path: routes.cluster,
|
|
6
|
+
exact: false,
|
|
7
|
+
});
|
|
8
|
+
if (singleClusterMode || !clusterRouteMatch) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return !new URLSearchParams(search).get('clusterName');
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=clusterRouteGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clusterRouteGuard.js","sourceRoot":"","sources":["../../../src/containers/App/clusterRouteGuard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAE3C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,UAAU,gCAAgC,CAAC,EAC7C,iBAAiB,EACjB,QAAQ,EACR,MAAM,GAKT;IACG,MAAM,iBAAiB,GAAG,SAAS,CAAC,QAAQ,EAAE;QAC1C,IAAI,EAAE,MAAM,CAAC,OAAO;QACpB,KAAK,EAAE,KAAK;KACf,CAAC,CAAC;IAEH,IAAI,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (key: "action_compaction" | "action_cancel" | "title_table-stats" | "title_tablet-metrics" | "title_partition-config" | "action_stop" | "action_manage-partitioning" | "action_manage-partition-config" | "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" | "
|
|
1
|
+
declare const _default: (key: "action_compaction" | "action_cancel" | "field_min-partitions-count" | "field_max-partitions-count" | "title_table-stats" | "title_tablet-metrics" | "title_partition-config" | "action_stop" | "action_manage-partitioning" | "action_manage-partition-config" | "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_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" | "help_cascade" | "help_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;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { formatObject } from '../../../../../components/InfoViewer';
|
|
2
|
-
import { formatPQGroupItem, formatPQPartitionConfig, formatPQTabletConfig, } from '../../../../../components/InfoViewer/formatters';
|
|
2
|
+
import { formatPQGroupItem, formatPQPartitionConfig, formatPQPartitionStrategy, formatPQTabletConfig, } from '../../../../../components/InfoViewer/formatters';
|
|
3
|
+
import { EPQPartitionStrategyType } from '../../../../../types/api/schema';
|
|
3
4
|
export const prepareTopicSchemaInfo = (data) => {
|
|
4
5
|
var _a;
|
|
5
6
|
const pqGroupData = (_a = data === null || data === void 0 ? void 0 : data.PathDescription) === null || _a === void 0 ? void 0 : _a.PersQueueGroup;
|
|
@@ -7,7 +8,7 @@ export const prepareTopicSchemaInfo = (data) => {
|
|
|
7
8
|
return [];
|
|
8
9
|
}
|
|
9
10
|
const { Partitions = [], PQTabletConfig = { PartitionConfig: { LifetimeSeconds: 0 } } } = pqGroupData;
|
|
10
|
-
const { Codecs, MeteringMode } = PQTabletConfig;
|
|
11
|
+
const { Codecs, MeteringMode, PartitionStrategy } = PQTabletConfig;
|
|
11
12
|
const { WriteSpeedInBytesPerSecond, StorageLimitBytes } = PQTabletConfig.PartitionConfig;
|
|
12
13
|
//@ts-expect-error
|
|
13
14
|
const pqGeneralInfo = formatObject(formatPQGroupItem, {
|
|
@@ -24,6 +25,19 @@ export const prepareTopicSchemaInfo = (data) => {
|
|
|
24
25
|
Codecs,
|
|
25
26
|
MeteringMode,
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
+
let pqAutopartitioningInfo = [];
|
|
29
|
+
const strategyType = PartitionStrategy === null || PartitionStrategy === void 0 ? void 0 : PartitionStrategy.PartitionStrategyType;
|
|
30
|
+
if (PartitionStrategy && strategyType) {
|
|
31
|
+
// For a disabled strategy only the state itself is meaningful; otherwise show the bounds.
|
|
32
|
+
const strategyFields = strategyType === EPQPartitionStrategyType.DISABLED
|
|
33
|
+
? { PartitionStrategyType: strategyType }
|
|
34
|
+
: {
|
|
35
|
+
PartitionStrategyType: strategyType,
|
|
36
|
+
MinPartitionCount: PartitionStrategy.MinPartitionCount,
|
|
37
|
+
MaxPartitionCount: PartitionStrategy.MaxPartitionCount,
|
|
38
|
+
};
|
|
39
|
+
pqAutopartitioningInfo = formatObject(formatPQPartitionStrategy, strategyFields);
|
|
40
|
+
}
|
|
41
|
+
return [...pqGeneralInfo, ...pqPartitionInfo, ...pqTabletInfo, ...pqAutopartitioningInfo];
|
|
28
42
|
};
|
|
29
43
|
//# sourceMappingURL=prepareTopicSchemaInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareTopicSchemaInfo.js","sourceRoot":"","sources":["../../../../../../src/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAClE,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,iDAAiD,CAAC;AAQzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAA8B,EAAyB,EAAE;;IAC5F,MAAM,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,eAAe,0CAAE,cAAc,CAAC;IAE1D,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,EAAC,UAAU,GAAG,EAAE,EAAE,cAAc,GAAG,EAAC,eAAe,EAAE,EAAC,eAAe,EAAE,CAAC,EAAC,EAAC,EAAC,GAAG,WAAW,CAAC;IAEhG,MAAM,EAAC,MAAM,EAAE,YAAY,EAAC,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"prepareTopicSchemaInfo.js","sourceRoot":"","sources":["../../../../../../src/containers/Tenant/Diagnostics/Overview/utils/prepareTopicSchemaInfo.ts"],"names":[],"mappings":"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AC1F,MAAM,cAAc,GAChB,YAAY,KAAK,wBAAwB,CAAC,QAAQ;YAC9C,CAAC,CAAC,EAAC,qBAAqB,EAAE,YAAY,EAAC;YACvC,CAAC,CAAC;gBACI,qBAAqB,EAAE,YAAY;gBACnC,iBAAiB,EAAE,iBAAiB,CAAC,iBAAiB;gBACtD,iBAAiB,EAAE,iBAAiB,CAAC,iBAAiB;aACzD,CAAC;QACZ,sBAAsB,GAAG,YAAY,CACjC,yBAAyB,EACzB,cAAc,CACjB,CAAC;IACN,CAAC;IAED,OAAO,CAAC,GAAG,aAAa,EAAE,GAAG,eAAe,EAAE,GAAG,YAAY,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAC9F,CAAC,CAAC"}
|
|
@@ -54,6 +54,22 @@ export interface TPQTabletConfig {
|
|
|
54
54
|
PartitionKeySchema?: TKeyComponentSchema[];
|
|
55
55
|
Partitions?: TPartition[];
|
|
56
56
|
MeteringMode?: EMeteringMode;
|
|
57
|
+
PartitionStrategy?: TPQPartitionStrategy;
|
|
58
|
+
}
|
|
59
|
+
export declare enum EPQPartitionStrategyType {
|
|
60
|
+
DISABLED = "DISABLED",
|
|
61
|
+
CAN_SPLIT = "CAN_SPLIT",
|
|
62
|
+
CAN_SPLIT_AND_MERGE = "CAN_SPLIT_AND_MERGE",
|
|
63
|
+
PAUSED = "PAUSED"
|
|
64
|
+
}
|
|
65
|
+
/** Strategy for automatically changing the number of topic partitions depending on the load */
|
|
66
|
+
export interface TPQPartitionStrategy {
|
|
67
|
+
MinPartitionCount?: number;
|
|
68
|
+
MaxPartitionCount?: number;
|
|
69
|
+
ScaleThresholdSeconds?: number;
|
|
70
|
+
ScaleUpPartitionWriteSpeedThresholdPercent?: number;
|
|
71
|
+
ScaleDownPartitionWriteSpeedThresholdPercent?: number;
|
|
72
|
+
PartitionStrategyType?: EPQPartitionStrategyType;
|
|
57
73
|
}
|
|
58
74
|
export interface TPQPartitionConfig {
|
|
59
75
|
MaxCountInPartition?: number;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export var EPQPartitionStrategyType;
|
|
2
|
+
(function (EPQPartitionStrategyType) {
|
|
3
|
+
EPQPartitionStrategyType["DISABLED"] = "DISABLED";
|
|
4
|
+
EPQPartitionStrategyType["CAN_SPLIT"] = "CAN_SPLIT";
|
|
5
|
+
EPQPartitionStrategyType["CAN_SPLIT_AND_MERGE"] = "CAN_SPLIT_AND_MERGE";
|
|
6
|
+
EPQPartitionStrategyType["PAUSED"] = "PAUSED";
|
|
7
|
+
})(EPQPartitionStrategyType || (EPQPartitionStrategyType = {}));
|
|
1
8
|
export var EMeteringMode;
|
|
2
9
|
(function (EMeteringMode) {
|
|
3
10
|
EMeteringMode["METERING_MODE_RESERVED_CAPACITY"] = "METERING_MODE_RESERVED_CAPACITY";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persQueueGroup.js","sourceRoot":"","sources":["../../../../src/types/api/schema/persQueueGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"persQueueGroup.js","sourceRoot":"","sources":["../../../../src/types/api/schema/persQueueGroup.ts"],"names":[],"mappings":"AAyEA,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,iDAAqB,CAAA;IACrB,mDAAuB,CAAA;IACvB,uEAA2C,CAAA;IAC3C,6CAAiB,CAAA;AACrB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAgID,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,oFAAmE,CAAA;IACnE,4EAA2D,CAAA;AAC/D,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ydb-embedded-ui",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.5.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"numeral": "^2.0.6",
|
|
51
51
|
"path-to-regexp": "^3.3.0",
|
|
52
52
|
"qrcode": "^1.5.4",
|
|
53
|
-
"qs": "^6.
|
|
53
|
+
"qs": "^6.16.0",
|
|
54
54
|
"react-error-boundary": "^4.1.2",
|
|
55
55
|
"react-helmet-async": "^2.0.5",
|
|
56
56
|
"react-hook-form": "^7.55.0",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
TPQPartitionConfig,
|
|
3
|
+
TPQPartitionStrategy,
|
|
3
4
|
TPQTabletConfig,
|
|
4
5
|
TPersQueueGroupDescription,
|
|
5
6
|
} from '../../../types/api/schema';
|
|
6
|
-
import {EMeteringMode} from '../../../types/api/schema';
|
|
7
|
-
import {HOUR_IN_SECONDS} from '../../../utils/constants';
|
|
7
|
+
import {EMeteringMode, EPQPartitionStrategyType} from '../../../types/api/schema';
|
|
8
|
+
import {EMPTY_DATA_PLACEHOLDER, HOUR_IN_SECONDS} from '../../../utils/constants';
|
|
8
9
|
import {formatBps, formatBytes, formatNumber} from '../../../utils/dataFormatters/dataFormatters';
|
|
10
|
+
import i18n from '../i18n';
|
|
9
11
|
import {createInfoFormatter} from '../utils';
|
|
10
12
|
|
|
11
13
|
const EMeteringModeToNames: Record<EMeteringMode, string> = {
|
|
@@ -13,6 +15,13 @@ const EMeteringModeToNames: Record<EMeteringMode, string> = {
|
|
|
13
15
|
[EMeteringMode.METERING_MODE_RESERVED_CAPACITY]: 'reserved-capacity',
|
|
14
16
|
};
|
|
15
17
|
|
|
18
|
+
const EPQPartitionStrategyTypeToNames: Record<EPQPartitionStrategyType, string> = {
|
|
19
|
+
[EPQPartitionStrategyType.DISABLED]: i18n('value_autopartitioning-disabled'),
|
|
20
|
+
[EPQPartitionStrategyType.CAN_SPLIT]: i18n('value_autopartitioning-up'),
|
|
21
|
+
[EPQPartitionStrategyType.CAN_SPLIT_AND_MERGE]: i18n('value_autopartitioning-up-and-down'),
|
|
22
|
+
[EPQPartitionStrategyType.PAUSED]: i18n('value_autopartitioning-paused'),
|
|
23
|
+
};
|
|
24
|
+
|
|
16
25
|
export const formatPQGroupItem = createInfoFormatter<TPersQueueGroupDescription>({
|
|
17
26
|
values: {
|
|
18
27
|
Partitions: (value) => formatNumber(value?.length || 0),
|
|
@@ -48,3 +57,22 @@ export const formatPQPartitionConfig = createInfoFormatter<TPQPartitionConfig>({
|
|
|
48
57
|
WriteSpeedInBytesPerSecond: 'Partitions write speed',
|
|
49
58
|
},
|
|
50
59
|
});
|
|
60
|
+
|
|
61
|
+
const formatPartitionCount = (value?: number) =>
|
|
62
|
+
value === undefined ? EMPTY_DATA_PLACEHOLDER : formatNumber(value);
|
|
63
|
+
|
|
64
|
+
export const formatPQPartitionStrategy = createInfoFormatter<TPQPartitionStrategy>({
|
|
65
|
+
values: {
|
|
66
|
+
// Fall back to the raw enum value so a strategy introduced by a newer YDB
|
|
67
|
+
// version still renders the Autopartitioning row instead of being dropped.
|
|
68
|
+
PartitionStrategyType: (value) =>
|
|
69
|
+
value && (EPQPartitionStrategyTypeToNames[value] ?? value),
|
|
70
|
+
MinPartitionCount: formatPartitionCount,
|
|
71
|
+
MaxPartitionCount: formatPartitionCount,
|
|
72
|
+
},
|
|
73
|
+
labels: {
|
|
74
|
+
PartitionStrategyType: i18n('field_autopartitioning'),
|
|
75
|
+
MinPartitionCount: i18n('field_min-partitions-count'),
|
|
76
|
+
MaxPartitionCount: i18n('field_max-partitions-count'),
|
|
77
|
+
},
|
|
78
|
+
});
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common.created": "Created",
|
|
3
3
|
"common.type": "Type",
|
|
4
|
-
"no-data": "No data"
|
|
4
|
+
"no-data": "No data",
|
|
5
|
+
"field_autopartitioning": "Autopartitioning",
|
|
6
|
+
"field_min-partitions-count": "Min partitions count",
|
|
7
|
+
"field_max-partitions-count": "Max partitions count",
|
|
8
|
+
"value_autopartitioning-disabled": "Disabled",
|
|
9
|
+
"value_autopartitioning-up": "Up",
|
|
10
|
+
"value_autopartitioning-up-and-down": "Up and down",
|
|
11
|
+
"value_autopartitioning-paused": "Paused"
|
|
5
12
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {connect} from 'react-redux';
|
|
4
4
|
import type {RedirectProps} from 'react-router-dom';
|
|
5
|
-
import {Redirect, Route, Switch} from 'react-router-dom';
|
|
5
|
+
import {Redirect, Route, Switch, useLocation} from 'react-router-dom';
|
|
6
6
|
|
|
7
7
|
import {Unauthenticated} from '../../components/Errors/401';
|
|
8
8
|
import {AccessDenied} from '../../components/Errors/403';
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
TenantSlot,
|
|
42
42
|
VDiskPageSlot,
|
|
43
43
|
} from './appSlots';
|
|
44
|
+
import {shouldRedirectClusterRouteToRoot} from './clusterRouteGuard';
|
|
44
45
|
import {getLegacyClusterTenantsRedirect, getLegacyTenantRedirect} from './legacyRedirects';
|
|
45
46
|
|
|
46
47
|
import './App.scss';
|
|
@@ -148,6 +149,12 @@ export function Content(props: ContentProps) {
|
|
|
148
149
|
const {singleClusterMode} = props;
|
|
149
150
|
|
|
150
151
|
const slots = useSlots(props);
|
|
152
|
+
const currentLocation = useLocation();
|
|
153
|
+
const shouldRedirectToRoot = shouldRedirectClusterRouteToRoot({
|
|
154
|
+
singleClusterMode,
|
|
155
|
+
pathname: currentLocation.pathname,
|
|
156
|
+
search: currentLocation.search,
|
|
157
|
+
});
|
|
151
158
|
|
|
152
159
|
const additionalRoutes = slots.get(RoutesSlot);
|
|
153
160
|
|
|
@@ -158,6 +165,7 @@ export function Content(props: ContentProps) {
|
|
|
158
165
|
return (
|
|
159
166
|
<Switch>
|
|
160
167
|
{additionalRoutes?.rendered}
|
|
168
|
+
{shouldRedirectToRoot ? <Redirect to="/" /> : null}
|
|
161
169
|
<Route>
|
|
162
170
|
<Header />
|
|
163
171
|
<Switch>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {matchPath} from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
import routes from '../../routes';
|
|
4
|
+
|
|
5
|
+
export function shouldRedirectClusterRouteToRoot({
|
|
6
|
+
singleClusterMode,
|
|
7
|
+
pathname,
|
|
8
|
+
search,
|
|
9
|
+
}: {
|
|
10
|
+
singleClusterMode: boolean;
|
|
11
|
+
pathname: string;
|
|
12
|
+
search: string;
|
|
13
|
+
}) {
|
|
14
|
+
const clusterRouteMatch = matchPath(pathname, {
|
|
15
|
+
path: routes.cluster,
|
|
16
|
+
exact: false,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
if (singleClusterMode || !clusterRouteMatch) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return !new URLSearchParams(search).get('clusterName');
|
|
24
|
+
}
|
|
@@ -3,14 +3,17 @@ import {formatObject} from '../../../../../components/InfoViewer';
|
|
|
3
3
|
import {
|
|
4
4
|
formatPQGroupItem,
|
|
5
5
|
formatPQPartitionConfig,
|
|
6
|
+
formatPQPartitionStrategy,
|
|
6
7
|
formatPQTabletConfig,
|
|
7
8
|
} from '../../../../../components/InfoViewer/formatters';
|
|
8
9
|
import type {
|
|
9
10
|
TEvDescribeSchemeResult,
|
|
10
11
|
TPQPartitionConfig,
|
|
12
|
+
TPQPartitionStrategy,
|
|
11
13
|
TPQTabletConfig,
|
|
12
14
|
TPersQueueGroupDescription,
|
|
13
15
|
} from '../../../../../types/api/schema';
|
|
16
|
+
import {EPQPartitionStrategyType} from '../../../../../types/api/schema';
|
|
14
17
|
|
|
15
18
|
export const prepareTopicSchemaInfo = (data?: TEvDescribeSchemeResult): Array<InfoViewerItem> => {
|
|
16
19
|
const pqGroupData = data?.PathDescription?.PersQueueGroup;
|
|
@@ -21,7 +24,7 @@ export const prepareTopicSchemaInfo = (data?: TEvDescribeSchemeResult): Array<In
|
|
|
21
24
|
|
|
22
25
|
const {Partitions = [], PQTabletConfig = {PartitionConfig: {LifetimeSeconds: 0}}} = pqGroupData;
|
|
23
26
|
|
|
24
|
-
const {Codecs, MeteringMode} = PQTabletConfig;
|
|
27
|
+
const {Codecs, MeteringMode, PartitionStrategy} = PQTabletConfig;
|
|
25
28
|
const {WriteSpeedInBytesPerSecond, StorageLimitBytes} = PQTabletConfig.PartitionConfig;
|
|
26
29
|
|
|
27
30
|
//@ts-expect-error
|
|
@@ -40,5 +43,23 @@ export const prepareTopicSchemaInfo = (data?: TEvDescribeSchemeResult): Array<In
|
|
|
40
43
|
MeteringMode,
|
|
41
44
|
});
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
let pqAutopartitioningInfo: InfoViewerItem[] = [];
|
|
47
|
+
const strategyType = PartitionStrategy?.PartitionStrategyType;
|
|
48
|
+
if (PartitionStrategy && strategyType) {
|
|
49
|
+
// For a disabled strategy only the state itself is meaningful; otherwise show the bounds.
|
|
50
|
+
const strategyFields: TPQPartitionStrategy =
|
|
51
|
+
strategyType === EPQPartitionStrategyType.DISABLED
|
|
52
|
+
? {PartitionStrategyType: strategyType}
|
|
53
|
+
: {
|
|
54
|
+
PartitionStrategyType: strategyType,
|
|
55
|
+
MinPartitionCount: PartitionStrategy.MinPartitionCount,
|
|
56
|
+
MaxPartitionCount: PartitionStrategy.MaxPartitionCount,
|
|
57
|
+
};
|
|
58
|
+
pqAutopartitioningInfo = formatObject<TPQPartitionStrategy>(
|
|
59
|
+
formatPQPartitionStrategy,
|
|
60
|
+
strategyFields,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return [...pqGeneralInfo, ...pqPartitionInfo, ...pqTabletInfo, ...pqAutopartitioningInfo];
|
|
44
65
|
};
|
|
@@ -67,6 +67,25 @@ export interface TPQTabletConfig {
|
|
|
67
67
|
Partitions?: TPartition[];
|
|
68
68
|
|
|
69
69
|
MeteringMode?: EMeteringMode;
|
|
70
|
+
|
|
71
|
+
PartitionStrategy?: TPQPartitionStrategy;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export enum EPQPartitionStrategyType {
|
|
75
|
+
DISABLED = 'DISABLED',
|
|
76
|
+
CAN_SPLIT = 'CAN_SPLIT',
|
|
77
|
+
CAN_SPLIT_AND_MERGE = 'CAN_SPLIT_AND_MERGE',
|
|
78
|
+
PAUSED = 'PAUSED',
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Strategy for automatically changing the number of topic partitions depending on the load */
|
|
82
|
+
export interface TPQPartitionStrategy {
|
|
83
|
+
MinPartitionCount?: number;
|
|
84
|
+
MaxPartitionCount?: number;
|
|
85
|
+
ScaleThresholdSeconds?: number;
|
|
86
|
+
ScaleUpPartitionWriteSpeedThresholdPercent?: number;
|
|
87
|
+
ScaleDownPartitionWriteSpeedThresholdPercent?: number;
|
|
88
|
+
PartitionStrategyType?: EPQPartitionStrategyType;
|
|
70
89
|
}
|
|
71
90
|
|
|
72
91
|
export interface TPQPartitionConfig {
|