Skip to content

Commit ea0394f

Browse files
authored
Merge branch 'main' into astandrik.very-bad-performance-1472
2 parents 6fea4b9 + e4cb52f commit ea0394f

File tree

15 files changed

+74
-40
lines changed

15 files changed

+74
-40
lines changed

CHANGELOG.md

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

3+
## [6.29.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v6.29.0...v6.29.1) (2024-10-25)
4+
5+
6+
### Bug Fixes
7+
8+
* **EntityStatus:** wrapper layout without clipboard ([#1538](https://github.com/ydb-platform/ydb-embedded-ui/issues/1538)) ([9858369](https://github.com/ydb-platform/ydb-embedded-ui/commit/9858369022c5921f1c66b17341355d2d97dd2e66))
9+
* primary keys for column tables ([#1541](https://github.com/ydb-platform/ydb-embedded-ui/issues/1541)) ([4359ca6](https://github.com/ydb-platform/ydb-embedded-ui/commit/4359ca6124da4e59e9541c6534bf524f3038c3ec))
10+
11+
## [6.29.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v6.28.0...v6.29.0) (2024-10-25)
12+
13+
14+
### Features
15+
16+
* add Bytes and Text types suggestion in autocomplete ([#1531](https://github.com/ydb-platform/ydb-embedded-ui/issues/1531)) ([6a99452](https://github.com/ydb-platform/ydb-embedded-ui/commit/6a994523986f68d775c1efb13f49c624f0125107))
17+
18+
19+
### Bug Fixes
20+
21+
* **ClusterDashboard:** hide dashboard if /cluster handler version less 5 ([#1535](https://github.com/ydb-platform/ydb-embedded-ui/issues/1535)) ([f24e5e4](https://github.com/ydb-platform/ydb-embedded-ui/commit/f24e5e4cb2498fd1fa828d8dc40a7f36253016a1))
22+
* remove excessive slash for requests via tenant node ([#1537](https://github.com/ydb-platform/ydb-embedded-ui/issues/1537)) ([6fb97a9](https://github.com/ydb-platform/ydb-embedded-ui/commit/6fb97a96710bccc39918bb5b127df421df1cbfc4))
23+
* **TenantOverview:** fix used tablet storage calculation ([#1528](https://github.com/ydb-platform/ydb-embedded-ui/issues/1528)) ([96411ee](https://github.com/ydb-platform/ydb-embedded-ui/commit/96411ee7b3f7f1830c2bd445c584438964cc7347))
24+
325
## [6.28.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v6.27.1...v6.28.0) (2024-10-23)
426

527

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": "6.28.0",
3+
"version": "6.29.1",
44
"files": [
55
"dist"
66
],

src/components/BasicNodeViewer/BasicNodeViewer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const BasicNodeViewer = ({node, additionalNodesProps, className}: BasicNo
2424
let nodeHref: string | undefined;
2525

2626
if (additionalNodesProps?.getNodeRef) {
27-
nodeHref = additionalNodesProps.getNodeRef(node) + 'internal';
27+
nodeHref = additionalNodesProps.getNodeRef(node) + '/internal';
2828
} else if (node.NodeId) {
29-
nodeHref = createDeveloperUILinkWithNodeId(node.NodeId) + 'internal';
29+
nodeHref = createDeveloperUILinkWithNodeId(node.NodeId) + '/internal';
3030
}
3131

3232
return (

src/components/EntityStatus/EntityStatus.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131

3232
overflow: hidden;
3333

34-
padding-right: var(--button-width);
34+
&_with-button {
35+
padding-right: var(--button-width);
36+
}
3537
}
3638

3739
&__controls-wrapper {

src/components/EntityStatus/EntityStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function EntityStatus({
9090
</span>
9191
)}
9292
{(path || name) && (
93-
<div className={b('wrapper')}>
93+
<div className={b('wrapper', {'with-button': hasClipboardButton})}>
9494
<span className={b('link', {'with-left-trim': withLeftTrim})}>
9595
{renderLink()}
9696
</span>

src/components/NodeHostWrapper/NodeHostWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export const NodeHostWrapper = ({node, getNodeRef, database}: NodeHostWrapperPro
3030

3131
let nodeHref: string | undefined;
3232
if (getNodeRef) {
33-
nodeHref = getNodeRef(node) + 'internal';
33+
nodeHref = getNodeRef(node) + '/internal';
3434
} else if (node.NodeId) {
35-
nodeHref = createDeveloperUILinkWithNodeId(node.NodeId) + 'internal';
35+
nodeHref = createDeveloperUILinkWithNodeId(node.NodeId) + '/internal';
3636
}
3737

3838
const nodePath = isNodeAvailable

src/containers/Cluster/ClusterDashboard/ClusterDashboard.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import {Flex, Text} from '@gravity-ui/uikit';
33
import {ResponseError} from '../../../components/Errors/ResponseError';
44
import {Tags} from '../../../components/Tags';
55
import type {ClusterGroupsStats} from '../../../store/reducers/cluster/types';
6-
import {isClusterInfoV2} from '../../../types/api/cluster';
7-
import type {TClusterInfo} from '../../../types/api/cluster';
6+
import type {TClusterInfo, TClusterInfoV2} from '../../../types/api/cluster';
87
import type {IResponseError} from '../../../types/api/error';
98
import {valueIsDefined} from '../../../utils';
109
import {formatNumber} from '../../../utils/dataFormatters/dataFormatters';
@@ -24,6 +23,13 @@ import {
2423

2524
import './ClusterDashboard.scss';
2625

26+
// fixed CPU calculation
27+
export function isClusterInfoV5(info?: TClusterInfo): info is TClusterInfoV2 {
28+
return info
29+
? 'Version' in info && typeof info.Version === 'number' && info.Version >= 5
30+
: false;
31+
}
32+
2733
interface AmountProps {
2834
value?: number | string;
2935
}
@@ -39,43 +45,44 @@ function Amount({value}: AmountProps) {
3945
);
4046
}
4147

42-
interface ClusterDashboardProps {
43-
cluster: TClusterInfo;
48+
interface ClusterDashboardProps<T = TClusterInfo> {
49+
cluster: T;
4450
groupStats?: ClusterGroupsStats;
4551
loading?: boolean;
4652
error?: IResponseError | string;
4753
}
4854

49-
export function ClusterDashboard(props: ClusterDashboardProps) {
55+
export function ClusterDashboard({cluster, ...props}: ClusterDashboardProps) {
56+
const isSupportedClusterResponse = isClusterInfoV5(cluster);
57+
if (!isSupportedClusterResponse) {
58+
return null;
59+
}
5060
if (props.error) {
5161
return <ResponseError error={props.error} className={b('error')} />;
5262
}
5363
return (
5464
<div className={b()}>
5565
<Flex gap={4} wrap>
5666
<Flex gap={4} wrap="nowrap">
57-
<ClusterDoughnuts {...props} />
67+
<ClusterDoughnuts {...props} cluster={cluster} />
5868
</Flex>
5969
<div className={b('cards-container')}>
60-
<ClusterDashboardCards {...props} />
70+
<ClusterDashboardCards {...props} cluster={cluster} />
6171
</div>
6272
</Flex>
6373
</div>
6474
);
6575
}
6676

67-
function ClusterDoughnuts({cluster, loading}: ClusterDashboardProps) {
77+
function ClusterDoughnuts({cluster, loading}: ClusterDashboardProps<TClusterInfoV2>) {
6878
if (loading) {
6979
return <ClusterDashboardSkeleton />;
7080
}
7181
const metricsCards = [];
72-
if (isClusterInfoV2(cluster)) {
73-
const {CoresUsed, NumberOfCpus} = cluster;
74-
if (valueIsDefined(CoresUsed) && valueIsDefined(NumberOfCpus)) {
75-
metricsCards.push(
76-
<ClusterMetricsCores value={CoresUsed} capacity={NumberOfCpus} key="cores" />,
77-
);
78-
}
82+
const {CoresUsed, NumberOfCpus, CoresTotal} = cluster;
83+
const total = CoresTotal ?? NumberOfCpus;
84+
if (valueIsDefined(CoresUsed) && valueIsDefined(total)) {
85+
metricsCards.push(<ClusterMetricsCores value={CoresUsed} capacity={total} key="cores" />);
7986
}
8087
const {StorageTotal, StorageUsed} = cluster;
8188
if (valueIsDefined(StorageTotal) && valueIsDefined(StorageUsed)) {

src/containers/Cluster/ClusterInfo/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const getInfo = (
6363
const nodesStates = arrayNodesStates.map(([state, count]) => {
6464
return (
6565
<NodesState state={state as EFlag} key={state}>
66-
{count}
66+
{formatNumber(count)}
6767
</NodesState>
6868
);
6969
});

src/containers/Tenant/Schema/SchemaViewer/prepareData.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ export function prepareFamilies(data?: TTableDescription): Record<number, TFamil
4343
function prepareRowTableSchema(data: TTableDescription = {}): SchemaData[] {
4444
const families = prepareFamilies(data);
4545

46-
const {Columns, KeyColumnIds} = data;
46+
const {Columns, KeyColumnNames} = data;
4747

4848
const preparedColumns = Columns?.map((column) => {
4949
const {Id, Name, NotNull, Type, Family, DefaultFromSequence, DefaultFromLiteral} = column;
5050

51-
const keyColumnIndex = KeyColumnIds?.findIndex((keyColumnId) => keyColumnId === Id) ?? -1;
51+
const keyColumnIndex =
52+
KeyColumnNames?.findIndex((keyColumnName) => keyColumnName === Name) ?? -1;
5253

5354
const familyName = Family ? families[Family].Name : undefined;
5455
const prefferedPoolKind = Family
@@ -92,14 +93,15 @@ function prepareExternalTableSchema(data: TExternalTableDescription = {}): Schem
9293

9394
function prepareColumnTableSchema(data: TColumnTableDescription = {}): SchemaData[] {
9495
const {Schema = {}, Sharding = {}} = data;
95-
const {Columns, KeyColumnIds} = Schema;
96+
const {Columns, KeyColumnNames} = Schema;
9697
const {HashSharding = {}} = Sharding;
9798
const {Columns: HashColumns = []} = HashSharding;
9899

99100
const preparedColumns = Columns?.map((column) => {
100101
const {Id, Name, Type, NotNull} = column;
101102

102-
const keyColumnIndex = KeyColumnIds?.findIndex((keyColumnId) => keyColumnId === Id) ?? -1;
103+
const keyColumnIndex =
104+
KeyColumnNames?.findIndex((keyColumnName) => keyColumnName === Name) ?? -1;
103105

104106
const isPartitioningKeyColumn = Boolean(
105107
HashColumns?.find((hashColumnName) => hashColumnName === Name),

0 commit comments

Comments
 (0)