Skip to content

Commit 9deee71

Browse files
committed
fix: dead tablets on node page
1 parent 816a712 commit 9deee71

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/containers/Node/Node.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function NodePageContent({
234234
);
235235
}
236236
case 'tablets': {
237-
return <Tablets nodeId={nodeId} database={tenantName} />;
237+
return <Tablets nodeId={nodeId} database={tenantName} onlyActive />;
238238
}
239239

240240
case 'structure': {

src/containers/Tablets/Tablets.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ interface TabletsProps {
1111
path?: string;
1212
database?: string;
1313
nodeId?: string | number;
14+
onlyActive?: boolean;
1415
}
1516

16-
export function Tablets({nodeId, path, database}: TabletsProps) {
17+
export function Tablets({nodeId, path, database, onlyActive}: TabletsProps) {
1718
const [autoRefreshInterval] = useAutoRefreshInterval();
1819

1920
let params: TabletsApiRequestParams = {};
21+
const filter = onlyActive ? `(State!=Dead)` : undefined;
22+
2023
if (valueIsDefined(nodeId)) {
21-
params = {nodeId, database};
24+
params = {nodeId, database, filter};
2225
} else if (path) {
23-
params = {path, database};
26+
params = {path, database, filter};
2427
}
2528
const {isLoading, error} = tabletsApi.useGetTabletsInfoQuery(
2629
Object.keys(params).length === 0 ? skipToken : params,

src/services/api/viewer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import type {TTenantInfo, TTenants} from '../../types/api/tenant';
3131
import type {DescribeTopicResult, TopicDataRequest, TopicDataResponse} from '../../types/api/topic';
3232
import type {TEvVDiskStateResponse} from '../../types/api/vdisk';
3333
import type {TUserToken} from '../../types/api/whoami';
34+
import type {TabletsApiRequestParams} from '../../types/store/tablets';
3435
import {BINARY_DATA_IN_PLAIN_TEXT_DISPLAY} from '../../utils/constants';
3536
import type {Nullable} from '../../utils/typecheckers';
3637
import {settingsManager} from '../settings';
@@ -128,7 +129,7 @@ export class ViewerAPI extends BaseYdbAPI {
128129
}
129130

130131
getTabletsInfo(
131-
{nodeId, path, database}: {nodeId?: string | number; path?: string; database?: string},
132+
{nodeId, path, database, filter}: TabletsApiRequestParams,
132133
{concurrentId, signal}: AxiosOptions = {},
133134
) {
134135
return this.get<TEvTabletStateResponse>(
@@ -138,6 +139,7 @@ export class ViewerAPI extends BaseYdbAPI {
138139
node_id: nodeId,
139140
path,
140141
enums: true,
142+
filter,
141143
},
142144
{concurrentId, requestConfig: {signal}},
143145
);

src/types/store/tablets.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export interface TabletsApiRequestParams {
22
nodeId?: string | number;
33
path?: string;
44
database?: string;
5+
filter?: string;
56
}

0 commit comments

Comments
 (0)