mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-05 10:41:36 +00:00
Fix more issues that are introduced by the merge
This commit is contained in:
parent
be689295e3
commit
11c233028b
@ -29,7 +29,7 @@ func NewApplicableRules(status bool, latency int64) tapApi.ApplicableRules {
|
|||||||
ar := tapApi.ApplicableRules{}
|
ar := tapApi.ApplicableRules{}
|
||||||
ar.Status = status
|
ar.Status = status
|
||||||
ar.Latency = latency
|
ar.Latency = latency
|
||||||
ar.NumberOfRules = number
|
// ar.NumberOfRules = number
|
||||||
return ar
|
return ar
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ func (fewp *FullEntryWithPolicy) UnmarshalData(entry *tapApi.MizuEntry) error {
|
|||||||
func RunValidationRulesState(harEntry har.Entry, service string) tapApi.ApplicableRules {
|
func RunValidationRulesState(harEntry har.Entry, service string) tapApi.ApplicableRules {
|
||||||
numberOfRules, resultPolicyToSend := rules.MatchRequestPolicy(harEntry, service)
|
numberOfRules, resultPolicyToSend := rules.MatchRequestPolicy(harEntry, service)
|
||||||
statusPolicyToSend, latency, numberOfRules := rules.PassedValidationRules(resultPolicyToSend, numberOfRules)
|
statusPolicyToSend, latency, numberOfRules := rules.PassedValidationRules(resultPolicyToSend, numberOfRules)
|
||||||
ar := NewApplicableRules(statusPolicyToSend, latency, numberOfRules)
|
ar := NewApplicableRules(statusPolicyToSend, latency)
|
||||||
return ar
|
return ar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ export const HarEntriesList: React.FC<HarEntriesListProps> = ({entries, setEntri
|
|||||||
if(list instanceof HTMLElement) {
|
if(list instanceof HTMLElement) {
|
||||||
list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' })
|
list.scrollTo({ top: list.scrollHeight, behavior: 'smooth' })
|
||||||
}
|
}
|
||||||
}}><img src={uninon} />
|
}}><img alt="Union" src={uninon} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -61,34 +61,42 @@ export const HarEntry: React.FC<HAREntryProps> = ({entry, setFocusedEntryId, isS
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let additionalRulesProperties = "";
|
// let additionalRulesProperties = "";
|
||||||
let ruleSuccess: boolean;
|
// let ruleSuccess: boolean;
|
||||||
let rule = 'latency' in entry.rules
|
let rule = 'latency' in entry.rules
|
||||||
if (rule) {
|
if (rule) {
|
||||||
if (entry.rules.latency !== -1) {
|
if (entry.rules.latency !== -1) {
|
||||||
if (entry.rules.latency >= entry.latency) {
|
if (entry.rules.latency >= entry.latency) {
|
||||||
additionalRulesProperties = styles.ruleSuccessRow
|
// additionalRulesProperties = styles.ruleSuccessRow
|
||||||
ruleSuccess = true
|
// ruleSuccess = true
|
||||||
} else {
|
} else {
|
||||||
additionalRulesProperties = styles.ruleFailureRow
|
// additionalRulesProperties = styles.ruleFailureRow
|
||||||
ruleSuccess = false
|
// ruleSuccess = false
|
||||||
}
|
}
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
additionalRulesProperties += ` ${entry.rules.latency >= entry.latency ? styles.ruleSuccessRowSelected : styles.ruleFailureRowSelected}`
|
// additionalRulesProperties += ` ${entry.rules.latency >= entry.latency ? styles.ruleSuccessRowSelected : styles.ruleFailureRowSelected}`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (entry.rules.status) {
|
if (entry.rules.status) {
|
||||||
additionalRulesProperties = styles.ruleSuccessRow
|
// additionalRulesProperties = styles.ruleSuccessRow
|
||||||
ruleSuccess = true
|
// ruleSuccess = true
|
||||||
} else {
|
} else {
|
||||||
additionalRulesProperties = styles.ruleFailureRow
|
// additionalRulesProperties = styles.ruleFailureRow
|
||||||
ruleSuccess = false
|
// ruleSuccess = false
|
||||||
}
|
}
|
||||||
if (isSelected) {
|
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 <>
|
return <>
|
||||||
<div
|
<div
|
||||||
id={entry.id}
|
id={entry.id}
|
||||||
@ -107,13 +115,6 @@ export const HarEntry: React.FC<HAREntryProps> = ({entry, setFocusedEntryId, isS
|
|||||||
<span title="Service Name">{entry.service}</span>
|
<span title="Service Name">{entry.service}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{
|
|
||||||
rule ?
|
|
||||||
<div className={`${ruleSuccess ? styles.ruleNumberTextSuccess : styles.ruleNumberTextFailure}`}>
|
|
||||||
{`Rules (${numberOfRules})`}
|
|
||||||
</div>
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
<div className={styles.directionContainer}>
|
<div className={styles.directionContainer}>
|
||||||
<span className={styles.port} title="Source Port">{entry.source_port}</span>
|
<span className={styles.port} title="Source Port">{entry.source_port}</span>
|
||||||
{entry.isOutgoing ?
|
{entry.isOutgoing ?
|
||||||
|
Loading…
Reference in New Issue
Block a user