New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zan-proxy

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zan-proxy - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

2

package.json
{
"name": "zan-proxy",
"version": "v3.1.0",
"version": "v3.1.1",
"description": "前端代理",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -1,2 +0,2 @@

webpackJsonp([1],{148:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(60),s=n.n(r),i=n(59),a=n.n(i),o=n(80),c=n.n(o),l=n(5),u=n.n(l),d=n(302),f=n.n(d),h=n(301),p=n.n(h),v=n(160);e.default={components:{HttpTraffic:f.a,Detail:p.a},data:function(){return{isDataCenter:!0,width:0,height:0,rows:{},smallId:3e3,bigId:0,rightClickRow:{},selectId:"",currentRequestBody:"",currentResponseBody:""}},methods:{calcSize:function(){this.width=c()(window).width(),this.height=c()(window).height()-300},receiveTraffic:function(t){var e=this;if(2==t.length){var n=t[0].rows,r=t[1].rows;u.a.forEach(n,function(t){e.smallId>t.idx&&(e.smallId=t.idx),e.bigId<t.idx&&(e.bigId=t.idx),e.rows[t.idx]=t}),u.a.forEach(r,function(t){e.rows[t.idx]=u.a.assign({},e.rows[t.idx],t)})}},setCurrentRowIndex:function(t){var e=this;return a()(s.a.mark(function n(){return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(e.selectId!=t){n.next=2;break}return n.abrupt("return");case 2:if(e.selectId=t,e.currentRequestBody="",e.currentResponseBody="",/(json)|(x-www-form-urlencoded)/i.test(e.currentRow.reqHeaders["content-type"])&&(e.currentRequestBody=e.currentRow.reqBody),!/(text)|(javascript)/i.test(e.currentRow.contentType)){n.next=10;break}return n.next=9,v.a(t);case 9:e.currentResponseBody=n.sent;case 10:case"end":return n.stop()}},n,e)}))()}},computed:{total:function(){return this.bigId-this.smallId+1},currentRow:function(){return this.rows[this.selectId]||{}},requestHeader:function(){var t=u.a.assign({},this.currentRow.reqHeaders);return delete t.cookie,t},requestCookie:function(){return this.currentRow.reqHeaders?v.b(this.currentRow.reqHeaders.cookie||""):{}},requestQueryParams:function(){return v.c(this.currentRow.path)},requestRawHeader:function(){var t=this.currentRow;if(!this.currentRow.resHeaders)return"";var e=t.method+" "+t.protocol+"/"+t.httpVersion+" "+t.path+"\n";return u.a.forEach(this.requestHeader,function(t,n){e+=n+" "+t+"\n"}),e},responseHeader:function(){var t=u.a.assign({},this.currentRow.resHeaders);return delete t["set-cookie"],t},setCookies:function(){return this.currentRow.resHeaders?this.currentRow.resHeaders["set-cookie"]:[]},responseRawHeader:function(){var t=this.currentRow;if(!this.currentRow.resHeaders)return"";var e=t.protocol+"/"+t.httpVersion+" "+t.result+"\n";return u.a.forEach(this.responseHeader,function(t,n){e+=n+" "+t+"\n"}),e}},created:function(){if(this.calcSize(),c()(window).resize(u.a.debounce(this.calcSize,200)),window.io){io("/httptrafic").on("proxy",this.receiveTraffic)}}}},149:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(304),s=n.n(r),i=n(305),a=n.n(i);e.default={components:{RequestDetail:s.a,ResponseDetail:a.a}}},150:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=(n.n(r),n(303)),i=n.n(s),a=n(173),o=n.n(a),c=n(163),l=n.n(c),u=n(34);e.default={props:["height","width"],components:{List:i.a,ContextMenu:l.a},data:function(){return{resizeProxyVisible:!1,dragging:!1,draggingColumn:null,dragState:{},cols:[{id:"result",name:"state",width:60},{id:"protocol",name:"protocol",width:70},{id:"method",name:"method",width:70},{id:"host",name:"host",width:250},{id:"contentType",name:"content-type",width:200},{id:"body",name:"body",width:100},{id:"path",name:"path",width:0}]}},computed:{columns:function(){for(var t=this.cols,e=0,n=0;n<t.length-1;n++)e+=t[n].width;return t[t.length-1].width=this.width-e,t}},methods:{saveData:function(){var t=this;if(!this.$dc.rightClickRow.resTime)return void this.$message({message:"服务器还没有响应",type:"warning"});this.$prompt("请输入数据文件名","保存为数据文件",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(e){var n=e.value;u.a.saveDataEntryFromTraffic(t.$dc.rightClickRow.idx,n,t.$dc.rightClickRow.contentType.split(";")[0]).then(function(e){var n=e.data;0==n.code?t.$message({type:"success",message:"保存成功!"}):t.$message.error("出错了,"+n.msg)})})},copyUrl:function(){o()(this.$dc.rightClickRow.protocol+"://"+this.$dc.rightClickRow.host+this.$dc.rightClickRow.path),this.$message("已将url复制到剪切板")},clickRow:function(t){this.$dc.setCurrentRowIndex(t)},onCtxOpen:function(t){this.$dc.rightClickRow=this.$dc.rows[t]},onCtxClose:function(t){},resetCtxLocals:function(){this.$dc.rightClickRow={}},handleMouseMove:function(t,e){for(var n=t.target;n&&"TH"!==n.tagName;)n=n.parentNode;if(!this.dragging){var r=n.getBoundingClientRect(),s=document.body.style;r.width>12&&r.right-t.pageX<8?(s.cursor="col-resize",this.draggingColumn=e):(s.cursor="",this.draggingColumn=null)}},handleMouseDown:function(t,e,n){var r=this;if(this.draggingColumn){this.dragging=!0,this.resizeProxyVisible=!0;var s=this.$el,i=s.getBoundingClientRect().left,a=this.$el.querySelector("\t#column_"+n),o=a.getBoundingClientRect(),c=o.left-i+30;this.dragState={startMouseLeft:t.clientX,startLeft:o.right-i,startColumnLeft:o.left-i,tableLeft:i};var l=this.$refs.resizeProxy;l.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var u=function(t){var e=t.clientX-r.dragState.startMouseLeft,n=r.dragState.startLeft+e;l.style.left=Math.max(c,n)+"px"},d=function t(){if(r.dragging){var n=parseInt(l.style.left,10),s=n-r.dragState.startColumnLeft;e.width=s,document.body.style.cursor="",r.dragging=!1,r.draggingColumn=null,r.dragState={},r.resizeProxyVisible=!1}document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",t),document.onselectstart=null,document.ondragstart=null};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d)}},handleMouseOut:function(t,e){document.body.style.cursor=""}}}},151:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:["data"]}},152:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{total:{type:Number,required:!0},height:{type:Number,required:!0},rowHeight:{type:Number,required:!0}},data:function(){return{scrollTop:0,start:0}},computed:{ids:function(){for(var t=[],e=this.start;e<this.end;e++)t.push(e);return t},contentHeight:function(){return this.rowHeight*this.total},keeps:function(){return Math.ceil(this.height/this.rowHeight)+2},end:function(){var t=this.start+this.keeps-1;return t>this.total?this.total:t},top:function(){return this.rowHeight*this.start}},methods:{handleScroll:_.debounce(function(){this.scrollTop=this.$refs.container.scrollTop;var t=Math.floor(this.scrollTop/this.rowHeight);this.start=t},100)}}},153:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(88),s=n.n(r);e.default={components:{KeyValueList:s.a}}},154:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(88),s=n.n(r);e.default={components:{KeyValueList:s.a}}},160:function(t,e,n){"use strict";function r(t,e){try{return e(t)}catch(e){return t}}function s(t,e){if("string"!=typeof t)throw new TypeError("argument str must be a string");for(var n={},s=e||{},i=t.split(v),a=s.decode||g,o=0;o<i.length;o++){var c=i[o],l=c.indexOf("=");if(!(l<0)){var u=c.substr(0,l).trim(),d=c.substr(++l,c.length).trim();'"'==d[0]&&(d=d.slice(1,-1)),void 0==n[u]&&(n[u]=r(d,a))}}return n}function i(t){return!t||t.indexOf("?")<0?{}:h.a.parse(t.split("?")[1])}var a=n(60),o=n.n(a),c=n(59),l=n.n(c),u=n(10),d=n.n(u),f=n(278),h=n.n(f);n.d(e,"a",function(){return p}),e.b=s,e.c=i;var p=function(){var t=l()(o.a.mark(function t(e){var n;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,d.a.get("/res/get?idx="+e);case 3:return n=t.sent,t.abrupt("return",n.data);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return","");case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}(),v=/; */,g=decodeURIComponent},161:function(t,e){t.exports=function(t){function e(e){e.preventDefault(),"function"==typeof t&&t(e);try{stop()}catch(t){}}function n(t){27===t.keyCode&&e(t)}var r=!1;return{get isListening(){return r},start:function(t){window.addEventListener("click",e,!0),window.addEventListener("keyup",n,!0),r=!0,"function"==typeof t&&t()},stop:function(t){window.removeEventListener("click",e,!0),window.removeEventListener("keyup",n,!0),r=!1,"function"==typeof t&&t()}}}},162:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(161),s=n.n(r);e.default={name:"context-menu",props:{id:{type:String,default:"default-ctx"},ctxOpen:{type:Function},ctxCancel:{type:Function},ctxClose:{type:Function}},data:function(){var t=this;return{locals:{},align:"left",ctxTop:0,ctxLeft:0,ctxVisible:!1,bodyClickListener:s()(function(e){if(!t.ctxVisible||t.$el.contains(e.target))t.ctxVisible=!1,t.ctxClose&&t.ctxClose(t.locals);else{if(1!==e.which)return e.preventDefault(),e.stopPropagation(),!1;t.ctxVisible=!1,t.ctxCancel&&t.ctxCancel(t.locals),e.stopPropagation()}})}},methods:{setPositionFromEvent:function(t){var e=t.pageX,n=t.pageY;this.ctxTop=n-document.body.scrollTop,this.ctxLeft=e},open:function(t,e){return this.ctxVisible=!0,this.ctxOpen&&this.ctxOpen(e),this.setPositionFromEvent(t),this.$el.setAttribute("tab-index",-1),this.bodyClickListener.start(),this}},watch:{ctxVisible:function(t,e){e===!0&&t===!1&&this.bodyClickListener.stop(function(t){})}},computed:{ctxStyle:function(){return{display:this.ctxVisible?"block":"none",top:(this.ctxTop||0)+"px",left:(this.ctxLeft||0)+"px"}}}}},163:function(t,e,n){var r=n(286);r.install=function(t){return t.component("context-menu",r)},window.VueContextMenu=r,t.exports=t.exports.default=r},165:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(92),i=n.n(s),a=n(18),o=n.n(a),c=n(17),l=n.n(c),u=n(8);n.n(u);r.default.use(l.a),r.default.use(o.a),new r.default({el:"#app",render:function(t){return t(i.a)}})},230:function(t,e){},234:function(t,e){},236:function(t,e){},239:function(t,e){},244:function(t,e){},286:function(t,e,n){n(239);var r=n(0)(n(162),n(327),null,null);t.exports=r.exports},301:function(t,e,n){var r=n(0)(n(149),n(336),null,null);t.exports=r.exports},302:function(t,e,n){n(230);var r=n(0)(n(150),n(312),null,null);t.exports=r.exports},303:function(t,e,n){var r=n(0)(n(152),n(333),null,null);t.exports=r.exports},304:function(t,e,n){var r=n(0)(n(153),n(332),null,null);t.exports=r.exports},305:function(t,e,n){n(234);var r=n(0)(n(154),n(317),null,null);t.exports=r.exports},312:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-table el-table--fit el-table--border el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%",height:"250px"},style:{width:"100%",height:t.height+"px"}},[n("div",{staticClass:"el-table__header-wrapper"},[n("table",{staticClass:"el-table__header",staticStyle:{width:"100%"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[n("colgroup",t._l(t.columns,function(t,e){return n("col",{attrs:{name:"head_col_"+e,width:t.width}})})),t._v(" "),n("thead",[n("tr",t._l(t.columns,function(e,r){return n("th",{staticStyle:{height:"22px"},attrs:{id:"column_"+r},on:{mousemove:function(n){t.handleMouseMove(n,e,r)},mousedown:function(n){t.handleMouseDown(n,e,r)},mouseout:function(n){t.handleMouseOut(n,e,r)}}},[n("div",{staticClass:"cell"},[t._v(t._s(e.name))])])}))])])]),t._v(" "),n("div",{staticClass:"el-table__body-wrapper"},[n("list",{attrs:{total:t.$dc.total,height:t.height-22,rowHeight:23},scopedSlots:t._u([{key:"default",fn:function(e){return[n("table",{staticClass:"el-table__body",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[n("colgroup",t._l(t.columns,function(t,e){return n("col",{attrs:{name:"body_col_"+e,width:t.width}})})),t._v(" "),t._l(e.ids,function(e){return n("tr",{class:{"user-selected":t.$dc.selectId==e+t.$dc.smallId},on:{click:function(n){t.clickRow(e+t.$dc.smallId)},contextmenu:function(n){n.preventDefault(),t.$refs.ctx.open(n,e+t.$dc.smallId)}}},t._l(t.columns,function(r){return n("td",[n("div",{staticClass:"cell",style:{width:r.width+"px"}},[t._v("\n "+t._s(t.$dc.rows[e+t.$dc.smallId][r.id])+"\n ")])])}))})],2)]}}])})],1),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"}),t._v(" "),n("context-menu",{ref:"ctx",attrs:{id:"testingctx",ctxOpen:t.onCtxOpen,ctxCancel:t.resetCtxLocals,ctxClose:t.onCtxClose}},[n("li",{staticClass:"ctx-item",on:{click:t.saveData}},[t._v("保存为mock数据")]),t._v(" "),n("li",{staticClass:"ctx-item",on:{click:t.copyUrl}},[t._v("复制url")])])],1)},staticRenderFns:[]}},317:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-tabs",{attrs:{type:"border-card"}},[n("el-tab-pane",{attrs:{label:"Response Header"}},[n("key-value-list",{attrs:{data:t.$dc.responseHeader}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Response Set Cookie"}},t._l(t.$dc.setCookies,function(e){return n("div",{staticClass:"cookie-row"},[t._v("\n "+t._s(e)+"\n ")])})),t._v(" "),n("el-tab-pane",{attrs:{label:"Response Raw Header"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.responseRawHeader))])]),t._v(" "),n("el-tab-pane",{attrs:{label:"Response Body"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.currentResponseBody))])])],1)},staticRenderFns:[]}},324:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"keyvalue-wrapper"},[t._l(t.data,function(e,r){return[n("div",{staticClass:"keyvalue-row"},[n("div",{staticClass:"keyvalue-key"},[t._v("\n "+t._s(r)+"\n ")]),t._v(" "),n("div",{staticClass:"keyvalue-value"},[t._v("\n "+t._s(e)+"\n ")])])]})],2)},staticRenderFns:[]}},327:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"contextMenu",staticClass:"ctx-menu-container",style:t.ctxStyle,attrs:{id:t.id},on:{click:function(t){t.stopPropagation()},contextmenu:function(t){t.stopPropagation()}}},[n("div",{staticClass:"ctx open",staticStyle:{"background-color":"transparent"}},[n("ul",{staticClass:"ctx-menu",class:{"ctx-menu-right":"right"===t.align,"ctx-menu-left":"left"===t.align},attrs:{role:"menu"}},[t._t("default")],2)])])},staticRenderFns:[]}},332:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-tabs",{attrs:{type:"border-card"}},[n("el-tab-pane",{attrs:{label:"Header"}},[n("key-value-list",{attrs:{data:t.$dc.requestHeader}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Cookie"}},[n("key-value-list",{attrs:{data:t.$dc.requestCookie}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Query Params"}},[n("key-value-list",{attrs:{data:t.$dc.requestQueryParams}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Raw Header"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.requestRawHeader))])]),t._v(" "),n("el-tab-pane",{attrs:{label:"Body"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.currentRequestBody))])])],1)},staticRenderFns:[]}},333:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"container",style:{"overflow-y":"auto",height:t.height+"px"},on:{scroll:t.handleScroll}},[n("div",{style:{height:t.contentHeight+"px"}},[n("div",{style:{transform:"translate3d(0,"+t.top+"px,0)"}},[t._t("default",null,{ids:t.ids})],2)])])},staticRenderFns:[]}},335:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{height:"100%"},attrs:{id:"app"}},[n("http-traffic",{attrs:{height:t.height,width:t.width}}),t._v(" "),n("div",{staticClass:"detail",staticStyle:{height:"300px"}},[n("detail")],1)],1)},staticRenderFns:[]}},336:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{height:"100%",width:"100%","font-size":"0"}},[n("div",{staticStyle:{width:"50%",height:"100%",display:"inline-block"}},[n("request-detail")],1),t._v(" "),n("div",{staticStyle:{width:"50%",height:"100%",display:"inline-block"}},[n("response-detail")],1)])},staticRenderFns:[]}},34:function(t,e,n){"use strict";var r=n(10),s=n.n(r),i=n(30),a=n.n(i);e.a={getDataList:function(){return s.a.get("/data/getdatalist")},saveDataList:function(t){return s.a.post("/data/savedatalist",t)},getDataFile:function(t){return s.a.get("/data/getdatafile?id="+t)},saveDataFile:function(t,e){var n=new FormData;return n.append("content",e),s.a.post("/data/savedatafile?id="+t,n)},saveDataEntryFromTraffic:function(t,e,n){return s.a.post("/data/savedatafromtraffic",{id:a()(),name:e,contenttype:n,reqid:t})}}},8:function(t,e){},88:function(t,e,n){n(236);var r=n(0)(n(151),n(324),null,null);t.exports=r.exports},92:function(t,e,n){n(244);var r=n(0)(n(148),n(335),null,null);t.exports=r.exports}},[165]);
webpackJsonp([1],{149:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(61),s=n.n(r),i=n(60),a=n.n(i),o=n(81),c=n.n(o),l=n(5),u=n.n(l),d=n(302),f=n.n(d),h=n(301),p=n.n(h),v=n(161);e.default={components:{HttpTraffic:f.a,Detail:p.a},data:function(){return{isDataCenter:!0,width:0,height:0,rows:{},smallId:3e3,bigId:0,rightClickRow:{},selectId:"",currentRequestBody:"",currentResponseBody:""}},methods:{calcSize:function(){this.width=c()(window).width(),this.height=c()(window).height()-300},receiveTraffic:function(t){var e=this;if(2==t.length){var n=t[0].rows,r=t[1].rows;u.a.forEach(n,function(t){e.smallId>t.idx&&(e.smallId=t.idx),e.bigId<t.idx&&(e.bigId=t.idx),e.rows[t.idx]=t}),u.a.forEach(r,function(t){e.rows[t.idx]=u.a.assign({},e.rows[t.idx],t)})}},setCurrentRowIndex:function(t){var e=this;return a()(s.a.mark(function n(){return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(e.selectId!=t){n.next=2;break}return n.abrupt("return");case 2:if(e.selectId=t,e.currentRequestBody="",e.currentResponseBody="",/(json)|(x-www-form-urlencoded)/i.test(e.currentRow.reqHeaders["content-type"])&&(e.currentRequestBody=e.currentRow.reqBody),!/(text)|(javascript)|(json)/i.test(e.currentRow.contentType)){n.next=10;break}return n.next=9,v.a(t);case 9:e.currentResponseBody=n.sent;case 10:case"end":return n.stop()}},n,e)}))()}},computed:{total:function(){return this.bigId-this.smallId+1},currentRow:function(){return this.rows[this.selectId]||{}},requestHeader:function(){var t=u.a.assign({},this.currentRow.reqHeaders);return delete t.cookie,t},requestCookie:function(){return this.currentRow.reqHeaders?v.b(this.currentRow.reqHeaders.cookie||""):{}},requestQueryParams:function(){return v.c(this.currentRow.path)},requestRawHeader:function(){var t=this.currentRow;if(!this.currentRow.resHeaders)return"";var e=t.method+" "+t.protocol+"/"+t.httpVersion+" "+t.path+"\n";return u.a.forEach(this.requestHeader,function(t,n){e+=n+" "+t+"\n"}),e},responseHeader:function(){var t=u.a.assign({},this.currentRow.resHeaders);return delete t["set-cookie"],t},setCookies:function(){return this.currentRow.resHeaders?this.currentRow.resHeaders["set-cookie"]:[]},responseRawHeader:function(){var t=this.currentRow;if(!this.currentRow.resHeaders)return"";var e=t.protocol+"/"+t.httpVersion+" "+t.result+"\n";return u.a.forEach(this.responseHeader,function(t,n){e+=n+" "+t+"\n"}),e}},created:function(){if(this.calcSize(),c()(window).resize(u.a.debounce(this.calcSize,200)),window.io){io("/httptrafic").on("proxy",this.receiveTraffic)}}}},150:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(304),s=n.n(r),i=n(305),a=n.n(i);e.default={components:{RequestDetail:s.a,ResponseDetail:a.a}}},151:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=(n.n(r),n(303)),i=n.n(s),a=n(173),o=n.n(a),c=n(164),l=n.n(c),u=n(34);e.default={props:["height","width"],components:{List:i.a,ContextMenu:l.a},data:function(){return{resizeProxyVisible:!1,dragging:!1,draggingColumn:null,dragState:{},cols:[{id:"result",name:"state",width:60},{id:"protocol",name:"protocol",width:70},{id:"method",name:"method",width:70},{id:"host",name:"host",width:250},{id:"contentType",name:"content-type",width:200},{id:"body",name:"body",width:100},{id:"path",name:"path",width:0}]}},computed:{columns:function(){for(var t=this.cols,e=0,n=0;n<t.length-1;n++)e+=t[n].width;return t[t.length-1].width=this.width-e,t}},methods:{saveData:function(){var t=this;if(!this.$dc.rightClickRow.resTime)return void this.$message({message:"服务器还没有响应",type:"warning"});this.$prompt("请输入数据文件名","保存为数据文件",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(e){var n=e.value;u.a.saveDataEntryFromTraffic(t.$dc.rightClickRow.idx,n,t.$dc.rightClickRow.contentType.split(";")[0]).then(function(e){var n=e.data;0==n.code?t.$message({type:"success",message:"保存成功!"}):t.$message.error("出错了,"+n.msg)})})},copyUrl:function(){o()(this.$dc.rightClickRow.protocol+"://"+this.$dc.rightClickRow.host+this.$dc.rightClickRow.path),this.$message("已将url复制到剪切板")},clickRow:function(t){this.$dc.setCurrentRowIndex(t)},onCtxOpen:function(t){this.$dc.rightClickRow=this.$dc.rows[t]},onCtxClose:function(t){},resetCtxLocals:function(){this.$dc.rightClickRow={}},handleMouseMove:function(t,e){for(var n=t.target;n&&"TH"!==n.tagName;)n=n.parentNode;if(!this.dragging){var r=n.getBoundingClientRect(),s=document.body.style;r.width>12&&r.right-t.pageX<8?(s.cursor="col-resize",this.draggingColumn=e):(s.cursor="",this.draggingColumn=null)}},handleMouseDown:function(t,e,n){var r=this;if(this.draggingColumn){this.dragging=!0,this.resizeProxyVisible=!0;var s=this.$el,i=s.getBoundingClientRect().left,a=this.$el.querySelector("\t#column_"+n),o=a.getBoundingClientRect(),c=o.left-i+30;this.dragState={startMouseLeft:t.clientX,startLeft:o.right-i,startColumnLeft:o.left-i,tableLeft:i};var l=this.$refs.resizeProxy;l.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var u=function(t){var e=t.clientX-r.dragState.startMouseLeft,n=r.dragState.startLeft+e;l.style.left=Math.max(c,n)+"px"},d=function t(){if(r.dragging){var n=parseInt(l.style.left,10),s=n-r.dragState.startColumnLeft;e.width=s,document.body.style.cursor="",r.dragging=!1,r.draggingColumn=null,r.dragState={},r.resizeProxyVisible=!1}document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",t),document.onselectstart=null,document.ondragstart=null};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d)}},handleMouseOut:function(t,e){document.body.style.cursor=""}}}},152:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:["data"]}},153:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{total:{type:Number,required:!0},height:{type:Number,required:!0},rowHeight:{type:Number,required:!0}},data:function(){return{scrollTop:0,start:0}},computed:{ids:function(){for(var t=[],e=this.start;e<this.end;e++)t.push(e);return t},contentHeight:function(){return this.rowHeight*this.total},keeps:function(){return Math.ceil(this.height/this.rowHeight)+2},end:function(){var t=this.start+this.keeps-1;return t>this.total?this.total:t},top:function(){return this.rowHeight*this.start}},methods:{handleScroll:_.debounce(function(){this.scrollTop=this.$refs.container.scrollTop;var t=Math.floor(this.scrollTop/this.rowHeight);this.start=t},100)}}},154:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(89),s=n.n(r);e.default={components:{KeyValueList:s.a}}},155:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(89),s=n.n(r);e.default={components:{KeyValueList:s.a}}},161:function(t,e,n){"use strict";function r(t,e){try{return e(t)}catch(e){return t}}function s(t,e){if("string"!=typeof t)throw new TypeError("argument str must be a string");for(var n={},s=e||{},i=t.split(v),a=s.decode||g,o=0;o<i.length;o++){var c=i[o],l=c.indexOf("=");if(!(l<0)){var u=c.substr(0,l).trim(),d=c.substr(++l,c.length).trim();'"'==d[0]&&(d=d.slice(1,-1)),void 0==n[u]&&(n[u]=r(d,a))}}return n}function i(t){return!t||t.indexOf("?")<0?{}:h.a.parse(t.split("?")[1])}var a=n(61),o=n.n(a),c=n(60),l=n.n(c),u=n(10),d=n.n(u),f=n(278),h=n.n(f);n.d(e,"a",function(){return p}),e.b=s,e.c=i;var p=function(){var t=l()(o.a.mark(function t(e){var n;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,d.a.get("/res/get?idx="+e);case 3:return n=t.sent,t.abrupt("return",n.data);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return","");case 10:case"end":return t.stop()}},t,this,[[0,7]])}));return function(e){return t.apply(this,arguments)}}(),v=/; */,g=decodeURIComponent},162:function(t,e){t.exports=function(t){function e(e){e.preventDefault(),"function"==typeof t&&t(e);try{stop()}catch(t){}}function n(t){27===t.keyCode&&e(t)}var r=!1;return{get isListening(){return r},start:function(t){window.addEventListener("click",e,!0),window.addEventListener("keyup",n,!0),r=!0,"function"==typeof t&&t()},stop:function(t){window.removeEventListener("click",e,!0),window.removeEventListener("keyup",n,!0),r=!1,"function"==typeof t&&t()}}}},163:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(162),s=n.n(r);e.default={name:"context-menu",props:{id:{type:String,default:"default-ctx"},ctxOpen:{type:Function},ctxCancel:{type:Function},ctxClose:{type:Function}},data:function(){var t=this;return{locals:{},align:"left",ctxTop:0,ctxLeft:0,ctxVisible:!1,bodyClickListener:s()(function(e){if(!t.ctxVisible||t.$el.contains(e.target))t.ctxVisible=!1,t.ctxClose&&t.ctxClose(t.locals);else{if(1!==e.which)return e.preventDefault(),e.stopPropagation(),!1;t.ctxVisible=!1,t.ctxCancel&&t.ctxCancel(t.locals),e.stopPropagation()}})}},methods:{setPositionFromEvent:function(t){var e=t.pageX,n=t.pageY;this.ctxTop=n-document.body.scrollTop,this.ctxLeft=e},open:function(t,e){return this.ctxVisible=!0,this.ctxOpen&&this.ctxOpen(e),this.setPositionFromEvent(t),this.$el.setAttribute("tab-index",-1),this.bodyClickListener.start(),this}},watch:{ctxVisible:function(t,e){e===!0&&t===!1&&this.bodyClickListener.stop(function(t){})}},computed:{ctxStyle:function(){return{display:this.ctxVisible?"block":"none",top:(this.ctxTop||0)+"px",left:(this.ctxLeft||0)+"px"}}}}},164:function(t,e,n){var r=n(286);r.install=function(t){return t.component("context-menu",r)},window.VueContextMenu=r,t.exports=t.exports.default=r},166:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(93),i=n.n(s),a=n(18),o=n.n(a),c=n(17),l=n.n(c),u=n(8);n.n(u);r.default.use(l.a),r.default.use(o.a),new r.default({el:"#app",render:function(t){return t(i.a)}})},230:function(t,e){},234:function(t,e){},236:function(t,e){},239:function(t,e){},244:function(t,e){},286:function(t,e,n){n(239);var r=n(0)(n(163),n(327),null,null);t.exports=r.exports},301:function(t,e,n){var r=n(0)(n(150),n(336),null,null);t.exports=r.exports},302:function(t,e,n){n(230);var r=n(0)(n(151),n(312),null,null);t.exports=r.exports},303:function(t,e,n){var r=n(0)(n(153),n(333),null,null);t.exports=r.exports},304:function(t,e,n){var r=n(0)(n(154),n(332),null,null);t.exports=r.exports},305:function(t,e,n){n(234);var r=n(0)(n(155),n(317),null,null);t.exports=r.exports},312:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-table el-table--fit el-table--border el-table--enable-row-hover el-table--enable-row-transition",staticStyle:{width:"100%",height:"250px"},style:{width:"100%",height:t.height+"px"}},[n("div",{staticClass:"el-table__header-wrapper"},[n("table",{staticClass:"el-table__header",staticStyle:{width:"100%"},attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[n("colgroup",t._l(t.columns,function(t,e){return n("col",{attrs:{name:"head_col_"+e,width:t.width}})})),t._v(" "),n("thead",[n("tr",t._l(t.columns,function(e,r){return n("th",{staticStyle:{height:"22px"},attrs:{id:"column_"+r},on:{mousemove:function(n){t.handleMouseMove(n,e,r)},mousedown:function(n){t.handleMouseDown(n,e,r)},mouseout:function(n){t.handleMouseOut(n,e,r)}}},[n("div",{staticClass:"cell"},[t._v(t._s(e.name))])])}))])])]),t._v(" "),n("div",{staticClass:"el-table__body-wrapper"},[n("list",{attrs:{total:t.$dc.total,height:t.height-22,rowHeight:23},scopedSlots:t._u([{key:"default",fn:function(e){return[n("table",{staticClass:"el-table__body",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[n("colgroup",t._l(t.columns,function(t,e){return n("col",{attrs:{name:"body_col_"+e,width:t.width}})})),t._v(" "),t._l(e.ids,function(e){return n("tr",{class:{"user-selected":t.$dc.selectId==e+t.$dc.smallId},on:{click:function(n){t.clickRow(e+t.$dc.smallId)},contextmenu:function(n){n.preventDefault(),t.$refs.ctx.open(n,e+t.$dc.smallId)}}},t._l(t.columns,function(r){return n("td",[n("div",{staticClass:"cell",style:{width:r.width+"px"}},[t._v("\n "+t._s(t.$dc.rows[e+t.$dc.smallId][r.id])+"\n ")])])}))})],2)]}}])})],1),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"}),t._v(" "),n("context-menu",{ref:"ctx",attrs:{id:"testingctx",ctxOpen:t.onCtxOpen,ctxCancel:t.resetCtxLocals,ctxClose:t.onCtxClose}},[n("li",{staticClass:"ctx-item",on:{click:t.saveData}},[t._v("保存为mock数据")]),t._v(" "),n("li",{staticClass:"ctx-item",on:{click:t.copyUrl}},[t._v("复制url")])])],1)},staticRenderFns:[]}},317:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-tabs",{attrs:{type:"border-card"}},[n("el-tab-pane",{attrs:{label:"Response Header"}},[n("key-value-list",{attrs:{data:t.$dc.responseHeader}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Response Set Cookie"}},t._l(t.$dc.setCookies,function(e){return n("div",{staticClass:"cookie-row"},[t._v("\n "+t._s(e)+"\n ")])})),t._v(" "),n("el-tab-pane",{attrs:{label:"Response Raw Header"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.responseRawHeader))])]),t._v(" "),n("el-tab-pane",{attrs:{label:"Response Body"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.currentResponseBody))])])],1)},staticRenderFns:[]}},324:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"keyvalue-wrapper"},[t._l(t.data,function(e,r){return[n("div",{staticClass:"keyvalue-row"},[n("div",{staticClass:"keyvalue-key"},[t._v("\n "+t._s(r)+"\n ")]),t._v(" "),n("div",{staticClass:"keyvalue-value"},[t._v("\n "+t._s(e)+"\n ")])])]})],2)},staticRenderFns:[]}},327:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"contextMenu",staticClass:"ctx-menu-container",style:t.ctxStyle,attrs:{id:t.id},on:{click:function(t){t.stopPropagation()},contextmenu:function(t){t.stopPropagation()}}},[n("div",{staticClass:"ctx open",staticStyle:{"background-color":"transparent"}},[n("ul",{staticClass:"ctx-menu",class:{"ctx-menu-right":"right"===t.align,"ctx-menu-left":"left"===t.align},attrs:{role:"menu"}},[t._t("default")],2)])])},staticRenderFns:[]}},332:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-tabs",{attrs:{type:"border-card"}},[n("el-tab-pane",{attrs:{label:"Header"}},[n("key-value-list",{attrs:{data:t.$dc.requestHeader}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Cookie"}},[n("key-value-list",{attrs:{data:t.$dc.requestCookie}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Query Params"}},[n("key-value-list",{attrs:{data:t.$dc.requestQueryParams}})],1),t._v(" "),n("el-tab-pane",{attrs:{label:"Raw Header"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.requestRawHeader))])]),t._v(" "),n("el-tab-pane",{attrs:{label:"Body"}},[n("textarea",{staticClass:"text-area"},[t._v(t._s(t.$dc.currentRequestBody))])])],1)},staticRenderFns:[]}},333:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"container",style:{"overflow-y":"auto",height:t.height+"px"},on:{scroll:t.handleScroll}},[n("div",{style:{height:t.contentHeight+"px"}},[n("div",{style:{transform:"translate3d(0,"+t.top+"px,0)"}},[t._t("default",null,{ids:t.ids})],2)])])},staticRenderFns:[]}},335:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{height:"100%"},attrs:{id:"app"}},[n("http-traffic",{attrs:{height:t.height,width:t.width}}),t._v(" "),n("div",{staticClass:"detail",staticStyle:{height:"300px"}},[n("detail")],1)],1)},staticRenderFns:[]}},336:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{height:"100%",width:"100%","font-size":"0"}},[n("div",{staticStyle:{width:"50%",height:"100%",display:"inline-block"}},[n("request-detail")],1),t._v(" "),n("div",{staticStyle:{width:"50%",height:"100%",display:"inline-block"}},[n("response-detail")],1)])},staticRenderFns:[]}},34:function(t,e,n){"use strict";var r=n(10),s=n.n(r),i=n(30),a=n.n(i);e.a={getDataList:function(){return s.a.get("/data/getdatalist")},saveDataList:function(t){return s.a.post("/data/savedatalist",t)},getDataFile:function(t){return s.a.get("/data/getdatafile?id="+t)},saveDataFile:function(t,e){var n=new FormData;return n.append("content",e),s.a.post("/data/savedatafile?id="+t,n)},saveDataEntryFromTraffic:function(t,e,n){return s.a.post("/data/savedatafromtraffic",{id:a()(),name:e,contenttype:n,reqid:t})}}},8:function(t,e){},89:function(t,e,n){n(236);var r=n(0)(n(152),n(324),null,null);t.exports=r.exports},93:function(t,e,n){n(244);var r=n(0)(n(149),n(335),null,null);t.exports=r.exports}},[166]);
//# sourceMappingURL=monitor.js.map

@@ -1,2 +0,2 @@

webpackJsonp([2],{155:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(306),i=s.n(n),o=s(307),c=s.n(o),a=s(309),r=s.n(a),u=s(308),d=s.n(u),l=s(5),f=s.n(l),p=null,v=1;t.default={components:{Card:i.a,List:c.a,Textinput:r.a,Message:d.a},data:function(){return{isDataCenter:!0,sessions:[],currentSessionLocalId:1,filterKey:""}},methods:{search:function(e){this.filterKey=e},selectSession:function(e){this.currentSessionLocalId=e,this.currentSession.hasNewMsg=!1},comingMsg:function(e){e.localId!=this.currentSession.localId&&(e.hasNewMsg=!0)},openSession:function(e){var t=v++;this.currentSessionLocalId=t,this.sessions.push({localId:t,sessionId:"",hasNewMsg:!1,urlPattern:e,messages:[{content:"等待服务器分配调试会话ID",date:new Date,type:"cmd"}]}),p.emit("opensession",e)},closeSession:function(e){var t=f.a.findIndex(this.sessions,function(t){return t.localId==e}),s=this.sessions[t].sessionId;this.sessions.splice(t,1),p.emit("closesession",s),this.currentSessionLocalId==e&&(t>0&&t--,this.currentSessionLocalId=this.sessions[t]&&this.sessions[t].localId)},assignedSessionId:function(e,t){var s=f.a.find(this.sessions,function(t){return t.urlPattern==e});s&&(s.sessionId=t,this.comingMsg(s),s.messages.push({content:"分配到调试会话ID: "+t,date:new Date,type:"cmd"}))},connectionBuild:function(e){var t=f.a.find(this.sessions,function(t){return t.sessionId==e});t&&(this.comingMsg(t),t.messages.push({content:"和目标页面建立调试连接",date:new Date,type:"cmd"}))},sendMsg:function(e){this.currentSession&&(this.currentSession.messages.push({content:e,date:new Date,type:"me"}),p.emit("debuggermsg",this.currentSession.sessionId,e))},recieve:function(e,t){var s=f.a.find(this.sessions,function(t){return t.sessionId==e});s&&(this.comingMsg(s),s.messages.push({content:t,date:new Date,type:"page"}))},connectionBreak:function(e){var t=f.a.find(this.sessions,function(t){return t.sessionId==e});t&&(this.comingMsg(t),t.messages.push({content:"页面终止调试会话,等待新的页面接入调试会话",date:new Date,type:"cmd"}))}},computed:{currentSession:function(){var e=this;return f.a.find(this.sessions,function(t){return t.localId==e.currentSessionLocalId})}},created:function(){window.io&&(p=io("/wsmock"),p.on("assignedsessionid",this.assignedSessionId),p.on("page-msg",this.recieve),p.on("page-connected",this.connectionBuild),p.on("page-closed",this.connectionBreak))}}},156:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={methods:{onKeyup:function(e){this.$dc.search(e.target.value)},requestAddSession:function(){var e=this;this.$prompt("请输入要拦截的WebSocket url特征","新建调试会话",{confirmButtonText:"新建会话",cancelButtonText:"取消"}).then(function(t){var s=t.value;e.$dc.openSession(s)})}}}},157:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={}},158:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(2);t.default={methods:{showTime:function(e,t){return"cmd"==e.type||0==t||e.date.getTime()-this.$dc.currentSession.messages[t-1].date.getTime()>3e5}},filters:{time:function(e){return"string"==typeof e&&(e=new Date(e)),e.getHours()+":"+e.getMinutes()}},directives:{"scroll-bottom":{componentUpdated:function(e){n.default.nextTick(function(){e.scrollTop=e.scrollHeight-e.clientHeight})}}}}},159:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{content:""}},methods:{onKeyup:function(e){e.ctrlKey&&13===e.keyCode&&this.content.length&&(this.$dc.sendMsg(this.content),this.content="")}}}},166:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(2),i=s(93),o=s.n(i),c=s(18),a=s.n(c),r=s(17),u=s.n(r),d=s(8);s.n(d);n.default.use(u.a),n.default.use(a.a),new n.default({el:"#app",render:function(e){return e(o.a)}})},235:function(e,t){},240:function(e,t){},241:function(e,t){},242:function(e,t){},243:function(e,t){},306:function(e,t,s){s(241);var n=s(0)(s(156),s(330),"data-v-75813fd3",null);e.exports=n.exports},307:function(e,t,s){s(240);var n=s(0)(s(157),s(329),"data-v-7398033e",null);e.exports=n.exports},308:function(e,t,s){s(235);var n=s(0)(s(158),s(319),"data-v-308cedd8",null);e.exports=n.exports},309:function(e,t,s){s(242);var n=s(0)(s(159),s(331),"data-v-79eddb8a",null);e.exports=n.exports},319:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"scroll-bottom",rawName:"v-scroll-bottom"}],staticClass:"message"},[e.$dc.currentSession?s("ul",e._l(e.$dc.currentSession.messages,function(t,n){return s("li",[e.showTime(t,n)?s("p",{staticClass:"time"},[s("span",[e._v(e._s(e._f("time")(t.date))+" "+e._s("cmd"==t.type?"- "+t.content:""))])]):e._e(),e._v(" "),"cmd"!=t.type?s("div",{staticClass:"main",class:{self:"me"==t.type}},[s("span",{staticClass:"avatar avatar-img"},[e._v("\n "+e._s("me"==t.type?"我":e.$dc.currentSession.urlPattern.charAt(0))+"\n ")]),e._v(" "),s("div",{staticClass:"text"},[e._v(e._s(t.content))])]):e._e()])})):e._e()])},staticRenderFns:[]}},329:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"list"},[s("ul",e._l(e.$dc.sessions,function(t){return s("li",{staticClass:"session-row",class:{active:t.localId===e.$dc.currentSession.localId,newmsg:t.hasNewMsg},on:{click:function(s){e.$dc.selectSession(t.localId)}}},[s("span",{staticClass:"avatar avatar-img"},[e._v("\n "+e._s(t.urlPattern.charAt(0))+"\n ")]),e._v(" "),s("p",{staticClass:"name"},[e._v(e._s(t.urlPattern))]),e._v(" "),s("p",{staticClass:"msg-state"}),e._v(" "),s("p",{staticClass:"close",on:{click:function(s){e.$dc.closeSession(t.localId)}}},[e._v("X")])])}))])},staticRenderFns:[]}},330:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"card"},[s("div",{staticClass:"header"},[s("p",{staticClass:"name"},[e._v("WebSocket Mock")]),e._v(" "),s("p",{staticClass:"add",on:{click:e.requestAddSession}},[e._v("+")])])])},staticRenderFns:[]}},331:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"text"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.content,expression:"content"}],attrs:{placeholder:"按 Ctrl + Enter 发送"},domProps:{value:e.content},on:{keyup:e.onKeyup,input:function(t){t.target.composing||(e.content=t.target.value)}}})])},staticRenderFns:[]}},334:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"app"}},[s("div",{staticClass:"sidebar"},[s("card"),e._v(" "),s("list")],1),e._v(" "),s("div",{staticClass:"main"},[s("message"),e._v(" "),s("textinput")],1)])},staticRenderFns:[]}},8:function(e,t){},93:function(e,t,s){s(243);var n=s(0)(s(155),s(334),null,null);e.exports=n.exports}},[166]);
webpackJsonp([2],{156:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(306),i=s.n(n),o=s(307),c=s.n(o),a=s(309),r=s.n(a),u=s(308),d=s.n(u),l=s(5),f=s.n(l),p=null,v=1;t.default={components:{Card:i.a,List:c.a,Textinput:r.a,Message:d.a},data:function(){return{isDataCenter:!0,sessions:[],currentSessionLocalId:1,filterKey:""}},methods:{search:function(e){this.filterKey=e},selectSession:function(e){this.currentSessionLocalId=e,this.currentSession.hasNewMsg=!1},comingMsg:function(e){e.localId!=this.currentSession.localId&&(e.hasNewMsg=!0)},openSession:function(e){var t=v++;this.currentSessionLocalId=t,this.sessions.push({localId:t,sessionId:"",hasNewMsg:!1,urlPattern:e,messages:[{content:"等待服务器分配调试会话ID",date:new Date,type:"cmd"}]}),p.emit("opensession",e)},closeSession:function(e){var t=f.a.findIndex(this.sessions,function(t){return t.localId==e}),s=this.sessions[t].sessionId;this.sessions.splice(t,1),p.emit("closesession",s),this.currentSessionLocalId==e&&(t>0&&t--,this.currentSessionLocalId=this.sessions[t]&&this.sessions[t].localId)},assignedSessionId:function(e,t){var s=f.a.find(this.sessions,function(t){return t.urlPattern==e});s&&(s.sessionId=t,this.comingMsg(s),s.messages.push({content:"分配到调试会话ID: "+t,date:new Date,type:"cmd"}))},connectionBuild:function(e){var t=f.a.find(this.sessions,function(t){return t.sessionId==e});t&&(this.comingMsg(t),t.messages.push({content:"和目标页面建立调试连接",date:new Date,type:"cmd"}))},sendMsg:function(e){this.currentSession&&(this.currentSession.messages.push({content:e,date:new Date,type:"me"}),p.emit("debuggermsg",this.currentSession.sessionId,e))},recieve:function(e,t){var s=f.a.find(this.sessions,function(t){return t.sessionId==e});s&&(this.comingMsg(s),s.messages.push({content:t,date:new Date,type:"page"}))},connectionBreak:function(e){var t=f.a.find(this.sessions,function(t){return t.sessionId==e});t&&(this.comingMsg(t),t.messages.push({content:"页面终止调试会话,等待新的页面接入调试会话",date:new Date,type:"cmd"}))}},computed:{currentSession:function(){var e=this;return f.a.find(this.sessions,function(t){return t.localId==e.currentSessionLocalId})}},created:function(){window.io&&(p=io("/wsmock"),p.on("assignedsessionid",this.assignedSessionId),p.on("page-msg",this.recieve),p.on("page-connected",this.connectionBuild),p.on("page-closed",this.connectionBreak))}}},157:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={methods:{onKeyup:function(e){this.$dc.search(e.target.value)},requestAddSession:function(){var e=this;this.$prompt("请输入要拦截的WebSocket url特征","新建调试会话",{confirmButtonText:"新建会话",cancelButtonText:"取消"}).then(function(t){var s=t.value;e.$dc.openSession(s)})}}}},158:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={}},159:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(2);t.default={methods:{showTime:function(e,t){return"cmd"==e.type||0==t||e.date.getTime()-this.$dc.currentSession.messages[t-1].date.getTime()>3e5}},filters:{time:function(e){return"string"==typeof e&&(e=new Date(e)),e.getHours()+":"+e.getMinutes()}},directives:{"scroll-bottom":{componentUpdated:function(e){n.default.nextTick(function(){e.scrollTop=e.scrollHeight-e.clientHeight})}}}}},160:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{content:""}},methods:{onKeyup:function(e){e.ctrlKey&&13===e.keyCode&&this.content.length&&(this.$dc.sendMsg(this.content),this.content="")}}}},167:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(2),i=s(94),o=s.n(i),c=s(18),a=s.n(c),r=s(17),u=s.n(r),d=s(8);s.n(d);n.default.use(u.a),n.default.use(a.a),new n.default({el:"#app",render:function(e){return e(o.a)}})},235:function(e,t){},240:function(e,t){},241:function(e,t){},242:function(e,t){},243:function(e,t){},306:function(e,t,s){s(241);var n=s(0)(s(157),s(330),"data-v-75813fd3",null);e.exports=n.exports},307:function(e,t,s){s(240);var n=s(0)(s(158),s(329),"data-v-7398033e",null);e.exports=n.exports},308:function(e,t,s){s(235);var n=s(0)(s(159),s(319),"data-v-308cedd8",null);e.exports=n.exports},309:function(e,t,s){s(242);var n=s(0)(s(160),s(331),"data-v-79eddb8a",null);e.exports=n.exports},319:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"scroll-bottom",rawName:"v-scroll-bottom"}],staticClass:"message"},[e.$dc.currentSession?s("ul",e._l(e.$dc.currentSession.messages,function(t,n){return s("li",[e.showTime(t,n)?s("p",{staticClass:"time"},[s("span",[e._v(e._s(e._f("time")(t.date))+" "+e._s("cmd"==t.type?"- "+t.content:""))])]):e._e(),e._v(" "),"cmd"!=t.type?s("div",{staticClass:"main",class:{self:"me"==t.type}},[s("span",{staticClass:"avatar avatar-img"},[e._v("\n "+e._s("me"==t.type?"我":e.$dc.currentSession.urlPattern.charAt(0))+"\n ")]),e._v(" "),s("div",{staticClass:"text"},[e._v(e._s(t.content))])]):e._e()])})):e._e()])},staticRenderFns:[]}},329:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"list"},[s("ul",e._l(e.$dc.sessions,function(t){return s("li",{staticClass:"session-row",class:{active:t.localId===e.$dc.currentSession.localId,newmsg:t.hasNewMsg},on:{click:function(s){e.$dc.selectSession(t.localId)}}},[s("span",{staticClass:"avatar avatar-img"},[e._v("\n "+e._s(t.urlPattern.charAt(0))+"\n ")]),e._v(" "),s("p",{staticClass:"name"},[e._v(e._s(t.urlPattern))]),e._v(" "),s("p",{staticClass:"msg-state"}),e._v(" "),s("p",{staticClass:"close",on:{click:function(s){e.$dc.closeSession(t.localId)}}},[e._v("X")])])}))])},staticRenderFns:[]}},330:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"card"},[s("div",{staticClass:"header"},[s("p",{staticClass:"name"},[e._v("WebSocket Mock")]),e._v(" "),s("p",{staticClass:"add",on:{click:e.requestAddSession}},[e._v("+")])])])},staticRenderFns:[]}},331:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"text"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.content,expression:"content"}],attrs:{placeholder:"按 Ctrl + Enter 发送"},domProps:{value:e.content},on:{keyup:e.onKeyup,input:function(t){t.target.composing||(e.content=t.target.value)}}})])},staticRenderFns:[]}},334:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"app"}},[s("div",{staticClass:"sidebar"},[s("card"),e._v(" "),s("list")],1),e._v(" "),s("div",{staticClass:"main"},[s("message"),e._v(" "),s("textinput")],1)])},staticRenderFns:[]}},8:function(e,t){},94:function(e,t,s){s(243);var n=s(0)(s(156),s(334),null,null);e.exports=n.exports}},[167]);
//# sourceMappingURL=wsmock.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc