PageSourceSearch

https://weespots.ai/assets/AdminMcpClaude-Cec625UY.js

js weespots.ai collected 2026-10-05 14:32:13 UTC 5,844 bytes, 1 lines download raw bytes

1import{r as t,j as e}from"./reactflow-D4V9tSA3.js";import{w as O,x as T,y as I,I as N,H as L,b2 as P,C as c,a as l,b as d,J as V,d as o,B as p,n as h,m as B,z as n,W as f}from"./index-GVOk_ySq.js";import{C as H}from"./copy-CbcaKKf-.js";import{T as M}from"./trash-2-DRceC4vT.js";import{f as _}from"./format-BPnX4zUu.js";import{f as k}from"./fr-BL-nAKzV.js";const w="https://eqzxkrniuachilkskyzi.supabase.co/functions/v1/mcp-server";function K(){const{user:i,loading:u}=O(),{isSuperAdmin:a,loading:m}=T(),r=I(),[j,y]=t.useState([]),[v,A]=t.useState([]),[g,b]=t.useState([]),[S,C]=t.useState(!0);t.useEffect(()=>{!u&&!i&&r("/auth")},[i,u,r]),t.useEffect(()=>{!m&&!a&&i&&r("/")},[a,m,i,r]);const x=async()=>{C(!0);const[s,R,E]=await Promise.all([n.from("mcp_oauth_clients").select("*").order("created_at",{ascending:!1}),n.from("mcp_oauth_tokens").select("*").order("created_at",{ascending:!1}).limit(50),n.from("mcp_audit_log").select("*").order("created_at",{ascending:!1}).limit(100)]);y(s.data??[]),A(R.data??[]),b(E.data??[]),C(!1)};t.useEffect(()=>{a&&x()},[a]);const z=s=>{navigator.clipboard.writeText(s),f.success("Copié")},q=async s=>{await n.from("mcp_oauth_clients").update({revoked_at:new Date().toISOString()}).eq("id",s),f.success("Application révoquée"),x()},D=async s=>{await n.from("mcp_oauth_tokens").update({revoked_at:new Date().toISOString()}).eq("id",s),f.success("Token révoqué"),x()};return u||m?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(N,{className:"size-6 animate-spin"})}):a?e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(L,{}),e.jsxs("main",{className:"flex-1 container max-w-6xl py-10 space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-2",children:[e.jsx(P,{className:"size-7"})," Connecteur Claude — Spider VO AI"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Expose les outils Spider VO AI à Claude.ai via un connecteur OAuth 2.1. Réservé aux super administrateurs (V1)."})]}),e.jsxs(c,{children:[e.jsxs(l,{children:[e.jsx(d,{children:"Installer dans Claude.ai"}),e.jsx(V,{children:"Claude.ai → Settings → Connectors → Add custom connector → coller l'URL ci-dessous."})]}),e.jsxs(o,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm break-all",children:[e.jsx("span",{className:"flex-1",children:w}),e.jsx(p,{size:"sm",variant:"outline",onClick:()=>z(w),children:e.jsx(H,{className:"size-3.5"})})]}),e.jsxs("ol",{className:"text-sm space-y-1 list-decimal list-inside text-muted-foreground",children:[e.jsx("li",{children:"Ouvrir Claude.ai → Settings → Connectors"}),e.jsx("li",{children:"Cliquer « Add custom connector »"}),e.jsx("li",{children:"Coller l'URL ci-dessus"}),e.jsx("li",{children:"Cliquer « Connect » : Claude redirige vers weespots.ai pour authentification"}),e.jsx("li",{children:"Approuver la demande (vous devez être connecté à votre compte super admin weespots.ai)"}),e.jsx("li",{children:"Claude affiche les 12 outils Spider VO disponibles dans une nouvelle conversation"})]})]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(d,{children:"Applications OAuth enregistrées"})}),e.jsx(o,{children:S?e.jsx(N,{className:"size-5 animate-spin"}):j.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Aucune application Claude enregistrée pour le moment."}):e.jsx("div",{className:"space-y-2",children:j.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-md",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[s.name,s.revoked_at&&e.jsx(h,{variant:"destructive",children:"Révoquée"})]}),e.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate",children:s.client_id}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.redirect_uris.join(", ")})]}),!s.revoked_at&&e.jsxs(p,{size:"sm",variant:"ghost",onClick:()=>q(s.id),children:[e.jsx(M,{className:"size-3.5 mr-1"}),"Révoquer"]})]},s.id))})})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(d,{children:"Tokens actifs"})}),e.jsx(o,{children:v.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Aucun token émis."}):e.jsx("div",{className:"space-y-1 text-sm",children:v.filter(s=>s.type==="access").map(s=>e.jsxs("div",{className:"flex items-center justify-between p-2 border rounded-md",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(h,{variant:s.revoked_at?"destructive":new Date(s.expires_at)<new Date?"secondary":"default",children:s.revoked_at?"Révoqué":new Date(s.expires_at)<new Date?"Expiré":"Actif"}),e.jsx("span",{className:"font-mono text-xs truncate",children:s.client_id}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Expire ",_(new Date(s.expires_at),"Pp",{locale:k})]})]}),!s.revoked_at&&e.jsx(p,{size:"sm",variant:"ghost",onClick:()=>D(s.id),children:"Révoquer"})]},s.id))})})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx(d,{children:"Derniers appels MCP"})}),e.jsx(o,{children:g.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Aucun appel pour le moment."}):e.jsx("div",{className:"space-y-1 text-xs font-mono",children:g.map(s=>e.jsxs("div",{className:"flex items-center gap-3 py-1 border-b",children:[e.jsx("span",{className:"text-muted-foreground w-32",children:_(new Date(s.created_at),"Pp",{locale:k})}),e.jsx(h,{variant:s.status==="ok"?"default":"destructive",children:s.status}),e.jsx("span",{className:"flex-1 truncate",children:s.tool}),e.jsxs("span",{className:"text-muted-foreground",children:[s.latency_ms,"ms"]})]},s.id))})})]})]}),e.jsx(B,{})]}):null}export{K 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.