PageSourceSearch

https://app.tribemap.ai/assets/AdminActivity-CdVV9y6g.js

js tribemap.ai collected 2026-10-05 13:07:46 UTC 8,365 bytes, 6 lines download raw bytes

1import{r as l,g as w,j as e,Y as A,h as k}from"./index-DqFv5MZG.js";import{C,A as S}from"./AdminSidebar-BNbhuVmh.js";import"./pixi-CCYuglfa.js";import"./socket-Cfb7vUdK.js";const I={account:"🏢",user:"👤",membership:"🤝",session:"📊",ai_config:"🤖",brand_asset:"🖼️"};function R(s){return I[s]??"📝"}function E(s,r){return s==="account"?r==="create"?"created account":r==="update"?"updated account":r==="delete"?"deleted account":r==="crawl"?"triggered crawl on":`${r} account`:s==="user"?r==="create"?"created user":r==="update"?"updated user":r==="delete"?"deleted user":r==="reset_password"?"reset password for":r==="password_change"?"changed the password for":r==="password_reset"?"reset the password for":r==="signup"?"signed up as":r==="login"?"signed in":r==="mfa_enable"?"turned on two-step verification for":r==="mfa_disable"?"turned off two-step verification for":r==="mfa_recovery_codes"?"made new recovery codes for":`${r} user`:s==="membership"?r==="add_member"?"added member to":r==="remove_member"?"removed member from":r==="join_via_invite"?"joined via invite":`${r} membership`:s==="session"?r==="bulk_classify"?"triggered bulk classification":r==="bulk_reclassify"?"triggered bulk reclassification":r==="promote_classification"?"promoted classification for session":`${r} session`:s==="ai_config"?r==="update_config"?"updated AI config":r==="revert_config"?"reverted AI config":`${r} AI config`:s==="brand_asset"?r==="create"?"uploaded brand asset":r==="delete"?"deleted brand asset":`${r} brand asset`:`${r} ${s}`}function f(s){return s==null?"null":Array.isArray(s)?s.every(a=>a==null||typeof a=="string"||typeof a=="number"||typeof a=="boolean")?s.join(", "):JSON.stringify(s):typeof s=="object"?JSON.stringify(s):String(s)}function T({entry:s}){const r=R(s.entityType),a=E(s.entityType,s.action),c=A(s.createdAt);return e.jsxs("div",{className:"border border-cyan-500/20 bg-black/50 p-4 font-sans",children:[e.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("span",{className:"text-lg",children:r}),e.jsx("span",{className:"text-cyan-400",children:s.actorEmail}),e.jsx("span",{className:"text-gray-300",children:a}),s.entityLabel&&e.jsx("span",{className:"font-bold text-purple-400",children:s.entityLabel})]})}),e.jsx("time",{className:"text-xs text-gray-600",title:s.createdAt,dateTime:s.createdAt,children:c})]}),s.changes&&Object.keys(s.changes).length>0&&e.jsx("div",{className:"mt-3 space-y-1 border-l-2 border-cyan-500/30 pl-6",children:Object.entries(s.changes).map(([i,n])=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"text-cyan-300",children:i}),e.jsx("span",{className:"mx-2 text-gray-500",children:":"}),e.jsxs("span",{className:"text-gray-500",children:["“",f(n.from),"”"]}),e.jsx("span",{className:"mx-2 text-gray-500",children:"→"}),e.jsxs("span",{className:"text-cyan-300",children:["“",f(n.to),"”"]})]},i))}),s.metadata&&Object.keys(s.metadata).length>0&&e.jsx("div",{className:"mt-3 space-y-1 pl-6 text-xs text-gray-600",children:Object.entries(s.metadata).map(([i,n])=>e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:i}),e.jsx("span",{className:"mx-2",children:":"}),e.jsx("span",{children:f(n)})]},i))})]})}const h=30;function M(){const[s,r]=l.useState(null),[a,c]=l.useState(!0),[i,n]=l.useState(null),[d,j]=l.useState(""),[u,v]=l.useState(""),[o,p]=l.useState(1),b=l.useCallback(async()=>{try{c(!0);const t={limit:h,page:o};d&&(t.entityType=d),u&&(t.action=u);const _=await w.getAdminActivity(t);r(_),n(null)}catch(t){n(t instanceof Error?t.message:"Failed to load activity log"),k.captureException(t)}finally{c(!1)}},[o,d,u]);l.useEffect(()=>{b()},[b]);const g=t=>{n(null),j(t),p(1)},y=t=>{n(null),v(t),p(1)},x=(s==null?void 0:s.pagination)??{limit:h,total:0},m=x.limit>0?Math.ceil(x.total/x.limit):1,N=e.jsxs("div",{className:"mb-6 flex items-center gap-4",children:[e.jsx("label",{className:"font-display text-xs tracking-wider text-cyan-300 uppercase",children:"Filter:"}),e.jsxs("select",{className:`border border-cyan-500/30 bg-black/50 px-3 py-2 font-sans text-sm text-cyan-300 focus:border-cyan-400
2          focus:outline-none`,onChange:t=>{g(t.target.value)},value:d,children:[e.jsx("option",{value:"",children:"All Types"}),e.jsx("option",{value:"account",children:"Account"}),e.jsx("option",{value:"user",children:"User"}),e.jsx("option",{value:"membership",children:"Membership"}),e.jsx("option",{value:"session",children:"Session"}),e.jsx("option",{value:"ai_config",children:"AI Config"}),e.jsx("option",{value:"brand_asset",children:"Brand Asset"})]}),e.jsxs("select",{className:`border border-cyan-500/30 bg-black/50 px-3 py-2 font-sans text-sm text-cyan-300 focus:border-cyan-400
3          focus:outline-none`,onChange:t=>{y(t.target.value)},value:u,children:[e.jsx("option",{value:"",children:"All Actions"}),e.jsx("option",{value:"create",children:"Create"}),e.jsx("option",{value:"update",children:"Update"}),e.jsx("option",{value:"delete",children:"Delete"}),e.jsx("option",{value:"crawl",children:"Crawl"}),e.jsx("option",{value:"signup",children:"Signup"}),e.jsx("option",{value:"login",children:"Sign In"}),e.jsx("option",{value:"reset_password",children:"Reset Password (admin)"}),e.jsx("option",{value:"password_change",children:"Password Change (self-serve)"}),e.jsx("option",{value:"password_reset",children:"Password Reset (self-serve)"}),e.jsx("option",{value:"add_member",children:"Add Member"}),e.jsx("option",{value:"remove_member",children:"Remove Member"}),e.jsx("option",{value:"join_via_invite",children:"Join via Invite"}),e.jsx("option",{value:"bulk_classify",children:"Bulk Classify"}),e.jsx("option",{value:"bulk_reclassify",children:"Bulk Reclassify"}),e.jsx("option",{value:"promote_classification",children:"Promote Classification"}),e.jsx("option",{value:"update_config",children:"Update Config"}),e.jsx("option",{value:"revert_config",children:"Revert Config"}),e.jsx("option",{value:"generate",children:"Generate"}),e.jsx("option",{value:"select",children:"Select"}),e.jsx("option",{value:"regenerate_image",children:"Regenerate Image"}
3),e.jsx("option",{value:"launch",children:"Launch"}),e.jsx("option",{value:"viewed",children:"Viewed"}),e.jsx("option",{value:"dismissed",children:"Dismissed"})]})]});return e.jsx(C,{breadcrumbs:[{label:"Admin",to:"/admin"},{label:"Activity"}],sidebar:e.jsx(S,{}),children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("h1",{className:"font-display mb-4 text-3xl font-bold tracking-wider text-cyan-400 uppercase",children:"ACTIVITY LOG"}),N,i&&e.jsxs("div",{className:"mb-6 border border-red-500/50 bg-red-500/10 px-4 py-3 font-sans text-red-400",children:["⚠️ ERROR: ",i]}),e.jsx("div",{className:"border border-cyan-500/30 bg-black/50 p-6 backdrop-blur-xl",children:a?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsxs("div",{className:"relative h-16 w-16",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-cyan-400/30"}),e.jsx("div",{className:`absolute inset-0 animate-spin rounded-full border-4 border-t-cyan-400 border-r-transparent
4                    border-b-transparent border-l-transparent`})]})}):!s||s.data.length===0?e.jsx("div",{className:"py-12 text-center",children:e.jsx("p",{className:"font-sans text-gray-500",children:"No activity recorded"})}):e.jsxs("div",{className:"space-y-4",children:[s.data.map(t=>e.jsx(T,{entry:t},t.id)),m>1&&e.jsxs("div",{className:"flex items-center justify-between border-t border-cyan-500/20 pt-4",children:[e.jsx("button",{onClick:()=>p(t=>t-1),disabled:o<=1,className:`font-display border border-cyan-500/50 px-3 py-1 text-sm uppercase tracking-wider
5                      text-cyan-400 transition-all hover:bg-cyan-500/10 disabled:cursor-not-allowed disabled:opacity-30`,children:"Previous"}),e.jsxs("span",{className:"font-sans text-sm text-gray-500",children:["Page ",o," of ",m]}),e.jsx("button",{onClick:()=>p(t=>t+1),disabled:o>=m,className:`font-display border border-cyan-500/50 px-3 py-1 text-sm uppercase tracking-wider
6                      text-cyan-400 transition-all hover:bg-cyan-500/10 disabled:cursor-not-allowed disabled:opacity-30`,children:"Next"})]})]})})]})})}export{M 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.