PageSourceSearch

https://apexmob.life/assets/admin.recovery-log--0AA4ik5.js

js apexmob.life collected 2026-10-02 02:00:10 UTC 5,921 bytes, 1 lines download raw bytes

1import{e as z,k as L,r as a,j as e,s as R}from"./index-CX8MQMhI.js";function W(){const{user:o,isAdmin:d,loading:y,adminLoading:b,signOut:j}=z(),c=L(),[n,S]=a.useState([]),[x,k]=a.useState(""),[i,w]=a.useState("all"),[p,u]=a.useState(!1);async function g(){u(!0);const{data:t}=await R.from("recovery_link_events").select("*").order("created_at",{ascending:!1}).limit(500);S(t??[]),u(!1)}a.useEffect(()=>{d&&g()},[d]);const s=a.useMemo(()=>{const t={all:n.length,created:0,used:0,failed:0};for(const r of n)t[r.event_type]+=1;return t},[n]),f=a.useMemo(()=>{const t=x.trim().toLowerCase();return n.filter(r=>i!=="all"&&r.event_type!==i?!1:t?r.email.toLowerCase().includes(t)||(r.source??"").toLowerCase().includes(t)||(r.note??"").toLowerCase().includes(t)||(r.actor_email??"").toLowerCase().includes(t):!0)},[n,x,i]);if(y||b)return e.jsx("div",{style:l,children:e.jsx("div",{style:{padding:40},children:"Loading…"})});if(!o)return e.jsx("div",{style:l,children:e.jsxs("div",{style:{padding:40,textAlign:"center"},children:[e.jsx("p",{children:"Please sign in on the main site first."}),e.jsx("button",{onClick:()=>c({to:"/"}),style:m,children:"Go Home"})]})});if(!d)return e.jsx("div",{style:l,children:e.jsxs("div",{style:{padding:40,textAlign:"center"},children:[e.jsx("p",{children:"Not authorized."}),e.jsx("button",{onClick:()=>j().then(()=>c({to:"/"})),style:m,children:"Sign Out"})]})});const C=[{id:"all",label:"All",count:s.all,color:"var(--ax-gold)"},{id:"created",label:"Created",count:s.created,color:"var(--ax-gold-text)"},{id:"used",label:"Used",count:s.used,color:"var(--ax-success)"},{id:"failed",label:"Failed",count:s.failed,color:"var(--ax-danger-strong)"}];return e.jsx("div",{style:l,children:e.jsxs("div",{style:{maxWidth:1100,margin:"0 auto",padding:"32px 24px"},children:[e.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:20,borderBottom:"1px solid rgba(217,173,92,0.3)",paddingBottom:16,flexWrap:"wrap",gap:12},children:[e.jsxs("div",{children:[e.jsx("div",{style:{color:"var(--ax-muted)",fontSize:10,letterSpacing:"0.35em"},children:"APEX MOB · ADMIN"}),e.jsx("h1",{style:{fontFamily:"'Cinzel',serif",color:"var(--ax-gold-text)",letterSpacing:"0.15em",fontSize:"1.4rem",margin:"6px 0 0"},children:"🔐 Recovery Link Log"})]}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("button",{onClick:g,style:v,disabled:p,children:p?"Refreshing…":"Refresh"}),e.jsx("button",{onClick:()=>c({to:"/admin"}),style:v,children:"← Admin"})]})]}),e.jsxs("p",{style:{color:"var(--ax-muted)",fontSize:13,marginBottom:16},children:["Every recovery link created by an admin, plus what happened when the recipient opened it.",e.jsx("b",{style:{color:"var(--ax-gold-text)"},children:" Created"})," = link generated / reset email sent.",e.jsx("b",{style:{color:"var(--ax-success)"},children:" Used"})," = password successfully set from the link.",e.jsx("b",{style:{color:"var(--ax-danger-strong)"},children:" Failed"})," = the link couldn't be used (expired, already consumed, session mismatch, etc.)."]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,flexWrap:"wrap"},children:[C.map(t=>e.jsxs("button",{onClick:()=>w(t.id),style:{padding:"8px 14px",fontSize:10,letterSpacing:"0.2em",textTransform:"uppercase",background:i===t.id?t.color:"transparent",color:i===t.id?"#000":t.color,border:`1px solid ${t.color}`,borderRadius:2,cursor:"pointer",fontFamily:"'Cinzel',serif",fontWeight:700},children:[t.label," (",t.count,")"]},t.id)),e.jsx("input",{value:x,onChange:t=>k(t.target.value),placeholder:"Search email, source, note…",style:{flex:1,minWidth:220,padding:"8px 12px",background:"var(--ax-card)",border:"1px solid rgba(217,173,92,0.35)",color:"var(--ax-text)",borderRadius:2,fontSize:13}})]}),f.length===0?e.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--ax-muted)",background:"var(--ax-card)",border:"1px solid var(--ax-line)",borderRadius:2},children:"No events match."}):e.jsx("div",{style:{display:"grid",gap:6},children:f.map(t=>e.jsxs("div",{style:{background:"var(--ax-card)",border:`1px solid ${h(t.event_type)}`,borderLeftWidth:4,padding:"10px 14px",borderRadius:2,display:"grid",gridTemplateColumns:"110px 1fr auto",gap:12,alignItems:"start"},children:[e.jsx("div",{children:e.jsx("span",{style:{display:"inline-block",padding:"3px 8px",fontSize:10,letterSpacing:"0.2em",textTransform:"uppercase",background:h(t.event_type),color:"#000",borderRadius:2,fontFamily:"'Cinzel',serif",fontWeight:700},children:t.event_type})}),e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{style:{color:"var(--ax-gold-text)",fontWeight:600,fontSize:14,wordBreak:"break-all"},children:t.email}),t.note&&e.jsx("div",{style:{color:"var(--ax-body)",fontSize:13,marginTop:3,whiteSpace:"pre-wrap"},children:t.note}),e.jsxs("div",{style:{color:"var(--ax-muted)",fontSize:11,marginTop:4},children:[t.source??"unknown source",t.actor_email&&e.jsxs(e.Fragment,{children:[" · by ",t.actor_email]})]})]}),e.jsx("div",{style:{color:"var(--ax-muted)",fontSize:11,whiteSpace:"nowrap",textAlign:"right"}
1,children:new Date(t.created_at).toLocaleString()})]},t.id))})]})})}function h(o){return o==="used"?"var(--ax-success)":o==="failed"?"var(--ax-danger-strong)":"var(--ax-gold-text)"}const l={background:"var(--ax-page)",color:"var(--ax-text)",minHeight:"100vh",fontFamily:"'Lato',sans-serif"},m={background:"linear-gradient(135deg,var(--ax-gold-text),var(--ax-gold))",color:"#000",padding:"10px 18px",border:"none",fontFamily:"'Cinzel',serif",letterSpacing:"0.22em",fontSize:11,textTransform:"uppercase",fontWeight:700,cursor:"pointer",borderRadius:2,marginTop:12},v={background:"transparent",color:"var(--ax-gold)",padding:"8px 14px",border:"1px solid var(--ax-gold)",fontFamily:"'Cinzel',serif",letterSpacing:"0.2em",fontSize:10,textTransform:"uppercase",fontWeight:700,cursor:"pointer",borderRadius:2};export{W 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.