diff --git a/agent/pkg/models/models.go b/agent/pkg/models/models.go index 8aa419f53..5a57ec079 100644 --- a/agent/pkg/models/models.go +++ b/agent/pkg/models/models.go @@ -29,7 +29,7 @@ func NewApplicableRules(status bool, latency int64) tapApi.ApplicableRules { ar := tapApi.ApplicableRules{} ar.Status = status ar.Latency = latency - ar.NumberOfRules = number + // ar.NumberOfRules = number return ar } @@ -168,7 +168,7 @@ func (fewp *FullEntryWithPolicy) UnmarshalData(entry *tapApi.MizuEntry) error { func RunValidationRulesState(harEntry har.Entry, service string) tapApi.ApplicableRules { numberOfRules, resultPolicyToSend := rules.MatchRequestPolicy(harEntry, service) statusPolicyToSend, latency, numberOfRules := rules.PassedValidationRules(resultPolicyToSend, numberOfRules) - ar := NewApplicableRules(statusPolicyToSend, latency, numberOfRules) + ar := NewApplicableRules(statusPolicyToSend, latency) return ar } diff --git a/ui/src/components/HarEntriesList.tsx b/ui/src/components/HarEntriesList.tsx index 9ba52450f..48799a845 100644 --- a/ui/src/components/HarEntriesList.tsx +++ b/ui/src/components/HarEntriesList.tsx @@ -131,7 +131,7 @@ export const HarEntriesList: React.FC = ({entries, setEntri if(list instanceof HTMLElement) { list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' }) } - }}> + }}>Union diff --git a/ui/src/components/HarEntry.tsx b/ui/src/components/HarEntry.tsx index 7f79e7ed5..5769bb664 100644 --- a/ui/src/components/HarEntry.tsx +++ b/ui/src/components/HarEntry.tsx @@ -61,34 +61,42 @@ export const HarEntry: React.FC = ({entry, setFocusedEntryId, isS break; } } - let additionalRulesProperties = ""; - let ruleSuccess: boolean; + // let additionalRulesProperties = ""; + // let ruleSuccess: boolean; let rule = 'latency' in entry.rules if (rule) { if (entry.rules.latency !== -1) { if (entry.rules.latency >= entry.latency) { - additionalRulesProperties = styles.ruleSuccessRow - ruleSuccess = true + // additionalRulesProperties = styles.ruleSuccessRow + // ruleSuccess = true } else { - additionalRulesProperties = styles.ruleFailureRow - ruleSuccess = false + // additionalRulesProperties = styles.ruleFailureRow + // ruleSuccess = false } if (isSelected) { - additionalRulesProperties += ` ${entry.rules.latency >= entry.latency ? styles.ruleSuccessRowSelected : styles.ruleFailureRowSelected}` + // additionalRulesProperties += ` ${entry.rules.latency >= entry.latency ? styles.ruleSuccessRowSelected : styles.ruleFailureRowSelected}` } } else { if (entry.rules.status) { - additionalRulesProperties = styles.ruleSuccessRow - ruleSuccess = true + // additionalRulesProperties = styles.ruleSuccessRow + // ruleSuccess = true } else { - additionalRulesProperties = styles.ruleFailureRow - ruleSuccess = false + // additionalRulesProperties = styles.ruleFailureRow + // ruleSuccess = false } if (isSelected) { - additionalRulesProperties += ` ${entry.rules.status ? styles.ruleSuccessRowSelected : styles.ruleFailureRowSelected}` + // additionalRulesProperties += ` ${entry.rules.status ? styles.ruleSuccessRowSelected : styles.ruleFailureRowSelected}` } } } + let backgroundColor = ""; + if ('latency' in entry.rules) { + if (entry.rules.latency !== -1) { + backgroundColor = entry.rules.latency >= entry.latency ? styles.ruleSuccessRow : styles.ruleFailureRow + } else { + backgroundColor = entry.rules.status ? styles.ruleSuccessRow : styles.ruleFailureRow + } + } return <>
= ({entry, setFocusedEntryId, isS {entry.service}
- { - rule ? -
- {`Rules (${numberOfRules})`} -
- : "" - }
{entry.source_port} {entry.isOutgoing ?