diff options
Diffstat (limited to 'web/src/js/components')
-rw-r--r-- | web/src/js/components/Footer.jsx | 10 | ||||
-rw-r--r-- | web/src/js/components/Header.jsx | 5 | ||||
-rw-r--r-- | web/src/js/components/Header/FileMenu.jsx | 4 | ||||
-rw-r--r-- | web/src/js/components/Header/FlowMenu.jsx | 7 | ||||
-rw-r--r-- | web/src/js/components/Header/OptionMenu.jsx | 8 | ||||
-rw-r--r-- | web/src/js/components/common/HideInStatic.jsx | 5 |
6 files changed, 34 insertions, 5 deletions
diff --git a/web/src/js/components/Footer.jsx b/web/src/js/components/Footer.jsx index 08d15496..db9afe6f 100644 --- a/web/src/js/components/Footer.jsx +++ b/web/src/js/components/Footer.jsx @@ -2,6 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { formatSize } from '../utils.js' +import HideInStatic from '../components/common/HideInStatic' Footer.propTypes = { settings: PropTypes.object.isRequired, @@ -49,11 +50,14 @@ function Footer({ settings }) { <span className="label label-success">stream: {formatSize(stream_large_bodies)}</span> )} <div className="pull-right"> - {server && ( + <HideInStatic> + { + server && ( <span className="label label-primary" title="HTTP Proxy Server Address"> {listen_host||"*"}:{listen_port} - </span> - )} + </span>) + } + </HideInStatic> <span className="label label-info" title="Mitmproxy Version"> v{version} </span> diff --git a/web/src/js/components/Header.jsx b/web/src/js/components/Header.jsx index ebe7453c..9b7354eb 100644 --- a/web/src/js/components/Header.jsx +++ b/web/src/js/components/Header.jsx @@ -8,6 +8,7 @@ import FileMenu from './Header/FileMenu' import FlowMenu from './Header/FlowMenu' import {setActiveMenu} from '../ducks/ui/header' import ConnectionIndicator from "./Header/ConnectionIndicator" +import HideInStatic from './common/HideInStatic' class Header extends Component { static entries = [MainMenu, OptionMenu] @@ -40,7 +41,9 @@ class Header extends Component { {Entry.title} </a> ))} - <ConnectionIndicator/> + <HideInStatic> + <ConnectionIndicator/> + </HideInStatic> </nav> <div> <Active/> diff --git a/web/src/js/components/Header/FileMenu.jsx b/web/src/js/components/Header/FileMenu.jsx index 62f721cf..5cb8e507 100644 --- a/web/src/js/components/Header/FileMenu.jsx +++ b/web/src/js/components/Header/FileMenu.jsx @@ -5,6 +5,7 @@ import FileChooser from '../common/FileChooser' import Dropdown, {Divider} from '../common/Dropdown' import * as flowsActions from '../../ducks/flows' import * as modalActions from '../../ducks/ui/modal' +import HideInStatic from "../common/HideInStatic"; FileMenu.propTypes = { clearFlows: PropTypes.func.isRequired, @@ -36,17 +37,18 @@ export function FileMenu ({clearFlows, loadFlows, saveFlows, openModal}) { Save... </a> + <HideInStatic> <a href="#" onClick={e => { e.preventDefault(); openModal(); }}> <i className="fa fa-fw fa-cog"></i> Options </a> - <Divider/> <a href="http://mitm.it/" target="_blank"> <i className="fa fa-fw fa-external-link"></i> Install Certificates... </a> + </HideInStatic> </Dropdown> ) } diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx index 8f104213..70c8bfcf 100644 --- a/web/src/js/components/Header/FlowMenu.jsx +++ b/web/src/js/components/Header/FlowMenu.jsx @@ -4,6 +4,7 @@ import { connect } from "react-redux" import Button from "../common/Button" import { MessageUtils } from "../../flow/utils.js" import * as flowsActions from "../../ducks/flows" +import HideInStatic from "../common/HideInStatic"; FlowMenu.title = 'Flow' @@ -22,6 +23,7 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow return <div/> return ( <div> + <HideInStatic> <div className="menu-group"> <div className="menu-content"> <Button title="[r]eplay flow" icon="fa-repeat text-primary" @@ -43,6 +45,8 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow </div> <div className="menu-legend">Flow Modification</div> </div> + </HideInStatic> + <div className="menu-group"> <div className="menu-content"> <Button title="download" icon="fa-download" @@ -52,6 +56,8 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow </div> <div className="menu-legend">Export</div> </div> + + <HideInStatic> <div className="menu-group"> <div className="menu-content"> <Button disabled={!flow || !flow.intercepted} title="[a]ccept intercepted flow" @@ -65,6 +71,7 @@ export function FlowMenu({ flow, resumeFlow, killFlow, replayFlow, duplicateFlow </div> <div className="menu-legend">Interception</div> </div> + </HideInStatic> </div> diff --git a/web/src/js/components/Header/OptionMenu.jsx b/web/src/js/components/Header/OptionMenu.jsx index b33d578d..c41c9d99 100644 --- a/web/src/js/components/Header/OptionMenu.jsx +++ b/web/src/js/components/Header/OptionMenu.jsx @@ -3,12 +3,14 @@ import PropTypes from 'prop-types' import { connect } from "react-redux" import { SettingsToggle, EventlogToggle } from "./MenuToggle" import DocsLink from "../common/DocsLink" +import HideInStatic from "../common/HideInStatic"; OptionMenu.title = 'Options' export default function OptionMenu() { return ( <div> + <HideInStatic> <div className="menu-group"> <div className="menu-content"> <SettingsToggle setting="http2">HTTP/2.0</SettingsToggle> @@ -17,6 +19,7 @@ export default function OptionMenu() { </div> <div className="menu-legend">Protocol Support</div> </div> + <div className="menu-group"> <div className="menu-content"> <SettingsToggle setting="anticache"> @@ -29,12 +32,17 @@ export default function OptionMenu() { </div> <div className="menu-legend">HTTP Options</div> </div> + </HideInStatic> + <div className="menu-group"> <div className="menu-content"> + <HideInStatic> <SettingsToggle setting="showhost"> Use Host Header <i className="fa fa-question-circle" title="Use the Host header to construct URLs for display."></i> </SettingsToggle> + </HideInStatic> + <EventlogToggle/> </div> <div className="menu-legend">View Options</div> diff --git a/web/src/js/components/common/HideInStatic.jsx b/web/src/js/components/common/HideInStatic.jsx new file mode 100644 index 00000000..c5f3bf47 --- /dev/null +++ b/web/src/js/components/common/HideInStatic.jsx @@ -0,0 +1,5 @@ +import React from 'react' + +export default function HideInStatic({ children }) { + return global.MITMWEB_STATIC ? null : [children] +} |