PageSourceSearch

https://portal.litelog.de/assets/index-D79qLokF.js

js litelog.de collected 2026-10-07 03:53:44 UTC 15,736 bytes, 1 lines download raw bytes

1import{r as u,C as e}from"./vendor-core-kDn7q5nn.js";import{g as T,aY as b,cA as ee,dn as te,dp as Y,dq as se,P as U,bB as P,dr as q,ds as R,bD as A,cR as F,dt as Z,bJ as I,du as ae,dv as ne,dw as ie,dx as re,a3 as W,aG as oe,dy as le,dz as ce,dA as ue,dB as de,h as he,dC as me,dD as pe,dE as ye,dF as fe,dG as ge,b2 as ve,cQ as _e,bZ as xe,dH as Se}from"./app-shared-D9Va_FlY.js";import{h as N,T as B,a as O,W as D}from"./historyCells-Br_YjbAa.js";import{S as z,bs as G,q as L,a4 as je,ab as ke,r as Te,by as be,bN as Ee,ck as we,T as Ve,B as Ce,aS as Pe}from"./antd-DUwX4n57.js";import{o as Re,n as Ae}from"./pro-components-U2bZqxZr.js";import"./mapbox-DrKvbh0K.js";import"./xlsx-DLNWaC59.js";import"./calendar-C0yHFNg9.js";import"./iso-3166-D9CfHPRA.js";import"./charts-B4kAPUKr.js";import"./html2canvas-CBrSDip1.js";const Fe=()=>{const{t:c}=T(["portal","common"]),[s]=b(),{runExport:g}=ee(),y=u.useCallback(()=>{const o=s.get("logsSources"),p=o?o.split(",").map(f=>f.trim()).filter(f=>te.includes(f)):[...Y],m=s.get("logsFrom")||void 0,v=s.get("logsTo")||void 0,l={};p&&p.length>0&&(l.sources=p),m&&v&&(l.dateRange=[m,v]);const h=Number(s.get("logsAccount"));Number.isInteger(h)&&h>0&&(l.account_id=h);const r=Number(s.get("logsProperty"));Number.isInteger(r)&&r>0&&(l.property_id=r);const x=(s.get("logsEvents")??"").split(",").map(f=>f.trim()).filter(Boolean);return x.length>0&&(l.events=x),l},[s]),d=u.useCallback(async o=>{"cancelled"in await g({key:"activity.logs",format:o,filters:y(),selfNotify:!0})},[y,g]);return e.jsx(se,{permission:U.EXPORT_REPORTS,onExport:d,formats:["csv","xlsx","pdf"],size:"large",ariaLabel:c("portal:historyPage.export.button",{defaultValue:"Export"}),scheduleReportKey:"activity.logs",scheduleFilters:{startDate:s.get("logsFrom"),endDate:s.get("logsTo"),property:s.get("logsProperty")}})},{Text:Ie}=L,K=["property","property_modules","lebendmeldung_config","attendance_config","attendance_instance","roster_week_copy","route_config","kiosk","form_response","incident","form_template","work_order","workflow_rule","company_settings","absence","role","work_schedule","time_adjustment","tag","tag_area","customer","api_key","qualification","account_custom_field","incident_log","file","tour","material_targets","material_warehouse_targets","task_material_defaults","mcp_connection","sso_config","account_mfa","webhook_subscription","device"],Ne=({showFilter:c=!0})=>{const{t:s}=T(["properties","portal","common"]),[g]=b(),y=P(),d=N(s),[o,p]=u.useState(1),[m,v]=u.useState(20),l=q(g.get("auditTypes"),K),h=u.useCallback(t=>{y({auditTypes:t.length?t.join(","):null}),p(1)},[y]),{data:r,isFetching:x}=R({queryKey:["tenant-config-audit",o,m,l],queryFn:()=>ae.list({entity_types:l.length?l:void 0,page:o,pageSize:m}),staleTime:6e4,keepPreviousData:!0}),f=t=>s(`properties:auditTrail.entityTypes.${t}`,{defaultValue:t}),S=t=>{const a=s(`properties:auditTrail.events.${t.event}`,{defaultValue:t.event});return`${f(t.entity_type)} ${a}`},n=t=>{var j;const a=(j=t.meta)==null?void 0:j.name;return typeof a=="string"&&a?a:e.jsx(Ie,{type:"secondary",children:"—"})},i=t=>s(`properties:auditTrail.fields.${t}`,{defaultValue:t}),_=ne(s,i);return e.jsxs("div",{children:[c&&e.jsx(A,{hasActiveFilters:l.length>0,onReset:()=>h([]),align:"left",children:e.jsx(F,{label:s("portal:history.settingsAudit.filterLabel",{defaultValue:"Bereich"}),minWidth:280,children:e.jsx(z,{mode:"multiple",allowClear:!0,style:{width:"100%"},placeholder:s("portal:history.settingsAudit.filterPlaceholder",{defaultValue:"Nach Bereich filtern"}),value:l,onChange:t=>h(t),options:K.map(t=>({value:t,label:f(t)})),maxTagCount:"responsive","data-testid":"settings-audit-types"})})}),e.jsx(G,{rowKey:"id",size:"small",loading:x&&!r,dataSource:(r==null?void 0:r.items)??[],pagination:!1,columns:[{key:"created_at",title:d.time,width:B,render:(t,a)=>e.jsx(O,{value:a.created_at})},{key:"actor",title:d.who,width:220,render:(t,a)=>e.jsx(D,{accountId:a.actor_account_id,name:a.actor_name,uuid:a.actor_uuid,systemLabel:s("portal:history.settingsAudit.system",{defaultValue:"System"})})},{key:"event",title:d.event,render:(t,a)=>e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:600},children:S(a)}),e.jsx(Z,{changes:a.changes,maxRows:3,labelFor:i,valueFor:_})]})},{key:"ref",title:d.ref,width:240,ellipsis:!0,render:(t,a)=>n(a)}],locale:{emptyText:s("portal:history.settingsAudit.empty",{defaultValue:"Noch keine Einstellungs-Änderungen aufgezeichnet"})}}),e.jsx(I,{total:(r==null?void 0:r.total)??0,current:o,pageSize:m,onChange:(t,a)=>{p(a!==m?1:t),v(a)}})]})},{Text:V}=L,Q=["edited","deleted","bulk_deleted","sublogs_cleared","overlap_override","confirmed","unconfirmed","confirm_dropped","created"],Oe=new Set(["pause_ms","work_ms","total_ms","planned_ms"]),De=new Set(["start_ts","end_ts","confirmed_at"]),ze=({showFilter:c=!0})=>{const{t:s}=T(["portal","common"]),[g]=b(),y=P(),d=N(s),[o,p]=u.useState(1),[m,v]=u.useState(20),l=q(g.get("editEvents"),Q),h=u.useCallback(t=>{y({editEvents:t.length?t.join(","):null}),p(1)},[y]),{data:r,isFetching:x}=R({queryKey:["worktime-edit-events",o,m,l],queryFn:()=>ie.list({events:l.length?l:void 0,page:o,pageSize:m}),staleTime:6e4,keepPreviousData:!0}),f=t=>s(`portal:history.worktimeEdits.events.${t}`,{defaultValue:t}),S=t=>s(`portal:history.worktimeEdits.fields.${t}`,{defaultValue:t}),n=(t,a)=>{if(!(a==null||a==="")){if(Oe.has(t))return re(a);
1if(De.has(t)&&typeof a=="string")return W(a)}},i=t=>!t.time_id&&!t.work_time_uuid?e.jsx(V,{type:"secondary",children:"—"}):e.jsxs("div",{children:[t.shift_account_name&&e.jsx("div",{children:oe(t.shift_account_name)}),e.jsxs(V,{type:"secondary",style:{fontSize:12,whiteSpace:"nowrap"},children:[t.shift_start_ts?W(t.shift_start_ts):s("portal:history.worktimeEdits.shiftDeleted",{defaultValue:"Schicht gelöscht"}),t.time_id!=null&&` · #${t.time_id}`]})]}),_=t=>{var w,$,H;const a=(w=t.meta)==null?void 0:w.reason,j=($=t.meta)==null?void 0:$.source,k=(H=t.meta)==null?void 0:H.cause;return e.jsxs(e.Fragment,{children:[typeof a=="string"&&a&&e.jsxs("div",{style:{fontSize:12},children:[e.jsxs(V,{type:"secondary",children:[s("portal:history.worktimeEdits.reason",{defaultValue:"Grund"}),": "]}),a]}),typeof k=="string"&&k&&e.jsxs("div",{style:{fontSize:12},children:[e.jsxs(V,{type:"secondary",children:[s("portal:history.worktimeEdits.cause",{defaultValue:"Auslöser"}),": "]}),s(`portal:history.worktimeEdits.causes.${k}`,{defaultValue:k})]}),j==="sync_v3"&&e.jsx(je,{style:{marginTop:2},children:s("portal:history.worktimeEdits.sync",{defaultValue:"Sync"})})]})};return e.jsxs("div",{children:[c&&e.jsx(A,{hasActiveFilters:l.length>0,onReset:()=>h([]),align:"left",children:e.jsx(F,{label:s("portal:history.worktimeEdits.filterLabel",{defaultValue:"Ereignis"}),minWidth:280,children:e.jsx(z,{mode:"multiple",allowClear:!0,style:{width:"100%"},placeholder:s("portal:history.worktimeEdits.filterPlaceholder",{defaultValue:"Nach Ereignis filtern"}),value:l,onChange:t=>h(t),options:Q.map(t=>({value:t,label:f(t)})),maxTagCount:"responsive","data-testid":"worktime-edit-events-filter"})})}),e.jsx(G,{rowKey:"id",size:"small",loading:x&&!r,dataSource:(r==null?void 0:r.items)??[],pagination:!1,columns:[{key:"created_at",title:d.time,width:B,render:(t,a)=>e.jsx(O,{value:a.created_at})},{key:"actor",title:d.who,width:220,render:(t,a)=>e.jsx(D,{accountId:a.actor_account_id,name:a.actor_name,uuid:a.actor_uuid,systemLabel:s("portal:history.worktimeEdits.system",{defaultValue:"System"})})},{key:"event",title:d.event,render:(t,a)=>e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:600},children:f(a.event)}),e.jsx(Z,{changes:a.changes,maxRows:3,labelFor:S,valueFor:n}),_(a)]})},{key:"shift",title:d.ref,width:240,render:(t,a)=>i(a)}],locale:{emptyText:s("portal:history.worktimeEdits.empty",{defaultValue:"Noch keine Zeiterfassungs-Änderungen aufgezeichnet"})}}),e.jsx(I,{total:(r==null?void 0:r.total)??0,current:o,pageSize:m,onChange:(t,a)=>{p(a!==m?1:t),v(a)}})]})},{Text:E}=L,Le=["shift_already_closed"],We=({showFilter:c=!0})=>{const{t:s}=T(["portal","common"]),[g]=b(),y=P(),d=N(s),[o,p]=u.useState(1),[m,v]=u.useState(20),l=q(g.get("quarantineReasons")),h=u.useCallback(n=>{y({quarantineReasons:n.length?n.join(","):null}),p(1)},[y]),{data:r,isFetching:x}=R({queryKey:["worktime-quarantine",o,m,l],queryFn:()=>le.list({reasons:l.length?l:void 0,page:o,pageSize:m}),staleTime:6e4,keepPreviousData:!0}),f=n=>s(`portal:history.worktimeQuarantine.reasons.${n}`,{defaultValue:n}),S=n=>e.jsxs("div",{children:[e.jsx("div",{children:n.property_name??e.jsx(E,{type:"secondary",children:"—"})}),e.jsxs(E,{type:"secondary",style:{fontSize:12,whiteSpace:"nowrap"},children:[n.state??"—",n.client_ts&&` · ${W(n.client_ts)}`,n.time_id!=null&&` · #${n.time_id}`]})]});return e.jsxs("div",{children:[c&&e.jsx(A,{hasActiveFilters:l.length>0,onReset:()=>h([]),align:"left",children:e.jsx(F,{label:s("portal:history.worktimeQuarantine.filterLabel",{defaultValue:"Grund"}),minWidth:280,children:e.jsx(z,{mode:"multiple",allowClear:!0,style:{width:"100%"},placeholder:s("portal:history.worktimeQuarantine.filterPlaceholder",{defaultValue:"Nach Grund filtern"}),value:l,onChange:n=>h(n),options:Le.map(n=>({value:n,label:f(n)})),maxTagCount:"responsive","data-testid":"worktime-quarantine-filter"})})}),e.jsx(G,{rowKey:"id",size:"small",loading:x&&!r,dataSource:(r==null?void 0:r.items)??[],pagination:!1,expandable:{expandedRowRender:n=>e.jsx("pre",{style:{margin:0,fontSize:12,whiteSpace:"pre-wrap"},children:JSON.stringify(n.payload,null,2)})},columns:[{key:"created_at",title:d.time,width:B,render:(n,i)=>e.jsx(O,{value:i.created_at})},{key:"who",title:d.who,width:220,render:(n,i)=>e.jsx(D,{accountId:i.account_id,name:i.account_name,uuid:i.account_uuid,systemLabel:"—"})},{key:"reason",title:s("portal:history.worktimeQuarantine.colReason",{defaultValue:"Grund"}),render:(n,i)=>i.reason?e.jsx("span",{style:{fontWeight:600},children:f(i.reason)}):e.jsx(E,{type:"secondary",children:"—"})},{key:"ref",title:d.ref,width:260,render:(n,i)=>S(i)},{key:"device",title:s("portal:history.worktimeQuarantine.colDevice",{defaultValue:"Gerät"}),width:160,render:(n,i)=>i.device_unique_id?e.jsx(E,{code:!0,style:{fontSize:12},children:i.device_unique_id}):e.jsx(E,{type:"secondary",children:"—"})}],locale:{emptyText:s("portal:history.worktimeQuarantine.empty",{defaultValue:"Keine Buchungen in Quarantäne"})}}),e.jsx(I,{total:(r==null?void 0:r.total)??0,current:o,pageSize:m,onChange:(n,i)=>{p(i!==m?1:n),v(i)}})]})},J=[7,30,90],M=30,Me=c=>{const s=Number(c);return J.includes(s)?s:M},qe=20,Be=(c,s)=>{let g=0,y=0;
1for(const d of de[s]){const o=c.byReason[d];o&&(g+=o.curr,y+=o.prev)}return{curr:g,prev:y}},Ge=({showFilter:c=!0})=>{const{t:s}=T(["portal","accounts"]),[g]=b(),y=P(),d=Me(g.get("verificationDays")),o=N(s),[p,m]=u.useState(1),[v,l]=u.useState(qe),{data:h,isFetching:r,isError:x}=R({queryKey:["verification-summary",d],queryFn:()=>ue.summary({days:d}),staleTime:6e4,keepPreviousData:!0}),f=(h==null?void 0:h.accounts)??[];u.useEffect(()=>{m(1)},[d]);const S=u.useMemo(()=>{const i=(t,a)=>t===0&&a===0?e.jsx("span",{style:{color:"#bbb"},children:"—"}):e.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[e.jsx("span",{style:{fontWeight:t>0?600:400},children:t})," ",e.jsx("span",{style:{color:"#888",fontSize:12},children:s("portal:history.verification.trendPrev",{defaultValue:"(zuvor {{prev}})",prev:a})})]});return[{title:o.who,key:"person",width:220,render:(t,a)=>e.jsx(D,{accountId:a.account_id,name:a.name,uuid:a.uuid,systemLabel:s("portal:history.settingsAudit.system",{defaultValue:"System"})})},...ce.map(t=>({title:s(`accounts:logs.verification.gate.${t}`,{defaultValue:t}),key:t,render:(a,j)=>{const{curr:k,prev:w}=Be(j,t);return i(k,w)}})),{title:s("portal:history.verification.colTotal",{defaultValue:"Gesamt"}),key:"total",width:100,render:(t,a)=>e.jsx("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:a.total})},{title:s("portal:history.verification.colLastAt",{defaultValue:"Zuletzt"}),key:"last_at",width:150,render:(t,a)=>e.jsx(O,{value:a.last_at})}]},[s,o.who]),n=u.useMemo(()=>f.slice((p-1)*v,p*v),[f,p,v]);return e.jsxs(e.Fragment,{children:[c&&e.jsx(A,{hasActiveFilters:d!==M,onReset:()=>y({verificationDays:null}),align:"left",children:e.jsx(F,{label:s("portal:history.verification.range",{defaultValue:"Zeitraum"}),minWidth:160,children:e.jsx(z,{value:d,onChange:i=>y({verificationDays:i===M?null:String(i)}),options:J.map(i=>({value:i,label:s("portal:history.verification.rangeDays",{defaultValue:"{{count}} Tage",count:i})})),style:{width:"100%"},"data-testid":"verification-days-select"})})}),e.jsx(L.Paragraph,{type:"secondary",style:{marginBottom:12},children:s("portal:history.verification.hint",{defaultValue:'Abgewiesene, umgangene und auffällige Buchungsversuche je Person — aktueller Zeitraum gegen die Vorperiode. Einzel-Ereignisse stehen im Abschnitt „Aktivitäten" (Quelle „Manipulationsschutz").'})}),e.jsx(Re,{rowKey:"account_id",search:!1,options:!1,cardProps:!1,pagination:!1,toolBarRender:!1,size:"small",dataSource:n,loading:r&&!h,columns:S,locale:{emptyText:e.jsx(ke,{description:x?s("portal:history.verification.loadError",{defaultValue:"Report konnte nicht geladen werden — bitte erneut versuchen."}):s("portal:history.verification.empty",{defaultValue:"Keine Auffälligkeiten im gewählten Zeitraum."})})}}),e.jsx(I,{total:f.length,current:p,pageSize:v,hideOnSinglePage:!0,onChange:(i,_)=>{m(_!==v?1:i),l(_)}})]})},X="history.columns.hidden.v1",C={location:!0},$e=()=>{try{const c=localStorage.getItem(X);return c?{...C,...JSON.parse(c)}:C}catch{return C}},He=(c,s)=>{switch(c){case"activity":{const g=new URLSearchParams(s);return g.delete("logsSources"),Se(g)}case"settings":return!!s.get("auditTypes");case"worktimeEdits":return!!s.get("editEvents");case"quarantine":return!!s.get("quarantineReasons");case"verification":return!!s.get("verificationDays");default:return!1}},nt=()=>{const{t:c}=T(["portal","attendance","accounts"]),[s]=b(),[g,y]=u.useState("list"),d=he(U.VIEW_TIME_TRACKING),o=me(s.get("section"),d),p=o==="activity",[m,v]=u.useState($e),l=u.useMemo(()=>He(o,s),[o,s]),[h,r]=u.useState(()=>l);u.useEffect(()=>{l&&r(!0)},[l]);const x=u.useCallback(_=>{v(_);try{localStorage.setItem(X,JSON.stringify(_))}catch{}},[]),f=u.useMemo(()=>pe(c),[c]),S=u.useRef(()=>{}),n=u.useCallback(_=>{S.current=_},[]),i=u.useCallback(()=>S.current(),[]);return ye(c("portal:mainMenu.history",{defaultValue:"Aktivität"})),e.jsxs(Ae,{title:c("portal:mainMenu.history",{defaultValue:"Aktivität"}),breadcrumb:{},extra:e.jsxs(Te,{size:8,children:[e.jsx(ve,{docKey:"history"}),p&&e.jsx(be,{value:g,onChange:_=>y(_),size:"large",options:[{value:"list",icon:e.jsx(Ee,{})},{value:"map",icon:e.jsx(we,{})}]}),e.jsx("span",{"data-testid":"history-filter-toggle",children:e.jsx(_e,{open:h,hasActiveFilters:l,onToggle:()=>r(_=>!_)})}),p&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{area:"activity",options:f,hidden:m,onChange:x,onReset:()=>x(C),tooltip:c("accounts:columnsButton.tooltip"),resetLabel:c("accounts:headerFilter.reset")}),e.jsx(Ve,{title:c("portal:mainMenu.reload",{defaultValue:"Aktualisieren"}),children:e.jsx(Ce,{size:"large",icon:e.jsx(Pe,{}),onClick:i,"aria-label":c("portal:mainMenu.reload",{defaultValue:"Aktualisieren"}),"data-testid":"history-reload-button"})}),e.jsx(Fe,{})]})]}),children:[p&&e.jsx(fe,{scope:ge,showFilter:h,showSourceChips:!1,defaultSources:Y,viewM
1ode:g,onViewModeChange:y,hiddenColumns:m,onRefetchReady:n}),o==="settings"&&e.jsx(Ne,{showFilter:h}),o==="worktimeEdits"&&e.jsx(ze,{showFilter:h}),o==="quarantine"&&e.jsx(We,{showFilter:h}),o==="verification"&&e.jsx(Ge,{showFilter:h})]})};export{nt as default};

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.