Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/containers/Tablets/Tablets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,28 @@ import {skipToken} from '@reduxjs/toolkit/query';
import {isNil} from 'lodash';

import {selectTabletsWithFqdn, tabletsApi} from '../../store/reducers/tablets';
import {ETabletState} from '../../types/api/tablet';
import type {TabletsApiRequestParams} from '../../types/store/tablets';
import {valueIsDefined} from '../../utils';
import {useAutoRefreshInterval, useTypedSelector} from '../../utils/hooks';

import {TabletsTable} from './TabletsTable';

const activeStatuses: ETabletState[] = [
ETabletState.Created,
ETabletState.ResolveStateStorage,
ETabletState.Candidate,
ETabletState.BlockBlobStorage,
ETabletState.RebuildGraph,
ETabletState.WriteZeroEntry,
ETabletState.Restored,
ETabletState.Discover,
ETabletState.Lock,
ETabletState.Active,
ETabletState.ResolveLeader,
ETabletState.Terminating,
];

interface TabletsProps {
path?: string;
database?: string;
Expand All @@ -34,7 +50,7 @@ export function Tablets({
const [autoRefreshInterval] = useAutoRefreshInterval();

let params: TabletsApiRequestParams = {};
const filter = onlyActive ? `(State!=Dead)` : undefined;
const filter = onlyActive ? `(State=[${activeStatuses.join(',')}])` : undefined;

const schemaPathParam = React.useMemo(() => {
if (!isNil(path) && !isNil(databaseFullPath)) {
Expand Down
1 change: 1 addition & 0 deletions src/types/api/tablet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export enum ETabletState {
'ResolveLeader' = 'ResolveLeader',
'Deleted' = 'Deleted',
'Stopped' = 'Stopped',
'Terminating' = 'Terminating',
}

interface TBoundChannel {
Expand Down
1 change: 1 addition & 0 deletions src/utils/tablet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const tabletStateToColorState: Record<ETabletState, EFlag> = {
[ETabletState.Stopped]: EFlag.Yellow,
[ETabletState.ResolveLeader]: EFlag.Yellow,
[ETabletState.RebuildGraph]: EFlag.Yellow,
[ETabletState.Terminating]: EFlag.Yellow,

[ETabletState.Deleted]: EFlag.Green,
[ETabletState.Active]: EFlag.Green,
Expand Down
Loading