mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-25 18:03:50 +00:00
[web] Add Option Modal to FileMenu.
This commit is contained in:
parent
c0ad25715b
commit
2a9b2a549a
@ -4,11 +4,13 @@ import { connect } from 'react-redux'
|
|||||||
import FileChooser from '../common/FileChooser'
|
import FileChooser from '../common/FileChooser'
|
||||||
import Dropdown, {Divider} from '../common/Dropdown'
|
import Dropdown, {Divider} from '../common/Dropdown'
|
||||||
import * as flowsActions from '../../ducks/flows'
|
import * as flowsActions from '../../ducks/flows'
|
||||||
|
import * as modalActions from '../../ducks/ui/modal'
|
||||||
|
|
||||||
FileMenu.propTypes = {
|
FileMenu.propTypes = {
|
||||||
clearFlows: PropTypes.func.isRequired,
|
clearFlows: PropTypes.func.isRequired,
|
||||||
loadFlows: PropTypes.func.isRequired,
|
loadFlows: PropTypes.func.isRequired,
|
||||||
saveFlows: PropTypes.func.isRequired
|
saveFlows: PropTypes.func.isRequired,
|
||||||
|
openModal: PropTypes.func.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
FileMenu.onNewClick = (e, clearFlows) => {
|
FileMenu.onNewClick = (e, clearFlows) => {
|
||||||
@ -17,7 +19,7 @@ FileMenu.onNewClick = (e, clearFlows) => {
|
|||||||
clearFlows()
|
clearFlows()
|
||||||
}
|
}
|
||||||
|
|
||||||
export function FileMenu ({clearFlows, loadFlows, saveFlows}) {
|
export function FileMenu ({clearFlows, loadFlows, saveFlows, openModal}) {
|
||||||
return (
|
return (
|
||||||
<Dropdown className="pull-left" btnClass="special" text="mitmproxy">
|
<Dropdown className="pull-left" btnClass="special" text="mitmproxy">
|
||||||
<a href="#" onClick={e => FileMenu.onNewClick(e, clearFlows)}>
|
<a href="#" onClick={e => FileMenu.onNewClick(e, clearFlows)}>
|
||||||
@ -34,6 +36,11 @@ export function FileMenu ({clearFlows, loadFlows, saveFlows}) {
|
|||||||
Save...
|
Save...
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href="#" onClick={e => { openModal('OptionModal') }}>
|
||||||
|
<i className="fa fa-fw fa-cog"></i>
|
||||||
|
Options
|
||||||
|
</a>
|
||||||
|
|
||||||
<Divider/>
|
<Divider/>
|
||||||
|
|
||||||
<a href="http://mitm.it/" target="_blank">
|
<a href="http://mitm.it/" target="_blank">
|
||||||
@ -50,5 +57,6 @@ export default connect(
|
|||||||
clearFlows: flowsActions.clear,
|
clearFlows: flowsActions.clear,
|
||||||
loadFlows: flowsActions.upload,
|
loadFlows: flowsActions.upload,
|
||||||
saveFlows: flowsActions.download,
|
saveFlows: flowsActions.download,
|
||||||
|
openModal: modalActions.setActiveModal,
|
||||||
}
|
}
|
||||||
)(FileMenu)
|
)(FileMenu)
|
||||||
|
Loading…
Reference in New Issue
Block a user