Skip to content

Commit e5648c3

Browse files
memodijotak
authored andcommitted
Make IPSec columns visible if feature is enabled (#837)
1 parent 70af9ba commit e5648c3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

web/src/components/netflow-traffic.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({
134134
return model.config.features.includes('networkEvents');
135135
}, [model.config.features]);
136136

137+
const isIPSec = React.useCallback(() => {
138+
return model.config.features.includes('ipsec');
139+
}, [model.config.features]);
140+
137141
const isPromOnly = React.useCallback(() => {
138142
return !allowLoki() || model.dataSource === 'prom';
139143
}, [allowLoki, model.dataSource]);
@@ -224,7 +228,8 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({
224228
(isUdn() || fd.id !== 'udns') &&
225229
(isPktXlat() || !fd.id.startsWith('xlat_')) &&
226230
(isNetEvents() || fd.id !== 'network_events') &&
227-
(!isPromOnly() || checkFilterAvailable(fd, model.config.promLabels))
231+
(!isPromOnly() || checkFilterAvailable(fd, model.config.promLabels)) &&
232+
(isIPSec() || !fd.id.startsWith('ipsec_'))
228233
);
229234
// eslint-disable-next-line react-hooks/exhaustive-deps
230235
}, [model.config.columns, model.config.filters, model.config.promLabels, isPromOnly]);

web/src/model/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export type Feature =
1313
| 'flowRTT'
1414
| 'udnMapping'
1515
| 'packetTranslation'
16-
| 'networkEvents';
16+
| 'networkEvents'
17+
| 'ipsec';
1718

1819
export type Deduper = {
1920
mark: boolean;

web/src/model/filters.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export type FilterId =
4646
| 'xlat_src_address'
4747
| 'xlat_dst_address'
4848
| 'xlat_src_port'
49-
| 'xlat_dst_port';
49+
| 'xlat_dst_port'
50+
| 'ipsec_success'
51+
| 'ipsec_retcode';
5052

5153
export interface FilterConfigDef {
5254
id: string;

0 commit comments

Comments
 (0)