ydb-embedded-ui 4.16.0 → 4.16.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/dist/components/BasicNodeViewer/BasicNodeViewer.tsx +5 -5
- package/dist/components/NodeHostWrapper/NodeHostWrapper.tsx +2 -1
- package/dist/containers/Cluster/Cluster.tsx +5 -5
- package/dist/containers/Node/Node.tsx +6 -4
- package/dist/containers/Node/NodeStructure/NodeStructure.tsx +7 -5
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +2 -2
- package/dist/containers/Nodes/Nodes.tsx +5 -4
- package/dist/containers/Nodes/getNodesColumns.tsx +3 -1
- package/dist/containers/Storage/Storage.tsx +5 -4
- package/dist/containers/Storage/StorageNodes/StorageNodes.tsx +4 -4
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +4 -3
- package/dist/containers/Tenant/Diagnostics/Diagnostics.tsx +5 -4
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +5 -4
- package/dist/containers/Tenant/ObjectGeneral/ObjectGeneral.tsx +6 -5
- package/dist/containers/Tenant/Tenant.tsx +5 -4
- package/dist/containers/Tenant/utils/queryTemplates.ts +23 -23
- package/dist/containers/Tenants/Tenants.tsx +1 -3
- package/dist/types/additionalProps.ts +8 -1
- package/dist/utils/nodes.ts +0 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [4.16.2](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.16.1...v4.16.2) (2023-08-28)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* fix topic templates ([#524](https://github.com/ydb-platform/ydb-embedded-ui/issues/524)) ([f593b57](https://github.com/ydb-platform/ydb-embedded-ui/commit/f593b575fb64d0c69b56e743fd4cd6faba1e9d0e))
|
9
|
+
* rename additionalInfo params to additionalProps ([#525](https://github.com/ydb-platform/ydb-embedded-ui/issues/525)) ([dd2b040](https://github.com/ydb-platform/ydb-embedded-ui/commit/dd2b04039cd80072fe11744f3490c176fe21b16b))
|
10
|
+
|
11
|
+
## [4.16.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.16.0...v4.16.1) (2023-08-25)
|
12
|
+
|
13
|
+
|
14
|
+
### Bug Fixes
|
15
|
+
|
16
|
+
* fix types for external props ([#522](https://github.com/ydb-platform/ydb-embedded-ui/issues/522)) ([173081f](https://github.com/ydb-platform/ydb-embedded-ui/commit/173081f2f0d2814b2311757988d91fbffc2a509f))
|
17
|
+
|
3
18
|
## [4.16.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.15.1...v4.16.0) (2023-08-25)
|
4
19
|
|
5
20
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import cn from 'bem-cn-lite';
|
2
2
|
|
3
3
|
import type {TSystemStateInfo} from '../../types/api/nodes';
|
4
|
-
import type {
|
4
|
+
import type {AdditionalNodesProps} from '../../types/additionalProps';
|
5
5
|
|
6
6
|
import EntityStatus from '../EntityStatus/EntityStatus';
|
7
7
|
import {Tags} from '../Tags';
|
@@ -13,13 +13,13 @@ const b = cn('basic-node-viewer');
|
|
13
13
|
|
14
14
|
interface BasicNodeViewerProps {
|
15
15
|
node: TSystemStateInfo;
|
16
|
-
|
16
|
+
additionalNodesProps?: AdditionalNodesProps;
|
17
17
|
className?: string;
|
18
18
|
}
|
19
19
|
|
20
|
-
export const BasicNodeViewer = ({node,
|
21
|
-
const nodeHref =
|
22
|
-
?
|
20
|
+
export const BasicNodeViewer = ({node, additionalNodesProps, className}: BasicNodeViewerProps) => {
|
21
|
+
const nodeHref = additionalNodesProps?.getNodeRef
|
22
|
+
? additionalNodesProps.getNodeRef(node) + 'internal'
|
23
23
|
: undefined;
|
24
24
|
|
25
25
|
return (
|
@@ -3,8 +3,9 @@ import block from 'bem-cn-lite';
|
|
3
3
|
import {Button, Popover, PopoverBehavior} from '@gravity-ui/uikit';
|
4
4
|
|
5
5
|
import type {NodesPreparedEntity} from '../../store/reducers/nodes/types';
|
6
|
+
import type {NodeAddress} from '../../types/additionalProps';
|
6
7
|
import {getDefaultNodePath} from '../../containers/Node/NodePages';
|
7
|
-
import {isUnavailableNode
|
8
|
+
import {isUnavailableNode} from '../../utils/nodes';
|
8
9
|
|
9
10
|
import EntityStatus from '../EntityStatus/EntityStatus';
|
10
11
|
import {NodeEndpointsTooltipContent} from '../TooltipsContent';
|
@@ -10,8 +10,8 @@ import type {
|
|
10
10
|
AdditionalClusterProps,
|
11
11
|
AdditionalTenantsProps,
|
12
12
|
AdditionalVersionsProps,
|
13
|
+
AdditionalNodesProps,
|
13
14
|
} from '../../types/additionalProps';
|
14
|
-
import type {AdditionalNodesInfo} from '../../utils/nodes';
|
15
15
|
import routes from '../../routes';
|
16
16
|
|
17
17
|
import {setHeaderBreadcrumbs} from '../../store/reducers/header/header';
|
@@ -35,7 +35,7 @@ const b = cn('cluster');
|
|
35
35
|
|
36
36
|
interface ClusterProps {
|
37
37
|
additionalTenantsProps?: AdditionalTenantsProps;
|
38
|
-
|
38
|
+
additionalNodesProps?: AdditionalNodesProps;
|
39
39
|
additionalClusterProps?: AdditionalClusterProps;
|
40
40
|
additionalVersionsProps?: AdditionalVersionsProps;
|
41
41
|
}
|
@@ -43,7 +43,7 @@ interface ClusterProps {
|
|
43
43
|
function Cluster({
|
44
44
|
additionalClusterProps,
|
45
45
|
additionalTenantsProps,
|
46
|
-
|
46
|
+
additionalNodesProps,
|
47
47
|
additionalVersionsProps,
|
48
48
|
}: ClusterProps) {
|
49
49
|
const dispatch = useDispatch();
|
@@ -104,10 +104,10 @@ function Cluster({
|
|
104
104
|
return <Tenants additionalTenantsProps={additionalTenantsProps} />;
|
105
105
|
}
|
106
106
|
case clusterTabsIds.nodes: {
|
107
|
-
return <Nodes
|
107
|
+
return <Nodes additionalNodesProps={additionalNodesProps} />;
|
108
108
|
}
|
109
109
|
case clusterTabsIds.storage: {
|
110
|
-
return <Storage
|
110
|
+
return <Storage additionalNodesProps={additionalNodesProps} />;
|
111
111
|
}
|
112
112
|
case clusterTabsIds.versions: {
|
113
113
|
return <Versions versionToColor={versionToColor} />;
|
@@ -21,6 +21,8 @@ import {setHeaderBreadcrumbs} from '../../store/reducers/header/header';
|
|
21
21
|
import {AutoFetcher} from '../../utils/autofetcher';
|
22
22
|
import {useTypedSelector} from '../../utils/hooks';
|
23
23
|
|
24
|
+
import type {AdditionalNodesProps} from '../../types/additionalProps';
|
25
|
+
|
24
26
|
import {clusterTabsIds} from '../Cluster/utils';
|
25
27
|
|
26
28
|
import './Node.scss';
|
@@ -32,7 +34,7 @@ export const STORAGE_ROLE = 'Storage';
|
|
32
34
|
const autofetcher = new AutoFetcher();
|
33
35
|
|
34
36
|
interface NodeProps {
|
35
|
-
|
37
|
+
additionalNodesProps?: AdditionalNodesProps;
|
36
38
|
className?: string;
|
37
39
|
}
|
38
40
|
|
@@ -113,7 +115,7 @@ function Node(props: NodeProps) {
|
|
113
115
|
);
|
114
116
|
};
|
115
117
|
const renderTabContent = () => {
|
116
|
-
const {
|
118
|
+
const {additionalNodesProps} = props;
|
117
119
|
|
118
120
|
switch (activeTab) {
|
119
121
|
case STORAGE: {
|
@@ -136,7 +138,7 @@ function Node(props: NodeProps) {
|
|
136
138
|
<NodeStructure
|
137
139
|
className={b('node-page-wrapper')}
|
138
140
|
nodeId={nodeId}
|
139
|
-
|
141
|
+
additionalNodesProps={additionalNodesProps}
|
140
142
|
/>
|
141
143
|
);
|
142
144
|
}
|
@@ -155,7 +157,7 @@ function Node(props: NodeProps) {
|
|
155
157
|
<div className={b(null, props.className)}>
|
156
158
|
<BasicNodeViewer
|
157
159
|
node={node}
|
158
|
-
|
160
|
+
additionalNodesProps={props.additionalNodesProps}
|
159
161
|
className={b('header')}
|
160
162
|
/>
|
161
163
|
|
@@ -13,6 +13,8 @@ import {selectNodeStructure} from '../../../store/reducers/node/selectors';
|
|
13
13
|
import {AutoFetcher} from '../../../utils/autofetcher';
|
14
14
|
import {useTypedSelector} from '../../../utils/hooks';
|
15
15
|
|
16
|
+
import type {AdditionalNodesProps} from '../../../types/additionalProps';
|
17
|
+
|
16
18
|
import {PDisk} from './Pdisk';
|
17
19
|
|
18
20
|
import './NodeStructure.scss';
|
@@ -30,12 +32,12 @@ function generateId({type, id}: {type: 'pdisk' | 'vdisk'; id: string}) {
|
|
30
32
|
interface NodeStructureProps {
|
31
33
|
nodeId: string;
|
32
34
|
className?: string;
|
33
|
-
|
35
|
+
additionalNodesProps?: AdditionalNodesProps;
|
34
36
|
}
|
35
37
|
|
36
38
|
const autofetcher = new AutoFetcher();
|
37
39
|
|
38
|
-
function NodeStructure({nodeId, className,
|
40
|
+
function NodeStructure({nodeId, className, additionalNodesProps}: NodeStructureProps) {
|
39
41
|
const dispatch = useDispatch();
|
40
42
|
|
41
43
|
const nodeStructure = useTypedSelector(selectNodeStructure);
|
@@ -44,10 +46,10 @@ function NodeStructure({nodeId, className, additionalNodesInfo}: NodeStructurePr
|
|
44
46
|
const nodeData = useTypedSelector((state) => state.node?.data?.SystemStateInfo?.[0]);
|
45
47
|
|
46
48
|
const nodeHref = useMemo(() => {
|
47
|
-
return
|
48
|
-
?
|
49
|
+
return additionalNodesProps?.getNodeRef
|
50
|
+
? additionalNodesProps.getNodeRef(nodeData)
|
49
51
|
: undefined;
|
50
|
-
}, [nodeData,
|
52
|
+
}, [nodeData, additionalNodesProps]);
|
51
53
|
|
52
54
|
const {pdiskId: pdiskIdFromUrl, vdiskId: vdiskIdFromUrl} = url.parse(
|
53
55
|
window.location.href,
|
@@ -27,7 +27,7 @@ interface PDiskProps {
|
|
27
27
|
unfolded?: boolean;
|
28
28
|
id: string;
|
29
29
|
selectedVdiskId?: string;
|
30
|
-
nodeHref?: string;
|
30
|
+
nodeHref?: string | null;
|
31
31
|
}
|
32
32
|
|
33
33
|
enum VDiskTableColumnsIds {
|
@@ -62,7 +62,7 @@ function getColumns({
|
|
62
62
|
}: {
|
63
63
|
pDiskId: number;
|
64
64
|
selectedVdiskId?: string;
|
65
|
-
nodeHref?: string;
|
65
|
+
nodeHref?: string | null;
|
66
66
|
}) {
|
67
67
|
const columns: Column<RowType>[] = [
|
68
68
|
{
|
@@ -26,7 +26,7 @@ import {
|
|
26
26
|
useNodesRequestParams,
|
27
27
|
useTableSort,
|
28
28
|
} from '../../utils/hooks';
|
29
|
-
import {
|
29
|
+
import {isUnavailableNode, NodesUptimeFilterValues} from '../../utils/nodes';
|
30
30
|
|
31
31
|
import {
|
32
32
|
getNodes,
|
@@ -39,6 +39,7 @@ import {
|
|
39
39
|
} from '../../store/reducers/nodes/nodes';
|
40
40
|
import {selectFilteredNodes} from '../../store/reducers/nodes/selectors';
|
41
41
|
import {changeFilter, ProblemFilterValues} from '../../store/reducers/settings/settings';
|
42
|
+
import type {AdditionalNodesProps} from '../../types/additionalProps';
|
42
43
|
|
43
44
|
import {isDatabaseEntityType} from '../Tenant/utils/schema';
|
44
45
|
|
@@ -53,10 +54,10 @@ const b = cn('ydb-nodes');
|
|
53
54
|
interface NodesProps {
|
54
55
|
path?: string;
|
55
56
|
type?: EPathType;
|
56
|
-
|
57
|
+
additionalNodesProps?: AdditionalNodesProps;
|
57
58
|
}
|
58
59
|
|
59
|
-
export const Nodes = ({path, type,
|
60
|
+
export const Nodes = ({path, type, additionalNodesProps = {}}: NodesProps) => {
|
60
61
|
const dispatch = useDispatch();
|
61
62
|
|
62
63
|
const isClusterNodes = !path;
|
@@ -153,7 +154,7 @@ export const Nodes = ({path, type, additionalNodesInfo = {}}: NodesProps) => {
|
|
153
154
|
|
154
155
|
const renderTable = () => {
|
155
156
|
const columns = getNodesColumns({
|
156
|
-
getNodeRef:
|
157
|
+
getNodeRef: additionalNodesProps.getNodeRef,
|
157
158
|
});
|
158
159
|
|
159
160
|
if (nodes && nodes.length === 0) {
|
@@ -6,11 +6,13 @@ import ProgressViewer from '../../components/ProgressViewer/ProgressViewer';
|
|
6
6
|
import {TabletsStatistic} from '../../components/TabletsStatistic';
|
7
7
|
import {NodeHostWrapper} from '../../components/NodeHostWrapper/NodeHostWrapper';
|
8
8
|
|
9
|
-
import {isSortableNodesProperty
|
9
|
+
import {isSortableNodesProperty} from '../../utils/nodes';
|
10
10
|
import {formatBytesToGigabyte} from '../../utils/index';
|
11
11
|
|
12
12
|
import type {NodesPreparedEntity} from '../../store/reducers/nodes/types';
|
13
13
|
|
14
|
+
import type {NodeAddress} from '../../types/additionalProps';
|
15
|
+
|
14
16
|
const NODES_COLUMNS_IDS = {
|
15
17
|
NodeId: 'NodeId',
|
16
18
|
Host: 'Host',
|
@@ -15,6 +15,7 @@ import type {
|
|
15
15
|
VisibleEntities,
|
16
16
|
} from '../../store/reducers/storage/types';
|
17
17
|
import type {NodesSortParams} from '../../store/reducers/nodes/types';
|
18
|
+
import type {AdditionalNodesProps} from '../../types/additionalProps';
|
18
19
|
import {
|
19
20
|
setInitialState,
|
20
21
|
setVisibleEntities,
|
@@ -45,7 +46,7 @@ import {
|
|
45
46
|
useTableSort,
|
46
47
|
useTypedSelector,
|
47
48
|
} from '../../utils/hooks';
|
48
|
-
import {
|
49
|
+
import {NodesUptimeFilterValues} from '../../utils/nodes';
|
49
50
|
import {DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
|
50
51
|
|
51
52
|
import {StorageGroups} from './StorageGroups/StorageGroups';
|
@@ -59,12 +60,12 @@ import './Storage.scss';
|
|
59
60
|
const b = cn('global-storage');
|
60
61
|
|
61
62
|
interface StorageProps {
|
62
|
-
|
63
|
+
additionalNodesProps?: AdditionalNodesProps;
|
63
64
|
tenant?: string;
|
64
65
|
nodeId?: string;
|
65
66
|
}
|
66
67
|
|
67
|
-
export const Storage = ({
|
68
|
+
export const Storage = ({additionalNodesProps, tenant, nodeId}: StorageProps) => {
|
68
69
|
const dispatch = useDispatch();
|
69
70
|
|
70
71
|
const {autorefresh} = useTypedSelector((state) => state.schema);
|
@@ -188,7 +189,7 @@ export const Storage = ({additionalNodesInfo, tenant, nodeId}: StorageProps) =>
|
|
188
189
|
data={storageNodes}
|
189
190
|
tableSettings={DEFAULT_TABLE_SETTINGS}
|
190
191
|
onShowAll={handleShowAllNodes}
|
191
|
-
|
192
|
+
additionalNodesProps={additionalNodesProps}
|
192
193
|
sort={nodesSort}
|
193
194
|
handleSort={handleNodesSort}
|
194
195
|
/>
|
@@ -5,10 +5,10 @@ import DataTable, {Column, Settings, SortOrder} from '@gravity-ui/react-data-tab
|
|
5
5
|
import type {ValueOf} from '../../../types/common';
|
6
6
|
import type {PreparedStorageNode, VisibleEntities} from '../../../store/reducers/storage/types';
|
7
7
|
import type {HandleSort} from '../../../utils/hooks/useTableSort';
|
8
|
+
import type {AdditionalNodesProps} from '../../../types/additionalProps';
|
8
9
|
|
9
10
|
import {VISIBLE_ENTITIES} from '../../../store/reducers/storage/constants';
|
10
11
|
import {
|
11
|
-
AdditionalNodesInfo,
|
12
12
|
isSortableNodesProperty,
|
13
13
|
isUnavailableNode,
|
14
14
|
NodesUptimeFilterValues,
|
@@ -40,7 +40,7 @@ interface StorageNodesProps {
|
|
40
40
|
visibleEntities: VisibleEntities;
|
41
41
|
nodesUptimeFilter: keyof typeof NodesUptimeFilterValues;
|
42
42
|
onShowAll?: VoidFunction;
|
43
|
-
|
43
|
+
additionalNodesProps?: AdditionalNodesProps;
|
44
44
|
sort?: SortOrder;
|
45
45
|
handleSort?: HandleSort;
|
46
46
|
}
|
@@ -63,11 +63,11 @@ export function StorageNodes({
|
|
63
63
|
visibleEntities,
|
64
64
|
onShowAll,
|
65
65
|
nodesUptimeFilter,
|
66
|
-
|
66
|
+
additionalNodesProps,
|
67
67
|
sort,
|
68
68
|
handleSort,
|
69
69
|
}: StorageNodesProps) {
|
70
|
-
const getNodeRef =
|
70
|
+
const getNodeRef = additionalNodesProps?.getNodeRef;
|
71
71
|
|
72
72
|
const rawColumns: Column<PreparedStorageNode>[] = [
|
73
73
|
{
|
@@ -5,6 +5,7 @@ import cn from 'bem-cn-lite';
|
|
5
5
|
import {Button, Modal} from '@gravity-ui/uikit';
|
6
6
|
|
7
7
|
import type {EPathType} from '../../../../types/api/schema';
|
8
|
+
import type {AdditionalTenantsProps} from '../../../../types/additionalProps';
|
8
9
|
import {Icon} from '../../../../components/Icon';
|
9
10
|
import Overview from '../Overview/Overview';
|
10
11
|
import {Healthcheck} from '../Healthcheck';
|
@@ -16,7 +17,7 @@ interface DetailedOverviewProps {
|
|
16
17
|
type?: EPathType;
|
17
18
|
className?: string;
|
18
19
|
tenantName: string;
|
19
|
-
|
20
|
+
additionalTenantProps?: AdditionalTenantsProps;
|
20
21
|
}
|
21
22
|
|
22
23
|
const b = cn('kv-detailed-overview');
|
@@ -51,7 +52,7 @@ function DetailedOverview(props: DetailedOverviewProps) {
|
|
51
52
|
};
|
52
53
|
|
53
54
|
const renderContent = () => {
|
54
|
-
const {type, tenantName,
|
55
|
+
const {type, tenantName, additionalTenantProps} = props;
|
55
56
|
const isTenant = tenantName === currentSchemaPath;
|
56
57
|
return (
|
57
58
|
<div className={b()}>
|
@@ -60,7 +61,7 @@ function DetailedOverview(props: DetailedOverviewProps) {
|
|
60
61
|
<div className={b('section')}>
|
61
62
|
<TenantOverview
|
62
63
|
tenantName={tenantName}
|
63
|
-
|
64
|
+
additionalTenantProps={additionalTenantProps}
|
64
65
|
/>
|
65
66
|
</div>
|
66
67
|
<div className={b('section')}>
|
@@ -8,6 +8,7 @@ import {useLocation} from 'react-router';
|
|
8
8
|
import {Switch, Tabs} from '@gravity-ui/uikit';
|
9
9
|
|
10
10
|
import type {EPathType} from '../../../types/api/schema';
|
11
|
+
import type {AdditionalTenantsProps, AdditionalNodesProps} from '../../../types/additionalProps';
|
11
12
|
|
12
13
|
import {useTypedSelector} from '../../../utils/hooks';
|
13
14
|
import routes, {createHref} from '../../../routes';
|
@@ -41,8 +42,8 @@ import './Diagnostics.scss';
|
|
41
42
|
|
42
43
|
interface DiagnosticsProps {
|
43
44
|
type?: EPathType;
|
44
|
-
|
45
|
-
|
45
|
+
additionalTenantProps?: AdditionalTenantsProps;
|
46
|
+
additionalNodesProps?: AdditionalNodesProps;
|
46
47
|
}
|
47
48
|
|
48
49
|
const b = cn('kv-tenant-diagnostics');
|
@@ -107,7 +108,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
107
108
|
<DetailedOverview
|
108
109
|
type={type}
|
109
110
|
tenantName={tenantNameString}
|
110
|
-
|
111
|
+
additionalTenantProps={props.additionalTenantProps}
|
111
112
|
/>
|
112
113
|
);
|
113
114
|
}
|
@@ -122,7 +123,7 @@ function Diagnostics(props: DiagnosticsProps) {
|
|
122
123
|
<Nodes
|
123
124
|
path={currentSchemaPath}
|
124
125
|
type={type}
|
125
|
-
|
126
|
+
additionalNodesProps={props.additionalNodesProps}
|
126
127
|
/>
|
127
128
|
);
|
128
129
|
}
|
@@ -13,7 +13,8 @@ import {TABLET_STATES, TENANT_DEFAULT_TITLE} from '../../../../utils/constants';
|
|
13
13
|
import {bytesToGB} from '../../../../utils/utils';
|
14
14
|
import {mapDatabaseTypeToDBName} from '../../utils/schema';
|
15
15
|
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
16
|
-
import {ETabletVolatileState} from '../../../../types/api/tenant';
|
16
|
+
import type {ETabletVolatileState} from '../../../../types/api/tenant';
|
17
|
+
import type {AdditionalTenantsProps} from '../../../../types/additionalProps';
|
17
18
|
import {getTenantInfo, setDataWasNotLoaded} from '../../../../store/reducers/tenant/tenant';
|
18
19
|
|
19
20
|
import i18n from './i18n';
|
@@ -23,10 +24,10 @@ const b = cn('tenant-overview');
|
|
23
24
|
|
24
25
|
interface TenantOverviewProps {
|
25
26
|
tenantName: string;
|
26
|
-
|
27
|
+
additionalTenantProps?: AdditionalTenantsProps;
|
27
28
|
}
|
28
29
|
|
29
|
-
export function TenantOverview({tenantName,
|
30
|
+
export function TenantOverview({tenantName, additionalTenantProps}: TenantOverviewProps) {
|
30
31
|
const {tenant, loading, wasLoaded} = useTypedSelector((state) => state.tenant);
|
31
32
|
const {autorefresh} = useTypedSelector((state) => state.schema);
|
32
33
|
const dispatch = useDispatch();
|
@@ -118,7 +119,7 @@ export function TenantOverview({tenantName, additionalTenantInfo}: TenantOvervie
|
|
118
119
|
<div className={b('top-label')}>{tenantType}</div>
|
119
120
|
<div className={b('top')}>
|
120
121
|
{renderName()}
|
121
|
-
{
|
122
|
+
{additionalTenantProps?.getMonitoringLink?.(Name, Type)}
|
122
123
|
</div>
|
123
124
|
<div className={b('system-tablets')}>
|
124
125
|
{SystemTablets &&
|
@@ -4,6 +4,7 @@ import cn from 'bem-cn-lite';
|
|
4
4
|
import {useThemeValue} from '@gravity-ui/uikit';
|
5
5
|
|
6
6
|
import type {EPathType} from '../../../types/api/schema';
|
7
|
+
import type {AdditionalTenantsProps, AdditionalNodesProps} from '../../../types/additionalProps';
|
7
8
|
import {TENANT_PAGES_IDS} from '../../../store/reducers/tenant/constants';
|
8
9
|
import {useSetting} from '../../../utils/hooks';
|
9
10
|
import {TENANT_INITIAL_PAGE_KEY} from '../../../utils/constants';
|
@@ -18,8 +19,8 @@ const b = cn('object-general');
|
|
18
19
|
|
19
20
|
interface ObjectGeneralProps {
|
20
21
|
type?: EPathType;
|
21
|
-
|
22
|
-
|
22
|
+
additionalTenantProps?: AdditionalTenantsProps;
|
23
|
+
additionalNodesProps?: AdditionalNodesProps;
|
23
24
|
}
|
24
25
|
|
25
26
|
function ObjectGeneral(props: ObjectGeneralProps) {
|
@@ -32,7 +33,7 @@ function ObjectGeneral(props: ObjectGeneralProps) {
|
|
32
33
|
const {name: tenantName, tenantPage = initialPage} = queryParams;
|
33
34
|
|
34
35
|
const renderTabContent = () => {
|
35
|
-
const {type,
|
36
|
+
const {type, additionalTenantProps, additionalNodesProps} = props;
|
36
37
|
switch (tenantPage) {
|
37
38
|
case TENANT_PAGES_IDS.query: {
|
38
39
|
return <Query path={tenantName as string} theme={theme} type={type} />;
|
@@ -41,8 +42,8 @@ function ObjectGeneral(props: ObjectGeneralProps) {
|
|
41
42
|
return (
|
42
43
|
<Diagnostics
|
43
44
|
type={type}
|
44
|
-
|
45
|
-
|
45
|
+
additionalTenantProps={additionalTenantProps}
|
46
|
+
additionalNodesProps={additionalNodesProps}
|
46
47
|
/>
|
47
48
|
);
|
48
49
|
}
|
@@ -5,6 +5,7 @@ import {useLocation} from 'react-router';
|
|
5
5
|
import qs from 'qs';
|
6
6
|
|
7
7
|
import type {TEvDescribeSchemeResult} from '../../types/api/schema';
|
8
|
+
import type {AdditionalTenantsProps, AdditionalNodesProps} from '../../types/additionalProps';
|
8
9
|
|
9
10
|
import {DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY} from '../../utils/constants';
|
10
11
|
import {useTypedSelector} from '../../utils/hooks';
|
@@ -37,8 +38,8 @@ const initialTenantSummaryState = {
|
|
37
38
|
};
|
38
39
|
|
39
40
|
interface TenantProps {
|
40
|
-
|
41
|
-
|
41
|
+
additionalTenantProps?: AdditionalTenantsProps;
|
42
|
+
additionalNodesProps?: AdditionalNodesProps;
|
42
43
|
}
|
43
44
|
|
44
45
|
function Tenant(props: TenantProps) {
|
@@ -124,8 +125,8 @@ function Tenant(props: TenantProps) {
|
|
124
125
|
/>
|
125
126
|
<ObjectGeneral
|
126
127
|
type={preloadedPathType || currentPathType}
|
127
|
-
|
128
|
-
|
128
|
+
additionalTenantProps={props.additionalTenantProps}
|
129
|
+
additionalNodesProps={props.additionalNodesProps}
|
129
130
|
/>
|
130
131
|
</SplitPane>
|
131
132
|
)}
|
@@ -69,42 +69,42 @@ export const createTopicTemplate = (path: string) => {
|
|
69
69
|
return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/create_topic
|
70
70
|
CREATE TOPIC \`${path}/my_topic\` (
|
71
71
|
CONSUMER consumer1,
|
72
|
-
CONSUMER consumer2 WITH (read_from = Datetime('
|
72
|
+
CONSUMER consumer2 WITH (read_from = Datetime('1970-01-01T00:00:00Z')) -- Sets up the message write time starting from which the consumer will receive data.
|
73
73
|
-- Value type: Datetime OR Timestamp OR integer (unix-timestamp in the numeric format).
|
74
74
|
-- Default value: now
|
75
75
|
) WITH (
|
76
|
-
min_active_partitions =
|
77
|
-
partition_count_limit =
|
78
|
-
retention_period = Interval('
|
79
|
-
retention_storage_mb =
|
76
|
+
min_active_partitions = 1, -- Minimum number of topic partitions.
|
77
|
+
partition_count_limit = 0, -- Maximum number of active partitions in the topic. 0 is interpreted as unlimited.
|
78
|
+
retention_period = Interval('PT18H'), -- Data retention period in the topic. Value type: Interval.
|
79
|
+
retention_storage_mb = 0, -- Limit on the maximum disk space occupied by the topic data.
|
80
80
|
-- When this value is exceeded, the older data is cleared, like under a retention policy.
|
81
81
|
-- 0 is interpreted as unlimited.
|
82
|
-
partition_write_speed_bytes_per_second =
|
83
|
-
partition_write_burst_bytes =
|
84
|
-
|
85
|
-
|
82
|
+
partition_write_speed_bytes_per_second = 1048576, -- Maximum allowed write speed per partition.
|
83
|
+
partition_write_burst_bytes = 0 -- Write quota allocated for write bursts.
|
84
|
+
-- When set to zero, the actual write_burst value is equalled to
|
85
|
+
-- the quota value (this allows write bursts of up to one second).
|
86
86
|
);`;
|
87
87
|
};
|
88
88
|
|
89
89
|
export const alterTopicTemplate = (path: string) => {
|
90
90
|
return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/alter_topic
|
91
91
|
ALTER TOPIC \`${path}\`
|
92
|
-
ADD CONSUMER new_consumer WITH (read_from =
|
93
|
-
|
94
|
-
|
95
|
-
ALTER CONSUMER consumer1 SET (read_from = Datetime('
|
92
|
+
ADD CONSUMER new_consumer WITH (read_from = Datetime('1970-01-01T00:00:00Z')), -- Sets up the message write time starting from which the consumer will receive data.
|
93
|
+
-- Value type: Datetime OR Timestamp OR integer (unix-timestamp in the numeric format).
|
94
|
+
-- Default value: now
|
95
|
+
ALTER CONSUMER consumer1 SET (read_from = Datetime('1970-01-01T00:00:00Z')),
|
96
96
|
DROP CONSUMER consumer2,
|
97
97
|
SET (
|
98
|
-
min_active_partitions =
|
99
|
-
partition_count_limit =
|
100
|
-
retention_period = Interval('
|
101
|
-
retention_storage_mb =
|
102
|
-
|
103
|
-
|
104
|
-
partition_write_speed_bytes_per_second =
|
105
|
-
partition_write_burst_bytes =
|
106
|
-
|
107
|
-
|
98
|
+
min_active_partitions = 1, -- Minimum number of topic partitions.
|
99
|
+
partition_count_limit = 0, -- Maximum number of active partitions in the topic. 0 is interpreted as unlimited.
|
100
|
+
retention_period = Interval('PT18H'), -- Data retention period in the topic. Value type: Interval.
|
101
|
+
retention_storage_mb = 0, -- Limit on the maximum disk space occupied by the topic data.
|
102
|
+
-- When this value is exceeded, the older data is cleared, like under a retention policy.
|
103
|
+
-- 0 is interpreted as unlimited.
|
104
|
+
partition_write_speed_bytes_per_second = 1048576, -- Maximum allowed write speed per partition.
|
105
|
+
partition_write_burst_bytes = 0 -- Write quota allocated for write bursts.
|
106
|
+
-- When set to zero, the actual write_burst value is equalled to
|
107
|
+
-- the quota value (this allows write bursts of up to one second).
|
108
108
|
);`;
|
109
109
|
};
|
110
110
|
|
@@ -106,9 +106,7 @@ export const Tenants = ({additionalTenantsProps}: TenantsProps) => {
|
|
106
106
|
backend,
|
107
107
|
})}
|
108
108
|
/>
|
109
|
-
{row.Name
|
110
|
-
row.Type &&
|
111
|
-
additionalTenantsProps?.getMonitoringLink?.(row.Name, row.Type)}
|
109
|
+
{additionalTenantsProps?.getMonitoringLink?.(row.Name, row.Type)}
|
112
110
|
</div>
|
113
111
|
);
|
114
112
|
},
|
@@ -2,6 +2,7 @@ import type {ReactNode} from 'react';
|
|
2
2
|
|
3
3
|
import type {InfoViewerItem} from '../components/InfoViewer';
|
4
4
|
import type {ETenantType} from './api/tenant';
|
5
|
+
import type {TSystemStateInfo} from './api/nodes';
|
5
6
|
import type {VersionToColorMap} from './versions';
|
6
7
|
|
7
8
|
export interface AdditionalVersionsProps {
|
@@ -20,5 +21,11 @@ export interface AdditionalClusterProps {
|
|
20
21
|
|
21
22
|
export interface AdditionalTenantsProps {
|
22
23
|
prepareTenantBackend?: (backend: string | undefined) => string | undefined;
|
23
|
-
getMonitoringLink?: (name
|
24
|
+
getMonitoringLink?: (name?: string, type?: ETenantType) => ReactNode;
|
25
|
+
}
|
26
|
+
|
27
|
+
export type NodeAddress = Pick<TSystemStateInfo, 'Host' | 'Endpoints'>;
|
28
|
+
|
29
|
+
export interface AdditionalNodesProps extends Record<string, unknown> {
|
30
|
+
getNodeRef?: (node?: NodeAddress) => string | null;
|
24
31
|
}
|
package/dist/utils/nodes.ts
CHANGED
@@ -18,12 +18,6 @@ export const NodesUptimeFilterTitles = {
|
|
18
18
|
export const isUnavailableNode = (node: NodesPreparedEntity | TSystemStateInfo) =>
|
19
19
|
!node.SystemState || node.SystemState === EFlag.Grey;
|
20
20
|
|
21
|
-
export type NodeAddress = Pick<TSystemStateInfo, 'Host' | 'Endpoints'>;
|
22
|
-
|
23
|
-
export interface AdditionalNodesInfo extends Record<string, unknown> {
|
24
|
-
getNodeRef?: (node?: NodeAddress) => string | null;
|
25
|
-
}
|
26
|
-
|
27
21
|
export const prepareNodesMap = (nodesList?: TNodeInfo[]) => {
|
28
22
|
return nodesList?.reduce<NodesMap>((nodesMap, node) => {
|
29
23
|
if (node.Id && node.Host) {
|