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.
2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
4 years ago
|
(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,r=n(0),a=n.n(r),i=n(18),o=n.n(i),c=(n(47),n(15)),l=n(16),d=n(21),h=n(20),u=n(41),j=n(7),b=n(9),O=(n(48),n(19)),f=n(14),p=n(10),v=n(34),w=n(23),x=n(1),S=function(e){Object(d.a)(n,e);var t=Object(h.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(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: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(O.a)(Object(O.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(O.a)(Object(O.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(O.a)(Object(O.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}(a.a.Component),E=n(39),m=n(25),y=n(42),g=n(40);!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 R,C=[s.REQUEST,s.REQUEST_BODY,s.RESPONSE,s.RESPONSE_BODY];!function(e){e[e.CHANGE_REQUEST=11]="CHANGE_REQUEST",e[e.CHANGE_RESPONSE=12]="CHANGE_RESPONSE",e[e.DROP_REQUEST=13]="DROP_REQUEST",e[e.DROP_RESPONSE=14]="DROP_RESPONSE",e[e.CHANGE_BREAK_POINT_RULES=21]="CHANGE_BREAK_POINT_RULES"}(R||(R={}));var T=function(e,t){if(e===R.DROP_REQUEST||e===R.DROP_RESPONSE){var n=new Uint8Array(38);return n[0]=1,n[1]=e,n.set((new TextEncoder).encode(t.id),2),n}var s,r;if(e===R.CHANGE_REQUEST){var a=t.request;r=a.body,s=Object(g.a)(a,["body"])}else{if(e!==R.CHANGE_RESPONSE)throw new Error("invalid message type");var i=t.response;r=i.body,s=Object(g.a)(i,["body"])}var o=r&&r.byteLength?r.byteLength:0,c=(new TextEncoder).encode(JSON.stringify(s)),l=42+c.byteLength+4+o,d=new ArrayBuffer(l),h=new Uint8Array(d);h[0]=1,h[1]=e,h.set((new TextEncoder).encode(t.id),2),h.set(c,42),o&&h.set(r,42+c.byteLength+4);var u=new DataView(d);return u.setUint32(38,c.byteLength),u.
|
||
|
//# sourceMappingURL=main.5904c112.chunk.js.map
|