PageSourceSearch

https://app.vitalityeld.com/assets/D_6IadOi.js

js vitalityeld.com collected 2026-10-02 01:49:09 UTC 4,169 bytes, 1 lines download raw bytes

1import{ct as s,W as a,ar as e,aI as t,eN as i,bg as l,F as r,ay as n}from"./CmVwsSB4.js";import{o as d,cD as o,B as c,bs as m,f as p,cE as u,L as x,h as g,i as j,j as h,k as _,l as y,cF as f,cG as v,W as b,cH as N,H as k,cI as w,cJ as A,a2 as C,cK as D,cL as P}from"./Bku_ZNU5.js";import{S as T}from"./fqwj5BFo.js";import{S as R}from"./DyUz7sCl.js";import{D as E}from"./D9CTyUQp.js";import"./CSc5fXZY.js";import"./KH3gTha8.js";import"./B-a-68O8.js";import"./y2jpHdmr.js";import"./DemIo6QM.js";import"./DTYXwo7g.js";function S({className:l}){const r=s({from:"/_protected/system/system-management/audit-logs"}),n=d(s=>s.hasPermission("TENANT_EXPORT_AUDIT_LOGS")),{mutate:p,isPending:u}=o();return n?a.jsx(c,{onClick:function(){p({tenant_id:m,company_id:r.company_id,user_id:r.user_id,recordType:r.record_type,action:r.action,startDate:r.start_date,endDate:r.end_date})},disabled:u,className:l,children:u?a.jsxs(a.Fragment,{children:["Exporting...",a.jsx(e,{icon:t,className:"animate-spin"})]}):a.jsxs(a.Fragment,{children:[a.jsx(e,{icon:i,strokeWidth:2}),"Export"]})}):null}const F=N.filter(s=>"drivehos"!==s.scope);function L(){const t=l({from:"/system/system-management/audit-logs"}),i=s({from:"/_protected/system/system-management/audit-logs"}),d=(s,a)=>{t({to:".",replace:!0,search:e=>({...e,[s]:a||"",page:1,..."company_id"===s?{user_id:""}:{}})})},o=r.useMemo(()=>({from:i.start_date?p(i.start_date):void 0,to:i.end_date?p(i.end_date):void 0}),[i.start_date,i.end_date]),N=Boolean(i.company_id||i.user_id||i.record_type!==u||i.action!==u);return a.jsxs("div",{className:"w-table flex flex-wrap items-end gap-2",children:[a.jsx("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-56",children:a.jsx(T,{label:"Company",tenant_id:m,withAsterisk:!1,value:i.company_id,onChange:s=>
1d("company_id",s.value),className:"w-full"})}),a.jsx("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-56",children:a.jsx(R,{type:"tenant",label:"User",withAsterisk:!1,value:i.user_id,onChange:s=>d("user_id",s.value),className:"w-full"})}),a.jsxs("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-48",children:[a.jsx(x,{children:"Action"}),a.jsxs(g,{value:i.action,onValueChange:s=>d("action",s),children:[a.jsx(j,{className:"w-full",children:a.jsx(h,{placeholder:"Action"})}),a.jsxs(_,{children:[a.jsx(y,{value:u,children:"All"}),f.map(s=>a.jsx(y,{value:s.value,children:s.label},s.value))]})]})]}),a.jsxs("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-56",children:[a.jsx(x,{children:"Record Type"}),a.jsxs(g,{value:i.record_type,onValueChange:s=>d("record_type",s),children:[a.jsx(j,{className:"w-full",children:a.jsx(h,{placeholder:"Record type"})}),a.jsxs(_,{children:[a.jsx(y,{value:u,children:"All"}),F.map(s=>a.jsx(y,{value:s.value,children:s.label},s.value))]})]})]}),a.jsxs("div",{className:"grid flex-1 shrink-0 basis-45 gap-2 sm:flex-0 sm:basis-64",children:[a.jsx(x,{children:"Period"}),a.jsx(E,{label:"Period",contentClassName:"w-full",date:o,setDate:s=>{const{from:a,to:e}=s??{};a&&e&&t({to:".",replace:!0,search:s=>({...s,start_date:k(a),end_date:k(e),page:1})})},maxRangeDays:v})]}),a.jsx(b,{queryKeys:["audit-logs"]}),N&&a.jsxs(c,{variant:"outline",className:"gap-2",onClick:()=>{t({to:".",replace:!0,search:s=>({...s,page:1,company_id:"",user_id:"",record_type:u,action:u,...w()})})},children:[a.jsx(e,{icon:n,size:16}),"Reset"]}),a.jsx(S,{className:"ml-auto"})]})}const I=()=>{var e,t;const i=l({from:"/system/system-management/audit-logs"}),r=s({from:"/_protected/system/system-management/audit-logs"}),{data:n,isPending:d}=A({page:r.page,limit:r.limit,company_id:r.company_id,user_id:r.user_id,recordType:r.record_type,action:r.action,startDate:r.start_date,endDate:r.end_date});return a.jsxs("div",{className:"space-y-4",children:[a.jsx(L,{}),a.jsx(C,{page:r.page,limit:r.limit,isLoading:d,columns:D,data:(null==(e=null==n?void 0:n.data)?void 0:e.audit_logs)??[],renderSubRow:s=>a.jsx(P,{log:s}),totalPages:null==(t=null==n?void 0:n.data.paging)?void 0:t.totalPages,onPageChange:(s,a)=>i({to:".",search:e=>({...e,page:s,limit:a}),replace:!0})})]})};export{I as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.