Skip to content
Draft
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
4 changes: 3 additions & 1 deletion src/components/NetworkTable/NetworkTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import {

type NetworkWrapperProps = Pick<
NodesProps,
'path' | 'scrollContainerRef' | 'database' | 'databaseFullPath'
'path' | 'scrollContainerRef' | 'database' | 'databaseFullPath' | 'nodeId'
>;

export function NetworkTable({
database,
databaseFullPath,
path,
scrollContainerRef,
nodeId,
}: NetworkWrapperProps) {
return (
<Nodes
Expand All @@ -32,6 +33,7 @@ export function NetworkTable({
requiredColumnsIds={NETWORK_REQUIRED_NODES_COLUMNS}
selectedColumnsKey={NETWORK_NODES_TABLE_SELECTED_COLUMNS_KEY}
groupByParams={NETWORK_NODES_GROUP_BY_PARAMS}
nodeId={nodeId}
/>
);
}
11 changes: 11 additions & 0 deletions src/containers/Node/Node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {ResponseError} from '../../components/Errors/ResponseError';
import {FullNodeViewer} from '../../components/FullNodeViewer/FullNodeViewer';
import {InfoViewerSkeleton} from '../../components/InfoViewerSkeleton/InfoViewerSkeleton';
import {InternalLink} from '../../components/InternalLink';
import {NetworkTable} from '../../components/NetworkTable/NetworkTable';
import {PageMetaWithAutorefresh} from '../../components/PageMeta/PageMeta';
import routes, {getDefaultNodePath} from '../../routes';
import {
Expand Down Expand Up @@ -281,6 +282,16 @@ function NodePageContent({
return <Configs database={database} scrollContainerRef={parentContainer} />;
}

case 'network': {
return (
<NetworkTable
database={database}
scrollContainerRef={parentContainer}
nodeId={nodeId}
/>
);
}

default:
return false;
}
Expand Down
7 changes: 7 additions & 0 deletions src/containers/Node/NodePages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const NODE_TABS_IDS = {
tablets: 'tablets',
structure: 'structure',
threads: 'threads',
network: 'network',
configs: 'configs',
} as const;

Expand Down Expand Up @@ -41,6 +42,12 @@ export const NODE_TABS = [
return i18n('tabs.threads');
},
},
{
id: NODE_TABS_IDS.network,
get title() {
return i18n('tabs.network');
},
},
{
id: NODE_TABS_IDS.configs,
get title() {
Expand Down
1 change: 1 addition & 0 deletions src/containers/Node/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"tabs.structure": "Structure",
"tabs.tablets": "Tablets",
"tabs.threads": "Threads",
"tabs.network": "Network",
"tabs.configs": "Configs",

"node": "Node",
Expand Down
3 changes: 3 additions & 0 deletions src/containers/Nodes/Nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface NodesProps {
requiredColumnsIds?: NodesColumnId[];
selectedColumnsKey?: string;
groupByParams?: NodesGroupByField[];
nodeId?: string;
}

export function Nodes({
Expand All @@ -50,6 +51,7 @@ export function Nodes({
requiredColumnsIds = REQUIRED_NODES_COLUMNS,
selectedColumnsKey = NODES_TABLE_SELECTED_COLUMNS_LS_KEY,
groupByParams = ALL_NODES_GROUP_BY_PARAMS,
nodeId,
}: NodesProps) {
const {handleDataFetched, columnsSettings} = useStorageColumnsSettings();

Expand Down Expand Up @@ -109,6 +111,7 @@ export function Nodes({
selectedColumnsKey={selectedColumnsKey}
groupByParams={effectiveGroupByParams}
onDataFetched={handleDataFetched}
nodeId={nodeId}
/>
);
}
5 changes: 5 additions & 0 deletions src/containers/Nodes/NodesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface NodesTableProps {
database?: string;
databaseFullPath?: string;

nodeId?: string;

searchValue: string;
withProblems: boolean;
uptimeFilter: NodesUptimeFilterValues;
Expand All @@ -40,6 +42,7 @@ export function NodesTable({
path,
database,
databaseFullPath,
nodeId,
searchValue,
withProblems,
uptimeFilter,
Expand All @@ -56,6 +59,7 @@ export function NodesTable({
path,
databaseFullPath,
database,
nodeId,
searchValue,
withProblems,
uptimeFilter,
Expand All @@ -67,6 +71,7 @@ export function NodesTable({
path,
databaseFullPath,
database,
nodeId,
searchValue,
withProblems,
uptimeFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ interface GroupedNodesComponentProps {
selectedColumnsKey: string;
groupByParams: NodesGroupByField[];
onDataFetched?: (data: PaginatedTableData<PreparedStorageNode>) => void;
nodeId?: string;
}

export function GroupedNodesComponent({
Expand All @@ -116,6 +117,7 @@ export function GroupedNodesComponent({
selectedColumnsKey,
groupByParams,
onDataFetched,
nodeId,
}: GroupedNodesComponentProps) {
const {searchValue, peerRoleFilter, groupByParam} = useNodesPageQueryParams(
groupByParams,
Expand Down Expand Up @@ -145,6 +147,7 @@ export function GroupedNodesComponent({
filter: searchValue,
filter_peer_role: peerRoleFilter,
group: groupByParam,
node_id: nodeId,
limit: 0,
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/containers/Nodes/PaginatedNodes/NodesComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface NodesComponentProps {
selectedColumnsKey: string;
groupByParams: NodesGroupByField[];
onDataFetched?: (data: PaginatedTableData<PreparedStorageNode>) => void;
nodeId?: string;
}

export function NodesComponent({
Expand All @@ -41,6 +42,7 @@ export function NodesComponent({
selectedColumnsKey,
groupByParams,
onDataFetched,
nodeId,
}: NodesComponentProps) {
const {searchValue, uptimeFilter, peerRoleFilter, withProblems} = useNodesPageQueryParams(
groupByParams,
Expand Down Expand Up @@ -78,6 +80,7 @@ export function NodesComponent({
path={path}
database={database}
databaseFullPath={databaseFullPath}
nodeId={nodeId}
searchValue={searchValue}
withProblems={withProblems}
uptimeFilter={uptimeFilter}
Expand Down
1 change: 1 addition & 0 deletions src/containers/Nodes/PaginatedNodes/PaginatedNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface PaginatedNodesProps {
selectedColumnsKey: string;
groupByParams: NodesGroupByField[];
onDataFetched?: (data: PaginatedTableData<PreparedStorageNode>) => void;
nodeId?: string;
}

export function PaginatedNodes(props: PaginatedNodesProps) {
Expand Down
2 changes: 2 additions & 0 deletions src/containers/Nodes/getNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const getNodes: FetchData<
peerRoleFilter,
filterGroup,
filterGroupBy,
nodeId,
} = filters ?? {};

const sortField = getNodesColumnSortField(columnId);
Expand All @@ -55,6 +56,7 @@ export const getNodes: FetchData<
filter_peer_role: peerRoleFilter,
filter_group: filterGroup,
filter_group_by: filterGroupBy,
node_id: nodeId,
fieldsRequired: dataFieldsRequired,
});
const preparedResponse = prepareStorageNodesResponse(response);
Expand Down
1 change: 1 addition & 0 deletions src/store/reducers/nodes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface NodesFilters {
path?: string;
databaseFullPath?: string;
database?: string;
nodeId?: string;

filterGroup?: string;
filterGroupBy?: NodesGroupByField;
Expand Down
Loading