Skip to content

Commit 61c56f3

Browse files
authored
Merge branch 'main' into 1362-fix-duplicating-vdisks
2 parents b1229c0 + 09599c1 commit 61c56f3

File tree

41 files changed

+592
-301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+592
-301
lines changed

src/containers/AppWithClusters/ExtendedCluster/ExtendedCluster.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import type {
55
AdditionalClusterProps,
66
AdditionalTenantsProps,
77
AdditionalVersionsProps,
8+
NodeAddress,
89
} from '../../../types/additionalProps';
910
import type {MetaClusterVersion} from '../../../types/api/meta';
1011
import type {ETenantType} from '../../../types/api/tenant';
1112
import {getVersionColors, getVersionMap} from '../../../utils/clusterVersionColors';
1213
import {cn} from '../../../utils/cn';
1314
import type {GetMonitoringClusterLink, GetMonitoringLink} from '../../../utils/monitoring';
1415
import {getCleanBalancerValue, removeViewerPathname} from '../../../utils/parseBalancer';
15-
import {getBackendFromNodeHost} from '../../../utils/prepareBackend';
16+
import {getBackendFromNodeHost, getBackendFromRawNodeData} from '../../../utils/prepareBackend';
1617
import type {Cluster} from '../../Cluster/Cluster';
1718
import {useClusterData} from '../useClusterData';
1819

