Skip to content

Commit

Permalink
fix(Core UI): 🐞 Check http status in forwardflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoval committed Jun 16, 2023
1 parent 2806d7f commit b614785
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/core/components/EmptyData/EmptyData.enum.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export enum EmptyDataLabels {
Default = 'no data found'
Default = 'no results found'
}
18 changes: 18 additions & 0 deletions src/pages/Processes/Processes.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@ export const processesConnectedColumns: SKColumn<ProcessPairsResponse>[] = [
}
];

export const processesHttpConnectedColumns: SKColumn<ProcessPairsResponse>[] = [
{
name: ProcessPairsColumnsNames.Process,
prop: 'destinationName' as keyof ProcessPairsResponse,
customCellName: 'ProcessLinkCell'
},
{
name: ProcessPairsColumnsNames.Protocol,
prop: 'protocol' as keyof ProcessPairsResponse,
width: 10
},
{
name: '',
customCellName: 'viewDetailsLinkCell',
modifier: 'fitContent'
}
];

const oldTcpHiddenColumns: Record<string, { show: boolean }> = {
[FlowPairsColumnsNames.Client]: {
show: false
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Processes/Processes.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ export enum ProcessPairsColumnsNames {
LatencyAvgRx = 'Avg Rx Latency',
Flows = 'Flows',
ViewDetails = 'view details',
Title = 'Processes Data transfers'
Title = 'Processes Data transfers',
Protocol = 'Protocol'
}
10 changes: 7 additions & 3 deletions src/pages/Processes/views/Process.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import { TopologyRoutesPaths, TopologyURLFilters, TopologyViews } from '@pages/T
import { ProcessPairsResponse } from 'API/REST.interfaces';

import ProcessDescription from '../components/ProcessDescription';
import { processesConnectedColumns, ProcessesConnectedComponentsTable } from '../Processes.constant';
import {
processesConnectedColumns,
ProcessesConnectedComponentsTable,
processesHttpConnectedColumns
} from '../Processes.constant';
import { ProcessesLabels, ProcessesRoutesPaths } from '../Processes.enum';
import { QueriesProcesses } from '../services/services.enum';

Expand Down Expand Up @@ -157,7 +161,7 @@ const Process = function () {
<FlexItem flex={{ default: 'flex_1' }} alignSelf={{ default: 'alignSelfStretch' }}>
<SkTable
title={ProcessesLabels.HTTPClients}
columns={processesConnectedColumns}
columns={processesHttpConnectedColumns}
rows={HTTPClients}
pagination={true}
paginationPageSize={SMALL_PAGINATION_SIZE}
Expand All @@ -177,7 +181,7 @@ const Process = function () {
<FlexItem flex={{ default: 'flex_1' }} alignSelf={{ default: 'alignSelfStretch' }}>
<SkTable
title={ProcessesLabels.HTTPServers}
columns={processesConnectedColumns}
columns={processesHttpConnectedColumns}
rows={HTTPServers}
pagination={true}
paginationPageSize={SMALL_PAGINATION_SIZE}
Expand Down
8 changes: 6 additions & 2 deletions src/pages/shared/FlowPairs/FlowPairs.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export const flowPairsComponentsTable = {
DurationCell: (props: LinkCellProps<FlowPairsResponse>) =>
DurationCell({ ...props, endTime: props.data.endTime || Date.now() * 1000, startTime: props.data.startTime }),
ByteFormatCell: (props: HighlightValueCellProps<FlowPairsResponse>) =>
HighlightValueCell({ ...props, format: formatBytes })
HighlightValueCell({ ...props, format: formatBytes }),
//TODO; BE need to fix it
HttpStatusCell: (props: { data?: FlowPairsResponse }) =>
props.data?.counterFlow?.result || props.data?.forwardFlow?.result || ''
};

export const tcpFlowPairsColumns: SKColumn<FlowPairsResponse>[] = [
Expand Down Expand Up @@ -125,7 +128,8 @@ export const httpFlowPairsColumns: SKColumn<FlowPairsResponse>[] = [
},
{
name: FlowPairsColumnsNames.StatusCode,
prop: 'counterFlow.result' as keyof FlowPairsResponse
prop: 'counterFlow.result' as keyof FlowPairsResponse,
customCellName: 'HttpStatusCell'
},
{
name: FlowPairsColumnsNames.From,
Expand Down

0 comments on commit b614785

Please sign in to comment.