You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-mitmproxy/addon/web/client/build/static/js/main.37b6cc16.chunk.js

2 lines
11 KiB
JavaScript

(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{30:function(e,t,n){},35:function(e,t,n){"use strict";n.r(t);var s=n(0),r=n.n(s),i=n(9),c=n.n(i),a=(n(29),n(12)),l=n(13),o=n(18),d=n(17),h=n(24),j=n(7),u=n(10),b=(n(30),n(11)),f=n(14),O=n(16),p=n(19),w=n(15),x=n(1),v=function(e){Object(o.a)(n,e);var t=Object(d.a)(n);function n(e){var s;return Object(a.a)(this,n),(s=t.call(this,e)).state={show:!1,rule:{method:"ALL",url:"",action:"1"}},s.handleClose=s.handleClose.bind(Object(f.a)(s)),s.handleShow=s.handleShow.bind(Object(f.a)(s)),s.handleSave=s.handleSave.bind(Object(f.a)(s)),s}return Object(l.a)(n,[{key:"handleClose",value:function(){this.setState({show:!1})}},{key:"handleShow",value:function(){this.setState({show:!0})}},{key:"handleSave",value:function(){var e=this.state.rule,t=[];e.url&&t.push({method:"ALL"===e.method?"":e.method,url:e.url,action:parseInt(e.action)}),this.props.onSave(t),this.handleClose()}},{key:"render",value:function(){var e=this,t=this.state.rule;return Object(x.jsxs)("div",{children:[Object(x.jsx)(u.a,{size:"sm",onClick:this.handleShow,children:"BreakPoint"}),Object(x.jsxs)(O.a,{show:this.state.show,onHide:this.handleClose,children:[Object(x.jsx)(O.a.Header,{closeButton:!0,children:Object(x.jsx)(O.a.Title,{children:"Set BreakPoint"})}),Object(x.jsx)(O.a.Body,{children:Object(x.jsxs)(j.a,{children:[Object(x.jsxs)(j.a.Group,{as:p.a,children:[Object(x.jsx)(j.a.Label,{column:!0,sm:2,children:"Method"}),Object(x.jsx)(w.a,{sm:10,children:Object(x.jsxs)(j.a.Control,{as:"select",value:t.method,onChange:function(n){e.setState({rule:Object(b.a)(Object(b.a)({},t),{},{method:n.target.value})})},children:[Object(x.jsx)("option",{children:"ALL"}),Object(x.jsx)("option",{children:"GET"}),Object(x.jsx)("option",{children:"POST"}),Object(x.jsx)("option",{children:"PUT"}),Object(x.jsx)("option",{children:"DELETE"})]})})]}),Object(x.jsxs)(j.a.Group,{as:p.a,children:[Object(x.jsx)(j.a.Label,{column:!0,sm:2,children:"URL"}),Object(x.jsx)(w.a,{sm:10,children:Object(x.jsx)(j.a.Control,{value:t.url,onChange:function(n){e.setState({rule:Object(b.a)(Object(b.a)({},t),{},{url:n.target.value})})}})})]}),Object(x.jsxs)(j.a.Group,{as:p.a,children:[Object(x.jsx)(j.a.Label,{column:!0,sm:2,children:"Action"}),Object(x.jsx)(w.a,{sm:10,children:Object(x.jsxs)(j.a.Control,{as:"select",value:t.action,onChange:function(n){e.setState({rule:Object(b.a)(Object(b.a)({},t),{},{action:n.target.value})})},children:[Object(x.jsx)("option",{value:"1",children:"Request"}),Object(x.jsx)("option",{value:"2",children:"Response"}),Object(x.jsx)("option",{value:"3",children:"Both"})]})})]})]})}),Object(x.jsxs)(O.a.Footer,{children:[Object(x.jsx)(u.a,{variant:"secondary",onClick:this.handleClose,children:"Close"}),Object(x.jsx)(u.a,{variant:"primary",onClick:this.handleSave,children:"Save Changes"})]})]})]})}}]),n}(r.a.Component),m=function(){function e(){Object(a.a)(this,e),this.items=[],this._map=new Map,this.filterText="",this.filterTimer=null,this.num=0,this.max=1e3}return Object(l.a)(e,[{key:"showList",value:function(){var e=this;return this.filterText?this.items.filter((function(t){return t.request.url.includes(e.filterText)})):this.items}},{key:"add",value:function(e){if(e.no=++this.num,this.items.push(e),this._map.set(e.id,e),this.items.length>this.max){var t=this.items.shift();this._map.delete(t.id)}}},{key:"get",value:function(e){return this._map.get(e)}},{key:"changeFilter",value:function(e){this.filterText=e}},{key:"changeFilterLazy",value:function(e,t){var n=this;this.filterTimer&&(clearTimeout(this.filterTimer),this.filterTimer=null),this.filterTimer=setTimeout((function(){n.filterText=e,t()}),300)}},{key:"clear",value:function(){this.items=[],this._map=new Map}}]),e}(),y=function(e){return!!e&&(!!e.header&&(!!e.header["Content-Type"]&&/text|javascript|json/.test(e.header["Content-Type"].join(""))))},g=function(e){return e&&e.header?(e.header["Content-Length"]?t=parseInt(e.header["Content-Length"][0]):e&&e.body&&(t=e.body.byteLength),t?isNaN(t)||t<=0?"0":t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(2)," KB"
//# sourceMappingURL=main.37b6cc16.chunk.js.map