@@ -76,7 +77,9 @@ const getAdditionalTenantsProps = (
7677
) => {
7778
const additionalTenantsProps: AdditionalTenantsProps = {};
7879

79-
additionalTenantsProps.prepareTenantBackend = (nodeHost: string | undefined) => {
80+
additionalTenantsProps.prepareTenantBackend = (
81+
nodeHostOrAddress: string | NodeAddress | undefined,
82+
) => {
8083
// Proxy received from balancer value, so it's necessary
8184
if (!balancer) {
8285
return undefined;
@@ -86,11 +89,15 @@ const getAdditionalTenantsProps = (
8689
return removeViewerPathname(balancer);
8790
}
8891

89-
if (!nodeHost) {
92+
if (!nodeHostOrAddress) {
9093
return undefined;
9194
}
9295

93-
return getBackendFromNodeHost(nodeHost, balancer);
96+
if (typeof nodeHostOrAddress === 'string') {
97+
return getBackendFromNodeHost(nodeHostOrAddress, balancer);
98+
}
99+
100+
return getBackendFromRawNodeData(nodeHostOrAddress, balancer, true) ?? undefined;
94101
};
95102

96103
if (monitoring && getMonitoringLink) {

src/containers/Storage/StorageGroups/columns/StorageGroupsColumns.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@
2222
}
2323
}
2424
}
25+
2526
&__pool-name-wrapper {
26-
width: 230px;
27+
overflow: hidden;
28+
29+
white-space: nowrap;
30+
text-overflow: ellipsis;
31+
direction: rtl;
32+
}
33+
34+
&__pool-name {
35+
unicode-bidi: plaintext;
2736
}
2837

2938
&__group-id {

src/containers/Storage/StorageGroups/columns/columns.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,17 @@ const poolNameColumn: StorageGroupsColumn = {
3333
header: STORAGE_GROUPS_COLUMNS_TITLES.PoolName,
3434
width: 250,
3535
render: ({row}) => {
36-
const splitted = row.PoolName?.split('/');
37-
return (
38-
splitted && (
39-
<CellWithPopover
40-
wrapperClassName={b('pool-name-wrapper')}
41-
content={row.PoolName}
42-
placement={['right']}
43-
behavior={PopoverBehavior.Immediate}
44-
>
45-
{splitted[splitted.length - 1]}
46-
</CellWithPopover>
47-
)
36+
return row.PoolName ? (
37+
<CellWithPopover
38+
content={row.PoolName}
39+
placement={['right']}
40+
behavior={PopoverBehavior.Immediate}
41+
className={b('pool-name-wrapper')}
42+
>
43+
<span className={b('pool-name')}>{row.PoolName}</span>
44+
</CellWithPopover>
45+
) : (
46+
EMPTY_DATA_PLACEHOLDER
4847
);
4948
},
5049
align: DataTable.LEFT,

src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function TopQueries({tenantName}: TopQueriesProps) {
4646
);
4747

4848
const loading = isFetching && currentData === undefined;
49-
const {result: data} = currentData || {};
49+
const data = currentData?.resultSets?.[0]?.result || [];
5050

5151
const handleRowClick = React.useCallback(
5252
(row: any) => {

src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const TopShards = ({tenantName, path}: TopShardsProps) => {
3232
);
3333

3434
const loading = isFetching && currentData === undefined;
35-
const {result: data} = currentData || {};
35+
const data = currentData?.resultSets?.[0]?.result || [];
3636

3737
const columns = getTopShardsColumns(tenantName, location);
3838

src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function TopTables({path}: TopTablesProps) {
3232
);
3333
const loading = isFetching && currentData === undefined;
3434

35-
const {result: data} = currentData || {};
35+
const data = currentData?.resultSets?.[0]?.result || [];
3636

3737
const formatSize = (value?: number) => {
3838
const size = getSizeWithSignificantDigits(data?.length ? Number(data[0].Size) : 0, 0);

src/containers/Tenant/Diagnostics/TopQueries/RunningQueriesData.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,16 @@ interface Props {
2121
export const RunningQueriesData = ({database}: Props) => {
2222
const [autoRefreshInterval] = useAutoRefreshInterval();
2323
const filters = useTypedSelector((state) => state.executeTopQueries);
24-
const {
25-
currentData: data,
26-
isFetching,
27-
error,
28-
} = topQueriesApi.useGetRunningQueriesQuery(
24+
const {currentData, isFetching, error} = topQueriesApi.useGetRunningQueriesQuery(
2925
{
3026
database,
3127
filters,
3228
},
3329
{pollingInterval: autoRefreshInterval},
3430
);
3531

32+
const data = currentData?.resultSets?.[0].result || [];
33+
3634
return (
3735
<React.Fragment>
3836
{error ? <ResponseError error={parseQueryErrorToString(error)} /> : null}
@@ -41,7 +39,7 @@ export const RunningQueriesData = ({database}: Props) => {
4139
emptyDataMessage={i18n('no-data')}
4240
columnsWidthLSKey={RUNNING_QUERIES_COLUMNS_WIDTH_LS_KEY}
4341
columns={RUNNING_QUERIES_COLUMNS}
44-
data={data || []}
42+
data={data}
4543
settings={QUERY_TABLE_SETTINGS}
4644
/>
4745
</TableWithControlsLayout.Table>

src/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const TopQueriesData = ({database, onRowClick}: Props) => {
3131
},
3232
{pollingInterval: autoRefreshInterval},
3333
);
34-
const {result: data} = currentData || {};
34+
const data = currentData?.resultSets?.[0]?.result || [];
3535

3636
const rawColumns = TOP_QUERIES_COLUMNS;
3737
const columns = rawColumns.map((column) => ({

src/containers/Tenant/Diagnostics/TopShards/TopShards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const TopShards = ({tenantName, path, type}: TopShardsProps) => {
120120
{pollingInterval: autoRefreshInterval},
121121
);
122122
const loading = isFetching && result === undefined;
123-
const {result: data} = result ?? {};
123+
const data = result?.resultSets?.[0]?.result || [];
124124

125125
const onSort = (newSortOrder?: SortOrder | SortOrder[]) => {
126126
// omit information about sort order to disable ASC order, only DESC makes sense for top shards

src/containers/Tenant/Query/ExecuteResult/ExecuteResult.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ export function ExecuteResult({
7272
const {error, isLoading, queryId, data} = result;
7373

7474
const stats: TKqpStatsQuery | undefined = data?.stats;
75-
const resultsSetsCount = data?.resultSets?.length;
76-
const isMulti = resultsSetsCount && resultsSetsCount > 0;
77-
const currentResult = isMulti ? data?.resultSets?.[selectedResultSet] : data;
75+
const resultsSetsCount = data?.resultSets?.length || 0;
76+
const currentResult = data?.resultSets?.[selectedResultSet];
7877
const {plan, simplifiedPlan} = React.useMemo(() => getPlan(data), [data]);
7978

8079
const resultOptions: ControlGroupOption<SectionID>[] = [
@@ -106,7 +105,7 @@ export function ExecuteResult({
106105
const renderResult = () => {
107106
return (
108107
<div className={b('result-wrapper')}>
109-
{isMulti && resultsSetsCount > 1 && (
108+
{resultsSetsCount > 1 && (
110109
<div>
111110
<Tabs
112111
className={b('result-tabs')}

0 commit comments

Comments
 (0)