PageSourceSearch

https://local-it-partner.de/assets/_admin.admin.analytics-BeQ1YQiR.js

js local-it-partner.de collected 2026-10-07 04:59:59 UTC 6,865 bytes, 1 lines download raw bytes

1import{ad as g,aO as p,ae as b,D as R,ah as h,bh as f,j as e}from"./index-pmhrAKwR.js";import{S as D,a as P,b as E,c as F,d as l}from"./select-BqxxNAKo.js";import{T as K,a as B,b as y,c as N,d as O,e as v}from"./table-DCwpeJqO.js";import{T as M,a as V,b as c,c as o}from"./tabs-CmsG7C8F.js";import{B as _}from"./badge-BanEc-xe.js";import{R as I,L as $,C as Q,X as U,Y as W,T as Y,a as S}from"./LineChart-C-p7rgdn.js";import"./index-BaIx5Ftm.js";import"./chevron-up-QYb3c6HO.js";import"./index-j-GkUALt.js";const H=g({method:"POST"}).middleware([p]).handler(b("9b82ced89f3f00620829c2ea27bfeb8698ecc0e18dbb0312bc68d7e79f4e0110")),X=g({method:"POST"}).middleware([p]).handler(b("d7693a407139c6161d67922ecffd02e38febf8d91d523a0368467563ed21e653")),J=g({method:"POST"}).middleware([p]).handler(b("df3782f4731fde9c4fe9fb9358d740ad3c83a8f6a8e7cc809f5e86ae1ef826cb")),Z=g({method:"GET"}).middleware([p]).handler(b("1f8e9095c2cda294d736183e4c72e578dfb144c17690764c8a97c9860cd9dfcc"));function j(s){return s.toLocaleString("de-DE")}function ee(s){return`${(s*100).toFixed(1).replace(".",",")} %`}function se(s){const a=Math.floor(s/60),r=Math.round(s%60);return a>0?`${a}m ${r}s`:`${r}s`}function ae(s,a){return a?(s-a)/a*100:null}function te({value:s}){if(s===null||!isFinite(s))return null;const a=s>=0;return e.jsxs(_,{variant:a?"default":"destructive",className:"ml-2 align-middle",children:[a?"▲":"▼"," ",Math.abs(s).toFixed(1).replace(".",",")," %"]})}function u({label:s,value:a,prev:r,format:d="int"}){const n=d==="pct"?ee(a):d==="duration"?se(a):j(a);return e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:s}),e.jsxs("p",{className:"mt-2 font-display text-3xl font-semibold",children:[n,e.jsx(te,{value:ae(a,r)})]})]})}function me(){const[s,a]=R.useState(28),r=h(H),d=h(X),n=h(J),A=h(Z),t=f({queryKey:["ga4","overview",s],queryFn:()=>r({data:{days:s}})}),T=f({queryKey:["ga4","series",s],queryFn:()=>d({data:{days:s}})}),w=f({queryKey:["ga4","realtime"],queryFn:()=>A(),refetchInterval:3e4});function i(m){return f({queryKey:["ga4","bd",m,s],queryFn:()=>n({data:{days:s,dimension:m,limit:25}})})}const k=i("pagePath"),z=i("sessionSource"),C=i("deviceCategory"),G=i("country"),q=i("eventName"),L=t.data?.error||T.data?.error||w.data?.error||k.data?.error;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-2xl font-semibold",children:"Analytics (GA4)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Echte Besucherdaten aus Google Analytics 4 (pseudonymisiert, Consent Mode v2)."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"rounded-full bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary",children:["● ",j(w.data?.total??0)," aktiv (30 Min)"]}),e.jsxs(D,{value:String(s),onValueChange:m=>a(Number(m)),children:[e.jsx(P,{className:"w-40",children:e.jsx(E,{})}),e.jsxs(F,{children:[e.jsx(l,{value:"7",children:"Letzte 7 Tage"}),e.jsx(l,{value:"28",children:"Letzte 28 Tage"}),e.jsx(l,{value:"90",children:"Letzte 90 Tage"}),e.jsx(l,{value:"180",children:"Letzte 180 Tage"}),e.jsx(l,{value:"365",children:"Letzte 12 Monate"})]})]})]})]}),L&&e.jsxs("div",{className:"rounded-lg border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive",children:[e.jsx("strong",{children:"GA4-Fehler:"})," ",L,e.jsxs("p",{className:"mt-1 text-xs opacity-80",children:["Prüfen: Secrets ",e.jsx("code",{children:"GA4_PROPERTY_ID"})," und ",e.jsx("code",{children:"GA4_SERVICE_ACCOUNT_JSON"}),', Service-Account muss in GA4 → Verwaltung → Property → Zugriffsverwaltung als „Leser" hinzugefügt sein.']})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[e.jsx(u,{label:"Aktive Nutzer",value:t.data?.current.activeUsers??0,prev:t.data?.previous.activeUsers??0}),e.jsx(u,{label:"Sitzungen",value:t.data?.current.sessions??0,prev:t.data?.previous.sessions??0}),e.jsx(u,{label:"Seitenaufrufe",value:t.data?.current.pageviews??0,prev:t.data?.previous.pageviews??0}),e.jsx(u,{label:"Absprungrate",value:t.data?.current.bounceRate??0,prev:t.data?.previous.bounceRate??0,format:"pct"}),e.jsx(u,{label:"Ø Sitzungsdauer",value:t.data?.current.avgDuration??0,prev:t.data?.previous.avgDuration??0,format:"duration"})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("h2",{className:"mb-4 font-display text-lg font-semibold",children:"Trend"}),e.jsx("div",{className:"h-72",children:e.jsx(I,{width:"100%",height:"100%",children:e.jsxs($,{data:T.data?.series??[],children:[e.jsx(Q,{strokeDasharray:"3 3",className:"stroke-border"}),e.jsx(U,{dataKey:"date",tick:{fontSize:11}}),e.jsx(W,{tick:{fontSize:11}}),e.jsx(Y,{}),e.jsx(S,{type:"monotone",dataKey:"users",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1,name:"Nutzer"}),e.jsx(S,{type:"monotone",dataKey:"sessions",stroke:"hsl(var(--muted-foreground))",strokeWidth:1.5,dot:!1,name:"Sitzungen"}),e.jsx(S,{type:"monotone",dataKey:"pageviews",stroke:"hsl(var(--accent-foreground))",strokeWidth:1,dot:!1,strokeDasharray:"4 4",name:"Seitenaufrufe"})]})})})]}),e.jsxs(M,{defaultValue:"pages",children:[e.jsxs(V,{children:[e.jsx(c,{value:"pages",children:"Top-Seiten"}),e.jsx(c,{value:"sources",children:"Quellen"}),e.jsx(c,{value:"devices",children:"Geräte"}),e.jsx(c,{value:"countries",children:"Länder"}),e.jsx(c,{value:"events",children:"Events"})]}),e.jsx(o,{value:"pages",children:e.jsx(x,{q:k,keyLabel:"Pfad",valueLabel:"Aufrufe"})}),e.jsx(o,{value:"sources",children:e.jsx(x,{q:z,keyLabel:"Quelle",valueLabel:"Aufrufe"})}),e.jsx(o,{value:"devices",children:e.jsx(x,{q:C,keyLabel:"Gerät",valueLabel:"Aufrufe"})}),e.jsx(o,{value:"countries",children:e.jsx(x,{q:G,keyLabel:"Land",valueLabel:"Aufrufe"})}),e.jsx(o,{value:"events",children:e.jsx(x,{q,keyLabel:"Event",valueLabel:"Anzahl"})})]})]})}function x({q:s,keyLabel:a,valueLabel:r}){const d=s.data?.rows??[];return e.jsx("div",{className:"rounded-2xl border border-border bg-card",children:e.jsxs(K,{children:[e.jsx(B,{children:e.jsxs(y,{children:[e.jsx(N,{children:a}),e.jsx(N,{className:"text-right",children:r}),e.jsx(N,{className:"text-right",children:"Nutzer"})]})}),e.jsxs(O,{children:[d.length===0&&e.jsx(y,{children:e.jsx(v,{colSpan:3,className:"py-8 text-center text-sm text-muted-foreground",children:s.isLoading?"Lädt …":"Keine Daten."})}),d.map(n=>e.jsxs(y,{children:[e.jsx(v,{className:"max-w-[420px] truncate font-mono text-xs",children:n.key}),e.jsx(v,{className:"text-right font-medium",children:j(n.value)}),e.jsx(v,{className:"text-right text-muted-foreground",children:j(n.users)})]},n.key))]})]})})}export{me 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.