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.6b681f56.chunk.js

2 lines
15 KiB
JavaScript

(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{48:function(e,t,n){},53:function(e,t,n){"use strict";n.r(t);var s=n(0),r=n.n(s),a=n(18),c=n.n(a),o=(n(47),n(15)),i=n(16),l=n(21),d=n(20),h=n(41),u=n(7),j=n(9),b=(n(48),n(19)),f=n(13),p=n(10),O=n(34),v=n(24),w=n(1),x=function(e){Object(l.a)(n,e);var t=Object(d.a)(n);function n(e){var s;return Object(o.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(i.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(),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(w.jsxs)("div",{children:[Object(w.jsx)(j.a,{variant:s,size:"sm",onClick:this.handleShow,children:"BreakPoint"}),Object(w.jsxs)(p.a,{show:this.state.show,onHide:this.handleClose,children:[Object(w.jsx)(p.a.Header,{closeButton:!0,children:Object(w.jsx)(p.a.Title,{children:"Set BreakPoint"})}),Object(w.jsxs)(p.a.Body,{children:[Object(w.jsxs)(u.a.Group,{as:O.a,children:[Object(w.jsx)(u.a.Label,{column:!0,sm:2,children:"Method"}),Object(w.jsx)(v.a,{sm:10,children:Object(w.jsxs)(u.a.Control,{as:"select",value:n.method,onChange:function(t){e.setState({rule:Object(b.a)(Object(b.a)({},n),{},{method:t.target.value})})},children:[Object(w.jsx)("option",{children:"ALL"}),Object(w.jsx)("option",{children:"GET"}),Object(w.jsx)("option",{children:"POST"}),Object(w.jsx)("option",{children:"PUT"}),Object(w.jsx)("option",{children:"DELETE"})]})})]}),Object(w.jsxs)(u.a.Group,{as:O.a,children:[Object(w.jsx)(u.a.Label,{column:!0,sm:2,children:"URL"}),Object(w.jsx)(v.a,{sm:10,children:Object(w.jsx)(u.a.Control,{value:n.url,onChange:function(t){e.setState({rule:Object(b.a)(Object(b.a)({},n),{},{url:t.target.value})})}})})]}),Object(w.jsxs)(u.a.Group,{as:O.a,children:[Object(w.jsx)(u.a.Label,{column:!0,sm:2,children:"Action"}),Object(w.jsx)(v.a,{sm:10,children:Object(w.jsxs)(u.a.Control,{as:"select",value:n.action,onChange:function(t){e.setState({rule:Object(b.a)(Object(b.a)({},n),{},{action:t.target.value})})},children:[Object(w.jsx)("option",{value:"1",children:"Request"}),Object(w.jsx)("option",{value:"2",children:"Response"}),Object(w.jsx)("option",{value:"3",children:"Both"})]})})]})]}),Object(w.jsxs)(p.a.Footer,{children:[Object(w.jsx)(j.a,{variant:"secondary",onClick:this.handleClose,children:"Close"}),Object(w.jsx)(j.a,{variant:"primary",onClick:this.handleSave,children:"Save"})]})]})]})}}]),n}(r.a.Component),y=n(39),m=n(26),g=n(42),C=n(40),S={request:1,requestBody:2,response:3,responseBody:4},k=Object.keys(S).map((function(e){return S[e]})),T=Object.keys(S).reduce((function(e,t){return e[S[t]]=t,e}),{}),L=11,q=12,N=13,R=14,M=21,B=function(e,t){if(e===N||e===R){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===L){var a=t.request;r=a.body,s=Object(C.a)(a,["body"])}else{if(e!==q)throw new Error("invalid message type");var c=t.response;r=c.body,s=Object(C.a)(c,["body"])}var o=r&&r.byteLength?r.byteLength:0,i=(new TextEncoder).encode(JSON.stringify(s)),l=42+i.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(i,42),o&&h.set(r,42+i.byteLength+4);var u=new DataView(d);return u.setUint32(38,i.byteLength),u.setUint32(42+i.byteLength,o),h},E=function(e){return!!e&&(!!e.header&&(!!e.header["Content-Type"]&&/text|javascript|json/.test(e.header["Content-Type"].join(""))))},I=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
//# sourceMappingURL=main.6b681f56.chunk.js.map