2024-11-16 10:35:58 +08:00
|
|
|
import{d as X,r as b,am as ee,bL as ce,dq as ue,aS as L,o as r,b as j,e as p,aQ as ae,Z as de,a0 as me,by as pe,q as fe,bZ as _e,c as m,w as s,f as l,g as $,h as g,av as E,t as U,cy as te,B as le,X as P,x as ve,bK as H,aj as C,F as ge,aq as he,ak as be,a9 as ye,_ as ke,da as xe,db as we,cO as Se,cP as Ie,a4 as W,l as $e}from"./index-Cxl_PNjp.js";import{a as ze,_ as ne}from"./CollapseItem-DL-2h2jV.js";const Te={scrollbarProps:Object,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},Ce=X({name:"VirtualList",props:Te,setup(u){const t=b(null),h=b(null);function f(){const{value:i}=t;i&&i.sync()}function z(i){var o;f(),(o=u.onScroll)===null||o===void 0||o.call(u,i)}function B(i){var o;f(),(o=u.onResize)===null||o===void 0||o.call(u,i)}function R(i){var o;(o=u.onWheel)===null||o===void 0||o.call(u,i)}function y(i,o){var w,S;typeof i=="number"?(w=h.value)===null||w===void 0||w.scrollTo(i,o??0):(S=h.value)===null||S===void 0||S.scrollTo(i)}function _(){var i;return(i=h.value)===null||i===void 0?void 0:i.listElRef}function T(){var i;return(i=h.value)===null||i===void 0?void 0:i.itemsElRef}return{scrollTo:y,scrollbarInstRef:t,virtualListInstRef:h,getScrollContainer:_,getScrollContent:T,handleScroll:z,handleResize:B,handleWheel:R}},render(){return ee(ue,Object.assign({},this.scrollbarProps,{ref:"scrollbarInstRef",container:this.getScrollContainer,content:this.getScrollContent}),{default:()=>ee(ce,{ref:"virtualListInstRef",showScrollbar:!1,items:this.items,itemSize:this.itemSize,itemResizable:this.itemResizable,itemsStyle:this.itemsStyle,visibleItemsTag:this.visibleItemsTag,visibleItemsProps:this.visibleItemsProps,ignoreItemResize:this.ignoreItemResize,keyField:this.keyField,defaultScrollKey:this.defaultScrollKey,defaultScrollIndex:this.defaultScrollIndex,paddingTop:this.paddingTop,paddingBottom:this.paddingBottom,onScroll:this.handleScroll,onResize:this.handleResize,onWheel:this.handleWheel},{default:({item:u,index:t})=>{var h,f;return(f=(h=this.$slots).default)===null||f===void 0?void 0:f.call(h,{item:u,index:t})}})})}}),je={class:"inline-block",viewBox:"0 0 14 14",width:"1em",height:"1em"};function Be(u,t){return r(),j("svg",je,t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},[p("path",{d:"M10.13 3.48L7.26.61a.36.36 0 0 0-.52 0L3.87 3.48m6.26 7.04l-2.87 2.87a.36.36 0 0 1-.52 0l-2.87-2.87"}),p("circle",{cx:"7",cy:"7",r:"1.25"})],-1)]))}const De=L({name:"streamline-interface-arrows-vertical-scroll-point-move-scroll-vertical",render:Be}),Ne={class:"inline-block",viewBox:"0 0 14 14",width:"1em",height:"1em"};function Le(u,t){return r(),j("svg",Ne,t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},[p("path",{d:"m5 11l.5 2l-2 .5"}),p("path",{d:"M5.5 13A6.76 6.76 0 0 1 1 7a6 6 0 0 1 .66-2.736M4.95 1.36a6 6 0 0 0-2.19 1.394M9 3l-.5-2l2-.5"}),p("path",{d:"M8.5 1c2.3.84 4.5 3.42 4.5 6a6 6 0 0 1-1.731 4.2M9 12.64q.33-.117.642-.27M.5.5l13 13"})],-1)]))}const Re=L({name:"streamline-synchronize-disable",render:Le}),Me={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function qe(u,t){return r(),j("svg",Me,t[0]||(t[0]=[p("path",{fill:"currentColor","fill-rule":"evenodd",d:"M2.93 11.2c.072-4.96 4.146-8.95 9.149-8.95a9.16 9.16 0 0 1 7.814 4.357a.75.75 0 0 1-1.277.786a7.66 7.66 0 0 0-6.537-3.643c-4.185 0-7.575 3.328-7.648 7.448l.4-.397a.75.75 0 0 1 1.057 1.065l-1.68 1.666a.75.75 0 0 1-1.056 0l-1.68-1.666A.75.75 0 1 1 2.528 10.8zm16.856-.733a.75.75 0 0 1 1.055 0l1.686 1.666a.75.75 0 1 1-1.054 1.067l-.41-.405c-.07 4.965-4.161 8.955-9.18 8.955a9.2 9.2 0 0 1-7.842-4.356a.75.75 0 1 1 1.277-.788a7.7 7.7 0 0 0 6.565 3.644c
|
2024-11-16 10:35:58 +08:00
|
|
|
- `);return I?l(ne,{title:k[0],name:`message-${a.index}`},{default:()=>[` - ${I}`]}):l("div",{class:"pl-6px"},[$("- "),`${v}`])},c=a=>{B.value=a},d=a=>{B.value=[]};return()=>l("code",{class:"snail-log"},[l(ze,{accordion:!0,"expanded-names":B.value,"onUpdate:expanded-names":a=>B.value=a,"on-update:expanded-names":c},{default:()=>[l(Ce,{ref:R,class:"virtual-list",itemSize:85,"item-resizable":!0,"ignore-item-resize":!0,"padding-bottom":16,items:_.value,"scrollbar-props":{xScrollable:!0},"on-resize":d},{default:({item:a})=>l("pre",{key:a.index,class:"min-h-85px min-w-full"},[l("div",null,[l("span",{class:"log-hljs-time inline-block"},[se(a.time_stamp)]),l("span",{class:`log-hljs-level-${a.level} ml-12px mr-12px inline-block`},[`${a.level}`]),l("span",{class:"log-hljs-thread mr-12px inline-block"},[`[${a.host}:${a.port}]`]),l("span",{class:"log-hljs-thread mr-12px inline-block"},[`[${a.thread}]`])]),l("div",{class:"log-hljs-location"},[`${a.location}: `]),l("div",null,[e(a)]),l("div",null,[n(a)]),l(be,null,null)])})]})])}});return(n,e)=>{const c=We,d=ye,a=Ae,v=Fe,k=ke,I=Re,N=De,F=xe,V=we,O=Se,A=Ie;return n.drawer?(r(),m(A,{key:0,show:h.value,"onUpdate:show":e[3]||(e[3]=x=>h.value=x),width:z.value?"100%":"50%","display-directive":"if","auto-focus":!1},{default:s(()=>[l(O,{closable:""},{header:s(()=>[p("div",{class:ve(["flex items-center justify-between",`tool-header${z.value?"-full":""}`])},[p("div",Ue,[o.value?(r(),m(d,{key:0},{trigger:s(()=>[l(c,{class:"text-20px color-success"})]),default:s(()=>[e[6]||(e[6]=$(" 日志加载完成 "))]),_:1})):(r(),m(d,{key:1},{trigger:s(()=>[l(g(E),{size:"small"},{icon:s(()=>[l(a)]),_:1})]),default:s(()=>[e[7]||(e[7]=$(" 日志正在加载 "))]),_:1})),p("span",He,U(n.title),1),l(g(te),{trigger:"hover",options:q.value,width:"trigger",onSelect:M},{default:s(()=>[l(d,{placement:"right"},{trigger:s(()=>[l(g(le),{dashed:"",class:"ml-16px w-136px",onClick:e[0]||(e[0]=x=>M(-1))},{icon:s(()=>[p("div",Xe,[l(v,{class:"text-18px"}),$(" "+U(q.value.filter(x=>x.key===y.value)[0].label)+" ",1),l(k,{icon:"material-symbols:expand-more-rounded"})])]),_:1})]),default:s(()=>[e[8]||(e[8]=$(" 自动刷新频率 "))]),_:1})]),_:1},8,["options"])]),p("div",Ze,[l(P,{size:"tiny","tooltip-content":f.value?"关闭自动滚动":"开启自动滚动",onClick:e[1]||(e[1]=()=>f.value=!f.value)},{default:s(()=>[f.value?(r(),m(I,{key:0})):(r(),m(N,{key:1}))]),_:1},8,["tooltip-content"]),l(P,{size:"tiny",icon:"hugeicons:share-01","tooltip-content":"在新标签页打开",class:"ml-6px",onClick:re}),l(P,{size:"tiny","tooltip-content":z.value?"半屏":"全屏",onClick:e[2]||(e[2]=()=>z.value=!z.value)},{default:s(()=>[z.value?(r(),m(F,{key:0})):(r(),m(V,{key:1}))]),_:1},8,["tooltip-content"])])],2)]),default:s(()=>[_.value.length===0?(r(),j("div",Je,[_.value.length===0&&o.value?(r(),m(g(H),{key:0})):C("",!0),_.value.length===0&&!o.value?(r(),m(g(E),{key:1})):C("",!0)])):C("",!0),_.value.length>0?(r(),m(g(Q),{key:1})):C("",!0)]),_:1})]),_:1},8,["show","width"])):(r(),m(g(ge),{key:1,bordered:!1,title:n.title,size:"small",class:"h-full sm:flex-1-hidden card-wrapper"},{"header-extra":s(()=>[p("div",Qe,[l(g(te),{trigger:"hover",options:q.value,width:"trigger",onSelect:M},{default:s(()=>[l(d,{placement:"right"},{trigger:s(()=>[l(g(le),{dashed:"",class:"mx-12px w-136px",onClick:e[4]||(e[4]=x=>M(-1))},{icon:s(()=>[p("div",Ye,[l(v,{class:"text-18px"}),$(" "+U(q.value.filter(x=>x.key===y.value)[0].label)+" ",1),l(k,{icon:"material-symbols:expand-more-rounded"})])]),_:1})]),default:s(()=>[e[9]||(e[9]=$(" 自动刷新频率 "))]),_:1})]),_:1},8,["options"]),l(P,{size:"tiny",class:"mr-12px","tooltip-content":f.value?"关闭自动滚动":"开启自动滚动",onClick:e[5]||(e[5]=()=>f.value=!f.value)},{default:s(()=>[f.value?(r(),m(I,{key:0})):(r(),m(N,{key:1}))]),_:1},8,["tooltip-content"]),o.value?(r(),m(d,{key:0},{trigger:s(()=>[l(c,{class:"text-20px color-success"})]),default:s(()=>[e[10]||(e[10]=$(" 日志加载完成 "))]),_:1})):(r(),m(d,{key:1},{trigger:s(()=>[l(g(E),{size:"small"},{icon:s(()=>[l(a)]),_:1})]),default:s(()=>[e[11]|
|