1 line
1.8 KiB
JavaScript
1 line
1.8 KiB
JavaScript
webpackJsonp([10],{DBgJ:function(e,t,s){(e.exports=s("FZ+f")(!1)).push([e.i,"\n.bg[data-v-625af12c] {\n /* background-image: url(~@/assets/img/13.jpg);\n background-size: cover;\n position: relative; */\n}\n.msgDiv[data-v-625af12c]{\n color: black;\n height: calc(100vh - 109px);\n overflow-y: auto;\n}\n.msg-div[data-v-625af12c] {\n}\n",""])},Sz5E:function(e,t,s){var o=s("DBgJ");"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);s("rjj0")("ae4e3c1c",o,!0)},uZtf:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=s("mvHQ"),n=s.n(o),i={data:function(){return{websock:"",wbData:[],url:""}},created:function(){this.url=window.SITE_CONFIG.wbURL,JSON.parse(sessionStorage.getItem("msgDiv"))?this.wbData=JSON.parse(sessionStorage.getItem("msgDiv")):this.wbData=[],this.initWebSocket()},methods:{initWebSocket:function(){var e="ws://"+this.url+"/log";this.websock=new WebSocket(e),this.websock.onmessage=this.websocketonmessage,this.websock.onopen=this.websocketonopen,this.websock.onerror=this.websocketonerror,this.websock.onclose=this.websocketclose},websocketonopen:function(){this.websocketsend()},websocketonerror:function(){this.initWebSocket()},websocketonmessage:function(e){this.wbData.length>=1e3?(this.wbData.shift(),this.wbData.push(e.data)):this.wbData.push(e.data),sessionStorage.setItem("msgDiv",n()(this.wbData))},websocketsend:function(e){this.websock.send(e)},websocketclose:function(e){console.log("断开连接",e)}}},a={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"bg mod-config msgDiv"},e._l(e.wbData,function(t,o){return s("div",{key:o,staticClass:"msg-div"},[e._v("\n "+e._s(t)+"\n ")])}))},staticRenderFns:[]};var c=s("VU/8")(i,a,!1,function(e){s("Sz5E")},"data-v-625af12c",null);t.default=c.exports}}); |