forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link artifacts to open a modal with description. (Velocidex#1028)
- Loading branch information
Showing
4 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
gui/velociraptor/src/components/artifacts/artifacts-link.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Button from 'react-bootstrap/Button'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import VeloReportViewer from "../artifacts/reporting.js"; | ||
import Modal from 'react-bootstrap/Modal'; | ||
|
||
export default class ArtifactLink extends React.Component { | ||
static propTypes = { | ||
artifact: PropTypes.string, | ||
}; | ||
|
||
state = { | ||
artifact_definition: {}, | ||
showInspector: false, | ||
} | ||
|
||
render() { | ||
return ( | ||
<> | ||
{ this.state.showInspector && | ||
<Modal show={true} | ||
size="lg" | ||
enforceFocus={false} | ||
scrollable={true} | ||
onHide={() => this.setState({showInspector: false})} > | ||
<Modal.Header closeButton> | ||
<Modal.Title>Artifact details</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<VeloReportViewer | ||
artifact={this.props.artifact} | ||
type="ARTIFACT_DESCRIPTION" | ||
/> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button variant="secondary" | ||
onClick={() => this.setState({ | ||
showInspector: false, | ||
})}> | ||
Close | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
} | ||
<Button size="sm" className="client-link" | ||
onClick={()=>this.setState({ | ||
showInspector: true, | ||
})} | ||
variant="outline-info"> | ||
<FontAwesomeIcon icon="external-link-alt"/> | ||
<span className="button-label">{ this.props.artifact }</span> | ||
</Button> | ||
</> | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters