(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{217:function(e,t,s){var n=s(310);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);(0,s(5).default)("62decb7d",n,!1,{})},309:function(e,t,s){"use strict";var n=s(217);s.n(n).a},310:function(e,t,s){(e.exports=s(4)(!1)).push([e.i,".log {\n  display: grid;\n  grid-template-rows: 1fr;\n}\n.log > div {\n    min-height: 0;\n}\n",""])},338:function(e,t,s){"use strict";s.r(t);var n=function(){var e=this.$createElement,t=this._self._c||e;return t("main",{staticClass:"main-container main-container--fullheight log"},[t("div",{staticClass:"container"},[t("asf-log")],1)])};n._withStripped=!0;var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"terminal",staticClass:"terminal"},e._l(e.log,function(t){t.type;var n=t.message;return s("div",{staticClass:"terminal-message terminal-message--truncated"},[s("span",{staticClass:"terminal-message__content"},[s("span",{staticClass:"terminal-message__time"},[e._v("["+e._s(n.time.toLocaleTimeString())+"]")]),e._v(" "),s("span",{staticClass:"terminal-message__level",class:"terminal-message__level--"+n.level.toLowerCase()},[e._v(e._s(n.level))]),e._v(" "),s("span",{staticClass:"terminal-message__logger"},[e._v(e._s(n.logger))]),e._v(" "),s("span",[e._v(">")]),e._v(" "),s("span",{staticClass:"terminal-message__text"},[e._v(e._s(n.text))])])])}),0)};a._withStripped=!0;var i=s(3);function r(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o={name:"asf-log",data:()=>({log:[]}),computed:Object(i.c)({password:"auth/password"}),watch:{log(){this.$refs.terminal.scrollTop<this.$refs.terminal.scrollHeight-this.$refs.terminal.clientHeight-20||this.$nextTick(()=>{this.$refs.terminal.scrollTop=Math.max(0,this.$refs.terminal.scrollHeight-this.$refs.terminal.clientHeight)})}},created(){const e="".concat(window.__BASE_URL__.replace(/^http/,"ws"),"api/nlog").concat(this.password?"?password=".concat(encodeURIComponent(this.password)):"");this.ws=new WebSocket(e),this.ws.onopen=this.onOpen.bind(this),this.ws.onmessage=this.onMessage.bind(this),this.ws.onclose=this.onClose.bind(this)},beforeDestroy(){this.ws.close()},methods:{onOpen(e){},onMessage(e){const t=JSON.parse(e.data).Result;this.log.push({type:"in",message:this.parseMessage(t)})},parseMessage(e){const t=r(e.split("|")),s=t[0],n=t[1],a=t[2],i=t[3],o=t.slice(4);return{time:new Date(s.replace(/-/g,"/")),process:n,level:a,logger:i,text:o.join("|")}},onClose(e){}}},l=s(1),c=Object(l.a)(o,a,[],!1,null,null,null);c.options.__file="src/components/AsfLog.vue";var p={name:"log",metaInfo(){return{title:this.$t("log")}},components:{AsfLog:c.exports}},m=(s(309),Object(l.a)(p,n,[],!1,null,null,null));m.options.__file="src/views/Log.vue";t.default=m.exports}}]);