PageSourceSearch

https://ovelinmall-ovelin-mall.hf.space/assets/analytics-Cw1ddl3X.js

js ovelinmall-ovelin-mall.hf.space collected 2026-10-03 17:12:44 UTC 4,446 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-vWFYep2x.js";import{u as h,r as d}from"./vendor-router-ChBioB4i.js";import{d as x}from"./index-C0Hc7JXq.js";import"./vendor-react-LI-sLqvG.js";import"./vendor-motion-CyE-KEXQ.js";function N(){const[,i]=h(),[s,r]=d.useState(null),[l,m]=d.useState(null);if(d.useEffect(()=>{const t=()=>{x("/api/admin/analytics/summary").then(r).catch(()=>i("/admin/login")),x("/api/admin/analytics/funnel").then(m).catch(()=>{})};t();const c=setInterval(t,3e4);return()=>clearInterval(c)},[]),!s)return e.jsx("div",{className:"p-6 text-center text-pink-600",children:"جاري التحميل..."});const n=s.totals||{},p=["bg-pink-500","bg-pink-500","bg-pink-500","bg-pink-500"];return e.jsxs("div",{className:"min-h-[100dvh] pb-20",children:[e.jsxs("div",{className:"px-4 py-4 flex items-center justify-between",children:[e.jsx("h1",{className:"text-lg font-bold text-pink-700",children:"📊 التحليلات"}),e.jsx("button",{onClick:()=>i("/admin"),className:"text-pink-500 text-sm",children:"رجوع"})]}),e.jsxs("div",{className:"px-4 grid grid-cols-2 gap-3",children:[e.jsx(a,{label:"أحداث 24س",value:n.events_24h,color:"from-pink-400 to-pink-600"}),e.jsx(a,{label:"جلسات 24س",value:n.sessions_24h,color:"from-pink-400 to-pink-600"}),e.jsx(a,{label:"مستخدمين جدد",value:n.new_users_24h,
1color:"from-pink-400 to-pink-600"}),e.jsx(a,{label:"طلبات 24س",value:n.orders_24h,color:"from-rose-400 to-rose-600"}),e.jsx(a,{label:"إيرادات 24س",value:`${Number(n.revenue_24h||0).toFixed(2)}$`,color:"from-pink-500 to-pink-500"}),e.jsx(a,{label:"طلبات معلقة",value:n.pending_orders,color:"from-yellow-400 to-orange-500"}),e.jsx(a,{label:"إيداعات معلقة",value:n.pending_deposits,color:"from-blue-400 to-cyan-500"}),e.jsx(a,{label:"تذاكر مفتوحة",value:n.open_tickets,color:"from-green-400 to-emerald-500"})]}),l&&e.jsxs("div",{className:"mx-4 mt-4 bg-white dark:bg-zinc-900 rounded-2xl p-4",children:[e.jsx("h3",{className:"font-bold text-pink-700 mb-3",children:"قمع التحويل (آخر 7 أيام)"}),e.jsx(o,{label:"زوار الصفحة الرئيسية",v:l.visitors,max:l.visitors}),e.jsx(o,{label:"شاهدوا منتجاً",v:l.product_views,max:l.visitors}),e.jsx(o,{label:"أضافوا للسلة",v:l.users_with_cart,max:l.visitors}),e.jsx(o,{label:"أكملوا الشراء",v:l.buyers,max:l.visitors})]}),!!s.eventsByType?.length&&e.jsxs("div",{className:"mx-4 mt-4 bg-white dark:bg-zinc-900 rounded-2xl p-4",children:[e.jsx("h3",{className:"font-bold text-pink-700 mb-3",children:"أنواع الأحداث الأكثر شيوعاً"}),e.jsx("div",{className:"space-y-1.5",children:s.eventsByType.map((t,c)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-32 truncate",children:t.type}),e.jsx("div",{className:"flex-1 h-5 bg-white dark:bg-zinc-800 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full ${p[c%4]}`,style:{width:`${t.count/s.eventsByType[0].count*100}%`}})}),e.jsx("span",{className:"font-bold w-10 text-left",children:t.count})]},t.type))})]}),!!s.topProducts?.length&&e.jsxs("div",{className:"mx-4 mt-4 bg-white dark:bg-zinc-900 rounded-2xl p-4",children:[e.jsx("h3",{className:"font-bold text-pink-700 mb-3",children:"أكثر المنتجات مشاهدة"}),e.jsx("div",{className:"space-y-1.5",children:s.topProducts.map(t=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"flex-1 truncate",children:t.name}),e.jsxs("span",{className:"text-pink-600 font-bold",children:[t.views||0," 👁"]}),e.jsxs("span",{className:"text-zinc-400",children:[t.sales_count||0," 🛒"]})]},t.id))})]})]})}function a({label:i,value:s,color:r}){return e.jsxs("div",{className:`rounded-2xl p-3 bg-gradient-to-br ${r} text-white`,children:[e.jsx("div",{className:"text-xs opacity-90",children:i}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:s??0})]})}function o({label:i,v:s,max:r}){const l=r>0?s/r*100:0;return e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[e.jsx("span",{children:i}),e.jsx("span",{className:"font-bold",children:s??0})]}),e.jsx("div",{className:"h-3 bg-white dark:bg-zinc-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-pink-500 to-pink-500",style:{width:`${l}%`}})})]})}export{N 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.