diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-06-26 02:17:07 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-26 02:17:07 -0700 |
commit | ed9a72553df91085021cc2a9187287ac73cc458c (patch) | |
tree | 28ef04d55b541a194d143ef660356e083b7c6c9e | |
parent | 370e6caedc8456de20eaa17aaace0873bc7d204f (diff) | |
download | mitmproxy-ed9a72553df91085021cc2a9187287ac73cc458c.tar.gz mitmproxy-ed9a72553df91085021cc2a9187287ac73cc458c.tar.bz2 mitmproxy-ed9a72553df91085021cc2a9187287ac73cc458c.zip |
fix mitmproxy/mitmweb#25
-rw-r--r-- | web/src/js/components/ContentView.jsx | 8 | ||||
-rw-r--r-- | web/src/js/components/ContentView/MetaViews.jsx (renamed from web/src/js/components/ContentView/ContentErrors.jsx) | 1 | ||||
-rw-r--r-- | web/src/js/components/FlowView/Details.jsx | 8 | ||||
-rwxr-xr-x | web/src/js/components/Prompt.jsx | 22 |
4 files changed, 17 insertions, 22 deletions
diff --git a/web/src/js/components/ContentView.jsx b/web/src/js/components/ContentView.jsx index af3bffc1..1533684e 100644 --- a/web/src/js/components/ContentView.jsx +++ b/web/src/js/components/ContentView.jsx @@ -1,7 +1,7 @@ import React, { Component, PropTypes } from 'react' import { MessageUtils } from '../flow/utils.js' import { ViewAuto, ViewImage } from './ContentView/ContentViews' -import * as ContentErrors from './ContentView/ContentErrors' +import * as MetaViews from './ContentView/MetaViews' import ContentLoader from './ContentView/ContentLoader' import ViewSelector from './ContentView/ViewSelector' @@ -45,15 +45,15 @@ export default class ContentView extends Component { const { displayLarge, View } = this.state if (message.contentLength === 0) { - return <ContentErrors.ContentEmpty {...this.props}/> + return <MetaViews.ContentEmpty {...this.props}/> } if (message.contentLength === null) { - return <ContentErrors.ContentMissing {...this.props}/> + return <MetaViews.ContentMissing {...this.props}/> } if (!displayLarge && this.isContentTooLarge(message)) { - return <ContentErrors.ContentTooLarge {...this.props} onClick={this.displayLarge}/> + return <MetaViews.ContentTooLarge {...this.props} onClick={this.displayLarge}/> } return ( diff --git a/web/src/js/components/ContentView/ContentErrors.jsx b/web/src/js/components/ContentView/MetaViews.jsx index 11594c7f..83720a13 100644 --- a/web/src/js/components/ContentView/ContentErrors.jsx +++ b/web/src/js/components/ContentView/MetaViews.jsx @@ -1,5 +1,4 @@ import React from 'react' -import { ViewImage } from './ContentViews' import {formatSize} from '../../utils.js' export function ContentEmpty({ flow, message }) { diff --git a/web/src/js/components/FlowView/Details.jsx b/web/src/js/components/FlowView/Details.jsx index 78e68ecf..6a16a98e 100644 --- a/web/src/js/components/FlowView/Details.jsx +++ b/web/src/js/components/FlowView/Details.jsx @@ -28,13 +28,9 @@ export function ConnectionInfo({ conn }) { <td>Address:</td> <td>{conn.address.address.join(':')}</td> </tr> - {conn.sni ? ( - <tr key="sni"></tr> - ) : ( + {conn.sni && ( <tr key="sni"> - <td> - <abbr title="TLS Server Name Indication">TLS SNI:</abbr> - </td> + <td><abbr title="TLS Server Name Indication">TLS SNI:</abbr></td> <td>{conn.sni}</td> </tr> )} diff --git a/web/src/js/components/Prompt.jsx b/web/src/js/components/Prompt.jsx index 701a0b85..e6564896 100755 --- a/web/src/js/components/Prompt.jsx +++ b/web/src/js/components/Prompt.jsx @@ -35,6 +35,17 @@ export default function Prompt({ prompt, done, options }, context) { } opts.push(opt) } + + function onKeyDown(event) { + event.stopPropagation() + event.preventDefault() + const key = opts.find(opt => Key[opt.key.toUpperCase()] === event.keyCode) + if (!key && event.keyCode !== Key.ESC && event.keyCode !== Key.ENTER) { + return + } + done(key.key || false) + context.returnFocus() + } return ( <div tabIndex="0" onKeyDown={onKeyDown} className="prompt-dialog"> @@ -57,15 +68,4 @@ export default function Prompt({ prompt, done, options }, context) { </div> </div> ) - - function onKeyDown(event) { - event.stopPropagation() - event.preventDefault() - const key = opts.find(opt => Key[opt.key.toUpperCase()] === event.keyCode) - if (!key && event.keyCode !== Key.ESC && event.keyCode !== Key.ENTER) { - return - } - done(key.key || false) - context.returnFocus() - } } |