Bloc A - Code mort: - Suppression Studio (components, views, features) - Suppression gamification + services mock (projectService, storageService, gamificationService) - Mise à jour Sidebar, Navbar, locales Bloc B - Frontend: - Suppression modal.tsx deprecated, Modal.stories (doublon Dialog) - Feature flags: PLAYLIST_SEARCH, PLAYLIST_RECOMMENDATIONS, ROLE_MANAGEMENT = true - Suppression 19 tests orphelins, retrait exclusions vitest.config Bloc C - Backend: - Extraction routes_auth.go depuis router.go Bloc D - Rust: - Suppression security_legacy.rs (code mort, patterns déjà dans security/)
1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
import{a as i,j as e}from"./vendor-react-yWUy5XPk.js";import{u as j,C as p,B as l,E as w,c as h}from"./index-CYK_b1Uz.js";import{I as N}from"./input-CGdBHtsQ.js";import{w as c}from"./webhookService-Bf4_1ebI.js";import{f as y,P as k,g as C,h as u,Z as T,i as E}from"./vendor-icons-DJFb1Tiw.js";import"./vendor-CveO81sn.js";import"./vendor-security-DsrNJhpn.js";import"./vendor-router-BNNHboN9.js";import"./vendor-tanstack-kPY9uK0s.js";import"./vendor-http-Cz8wfb0q.js";import"./vendor-utils-DtoSyhX2.js";import"./vendor-motion-B3XPS3Jc.js";import"./vendor-i18n-CMcqpBLz.js";const A=()=>{const{addToast:t}=j(),[o,n]=i.useState([]),[f,d]=i.useState(!0),[r,m]=i.useState(""),x=async()=>{d(!0);try{const s=await c.list();n(s)}catch{t("Failed to load webhooks","error")}finally{d(!1)}};i.useEffect(()=>{x()},[]);const g=async()=>{if(r)try{await c.create(r),m(""),t("Webhook generated successfully","success"),x()}catch{t("Failed to create webhook","error")}},v=s=>{t("Sending test payload to endpoint...","info")},b=async s=>{try{await c.delete(s),n(o.filter(a=>a.id!==s)),t("Webhook disconnected","info")}catch{t("Failed to delete webhook","error")}};return e.jsxs("div",{className:"space-y-6 pb-20 container mx-auto px-4 py-8 max-w-5xl",children:[e.jsx("div",{className:"flex items-end justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-heading font-bold text-foreground mb-1",children:"Webhooks"}),e.jsxs("p",{className:"text-muted-foreground font-mono text-xs flex items-center gap-2",children:[e.jsx(y,{className:"w-3 h-3"})," EVENT SUBSCRIPTION PROTOCOL"]})]})}),e.jsxs(p,{variant:"glass",className:"p-6 border-primary/20 bg-black/40 relative overflow-hidden group",children:[e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1 bg-gradient-to-r from-transparent via-primary/50 to-transparent opacity-50 group-hover:opacity-100 transition-opacity"}),e.jsxs("h3",{className:"font-bold text-foreground mb-4 flex items-center gap-2 text-sm uppercase tracking-widest",children:[e.jsx(k,{className:"w-4 h-4 text-primary"})," Register Endpoint"]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(N,{placeholder:"https://api.domain.com/webhook",value:r,onChange:s=>m(s.target.value),className:"flex-1 font-mono text-sm"}),e.jsx(l,{onClick:g,disabled:!r,className:"shadow-glow-cyan",children:"Create Hook"})]})]}),e.jsx("div",{className:"space-y-4",children:f?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(C,{className:"w-8 h-8 text-primary animate-spin"})}):o.length===0?e.jsx(w,{icon:e.jsx(u,{className:"w-full h-full"}),title:"No endpoints registered",description:"Ready to stream real-time events to your external infra.",size:"lg"}):o.map(s=>e.jsxs(p,{variant:"glass",className:"group overflow-hidden relative border-white/5 hover:border-white/10 transition-all bg-black/40",children:[e.jsx("div",{className:h("absolute left-0 top-0 bottom-0 w-1",s.status==="active"?"bg-success shadow-status-dot-lime":"bg-destructive")}),e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between p-6 pl-8 gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:h("text-xs font-bold px-2 py-0.5 rounded border uppercase tracking-wider",s.status==="active"?"border-success/30 text-success bg-success/10":"border-destructive/30 text-destructive bg-destructive/10"),children:s.status}),e.jsx("span",{className:"font-mono text-foreground text-sm break-all",children:s.url})]}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground items-center",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-primary/70",children:"events:"}),s.events.map(a=>e.jsx("span",{className:"text-foreground bg-white/5 px-1 rounded",children:a},a))]}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-white/20"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(u,{className:"w-3 h-3"})," Last trigger: ",s.lastTriggered]})]})]}),e.jsxs("div",{className:"flex gap-2 w-full md:w-auto opacity-60 group-hover:opacity-100 transition-opacity",children:[e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>v(s.id),className:"border-white/10 hover:bg-primary/20 hover:text-primary hover:border-primary/50",children:[e.jsx(T,{className:"w-3 h-3 mr-2"})," Test"]}),e.jsx(l,{variant:"outline",size:"sm",onClick:()=>b(s.id),className:"border-white/10 hover:bg-destructive/20 hover:text-destructive hover:border-destructive/50",children:e.jsx(E,{className:"w-3 h-3"})})]})]})]},s.id))})]})};export{A as WebhooksView};
|