Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const tulipApi = createApi({
parent_id: flow.link_parent_id,
child_id: flow.link_child_id,
tags: flow.tags,
flags_in: flow.flags_in,
flags_out: flow.flags_out,
flags: flow.flags,
flagids: flow.flagids,
filename: flow.pcap_name,
Expand Down Expand Up @@ -91,6 +93,8 @@ export const tulipApi = createApi({
parent_id: flow.link_parent_id,
child_id: flow.link_child_id,
tags: flow.tags,
flags_in: flow.flags_in,
flags_out: flow.flags_out,
flags: flow.flags,
flagids: flow.flagids,
filename: flow.pcap_name,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/FlowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ function FlowListEntry({ flow, isActive, onHeartClick }: FlowListEntryProps) {
</div>
<div className="flex gap-2 flex-wrap">
{filtered_tag_list.map((tag) => (
<Tag key={tag} tag={tag}></Tag>
<Tag key={tag} tag={tag} count={tag === "flag-in" ? flow.flags_in : (tag === "flag-out" ? flow.flags_out : 0)}></Tag>
))}
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export function tagToColor(tag: string) {
}
interface TagProps {
tag: string;
count?: number;
color?: string;
disabled?: boolean;
excluded?: boolean;
onClick?: () => void;
}
export const Tag = ({ tag, color, disabled = false, excluded = false, onClick }: TagProps) => {
export const Tag = ({ tag, count = 0, color, disabled = false, excluded = false, onClick }: TagProps) => {
var tagBackgroundColor = disabled ? "#eee" : color ?? tagToColor(tag);

var tagTextColor = disabled
Expand All @@ -52,7 +53,7 @@ export const Tag = ({ tag, color, disabled = false, excluded = false, onClick }:
color: tagTextColor,
}}
>
<span style={excluded ? { textDecoration: 'line-through' } : {}}>{tag}</span>
<span style={excluded ? { textDecoration: 'line-through' } : {}}>{tag}{count > 1 ? ` x${count}` : ''}</span>
</div>
);
};
2 changes: 2 additions & 0 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface Flow {
parent_id: Id;
child_id: Id;
tags: string[];
flags_in: number;
flags_out: number;
flags: string[];
flagids: string[];
suricata: number[];
Expand Down