Skip to content

Commit

Permalink
feat(Nodes): add node name column (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemmufazalov authored Oct 2, 2024
1 parent 5f26767 commit a4c24e1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/containers/Nodes/columns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ const getHostColumn = (getNodeRef?: GetNodeRefFunc, database?: string): NodesCol
align: DataTable.LEFT,
sortable: false,
});
const nodeNameColumn: NodesColumn = {
name: NODES_COLUMNS_IDS.NodeName,
header: NODES_COLUMNS_TITLES.NodeName,
align: DataTable.LEFT,
render: ({row}) => row.NodeName || EMPTY_DATA_PLACEHOLDER,
width: 200,
};

const getHostColumnWithUndefinedWidth = (
getNodeRef?: GetNodeRefFunc,
Expand Down Expand Up @@ -217,6 +224,7 @@ export function getNodesColumns({database, getNodeRef}: GetNodesColumnsProps): N
const columns = [
nodeIdColumn,
getHostColumn(getNodeRef, database),
nodeNameColumn,
dataCenterColumn,
rackColumn,
versionColumn,
Expand Down
4 changes: 4 additions & 0 deletions src/containers/Nodes/columns/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const NODES_TABLE_SELECTED_COLUMNS_LS_KEY = 'nodesTableSelectedColumns';
export const NODES_COLUMNS_IDS = {
NodeId: 'NodeId',
Host: 'Host',
NodeName: 'NodeName',
DC: 'DC',
Rack: 'Rack',
Version: 'Version',
Expand Down Expand Up @@ -48,6 +49,9 @@ export const NODES_COLUMNS_TITLES = {
get Host() {
return i18n('host');
},
get NodeName() {
return i18n('node-name');
},
get DC() {
return i18n('dc');
},
Expand Down
1 change: 1 addition & 0 deletions src/containers/Nodes/columns/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"node-id": "Node Id",
"host": "Host",
"node-name": "Node Name",
"dc": "DC",
"rack": "Rack",
"version": "Version",
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 @@ -11,6 +11,7 @@ import type {ProblemFilterValue} from '../settings/types';
export interface NodesPreparedEntity {
NodeId: number;
Host?: string;
NodeName?: string;
SystemState?: EFlag;
DC?: string;
Rack?: string;
Expand Down
1 change: 1 addition & 0 deletions src/types/api/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export interface TSystemStateInfo {

SharedCacheStats?: TNodeSharedCache;
TotalSessions?: number;
NodeName?: string;
}

export type PoolName = 'System' | 'User' | 'Batch' | 'IO' | 'IC';
Expand Down

0 comments on commit a4c24e1

Please sign in to comment.