diff options
-rw-r--r-- | libmproxy/web/static/css/app.css | 12 | ||||
-rw-r--r-- | libmproxy/web/static/js/app.js | 13 | ||||
-rw-r--r-- | libmproxy/web/templates/index.html | 8 | ||||
-rw-r--r-- | web/gulpfile.js | 2 | ||||
-rw-r--r-- | web/src/css/eventlog.less | 11 | ||||
-rw-r--r-- | web/src/css/header.less | 2 | ||||
-rw-r--r-- | web/src/index.html | 8 | ||||
-rw-r--r-- | web/src/js/components/EventLog.react.js | 6 | ||||
-rw-r--r-- | web/src/js/components/Header.react.js | 9 |
9 files changed, 51 insertions, 20 deletions
diff --git a/libmproxy/web/static/css/app.css b/libmproxy/web/static/css/app.css index fe8fd79a..e5b9d134 100644 --- a/libmproxy/web/static/css/app.css +++ b/libmproxy/web/static/css/app.css @@ -64,7 +64,7 @@ header nav a.special:hover { background-color: #5386c6; } header .menu { - height: 100px; + padding: 10px; border-bottom: solid #a6a6a6 1px; } .eventlog { @@ -76,6 +76,16 @@ header .menu { height: 200px; overflow: auto; } +.eventlog .close-button { + float: right; + margin: -9px; + padding: 4px; + cursor: pointer; + color: grey; +} +.eventlog .close-button:hover { + color: black; +} footer { box-shadow: 0 -1px 3px #d3d3d3; padding: 0px 10px 3px; diff --git a/libmproxy/web/static/js/app.js b/libmproxy/web/static/js/app.js index 7873046a..72bb5ff8 100644 --- a/libmproxy/web/static/js/app.js +++ b/libmproxy/web/static/js/app.js @@ -232,14 +232,13 @@ var MainMenu = React.createClass({displayName: 'MainMenu', mixins: [SettingsMixin], handleSettingsChange:function() { SettingsActions.update({ - showEventLog: this.refs.showEventLogInput.getDOMNode().checked + showEventLog: !this.state.settings.showEventLog }); }, render:function(){ return React.DOM.div(null, - React.DOM.label(null, - React.DOM.input({type: "checkbox", ref: "showEventLogInput", checked: this.state.settings.showEventLog, onChange: this.handleSettingsChange}), - "Show Event Log" + React.DOM.button({className: "btn " + (this.state.settings.showEventLog ? "btn-primary" : "btn-default"), onClick: this.handleSettingsChange}, + React.DOM.i({className: "fa fa-database"}), " Display Event Log" ) ); } @@ -355,10 +354,16 @@ var TrafficTable = React.createClass({displayName: 'TrafficTable', /** @jsx React.DOM */ var EventLog = React.createClass({displayName: 'EventLog', + close:function(){ + SettingsActions.update({ + showEventLog: false + }); + }, render:function(){ return ( React.DOM.div({className: "eventlog"}, React.DOM.pre(null, + React.DOM.i({className: "fa fa-close close-button", onClick: this.close}), "much log." ) ) diff --git a/libmproxy/web/templates/index.html b/libmproxy/web/templates/index.html index 6cef0d25..4db2ed51 100644 --- a/libmproxy/web/templates/index.html +++ b/libmproxy/web/templates/index.html @@ -4,10 +4,10 @@ <meta charset="UTF-8"> <title>mitmproxy</title> <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="stylesheet" href="css/vendor.css"/> - <link rel="stylesheet" href="css/app.css"/> - <script src="js/vendor.js"></script> - <script src="js/app.js"></script> + <link rel="stylesheet" href="/static/css/vendor.css"/> + <link rel="stylesheet" href="/static/css/app.css"/> + <script src="/static/js/vendor.js"></script> + <script src="/static/js/app.js"></script> </head> <body> <div id="mitmproxy"></div> diff --git a/web/gulpfile.js b/web/gulpfile.js index 68a5e479..939f4fcc 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -106,7 +106,7 @@ gulp.task("jshint", function () { gulp.task("html", function () { return gulp.src(path.html) - .pipe(gulp.dest(path.dist + "static")) + .pipe(gulp.dest(path.dist + "templates")) .pipe(livereload({ auto: false })); }); diff --git a/web/src/css/eventlog.less b/web/src/css/eventlog.less index 0e97832b..8ad304aa 100644 --- a/web/src/css/eventlog.less +++ b/web/src/css/eventlog.less @@ -8,4 +8,15 @@ height: 200px; overflow: auto; } + + .close-button { + float: right; + margin: -9px; + padding: 4px; + cursor: pointer; + color: grey; + &:hover { + color: black; + } + } }
\ No newline at end of file diff --git a/web/src/css/header.less b/web/src/css/header.less index 69a947c5..2a3c9765 100644 --- a/web/src/css/header.less +++ b/web/src/css/header.less @@ -45,7 +45,7 @@ header { } .menu { - height: 100px; + padding: 10px; border-bottom: solid @separator-color 1px; } }
\ No newline at end of file diff --git a/web/src/index.html b/web/src/index.html index 6cef0d25..4db2ed51 100644 --- a/web/src/index.html +++ b/web/src/index.html @@ -4,10 +4,10 @@ <meta charset="UTF-8"> <title>mitmproxy</title> <meta name="viewport" content="width=device-width, initial-scale=1"> - <link rel="stylesheet" href="css/vendor.css"/> - <link rel="stylesheet" href="css/app.css"/> - <script src="js/vendor.js"></script> - <script src="js/app.js"></script> + <link rel="stylesheet" href="/static/css/vendor.css"/> + <link rel="stylesheet" href="/static/css/app.css"/> + <script src="/static/js/vendor.js"></script> + <script src="/static/js/app.js"></script> </head> <body> <div id="mitmproxy"></div> diff --git a/web/src/js/components/EventLog.react.js b/web/src/js/components/EventLog.react.js index e710d30c..0ecf40b1 100644 --- a/web/src/js/components/EventLog.react.js +++ b/web/src/js/components/EventLog.react.js @@ -1,10 +1,16 @@ /** @jsx React.DOM */ var EventLog = React.createClass({ + close(){ + SettingsActions.update({ + showEventLog: false + }); + }, render(){ return ( <div className="eventlog"> <pre> + <i className="fa fa-close close-button" onClick={this.close}></i> much log. </pre> </div> diff --git a/web/src/js/components/Header.react.js b/web/src/js/components/Header.react.js index dc304d81..d1f18a82 100644 --- a/web/src/js/components/Header.react.js +++ b/web/src/js/components/Header.react.js @@ -4,15 +4,14 @@ var MainMenu = React.createClass({ mixins: [SettingsMixin], handleSettingsChange() { SettingsActions.update({ - showEventLog: this.refs.showEventLogInput.getDOMNode().checked + showEventLog: !this.state.settings.showEventLog }); }, render(){ return <div> - <label> - <input type="checkbox" ref="showEventLogInput" checked={this.state.settings.showEventLog} onChange={this.handleSettingsChange}/> - Show Event Log - </label> + <button className={"btn " + (this.state.settings.showEventLog ? "btn-primary" : "btn-default")} onClick={this.handleSettingsChange}> + <i className="fa fa-database"></i> Display Event Log + </button> </div>; } }); |