Skip to content

Commit

Permalink
link fields of alerts that refer to a network
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkoopmann committed Aug 27, 2020
1 parent 1beaf29 commit a343eee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web-interface/src/components/alerts/AlertField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ class AlertField extends React.Component {
console.log(this.props);

let additional;
// Link to bandit.
if ((key === "bandit_name" && fields.hasOwnProperty("bandit_uuid"))|| key === "bandit_uuid") {
additional = <a href={Routes.BANDITS.SHOW(fields.bandit_uuid)}><i className="fas fa-link" /></a>
}

// Link to network details.
if (fields.hasOwnProperty("ssid") && fields.hasOwnProperty("bssid") && fields.hasOwnProperty("channel")) {
// We have all fields to link to a network. Link the right fields.
if(key === "ssid" || key === "bssid") {
additional = <a href={Routes.NETWORKS.SHOW(fields.bssid, fields.ssid, fields.channel)}><i className="fas fa-link" /></a>;
}
}

return (
<React.Fragment>
<dt>{key}</dt>
Expand Down

0 comments on commit a343eee

Please sign in to comment.