Skip to content

Commit 412ac8f

Browse files
committed
manage missing features on filters
1 parent 67a9dd2 commit 412ac8f

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

web/src/components/netflow-traffic.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({
122122
return model.config.features.includes('pktDrop');
123123
}, [model.config.features]);
124124

125+
const isUdn = React.useCallback(() => {
126+
return model.config.features.includes('udnMapping');
127+
}, [model.config.features]);
128+
129+
const isPktXlat = React.useCallback(() => {
130+
return model.config.features.includes('packetTranslation');
131+
}, [model.config.features]);
132+
133+
const isNetEvents = React.useCallback(() => {
134+
return model.config.features.includes('networkEvents');
135+
}, [model.config.features]);
136+
125137
const isPromOnly = React.useCallback(() => {
126138
return !allowLoki() || model.dataSource === 'prom';
127139
}, [allowLoki, model.dataSource]);
@@ -209,6 +221,9 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({
209221
(isDNSTracking() || !fd.id.startsWith('dns_')) &&
210222
(isPktDrop() || !fd.id.startsWith('pkt_drop_')) &&
211223
(isFlowRTT() || fd.id !== 'time_flow_rtt') &&
224+
(isUdn() || fd.id !== 'udns') &&
225+
(isPktXlat() || fd.id.startsWith('xlat_')) &&
226+
(isNetEvents() || fd.id !== 'network_events') &&
212227
(!isPromOnly() || checkFilterAvailable(fd, model.config.promLabels))
213228
);
214229
// eslint-disable-next-line react-hooks/exhaustive-deps

web/src/model/config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ import { RecordType } from './flow-query';
55
import { RawQuickFilter } from './quick-filters';
66
import { ScopeConfigDef } from './scope';
77

8-
export type Feature = 'multiCluster' | 'zones' | 'pktDrop' | 'dnsTracking' | 'flowRTT';
8+
export type Feature =
9+
| 'multiCluster'
10+
| 'zones'
11+
| 'pktDrop'
12+
| 'dnsTracking'
13+
| 'flowRTT'
14+
| 'udnMapping'
15+
| 'packetTranslation'
16+
| 'networkEvents';
917

1018
export type Deduper = {
1119
mark: boolean;

web/src/model/filters.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,21 @@ export type FilterId =
3232
| 'dscp'
3333
| 'icmp_type'
3434
| 'icmp_code'
35+
| 'udns'
3536
| 'id'
3637
| 'pkt_drop_state'
3738
| 'pkt_drop_cause'
3839
| 'dns_id'
3940
| 'dns_latency'
4041
| 'dns_flag_response_code'
4142
| 'dns_errno'
42-
| 'time_flow_rtt';
43+
| 'time_flow_rtt'
44+
| 'network_events'
45+
| 'xlat_zone_id'
46+
| 'xlat_src_address'
47+
| 'xlat_dst_address'
48+
| 'xlat_src_port'
49+
| 'xlat_dst_port';
4350

4451
export interface FilterConfigDef {
4552
id: string;

0 commit comments

Comments
 (0)