import{b as w,g as i,c as A,o as f,w as r,a as o,l as g,t as _,f as y,j as b,m as C,F as L}from"./index-CTxlYqj4.js";import{l as I}from"./logs-B92gHEZQ.js";import{d as N}from"./index-a9uUi1ey.js";import{V as R}from"./VDataTableServer-DyIOcZiN.js";import{V as F}from"./VChip-Def9BYoN.js";import{V as h,a as D}from"./VToolbar-Cd2iSn8H.js";import{V as S}from"./VTextField-CWm47OUI.js";import{b as $}from"./VCard-DRptUN8Y.js";import"./VDataTable-CYPG0MtF.js";import"./VAvatar-x_79C0tA.js";import"./tag-Dx3OexMp.js";import"./VProgressCircular-ubzZW5PC.js";import"./VSelect-tV4GZAtn.js";import"./forwardRefs-BSESyuUp.js";import"./ssrBoot-DGgZQEVC.js";import"./VMenu-DTm7W1Hp.js";import"./VCheckboxBtn-xrhfoOlo.js";import"./VSelectionControl-Bdgm37Tl.js";import"./VTable-B-HE2nmK.js";import"./filter-DaBUD6Rp.js";const z={__name:"AuditTrailList",setup(V){const{$gettext:t}=w(),s=i(!1),c=i([]),n=i(""),d=i(0),v=[{title:t("Date"),key:"date_created"},{title:t("Level"),key:"level"},{title:t("Logger"),key:"logger"},{title:t("Message"),key:"message"}];function x(a){return a==="INFO"?"primary":a==="WARNING"?"orange":a==="CRITICAL"||a==="ERROR"?"red":""}function m({page:a,itemsPerPage:l,sortBy:e,search:T}){let p;e.length&&(p=(e[0].order==="desc"?"-":"")+e[0].key);const k={ordering:p,page:a,page_size:l,search:T};s.value=!0,I.getAuditTrail(k).then(u=>{c.value=u.data.results,d.value=u.data.count,s.value=!1})}return m=N(m,500),(a,l)=>(f(),A($,{class:"mt-6"},{default:r(()=>[o(R,{headers:v,items:c.value,search:n.value,class:"elevation-0","items-length":d.value,"onUpdate:options":m},{top:r(()=>[o(h,{flat:"",color:"white"},{default:r(()=>[o(S,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=e=>n.value=e),"prepend-inner-icon":"mdi-magnify",placeholder:y(t)("Search"),variant:"outlined","hide-details":"",density:"compact",class:"flex-grow-0 w-33"},null,8,["modelValue","placeholder"])]),_:1})]),"item.level":r(({item:e})=>[o(F,{color:x(e.level),"text-color":"white",size:"small"},{default:r(()=>[g(_(e.level),1)]),_:2},1032,["color"])]),_:2},1032,["items","search","items-length"])]),_:1}))}},E={__name:"AuditTrailView",setup(V){return(t,s)=>(f(),C(L,null,[o(h,{flat:""},{default:r(()=>[o(D,null,{default:r(()=>[g(_(t.$gettext("Audit trail")),1)]),_:1})]),_:1}),o(z)],64))}},oe=b(E,[["__scopeId","data-v-5d9f29af"]]);export{oe as default};
