PageSourceSearch

https://www.ascendtradingconcepts.com/assets/AdminDashboard-CcKzzjAD.js

js ascendtradingconcepts.com collected 2026-10-05 23:19:53 UTC 5,517 bytes, 1 lines download raw bytes

1import{b as u,u as A,r as t,t as j,j as e,N as m,T as x,C as D,B as N}from"./index-D495-HzB.js";import{F as h}from"./Footer-Oj04hllU.js";import{R as b}from"./refresh-cw-DJ5ESkV8.js";function R(){const{user:s,loading:r}=u(),[,l]=A(),[d,c]=t.useState(!1),[i,g]=t.useState(null),[o,a]=t.useState("idle");t.useEffect(()=>{!r&&(!s||s.role!=="admin")&&l("/")},[s,r,l]);const p=j.roadmap.refreshRoadmap.useMutation({onSuccess:n=>{a("success"),g(n.generatedAt),c(!1),setTimeout(()=>a("idle"),3e3)},onError:n=>{a("error"),c(!1),console.error("Refresh failed:",n),setTimeout(()=>a("idle"),3e3)}}),f=async()=>{c(!0),a("idle"),await p.mutateAsync()};return r?e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:47",className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:48",className:"w-8 h-8 border-2 border-teal border-t-transparent rounded-full animate-spin"})}):!s||s.role!=="admin"?e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:55",className:"min-h-screen bg-background text-foreground overflow-x-hidden",children:[e.jsx(m,{"data-loc":"client/src/pages/AdminDashboard.tsx:56"}),e.jsx("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"pt-28 pb-20 px-4",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:58",className:"max-w-2xl mx-auto text-center",children:[e.jsx(x,{"data-loc":"client/src/pages/AdminDashboard.tsx:59",className:"w-12 h-12 text-red-400/60 mx-auto mb-4"}),e.jsx("h1",{"data-loc":"client/src/pages/AdminDashboard.tsx:60",className:"text-2xl font-bold mb-2",children:"Access Denied"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:61",className:"text-foreground/60",children:"You do not have permission to access this page."})]})}),e.jsx(h,{"data-loc":"client/src/pages/AdminDashboard.tsx:64"})]}):e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:70",className:"min-h-screen bg-background text-foreground overflow-x-hidden",children:[e.jsx(m,{"data-loc":"client/src/pages/AdminDashboard.tsx:71"}),e.jsx("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:73",className:"pt-28 pb-20 px-4",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:74",className:"max-w-4xl mx-auto",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:75",className:"mb-8",children:[e.jsx("h1",{"data-loc":"client/src/pages/AdminDashboard.tsx:76",className:"text-3xl font-bold mb-2",children:"Admin Dashboard"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:77",className:"text-foreground/60",children:"Manage site content and refresh cached data"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:81",className:"rounded-xl border border-white/[0.07] bg-white/[0.02] p-8",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:82",className:"flex items-start justify-between mb-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:83",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:84",className:"text-xl font-bold mb-1",children:"Market Brief"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:85",className:"text-foreground/60 text-sm",children:"Manually refresh all Market Brief data: Market Briefing, Market Bias, Today's Economic Catalysts, and Key Levels"})]}),e.jsx(b,{"data-loc":"client/src/pages/AdminDashboard.tsx:89",className:"w-6 h-6 text-teal/60"})]}),i&&e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:93",className:"mb-6 p-4 rounded-lg bg-teal/5 border border-teal/20",children:e.jsxs("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:94",className:"text-sm text-foreground/70",children:[e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:95",className:"font-semibold",children:"Last refreshed:"})," ",new Date(i).toLocaleString()]})}),o==="success"&&e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:102",className:"mb-6 p-4 rounded-lg bg-green-400/5 border border-green-400/20 flex items-center gap-2",children:[e.jsx(D,{"data-loc":"client/src/pages/AdminDashboard.tsx:103",className:"w-5 h-5 text-green-400"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:104",className:"text-sm text-green-400/90",children:"Market Brief refreshed successfully!"})]}),o==="error"&&e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:109",className:"mb-6 p-4 rounded-lg bg-red-400/5 border border-red-400/20 flex items-center gap-2",children:[e.jsx(x,{"data-loc":"client/src/pages/AdminDashboard.tsx:110",className:"w-5 h-5 text-red-400"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:111",className:"text-sm text-red-400/90",children:"Failed to refresh Market Brief. Check console for details."})]}),e.jsxs(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:115",onClick:f,disabled:d,className:"gap-2 bg-teal hover:bg-teal/90 text-background font-semibold",children:[e.jsx(b,{"data-loc":"client/src/pages/AdminDashboard.tsx:120",className:`w-4 h-4 ${d?"animate-spin":""}`}),d?"Refreshing...":"Refresh Market Brief Now"]}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:124",className:"text-xs text-foreground
1/40 mt-4",children:"This will fetch live market data, economic events, generate the market narrative, and calculate key levels. All users will see the updated content immediately on the Market Brief page."})]})]})}),e.jsx(h,{"data-loc":"client/src/pages/AdminDashboard.tsx:132"})]})}export{R 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.