← Back
Editing: index-legacy347.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,u=[],c=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return r};var e,r={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),u=new P(n||[]);return i(a,"_invoke",{value:k(t,r,u)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function _(){}function w(){}var x={};f(x,c,(function(){return this}));var L=Object.getPrototypeOf,j=L&&L(L(C([])));j&&j!==o&&a.call(j,c)&&(x=j);var E=w.prototype=g.prototype=Object.create(x);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function S(e,r){function n(o,i,u,c){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,c)}))}c(l.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function k(t,r,n){var o=h;return function(a,i){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=T(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function C(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return _.prototype=w,i(E,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:_,configurable:!0}),_.displayName=f(w,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},O(S.prototype),f(S.prototype,l,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new S(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(E),f(E,s,"Generator"),f(E,c,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=C,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},r}function o(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function u(t){o(i,n,a,u,c,"next",t)}function c(t){o(i,n,a,u,c,"throw",t)}u(void 0)}))}}System.register(["./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy123.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./useController-legacy10.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,u,c,l,s,f,p,d,h,y,v,m,b,g,_,w,x,L,j,E,O,S,k,T,N,D,P,C,A,I,M,G,F,R;return{setters:[function(t){o=t._},function(t){i=t.s,u=t.j,c=t.r,l=t.c,s=t.g,f=t.a4,p=t.q,d=t.v,h=t.e,y=t.A,v=t.y,m=t.x,b=t.P,g=t.M,_=t.C,w=t.B,x=t.H,L=t.I,j=t.b6,E=t.D},function(t){O=t._},function(t){S=t.iP,k=t.iQ,T=t.M,N=t.R,D=t.iR,P=t.u,C=t.w,A=t.fj,I=t.iS,M=t.iT,G=t.$,F=t.e},function(t){R=t.u},null],execute:function(){var r=u("CLB-LOG-STORE",(function(){var t=c("today"),e=c(""),r=c("");return{currentTab:t,logCustomDate:e,dateTabs:c([{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"自定义时间",value:"custom"}]),currentDate:r}})),V=function(){return i(r())},Y=R().activeTabs,q=V(),U=q.logCustomDate,B=q.currentDate,H=function(){var t=a(n().mark((function t(e){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("http"!==Y.value){t.next=6;break}return t.next=3,S({load_id:e.load_id,date:B.value});case 3:t.t0=t.sent,t.next=9;break;case 6:return t.next=8,k({load_id:e.load_id,date:B.value});case 8:t.t0=t.sent;case 9:(r=t.t0).status?window.open("/download?filename="+r.data.filename):T.error("导出失败");case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),J=function(t){var e="";return"today"===t&&(e=N(new Date,"yyyy-MM-dd")),"yesterday"===t&&(e=N(D(-1),"yyyy-MM-dd")),"custom"===t&&(e=null==U?void 0:U.value),B.value=e,e};function $(t){var r=t.match(/^(\d{2})\/(\w{3})\/(\d{4}):(\d{2}):(\d{2}):(\d{2})/);if(!r)return t;var n=e(r,7),o=n[1],a=n[2],i=n[3],u=n[4],c=n[5],l=n[6],s={Jan:"01",Feb:"02",Mar:"03",Apr:"04",May:"05",Jun:"06",Jul:"07",Aug:"08",Sep:"09",Oct:"10",Nov:"11",Dec:"12"}[a];return"".concat(i,"-").concat(s,"-").concat(o," ").concat(u,":").concat(c,":").concat(l)}var Q={class:"p-[2rem] node-clb-http-log"},z={class:"flex items-center"},K=l({__name:"index",props:{compData:{default:function(){return{row:{load_id:0}}}}},setup:function(t){var e,r=P().mainHeight,i=R().activeTabs,u=V(),l=u.currentTab,S=u.logCustomDate,k=u.dateTabs,N=u.currentDate,D=t,F=s((function(){return D.compData.row})),Y=c(-1),q=function(t){l.value=t,Y.value=-1,"custom"!==t&&(S.value="",B())},U=function(t){Y.value=-1,t&&(S.value=t,B())},B=function(){tt()},K=function(t){"first"===t?(Y.value=-1,tt()):"next"===t&&tt()},W=c("tcpudp"===i.value?[{label:"时间",prop:"time_local",width:180,render:function(t){return $(t.time_local)}},{label:"客户端IP",prop:"remote_addr"},{label:"协议",prop:"protocol"},{label:"响应状态",prop:"status"},{label:"发送大小",prop:"bytes_sent",render:function(t){return C(Number(t.bytes_sent))}},{label:"接收大小",prop:"bytes_received",render:function(t){return C(Number(t.bytes_received))}},{label:"会话耗时(秒)",prop:"session_time",render:function(t){return"".concat(t.session_time)}},{label:"节点地址",prop:"upstream_addr",width:120},{label:"TO大小",prop:"upstream_bytes_sent",render:function(t){return C(Number(t.upstream_bytes_sent))}},{label:"RE大小",prop:"upstream_bytes_received",render:function(t){return C(Number(t.upstream_bytes_received))}},{label:"连接耗时(秒)",prop:"upstream_connect_time",render:function(t){return"".concat(t.upstream_connect_time)}}]:[{label:"时间",prop:"time",render:function(t){return $(t.time)}},{label:"客户端IP",prop:"remote_addr"},{label:"请求类型",prop:"request_method",width:80},{label:"负载节点",prop:"upstream_addr"},{label:"回源耗时(秒)",prop:"upstream_response_time"},{label:"主体大小",prop:"body_bytes_sent",render:function(t){return C(Number(t.body_bytes_sent))}},{label:"传输大小",prop:"bytes_sent",render:function(t){return C(Number(t.bytes_sent))}},{label:"响应状态",prop:"status"},{label:"URI",prop:"request_uri"}]),X=A({request:(e=a(n().mark((function t(e){var r,o,a;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r={load_id:F.value.load_id,date:J(l.value),position:Y.value,limit:10},"tcpudp"!==i.value){t.next=7;break}return t.next=4,I(r);case 4:t.t0=t.sent,t.next=10;break;case 7:return t.next=9,M(r);case 9:t.t0=t.sent;case 10:return o=t.t0,(a=o.data).msg&&!1===a.status&&T.error(a.msg),Y.value=a.data.last_position,t.abrupt("return",{data:a.data.logs||[],total:0,other:{}});case 15:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)}),columns:W.value}),Z=X.BtTable,tt=X.refresh;return f((function(){S.value="",N.value="",l.value="today"})),function(t,e){var n=G,a=j,i=O,u=E,c=o;return p(),d("div",Q,[h(c,null,{"header-left":y((function(){return[v("div",z,[v("div",null,[h(n,{type:"button",modelValue:m(l),"onUpdate:modelValue":e[0]||(e[0]=function(t){return b(l)?l.value=t:null}),options:m(k),onChange:q,class:"mr-[1rem] !flex-nowrap"},null,8,["modelValue","options"])]),"custom"===m(l)?(p(),g(a,{key:0,modelValue:m(S),"onUpdate:modelValue":e[1]||(e[1]=function(t){return b(S)?S.value=t:null}),type:"date",placeholder:"请选择日期","value-format":"YYYY-MM-DD",onChange:U,class:"ml-2"},null,8,["modelValue"])):_("",!0)])]})),"header-right":y((function(){return[h(i,{class:"ml-[10px]",onRefresh:e[2]||(e[2]=function(t){return K("first")})}),h(u,{type:"success",onClick:e[3]||(e[3]=function(t){return m(H)(m(F))})},{default:y((function(){return e[6]||(e[6]=[v("i",{class:"el-icon-download"},null,-1),w(" 导出日志 ")])})),_:1})]})),content:y((function(){return[h(m(Z),{"min-height":m(r)},null,8,["min-height"])]})),"footer-right":y((function(){return[h(u,{type:"info",text:"",bg:"",onClick:e[4]||(e[4]=function(t){return K("first")})},{default:y((function(){return e[7]||(e[7]=[w("首页")])})),_:1}),x(h(u,{type:"info",text:"",bg:"",onClick:e[5]||(e[5]=function(t){return K("next")})},{default:y((function(){return e[8]||(e[8]=[w("下一页")])})),_:1},512),[[L,m(Y)>0]])]})),_:1})])}}});t("default",F(K,[["__scopeId","data-v-a754b624"]]))}}}))}();
Save File
Cancel