Skip to content

fix: remove host fqdn and node id columns from node tablets table #2473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025
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
1 change: 1 addition & 0 deletions src/containers/Tablets/Tablets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function Tablets({nodeId, path, database, onlyActive, scrollContainerRef}
database={database}
loading={isLoading}
error={error}
nodeId={nodeId}
/>
);
}
62 changes: 37 additions & 25 deletions src/containers/Tablets/TabletsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {getDefaultNodePath} from '../Node/NodePages';

import i18n from './i18n';

function getColumns({database}: {database?: string}) {
function getColumns({database, nodeId}: {database?: string; nodeId?: string | number}) {
const columns: DataTableColumn<TTabletStateInfo & {fqdn?: string}>[] = [
{
name: 'Type',
Expand Down Expand Up @@ -71,30 +71,39 @@ function getColumns({database}: {database?: string}) {
return <TabletState state={row.State} />;
},
},
{
name: 'NodeId',
get header() {
return i18n('Node ID');
},
render: ({row}) => {
const nodePath =
row.NodeId === undefined ? undefined : getDefaultNodePath(row.NodeId);
return <InternalLink to={nodePath}>{row.NodeId}</InternalLink>;
},
align: 'right',
},
{
name: 'fqdn',
get header() {
return i18n('Node FQDN');
];

// For node page we don't need to show node columns
if (nodeId === undefined) {
columns.push(
{
name: 'NodeId',
get header() {
return i18n('Node ID');
},
render: ({row}) => {
const nodePath =
row.NodeId === undefined ? undefined : getDefaultNodePath(row.NodeId);
return <InternalLink to={nodePath}>{row.NodeId}</InternalLink>;
},
align: 'right',
},
render: ({row}) => {
if (!row.fqdn) {
return <span>—</span>;
}
return <EntityStatus name={row.fqdn} showStatus={false} hasClipboardButton />;
{
name: 'fqdn',
get header() {
return i18n('Node FQDN');
},
render: ({row}) => {
if (!row.fqdn) {
return <span>—</span>;
}
return <EntityStatus name={row.fqdn} showStatus={false} hasClipboardButton />;
},
},
},
);
}

columns.push(
{
name: 'Generation',
get header() {
Expand Down Expand Up @@ -123,7 +132,8 @@ function getColumns({database}: {database?: string}) {
return <TabletActions {...row} />;
},
},
];
);

return columns;
}

Expand Down Expand Up @@ -170,6 +180,7 @@ interface TabletsTableProps {
loading?: boolean;
error?: unknown;
scrollContainerRef: React.RefObject<HTMLElement>;
nodeId?: string | number;
}

export function TabletsTable({
Expand All @@ -178,6 +189,7 @@ export function TabletsTable({
loading,
error,
scrollContainerRef,
nodeId,
}: TabletsTableProps) {
const [{tabletsSearch}, setQueryParams] = useQueryParams({
tabletsSearch: StringParam,
Expand All @@ -186,7 +198,7 @@ export function TabletsTable({
// Track sort state for scroll dependencies
const [sortParams, setSortParams] = React.useState<SortOrder | SortOrder[] | undefined>();

const columns = React.useMemo(() => getColumns({database}), [database]);
const columns = React.useMemo(() => getColumns({database, nodeId}), [database, nodeId]);

const filteredTablets = React.useMemo(() => {
return tablets.filter((tablet) => {
Expand Down
Loading