Skip to content

Commit 3e8afdf

Browse files
authored
Merge branch 'main' into astandrik.move-storage-tables-to-paginated-1693
2 parents d2dbd72 + b3d5897 commit 3e8afdf

File tree

20 files changed

+178
-108
lines changed

20 files changed

+178
-108
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "7.1.0"
2+
".": "7.2.0"
33
}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [7.2.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v7.1.0...v7.2.0) (2024-12-10)
4+
5+
6+
### Features
7+
8+
* add wrapper for gravity-ui/table ([#1736](https://github.com/ydb-platform/ydb-embedded-ui/issues/1736)) ([26d00e9](https://github.com/ydb-platform/ydb-embedded-ui/commit/26d00e910a078ad7042a3a41599978c0fb1995ad))
9+
* **JSONTree:** allow case insensitive search ([#1735](https://github.com/ydb-platform/ydb-embedded-ui/issues/1735)) ([d4845d3](https://github.com/ydb-platform/ydb-embedded-ui/commit/d4845d3cd598ebbaece4934e7b0a4a886f657170))
10+
* redirect to embedded ([#1732](https://github.com/ydb-platform/ydb-embedded-ui/issues/1732)) ([dacc546](https://github.com/ydb-platform/ydb-embedded-ui/commit/dacc546dc86f1e442c81dcd3120b40707d5a0504))
11+
* show negative uptime for nodes when disconnected ([#1740](https://github.com/ydb-platform/ydb-embedded-ui/issues/1740)) ([3991c56](https://github.com/ydb-platform/ydb-embedded-ui/commit/3991c5666c222688fbcc24c578d58833ba258904))
12+
* **TopQueries:** add limit, sort on backend ([#1737](https://github.com/ydb-platform/ydb-embedded-ui/issues/1737)) ([bc8acee](https://github.com/ydb-platform/ydb-embedded-ui/commit/bc8aceee8ac50c85110139324ddbed279b863925))
13+
14+
15+
### Bug Fixes
16+
17+
* make grey more grey ([#1738](https://github.com/ydb-platform/ydb-embedded-ui/issues/1738)) ([6d39f9d](https://github.com/ydb-platform/ydb-embedded-ui/commit/6d39f9d498d86e2ec9f6763758a2c379aec71518))
18+
319
## [7.1.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v7.0.0...v7.1.0) (2024-12-04)
420

521

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ydb-embedded-ui",
3-
"version": "7.1.0",
3+
"version": "7.2.0",
44
"files": [
55
"dist"
66
],

src/components/TooltipsContent/TabletTooltipContent/TabletTooltipContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type {TTabletStateInfo} from '../../../types/api/tablet';
2-
import {calcUptime} from '../../../utils/dataFormatters/dataFormatters';
2+
import {getUptimeFromDateFormatted} from '../../../utils/dataFormatters/dataFormatters';
33
import {InfoViewer, createInfoFormatter, formatObject} from '../../InfoViewer';
44

55
const formatTablet = createInfoFormatter<TTabletStateInfo>({
66
values: {
7-
ChangeTime: (value) => calcUptime(value),
7+
ChangeTime: (value) => getUptimeFromDateFormatted(value),
88
},
99
labels: {
1010
TabletId: 'Tablet',

src/components/nodesColumns/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function getUptimeColumn<T extends {StartTime?: string; Uptime?: string}>
110110
sortAccessor: ({StartTime}) => (StartTime ? -StartTime : 0),
111111
render: ({row}) => row.Uptime,
112112
align: DataTable.RIGHT,
113-
width: 110,
113+
width: 120,
114114
};
115115
}
116116

src/components/nodesColumns/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export const NODES_COLUMNS_TO_DATA_FIELDS: Record<NodesColumnId, NodesRequiredFi
177177
DC: ['DC'],
178178
Rack: ['Rack'],
179179
Version: ['Version'],
180-
Uptime: ['Uptime'],
180+
Uptime: ['Uptime', 'DisconnectTime'],
181181
Memory: ['Memory', 'MemoryDetailed'],
182182
RAM: ['Memory'],
183183
Pools: ['CPU'],

src/containers/Cluster/ClusterInfo/ClusterInfo.scss

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,19 @@
33
.cluster-info {
44
padding: 20px 0;
55

6+
@include mixins.body-2-typography();
7+
68
&__skeleton {
79
margin-top: 5px;
810
}
911

10-
&__error {
11-
@include mixins.body-2-typography();
12+
&__section-title {
13+
margin: var(--g-spacing-1) 0 var(--g-spacing-3);
14+
@include mixins.text-subheader-2();
1215
}
1316

14-
&__metrics {
15-
margin: 0 -15px;
16-
padding: 0 15px !important;
17-
18-
.info-viewer__items {
19-
grid-template-columns: repeat(2, minmax(auto, 250px));
20-
}
21-
22-
.info-viewer__label {
23-
width: 50px;
24-
}
25-
.info-viewer__value {
26-
width: 130px;
27-
}
28-
}
29-
30-
&__tablets {
31-
margin-left: 15px;
32-
padding: 0 !important;
33-
}
34-
&__links {
35-
display: flex;
36-
flex-flow: row wrap;
37-
gap: var(--g-spacing-2);
17+
&__dc {
18+
height: 20px;
3819
}
3920

4021
&__clipboard-button {

src/containers/Cluster/ClusterInfo/ClusterInfo.tsx

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
import {DefinitionList, Flex} from '@gravity-ui/uikit';
2+
13
import {ResponseError} from '../../../components/Errors/ResponseError';
2-
import {InfoViewer} from '../../../components/InfoViewer/InfoViewer';
34
import {InfoViewerSkeleton} from '../../../components/InfoViewerSkeleton/InfoViewerSkeleton';
5+
import {LinkWithIcon} from '../../../components/LinkWithIcon/LinkWithIcon';
46
import type {AdditionalClusterProps} from '../../../types/additionalProps';
57
import type {TClusterInfo} from '../../../types/api/cluster';
68
import type {IResponseError} from '../../../types/api/error';
79
import type {VersionToColorMap} from '../../../types/versions';
10+
import i18n from '../i18n';
811

912
import {b} from './shared';
1013
import {getInfo, useClusterLinks} from './utils';
@@ -28,25 +31,65 @@ export const ClusterInfo = ({
2831
const {info = [], links = []} = additionalClusterProps;
2932

3033
const clusterLinks = useClusterLinks();
34+
const linksList = links.concat(clusterLinks);
3135

32-
const clusterInfo = getInfo(cluster ?? {}, info, [...links, ...clusterLinks]);
33-
34-
const getContent = () => {
35-
if (loading) {
36-
return <InfoViewerSkeleton className={b('skeleton')} rows={9} />;
37-
}
36+
const clusterInfo = getInfo(cluster ?? {}, info);
3837

38+
const renderInfo = () => {
3939
if (error && !cluster) {
4040
return null;
4141
}
4242

43-
return <InfoViewer dots={true} info={clusterInfo} />;
43+
return (
44+
<div>
45+
<div className={b('section-title')}>{i18n('title_info')}</div>
46+
<DefinitionList nameMaxWidth={200}>
47+
{clusterInfo.map(({label, value}) => {
48+
return (
49+
<DefinitionList.Item key={label} name={label}>
50+
{value}
51+
</DefinitionList.Item>
52+
);
53+
})}
54+
</DefinitionList>
55+
</div>
56+
);
57+
};
58+
59+
const renderLinks = () => {
60+
if (linksList.length) {
61+
return (
62+
<div>
63+
<div className={b('section-title')}>{i18n('title_links')}</div>
64+
<Flex direction="column" gap={4}>
65+
{linksList.map(({title, url}) => {
66+
return <LinkWithIcon key={title} title={title} url={url} />;
67+
})}
68+
</Flex>
69+
</div>
70+
);
71+
}
72+
73+
return null;
74+
};
75+
76+
const renderContent = () => {
77+
if (loading) {
78+
return <InfoViewerSkeleton className={b('skeleton')} rows={4} />;
79+
}
80+
81+
return (
82+
<Flex gap={10} wrap="nowrap">
83+
{renderInfo()}
84+
{renderLinks()}
85+
</Flex>
86+
);
4487
};
4588

4689
return (
4790
<div className={b()}>
4891
{error ? <ResponseError error={error} className={b('error')} /> : null}
49-
<div className={b('info')}>{getContent()}</div>
92+
{renderContent()}
5093
</div>
5194
);
5295
};

src/containers/Cluster/ClusterInfo/utils.tsx

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ import React from 'react';
22

33
import {Flex} from '@gravity-ui/uikit';
44

5-
import type {InfoViewerItem} from '../../../components/InfoViewer/InfoViewer';
6-
import {LinkWithIcon} from '../../../components/LinkWithIcon/LinkWithIcon';
75
import {ProgressViewer} from '../../../components/ProgressViewer/ProgressViewer';
86
import {Tags} from '../../../components/Tags';
97
import {useClusterBaseInfo} from '../../../store/reducers/cluster/cluster';
108
import type {ClusterLink} from '../../../types/additionalProps';
119
import {isClusterInfoV2} from '../../../types/api/cluster';
1210
import type {TClusterInfo} from '../../../types/api/cluster';
1311
import type {EFlag} from '../../../types/api/enums';
14-
import type {TTabletStateInfo} from '../../../types/api/tablet';
15-
import {EType} from '../../../types/api/tablet';
12+
import type {InfoItem} from '../../../types/components';
1613
import {formatNumber} from '../../../utils/dataFormatters/dataFormatters';
1714
import {parseJson} from '../../../utils/utils';
1815
import i18n from '../i18n';
@@ -29,18 +26,6 @@ const COLORS_PRIORITY: Record<EFlag, number> = {
2926
Grey: 0,
3027
};
3128

32-
export const compareTablets = (tablet1: TTabletStateInfo, tablet2: TTabletStateInfo) => {
33-
if (tablet1.Type === EType.TxAllocator) {
34-
return 1;
35-
}
36-
37-
if (tablet2.Type === EType.TxAllocator) {
38-
return -1;
39-
}
40-
41-
return 0;
42-
};
43-
4429
const getDCInfo = (cluster: TClusterInfo) => {
4530
if (isClusterInfoV2(cluster) && cluster.MapDataCenters) {
4631
return Object.entries(cluster.MapDataCenters).map(([dc, count]) => (
@@ -52,12 +37,8 @@ const getDCInfo = (cluster: TClusterInfo) => {
5237
return undefined;
5338
};
5439

55-
export const getInfo = (
56-
cluster: TClusterInfo,
57-
additionalInfo: InfoViewerItem[],
58-
links: ClusterLink[],
59-
) => {
60-
const info: InfoViewerItem[] = [];
40+
export const getInfo = (cluster: TClusterInfo, additionalInfo: InfoItem[]) => {
41+
const info: InfoItem[] = [];
6142

6243
if (isClusterInfoV2(cluster) && cluster.MapNodeStates) {
6344
const arrayNodesStates = Object.entries(cluster.MapNodeStates) as [EFlag, number][];
@@ -80,7 +61,7 @@ export const getInfo = (
8061
if (dataCenters?.length) {
8162
info.push({
8263
label: i18n('label_dc'),
83-
value: <Tags tags={dataCenters} gap={2} />,
64+
value: <Tags tags={dataCenters} gap={2} className={b('dc')} />,
8465
});
8566
}
8667

@@ -91,19 +72,6 @@ export const getInfo = (
9172

9273
info.push(...additionalInfo);
9374

94-
if (links.length) {
95-
info.push({
96-
label: i18n('links'),
97-
value: (
98-
<div className={b('links')}>
99-
{links.map(({title, url}) => (
100-
<LinkWithIcon key={title} title={title} url={url} />
101-
))}
102-
</div>
103-
),
104-
});
105-
}
106-
10775
return info;
10876
};
10977

0 commit comments

Comments
 (0)