From 06eff652dd25228d86a5c228f833174f69cd7197 Mon Sep 17 00:00:00 2001 From: Gala Date: Wed, 21 Dec 2022 11:54:41 +0100 Subject: [PATCH] wip adding gt version --- explorer/src/components/Gateways.ts | 17 ++++++++++------- explorer/src/pages/Gateways/index.tsx | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/explorer/src/components/Gateways.ts b/explorer/src/components/Gateways.ts index e75c9aeb05..6e6d08b1f9 100644 --- a/explorer/src/components/Gateways.ts +++ b/explorer/src/components/Gateways.ts @@ -7,6 +7,7 @@ export type GatewayRowType = { bond: number; host: string; location: string; + version: string; }; export type GatewayEnrichedRowType = GatewayRowType & { @@ -20,13 +21,14 @@ export function gatewayToGridRow(arrayOfGateways: GatewayResponse): GatewayRowTy return !arrayOfGateways ? [] : arrayOfGateways.map((gw) => ({ - id: gw.owner, - owner: gw.owner, - identityKey: gw.gateway.identity_key || '', - location: gw?.gateway?.location || '', - bond: gw.pledge_amount.amount || 0, - host: gw.gateway.host || '', - })); + id: gw.owner, + owner: gw.owner, + identityKey: gw.gateway.identity_key || '', + location: gw?.gateway?.location || '', + bond: gw.pledge_amount.amount || 0, + host: gw.gateway.host || '', + version: gw.gateway.version || '', + })); } export function gatewayEnrichedToGridRow( @@ -40,6 +42,7 @@ export function gatewayEnrichedToGridRow( location: gateway?.gateway?.location || '', bond: gateway.pledge_amount.amount || 0, host: gateway.gateway.host || '', + version: gateway.gateway.version || '', clientsPort: gateway.gateway.clients_port || 0, mixPort: gateway.gateway.mix_port || 0, routingScore: `${report.most_recent}%`, diff --git a/explorer/src/pages/Gateways/index.tsx b/explorer/src/pages/Gateways/index.tsx index 2430e4f9a5..60fdf28bd5 100644 --- a/explorer/src/pages/Gateways/index.tsx +++ b/explorer/src/pages/Gateways/index.tsx @@ -27,6 +27,7 @@ export const PageGateways: React.FC = () => { React.useEffect(() => { if (searchTerm === '' && gateways?.data) { + console.log('gateways?.data', gateways?.data); setFilteredGateways(gateways?.data); } else { const filtered = gateways?.data?.filter((g) => { @@ -142,6 +143,25 @@ export const PageGateways: React.FC = () => { ), }, + , + { + field: 'version', + headerName: 'Version', + renderHeader: () => , + width: 150, + headerAlign: 'left', + headerClassName: 'MuiDataGrid-header-override', + renderCell: (params: GridRenderCellParams) => ( + + {params.value} + + ), + }, ]; const handlePageSize = (event: SelectChangeEvent) => {