Skip to content

Commit

Permalink
Merge pull request #2778 from weili520/gateway_search_highlight
Browse files Browse the repository at this point in the history
fix: highlight the matched keywords in the query result of gateway logs
  • Loading branch information
ks-ci-bot authored Dec 8, 2021
2 parents 48ef4c6 + 36d5ee8 commit a0e2bf4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ export default class GatewayLog extends React.Component {
.map(({ value }) => value)

const markedResult = this.markMemoizee(queryResult, querys, handler)

const result = markedResult.map(log =>
isString(log)
? log
: `<span class="${styles.hightLightMatch}">${log.hightLighted}</span>`
)
return (
<span
dangerouslySetInnerHTML={{
__html: markedResult.map(log =>
isString(log)
? log
: `<span class="${styles.hightLightMatch}">${log.hightLighted}</span>`
),
__html: result.join(''),
}}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,7 @@
cursor: pointer;
font-weight: $font-bold;
}

.hightLightMatch {
background: $yellow-color02;
}

0 comments on commit a0e2bf4

Please sign in to comment.