PageSourceSearch

https://dotweekly.com/assets/AdminAnalytics-BVNCEPMv.js

js dotweekly.com collected 2026-10-02 10:25:30 UTC 9,729 bytes, 1 lines download raw bytes

1import{i as j,j as e,e as u}from"./index-BzPsVFMX.js";import{a as N,J as b,ae as n,Q as f,Y as m,a6 as o,G as v,aa as w}from"./icons-CJQVGBFB.js";const h={"/":"Homepage (Expired Auctions)","/expired":"Expired Auctions","/lazy-investor":"Lazy Investor","/gems":"Domain Gems","/domain-score":"Domain Score","/upgrade-scanner":"Upgrade Scanner","/zone-match":"ZoneMatch","/keyword-facts":"Keyword Fact Sheet","/trend-pulse":"Trend Pulse","/trap-discovery":"Trap Discovery","/domain-monitor":"Domain Monitor","/buy-list":"Buy List","/pricing":"Pricing","/login":"Login","/register":"Register","/settings":"Settings","/admin":"Admin Panel","/admin/analytics":"Analytics (this page)"};function g(r){return h[r]?h[r]:r.startsWith("/blog/")?r.replace("/blog/","").replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase()):r}function L(){const[r,d]=N.useState("7d"),{data:t,isLoading:p}=j({queryKey:["/api/admin/page-analytics",r],staleTime:6e4,queryFn:async()=>{const s=await fetch(`/api/admin/page-analytics?period=${r}`);if(!s.ok)throw new Error("Failed to load analytics");return s.json()}});return e.jsx(u,{children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(b,{className:"w-6 h-6 text-[#296374]"}),e.jsx("h1",{className:"text-2xl font-bold text-[#1A4472]",children:"Site Analytics"})]}),e.jsx("div",{className:"flex gap-2",children:["7d","30d","90d"].map(s=>e.jsx("button",{onClick:()=>d(s),className:`px-3 py-1.5 rounded-lg text-sm font-medium border transition-all ${r===s?"bg-[#296374] text-white border-transparent":"bg-white text-gray-500 border-gray-200 hover:border-[#296374]/30"}`,children:s==="7d"?"7 Days":s==="30d"?"30 Days":"90 Days"},s))})]}),p?e.jsx("div",{className:"text-center py-12 text-gray-400",children:"Loading analytics..."}):t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-white rounded-xl border p-4 text-center",children:[e.jsx(n,{className:"w-5 h-5 text-[#296374] mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-[#1A4472]",children:t.summary.total_views.toLocaleString()}),e.jsx("div",{className:"text-xs text-gray-500",children:"Page Views"})]}),e.jsxs("div",{className:"bg-white rounded-xl border p-4 text-center",children:[e.jsx(f,{className:"w-5 h-5 text-emerald-600 mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-emerald-600",children:t.summary.total_uniques.toLocaleString()}),e.jsx("div",{className:"text-xs text-gray-500",children:"Unique Visitors"})]}),e.jsxs("div",{className:"bg-white rounded-xl border p-4 text-center",children:[e.jsx(m,{className:"w-5 h-5 text-amber-600 mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-amber-600",children:t.summary.pages_visited}),e.jsx("div",{className:"text-xs text-gray-500",children:"Pages Visited"})]}),e.jsxs("div",{className:"bg-white rounded-xl border p-4 text-center",children:[e.jsx(o,{className:"w-5 h-5 text-purple-600 mx-auto mb-1"}),e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:t.summary.active_days>0?Math.round(t.summary.total_views/t.summary.active_days):0}),e.jsx("div",{className:"text-xs text-gray-500",children:"Avg Views/Day"})]})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-xl border shadow-sm",children:[e.jsxs("div",{className:"px-4 py-3 border-b flex items-center gap-2",children:[e.jsx(n,{className:"w-4 h-4 text-[#296374]"}),e.jsx("span",{className:"text-sm font-semibold text-[#1A4472]",children:"Top Pages"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 text-gray-500 text-xs",children:[e.jsx("th",{className:"text-left py-2 px-4 font-medium",children:"Page"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Views"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Uniques"})]})}),e.jsx("tbody",{children:t.topPages.map((s,a)=>e.jsxs("tr",{className:`border-t ${a<3?"bg-amber-50/30":""}`,children:[e.jsx("td",{className:"py-2 px-4 text-gray-700 font-medium",children:g(s.path)}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-600",children:s.views.toLocaleStr
1ing()}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-500",children:s.uniques.toLocaleString()})]},s.path))})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border shadow-sm",children:[e.jsxs("div",{className:"px-4 py-3 border-b flex items-center gap-2",children:[e.jsx(v,{className:"w-4 h-4 text-[#296374]"}),e.jsx("span",{className:"text-sm font-semibold text-[#1A4472]",children:"Top Referrers"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 text-gray-500 text-xs",children:[e.jsx("th",{className:"text-left py-2 px-4 font-medium",children:"Referrer"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Views"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Uniques"})]})}),e.jsx("tbody",{children:t.topReferrers.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"py-4 px-4 text-center text-gray-400",children:"No referrer data yet"})}):t.topReferrers.map((s,a)=>e.jsxs("tr",{className:`border-t ${a<3?"bg-emerald-50/30":""}`,children:[e.jsx("td",{className:"py-2 px-4 text-gray-700 font-medium",children:s.referrer}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-600",children:s.views.toLocaleString()}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-500",children:s.uniques.toLocaleString()})]},s.referrer))})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border shadow-sm",children:[e.jsxs("div",{className:"px-4 py-3 border-b flex items-center gap-2",children:[e.jsx(o,{className:"w-4 h-4 text-[#296374]"}),e.jsx("span",{className:"text-sm font-semibold text-[#1A4472]",children:"Daily Trend"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 text-gray-500 text-xs",children:[e.jsx("th",{className:"text-left py-2 px-4 font-medium",children:"Date"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Views"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Uniques"})]})}),e.jsx("tbody",{children:t.dailyTrend.map((s,a)=>{const c=Math.max(...t.dailyTrend.map(i=>i.views),1),l=Math.round(s.views/c*100);return e.jsxs("tr",{className:"border-t",children:[e.jsx("td",{className:"py-2 px-4 text-gray-700 font-medium",children:s.date}),e.jsx("td",{className:"py-2 px-3 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("div",{className:"h-2 rounded-full bg-[#296374]/20",style:{width:`${l}px`},children:e.jsx("div",{className:"h-full rounded-full bg-[#296374]",style:{width:"100%"}})}),e.jsx("span",{className:"text-gray-600 w-12 text-right",children:s.views.toLocaleString()})]})}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-500",children:s.uniques.toLocaleString()})]},s.date)})})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border shadow-sm",children:[e.jsxs("div",{className:"px-4 py-3 border-b flex items-center gap-2",children:[e.jsx(m,{className:"w-4 h-4 text-[#296374]"}),e.jsx("span",{className:"text-sm font-semibold text-[#1A4472]",children:"Blog Post Views"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-gray-50 text-gray-500 text-xs",children:[e.jsx("th",{className:"text-left py-2 px-4 font-medium",children:"Post"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Views"}),e.jsx("th",{className:"text-right py-2 px-3 font-medium",children:"Uniques"})]})}),e.jsx("tbody",{children:t.blogViews.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"py-4 px-4 text-center text-gray-400",children:"No blog views tracked yet"})}):t.blogViews.map(s=>e.jsxs("tr",{className:"border-t",children:[e.jsx("td",{className:"py-2 px-4 text-gray-700 font-medium",children:g(s.path)}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-600",children:s.views.toLocaleString()}),e.jsx("td",{className:"py-2 px-3 text-right text-gray-500",children:s.uniques.toLocaleStr
1ing()})]},s.path))})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl border shadow-sm lg:col-span-2",children:[e.jsxs("div",{className:"px-4 py-3 border-b flex items-center gap-2",children:[e.jsx(w,{className:"w-4 h-4 text-[#296374]"}),e.jsx("span",{className:"text-sm font-semibold text-[#1A4472]",children:"Traffic by Hour (UTC)"})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"flex items-end gap-1 h-24",children:Array.from({length:24},(s,a)=>{const l=t.hourlyDist.find(x=>x.hour===a)?.views||0,i=Math.max(...t.hourlyDist.map(x=>x.views),1),y=Math.max(l/i*100,2);return e.jsx("div",{className:"flex-1 flex flex-col items-center gap-0.5",title:`${a}:00 UTC — ${l} views`,children:e.jsx("div",{className:"w-full rounded-t bg-[#296374]",style:{height:`${y}%`}})},a)})}),e.jsx("div",{className:"flex gap-1 mt-1",children:Array.from({length:24},(s,a)=>e.jsx("div",{className:"flex-1 text-center text-[9px] text-gray-400",children:a%4===0?a:""},a))})]})]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-400",children:"No data available yet. Analytics will populate as visitors browse the site."})]})})}export{L 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.