var ne=Object.defineProperty,se=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable;var U=(s,a,o)=>a in s?ne(s,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[a]=o,W=(s,a)=>{for(var o in a||(a={}))re.call(a,o)&&U(s,o,a[o]);if(A)for(var o of A(a))ce.call(a,o)&&U(s,o,a[o]);return s},j=(s,a)=>se(s,le(a));var G=(s,a,o)=>new Promise((N,h)=>{var d=l=>{try{k(o.next(l))}catch(v){h(v)}},T=l=>{try{k(o.throw(l))}catch(v){h(v)}},k=l=>l.done?N(l.value):Promise.resolve(l.value).then(d,T);k((o=o.apply(s,a)).next())});import{u as ie,f as ue,g as _e,l as de}from"./index-2a45336b.js";import{u as me}from"./usePagination-7442a465.js";import{a as x,b as n,o as b,k as D,e as t,w as e,u as c,aW as J,aX as K,E as _,G as f,a6 as ge,F as L,D as pe,c as E,K as fe,i as F}from"./ant-design-vue-710243d9.js";import"./tinymce-3184e0f1.js";import"./echarts-ca5d9323.js";import"./cropper-47c8e461.js";import"./lodash-es-7cb071db.js";import"./qrcode-bec2257a.js";import"./jschardet-bd496279.js";const ve={class:"gutter-box"},Te=Object.assign({name:"Logger"},{__name:"index",setup(s){const{t:a}=ie(),o=x({info:"success",warn:"warning",error:"error"}),N=[{title:a("pages.system.logger.form.level"),dataIndex:"level",key:"levels"},{title:a("pages.system.logger.form.trace_id"),dataIndex:"trace_id"},{title:a("pages.system.logger.form.user_name"),dataIndex:"user_id"},{title:a("pages.system.logger.form.tag"),dataIndex:"tag",key:"tags"},{title:a("pages.system.logger.form.message"),dataIndex:"message"},{title:a("pages.system.logger.form.created_at"),dataIndex:"created_at",key:"createAt",width:180}],{listData:h,paginationState:d,loading:T,showLoading:k,hideLoading:l,resetPagination:v,searchFormData:m}=me(),X=x("default"),O=x(""),P=x(""),q=x();C();function C(){return G(this,null,function*(){try{k();const{pageSize:r,current:u}=d,{success:w,data:R,total:I}=yield ue.system.getLoggers(j(W({pageSize:r,current:u},m.value),{startTime:O.value,endTime:P.value})).catch(()=>{throw new Error});l(),_e("http.code.success")===w&&(R.forEach(g=>{g.children=JSON.parse(g.data)}),h.value=R,d.total=I)}catch(r){l()}})}function S(){v(),C()}function H({current:r,pageSize:u}){d.current=r,d.pageSize=u,C()}function M(){v(),m.value={},O.value="",P.value="",q.value="",C()}return(r,u)=>{const w=n("a-select-option"),R=n("a-select"),I=n("a-form-item"),g=n("a-col"),Q=n("a-input"),z=n("a-button"),$=n("a-space"),B=n("a-row"),Y=n("a-form"),Z=n("x-search-bar"),ee=n("a-tooltip"),te=n("x-action-bar"),V=n("a-tag"),ae=n("a-table"),oe=n("a-card");return b(),D(L,null,[t(Z,{class:"mb-8-2"},{default:e(({gutter:p,colSpan:i})=>[t(Y,{"label-col":{style:{width:"80px"}},model:c(m),layout:"inline"},{default:e(()=>[t(B,{gutter:p},{default:e(()=>[t(g,J(K(i)),{default:e(()=>[t(I,{name:"level",label:r.$t("pages.system.logger.form.level")},{default:e(()=>[t(R,{value:c(m).level,"onUpdate:value":u[0]||(u[0]=y=>c(m).level=y)},{default:e(()=>[t(w,{value:"info"},{default:e(()=>[_("INFO")]),_:1}),t(w,{value:"warn"},{default:e(()=>[_("WARN")]),_:1}),t(w,{value:"error"},{default:e(()=>[_("ERROR")]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])]),_:2},1040),t(g,J(K(i)),{default:e(()=>[t(I,{name:"trace_id",label:r.$t("pages.system.logger.form.trace_id")},{default:e(()=>[t(Q,{value:c(m).trace_id,"onUpdate:value":u[1]||(u[1]=y=>c(m).trace_id=y)},null,8,["value"])]),_:1},8,["label"])]),_:2},1040),t(g,{class:"align-right"},{default:e(()=>[t($,null,{default:e(()=>[t(z,{onClick:M},{default:e(()=>[_(f(r.$t("button.reset")),1)]),_:1}),t(z,{ghost:"",type:"primary",onClick:S},{default:e(()=>[_(f(r.$t("button.search")),1)]),_:1})]),_:1})]),_:1})]),_:2},1032,["gutter"])]),_:2},1032,["model"])]),_:1}),t(oe,null,{default:e(()=>[t(te,{class:"mb-8-2"},{extra:e(()=>[t($,null,{default:e(()=>[t(ee,{title:r.$t("app.pwa.serviceworker.updated.ok")},{default:e(()=>[t(z,{type:"text",onClick:S},{icon:e(()=>[t(c(ge))]),_:1})]),_:1},8,["title"])]),_:1})]),_:1}),t(ae,{columns:N,"data-source":c(h),loading:c(T),pagination:c(d),size:X.value,"row-key":"id",onChange:H},{expandedRowRender:e(({record:p})=>[t(B,{gutter:[16,24]},{default:e(()=>[(b(!0),D(L,null,pe(p.children,(i,y)=>(b(),E(g,{key:y,class:"gutter-row",span:6},{default:e(()=>[fe("div",ve,f(y)+"："+f(i),1)]),_:2},1024))),128))]),_:2},1024)]),bodyCell:e(({column:p,record:i})=>[p.key==="levels"?(b(),E(V,{key:0,color:o.value[i.level]},{default:e(()=>[_(f(i.level),1)]),_:2},1032,["color"])):F("",!0),p.key==="tags"?(b(),E(V,{key:1,color:"processing"},{default:e(()=>[_(f(i.tag),1)]),_:2},1024)):F("",!0),p.key==="createAt"?(b(),D(L,{key:2},[_(f(c(de)(i.created_at)),1)],64)):F("",!0)]),_:1},8,["data-source","loading","pagination","size"])]),_:1})],64)}}});export{Te as default};
