forked from SpecterOps/BloodHound-Legacy
-
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.
- Loading branch information
Showing
12 changed files
with
321 additions
and
21 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,120 @@ | ||
import React, { Component } from 'react'; | ||
|
||
export default class Settings extends Component { | ||
constructor(){ | ||
super(); | ||
} | ||
|
||
componentDidMount() { | ||
emitter.on('openSettings', function(){ | ||
this.openSettings() | ||
}.bind(this)) | ||
|
||
$(this.refs.edge).simpleSlider({ | ||
range: [0,20], | ||
step: 1, | ||
theme: 'volume slideinline' | ||
}) | ||
|
||
$(this.refs.sibling).simpleSlider({ | ||
range: [0,20], | ||
step: 1, | ||
theme: 'volume slideinline' | ||
}) | ||
|
||
$(this.refs.edge).bind('slider:changed', this.edgeChange.bind(this)) | ||
$(this.refs.sibling).bind('slider:changed', this.siblingChange.bind(this)) | ||
|
||
$(this.refs.edge).simpleSlider('setValue', appStore.performance.edge) | ||
$(this.refs.sibling).simpleSlider('setValue', appStore.performance.sibling) | ||
|
||
$(this.refs.check).prop('checked', appStore.performance.lowGraphics) | ||
|
||
$(this.refs.outer).fadeToggle(0) | ||
} | ||
|
||
edgeChange(event, data){ | ||
appStore.performance.edge = data.value; | ||
$(this.refs.edgeinput).val(data.value) | ||
conf.set('performance', appStore.performance) | ||
} | ||
|
||
siblingChange(event, data){ | ||
appStore.performance.sibling = data.value; | ||
$(this.refs.siblinginput).val(data.value) | ||
conf.set('performance', appStore.performance) | ||
} | ||
|
||
onGfxChange(event){ | ||
$(this.refs.check).prop('checked', event.target.checked) | ||
appStore.performance.lowGraphics = event.target.checked | ||
conf.set('performance', appStore.performance) | ||
emitter.emit('changeGraphicsMode') | ||
} | ||
|
||
closeSettings(){ | ||
$(this.refs.outer).fadeToggle(false) | ||
} | ||
|
||
openSettings(){ | ||
$(this.refs.outer).fadeToggle(false) | ||
} | ||
|
||
updateSibling(event){ | ||
$(this.refs.sibling).simpleSlider('setValue', event.target.value) | ||
} | ||
|
||
updateEdge(event){ | ||
$(this.refs.edge).simpleSlider('setValue', event.target.value) | ||
} | ||
|
||
render() { | ||
return ( | ||
<div></div> | ||
<div ref="outer" className="settingsDiv panel panel-default"> | ||
<div className="panel-heading"> | ||
Settings | ||
<button type="button" className="close" onClick={this.closeSettings.bind(this)} aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
|
||
<div className="panel-body sliderfix"> | ||
<div> | ||
<strong>Sibling Collapse Threshold</strong> | ||
<i data-toggle="tooltip" | ||
data-placement="right" | ||
title="Merge nodes that have the same parent. 0 to Disable, Default 10" | ||
className="glyphicon glyphicon-question-sign"></i> | ||
<br/> | ||
<input type="text" ref="sibling" /> | ||
<span> | ||
<input onChange={this.updateSibling.bind(this)} type="number" min="0" max="20" className="sliderinput" ref="siblinginput" /> | ||
</span> | ||
</div> | ||
|
||
<div> | ||
<strong>Node Collapse Threshold</strong> | ||
<i data-toggle="tooltip" | ||
data-placement="right" | ||
title="Collapse nodes at the end of paths that only have one relationship. 0 to Disable, Default 5" | ||
className="glyphicon glyphicon-question-sign"></i> | ||
<br /> | ||
<input type="text" ref="edge" /> | ||
<span> | ||
<input type="number" min="0" max="20" className="sliderinput" ref="edgeinput" /> | ||
</span> | ||
</div> | ||
<div className="checkbox-inline"> | ||
<label> | ||
<input ref="check" type="checkbox" onChange={this.onGfxChange.bind(this)}/> Low Detail Mode | ||
</label> | ||
</div> | ||
<i data-toggle="tooltip" | ||
data-placement="right" | ||
title="Lower detail of graph to improve performance" | ||
className="glyphicon glyphicon-question-sign"></i> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
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
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,38 @@ | ||
import React, { Component } from 'react'; | ||
|
||
var Modal = require('react-bootstrap').Modal; | ||
|
||
export default class ClearingModal extends Component { | ||
constructor(){ | ||
super(); | ||
this.state = { | ||
open: false | ||
} | ||
} | ||
|
||
openModal(){ | ||
this.setState({open: true}) | ||
} | ||
|
||
closeModal(){ | ||
this.setState({ open: false }) | ||
} | ||
|
||
componentDidMount() { | ||
emitter.on('openClearingModal', this.openModal.bind(this)) | ||
emitter.on('hideDBClearModal', this.closeModal.bind(this)) | ||
} | ||
render() { | ||
return ( | ||
<Modal | ||
show={this.state.open} | ||
onHide={this.closeModal} | ||
aria-labelledby="ClearingModalHeader"> | ||
|
||
<Modal.Header closeButton={true}> | ||
<Modal.Title id="ClearingModalHeader">Clearing Database</Modal.Title> | ||
</Modal.Header> | ||
</Modal> | ||
); | ||
} | ||
} |
Oops, something went wrong.