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.4248f977.chunk.js

2 lines
18 KiB
JavaScript

(this["webpackJsonpmitmproxy-client"]=this["webpackJsonpmitmproxy-client"]||[]).push([[0],{48:function(e,t,n){},53:function(e,t,n){"use strict";n.r(t);var s,i=n(0),r=n.n(i),o=n(20),a=n.n(o),c=(n(47),n(9)),l=n(10),h=n(19),d=n(18),u=n(41),j=n(7),b=n(11),f=(n(48),n(21)),O=n(16),p=n(12),v=n(33),w=n(23),x=n(1),S=function(e){Object(h.a)(n,e);var t=Object(d.a)(n);function n(e){var s;return Object(c.a)(this,n),(s=t.call(this,e)).state={show:!1,rule:{method:"ALL",url:"",action:1},haveRules:!1},s.handleClose=s.handleClose.bind(Object(O.a)(s)),s.handleShow=s.handleShow.bind(Object(O.a)(s)),s.handleSave=s.handleSave.bind(Object(O.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:e.action}),this.props.onSave(t),this.handleClose(),this.setState({haveRules:!!t.length})}},{key:"render",value:function(){var e=this,t=this.state,n=t.rule,s=t.haveRules?"success":"primary";return Object(x.jsxs)("div",{children:[Object(x.jsx)(b.a,{variant:s,size:"sm",onClick:this.handleShow,children:"BreakPoint"}),Object(x.jsxs)(p.a,{show:this.state.show,onHide:this.handleClose,children:[Object(x.jsx)(p.a.Header,{closeButton:!0,children:Object(x.jsx)(p.a.Title,{children:"Set BreakPoint"})}),Object(x.jsxs)(p.a.Body,{children:[Object(x.jsxs)(j.a.Group,{as:v.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:n.method,onChange:function(t){e.setState({rule:Object(f.a)(Object(f.a)({},n),{},{method:t.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:v.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:n.url,onChange:function(t){e.setState({rule:Object(f.a)(Object(f.a)({},n),{},{url:t.target.value})})}})})]}),Object(x.jsxs)(j.a.Group,{as:v.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:n.action,onChange:function(t){e.setState({rule:Object(f.a)(Object(f.a)({},n),{},{action:parseInt(t.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)(p.a.Footer,{children:[Object(x.jsx)(b.a,{variant:"secondary",onClick:this.handleClose,children:"Close"}),Object(x.jsx)(b.a,{variant:"primary",onClick:this.handleSave,children:"Save"})]})]})]})}}]),n}(r.a.Component),y=n(39),E=n(34),m=n(42),g=n(40),R=function(e){return!!e&&(!!e.header&&(!!e.header["Content-Type"]&&/text|javascript|json/.test(e.header["Content-Type"].join(""))))};!function(e){e[e.REQUEST=1]="REQUEST",e[e.REQUEST_BODY=2]="REQUEST_BODY",e[e.RESPONSE=3]="RESPONSE",e[e.RESPONSE_BODY=4]="RESPONSE_BODY"}(s||(s={}));var C=function(){function e(t){Object(c.a)(this,e),this.no=void 0,this.id=void 0,this.waitIntercept=void 0,this.request=void 0,this.response=null,this.url=void 0,this._host="",this._path="",this._size="",this.no=++e.curNo,this.id=t.id,this.waitIntercept=t.waitIntercept,this.request=t.content,this.url=new URL(this.request.url)}return Object(l.a)(e,[{key:"addRequestBody",value:function(e){return this.waitIntercept=e.waitIntercept,this.request.body=e.content,this}},{key:"addResponse",value:function(e){return this.waitIntercept=e.waitIntercept,this.response=e.content,this}},{key:"addResponseBody",value:function(e){return this.waitIntercept=e.waitIntercept,this.response&&(this.response.body=e.content),this}},{key:"preview",value:function(){return{no:this.no,id:this.id,waitIntercept:this.waitIntercept,host:this.host,path:thi
//# sourceMappingURL=main.4248f977.chunk.js.map