PageSourceSearch

https://fosapp.manus.space/assets/AdminChannels-bH-cWJPs.js

js fosapp.manus.space collected 2026-10-03 05:01:56 UTC 17,702 bytes, 13 lines download raw bytes

1import{b as D,u as V,k as J,r as n,t,a,j as e,B as l,L as R}from"./index-Df9RYwwb.js";import{I as i}from"./input-DjTme8O2.js";import{T as K}from"./textarea-DPJKqdc7.js";import{L as d}from"./loader-circle-BoW_trwV.js";import{S as h}from"./shield-ban-48tMaO4-.js";import{A as X}from"./arrow-left-DXZ0bDFu.js";import{P as z}from"./plus-DqPraZDE.js";import{C as Z}from"./circle-check-big-Cxq4SgL1.js";import{E as O}from"./external-link-BPMXaBTv.js";import{E as $}from"./eye-DgAiWYHS.js";import{T as ee}from"./trash-2-Bzz0cTJF.js";import"./dialog-CCm092Hq.js";import"./index--YHQQRNx.js";import"./Combination-Dr1zqeqq.js";import"./x-Dpi4zoMf.js";import"./usePersistFn-3_pBEfWa.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const j=D("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const se=D("TvMinimal",[["path",{d:"M7 21h10",key:"1b0cd5"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}]]);function fe(){const{user:b,loading:Y}=V(),[,Q]=J(),[x,y]=n.useState(""),[p,w]=n.useState(""),[k,S]=n.useState(""),[g,u]=n.useState(""),[C,f]=n.useState(""),[I,B]=n.useState(""),[L,U]=n.useState(""),[r,E]=n.useState(""),[_,v]=n.useState(!1),c=t.useUtils(),{data:o=[],isLoading:F}=t.admin.listWatchedChannels.useQuery(),{data:m=[],isLoading:H}=t.admin.listBlacklist.useQuery(),{data:M=[]}=t.admin.listArchiveChannels.useQuery(),N=t.admin.addWatchedChannel.useMutation({onSuccess:()=>{c.admin.listWatchedChannels.invalidate(),c.admin.listAllChannels.invalidate(),y(""),w(""),S(""),a.success("Channel added to watch list")},onError:s=>a.error(s.message)}),P=t.admin.removeWatchedChannel.useMutation({onSuccess:()=>{c.admin.listWatchedChannels.invalidate(),a.success("Channel removed from watch list")},onError:s=>a.error(s.message)}),A=t.admin.addToBlacklist.useMutation({onSuccess:()=>{c.admin.listBlacklist.invalidate(),c.admin.listWatchedChannels.invalidate(),u(""),f(""),B(""),U(""),a.success("Channel added to blacklist")},onError:s=>a.error(s.message)}),T=t.admin.removeFromBlacklist.useMutation({onSuccess:()=>{c.admin.listBlacklist.invalidate(),a.success("Channel removed from blacklist")},onError:s=>a.error(s.message)}),W=t.admin.toggleBlacklistSuppression.useMutation({onSuccess:(s,G)=>{c.admin.listBlacklist.invalidate(),a.success(G.suppressed?"Channel suppressed — videos hidden from public views":"Channel unsuppressed — videos now visible")},onError:s=>a.error(s.message)});if(Y)return e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:84",className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(d,{"data-loc":"client/src/pages/AdminChannels.tsx:85",className:"w-8 h-8 animate-spin text-primary"})});if(!b||b.role!=="admin")return e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:92",className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:93",className:"text-center",children:[e.jsx(h,{"data-loc":"client/src/pages/AdminChannels.tsx:94",className:"w-12 h-12 text-destructive mx-auto mb-4"}),e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:95",className:"text-foreground/85",children:"Admin access required."}),e.jsx(l,{"data-loc":"client/src/pages/AdminChannels.tsx:96",variant:"outline",className:"mt-4",onClick:()=>Q("/home"),children:"Go Home"})]})});const q=new Set(m.map(s=>s.channelId));return e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:105",className:"min-h-screen bg-background text-foreground",children:[e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:107",className:"border-b border-border/40 bg-card/60 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:108",className:"max-w-5xl mx-auto px-6 py-4 flex items-center gap-4",children:[e.jsx(R,{"data-loc":"client/src/pages/AdminChannels.tsx:109",href:"/admin",children:e.jsxs(l,{"data-loc":"client/src/pages/AdminChannels.tsx:110",variant:"ghost",size:"sm",className:"gap-2 text-foreground
11/85 hover:text-foreground",children:[e.jsx(X,{"data-loc":"client/src/pages/AdminChannels.tsx:111",className:"w-4 h-4"})," Admin Panel"]})}),e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:114",className:"h-5 w-px bg-border"}),e.jsx("h1",{"data-loc":"client/src/pages/AdminChannels.tsx:115",className:"font-display text-lg font-semibold tracking-wide",children:"Channel Management"}),e.jsx(R,{"data-loc":"client/src/pages/AdminChannels.tsx:116",href:"/SEI/admin/white-labels",className:"ml-auto",children:e.jsx(l,{"data-loc":"client/src/pages/AdminChannels.tsx:117",variant:"outline",size:"sm",className:"border-primary/40 text-primary hover:bg-primary/10",children:"White-label settings"})})]})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:122",className:"max-w-5xl mx-auto px-6 py-10 space-y-12",children:[e.jsxs("section",{"data-loc":"client/src/pages/AdminChannels.tsx:125",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:126",className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:127",className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(se,{"data-loc":"client/src/pages/AdminChannels.tsx:128",className:"w-4 h-4 text-primary"})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:130",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminChannels.tsx:131",className:"font-display text-xl font-semibold",children:"Watched Channels"}),e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:132",className:"text-sm text-foreground/85",children:"Only videos from these channels are ingested into the archive."})]}),e.jsxs("span",{"data-loc":"client/src/pages/AdminChannels.tsx:134",className:"ml-auto text-sm text-foreground/85 font-mono",children:[o.length," channel",o.length!==1?"s":""]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:140",className:"glass-card p-5 mb-6 border border-primary/20",children:[e.jsxs("p",{"data-loc":"client/src/pages/AdminChannels.tsx:141",className:"text-sm font-medium text-primary mb-4 flex items-center gap-2",children:[e.jsx(z,{"data-loc":"client/src/pages/AdminChannels.tsx:142",className:"w-4 h-4"})," Add Channel to Watch List"]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:144",className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:145",placeholder:"YouTube Channel ID (e.g. UCxxxxxx)",value:x,onChange:s=>y(s.target.value),className:"font-mono text-sm"}),e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:151",placeholder:"Channel Name",value:p,onChange:s=>w(s.target.value)}),e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:156",placeholder:"YouTube URL (optional)",value:k,onChange:s=>S(s.target.value)})]}),e.jsxs(l,{"data-loc":"client/src/pages/AdminChannels.tsx:162",className:"mt-3",disabled:!x.trim()||!p.trim()||N.isPending,onClick:()=>N.mutate({channelId:x.trim(),channelName:p.trim(),youtubeUrl:k.trim()||void 0}),children:[N.isPending?e.jsx(d,{"data-loc":"client/src/pages/AdminChannels.tsx:171",className:"w-4 h-4 animate-spin mr-2"}):e.jsx(z,{"data-loc":"client/src/pages/AdminChannels.tsx:171",className:"w-4 h-4 mr-2"}),"Add Channel"]})]}),F?e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:178",className:"flex items-center gap-2 text-foreground/85 py-8 justify-center",children:[e.jsx(d,{"data-loc":"client/src/pages/AdminChannels.tsx:179",className:"w-4 h-4 animate-spin"})," Loading…"]}):e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:182",className:"space-y-2",children:[o.map(s=>e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:184",className:`glass-card px-4 py-3 flex items-center gap-3 ${q.has(s.channelId)?"opacity-50":""}`,children:[e.jsx(Z,{"data-loc":"client/src/pages/AdminChannels.tsx:188",className:"w-4 h-4 text-green-500 flex-shrink-0"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:189",className:"flex-1 min-w-0",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:190",className:"font-medium text-sm truncate",children:s.channelName}),e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:191",className:"text-xs text-foreground
11/85 font-mono",children:s.channelId})]}),s.youtubeUrl&&e.jsx("a",{"data-loc":"client/src/pages/AdminChannels.tsx:194",href:s.youtubeUrl,target:"_blank",rel:"noopener noreferrer",className:"text-foreground/85 hover:text-primary transition-colors",children:e.jsx(O,{"data-loc":"client/src/pages/AdminChannels.tsx:195",className:"w-4 h-4"})}),e.jsx(l,{"data-loc":"client/src/pages/AdminChannels.tsx:198",variant:"ghost",size:"sm",className:"text-foreground/85 hover:text-destructive",disabled:P.isPending,onClick:()=>{confirm(`Remove "${s.channelName}" from watch list?`)&&P.mutate({channelId:s.channelId})},children:e.jsx(j,{"data-loc":"client/src/pages/AdminChannels.tsx:209",className:"w-4 h-4"})})]},s.channelId)),o.length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:214",className:"text-center text-foreground/85 py-8 text-sm",children:"No watched channels yet."})]})]}),e.jsxs("section",{"data-loc":"client/src/pages/AdminChannels.tsx:221",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:222",className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:223",className:"w-8 h-8 rounded-lg bg-destructive/10 flex items-center justify-center",children:e.jsx(h,{"data-loc":"client/src/pages/AdminChannels.tsx:224",className:"w-4 h-4 text-destructive"})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:226",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminChannels.tsx:227",className:"font-display text-xl font-semibold",children:"Channel Blacklist"}),e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:228",className:"text-sm text-foreground/85",children:"Channels blocked from ever being ingested, with a reason on record."})]}),e.jsxs("span",{"data-loc":"client/src/pages/AdminChannels.tsx:230",className:"ml-auto text-sm text-foreground/85 font-mono",children:[m.length," blocked"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:236",className:"glass-card p-5 mb-6 border border-destructive/20",children:[e.jsxs("p",{"data-loc":"client/src/pages/AdminChannels.tsx:237",className:"text-sm font-medium text-destructive mb-4 flex items-center gap-2",children:[e.jsx(h,{"data-loc":"client/src/pages/AdminChannels.tsx:238",className:"w-4 h-4"})," Block a Channel"]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:242",className:"mb-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:243",className:"text-xs text-foreground/85 mb-2 font-medium",children:"Pick from archive channels:"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:244",className:"relative",children:[e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:245",placeholder:"Search archive channels…",value:r,onChange:s=>{E(s.target.value),v(!0)},onFocus:()=>v(!0),className:"text-sm"}),_&&e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:253",className:"absolute z-50 mt-1 w-full bg-card border border-border rounded-lg shadow-xl max-h-56 overflow-y-auto",onMouseDown:s=>s.preventDefault(),children:[M.filter(s=>!r.trim()||s.channelName.toLowerCase().includes(r.toLowerCase())).map(s=>e.jsxs("button",{"data-loc":"client/src/pages/AdminChannels.tsx:260",type:"button",className:"w-full text-left px-4 py-2.5 hover:bg-primary/10 flex items-center justify-between gap-3 text-sm",onClick:()=>{u(s.channelId),f(s.channelName),E(s.channelName),v(!1)},children:[e.jsx("span",{"data-loc":"client/src/pages/AdminChannels.tsx:271",className:"font-medium truncate",children:s.channelName}),e.jsxs("span",{"data-loc":"client/src/pages/AdminChannels.tsx:272",className:"text-xs text-foreground/85 flex-shrink-0",children:[s.videoCount," videos"]})]},s.channelId)),M.filter(s=>!r.trim()||s.channelName.toLowerCase().includes(r.toLowerCase())).length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:277",className:"px-4 py-3 text-sm text-foreground/85",children:"No channels match."})]})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:282",className:"text-xs text-foreground/85 mt-1",children:"Or fill in manually below:"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:285",className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:286",placeholder:"YouTube Channel ID",value:g,onChange:s=>u(s.target.value),className:"font-mono text-sm"}),e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:292",placeholder:"Channel Name",value:C,onChange:s=>
11f(s.target.value)}),e.jsx(i,{"data-loc":"client/src/pages/AdminChannels.tsx:297",placeholder:"YouTube URL (optional)",value:L,onChange:s=>U(s.target.value),className:"sm:col-span-2"}),e.jsx(K,{"data-loc":"client/src/pages/AdminChannels.tsx:303",placeholder:"Reason for blocking (e.g. 'AI-generated clickbait, falsely attributed to Buckeye Bigfoot')",value:I,onChange:s=>B(s.target.value),rows:2,className:"sm:col-span-2 text-sm"})]}),e.jsxs(l,{"data-loc":"client/src/pages/AdminChannels.tsx:311",variant:"destructive",className:"mt-3",disabled:!g.trim()||!C.trim()||A.isPending,onClick:()=>A.mutate({channelId:g.trim(),channelName:C.trim(),reason:I.trim()||void 0,youtubeUrl:L.trim()||void 0}),children:[A.isPending?e.jsx(d,{"data-loc":"client/src/pages/AdminChannels.tsx:322",className:"w-4 h-4 animate-spin mr-2"}):e.jsx(h,{"data-loc":"client/src/pages/AdminChannels.tsx:322",className:"w-4 h-4 mr-2"}),"Block Channel"]})]}),H?e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:329",className:"flex items-center gap-2 text-foreground/85 py-8 justify-center",children:[e.jsx(d,{"data-loc":"client/src/pages/AdminChannels.tsx:330",className:"w-4 h-4 animate-spin"})," Loading…"]}):e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:333",className:"space-y-2",children:[m.map(s=>e.jsx("div",{"data-loc":"client/src/pages/AdminChannels.tsx:335",className:`glass-card px-4 py-3 border ${s.suppressed?"border-destructive/20 bg-destructive/5":"border-amber-500/20 bg-amber-500/5"}`,children:e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:338",className:"flex items-start gap-3",children:[s.suppressed?e.jsx(j,{"data-loc":"client/src/pages/AdminChannels.tsx:340",className:"w-4 h-4 text-destructive flex-shrink-0 mt-0.5"}):e.jsx($,{"data-loc":"client/src/pages/AdminChannels.tsx:341",className:"w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:343",className:"flex-1 min-w-0",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminChannels.tsx:344",className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:345",className:"font-medium text-sm",children:s.channelName}),e.jsx("span",{"data-loc":"client/src/pages/AdminChannels.tsx:346",className:`text-xs px-1.5 py-0.5 rounded font-medium ${s.suppressed?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"}`,children:s.suppressed?"Hidden":"Visible"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:354",className:"text-xs text-foreground/85 font-mono mb-1",children:s.channelId}),s.reason&&e.jsxs("p",{"data-loc":"client/src/pages/AdminChannels.tsx:356",className:"text-xs text-foreground/70",children:['"',s.reason,'"']})]}),s.youtubeUrl&&e.jsx("a",{"data-loc":"client/src/pages/AdminChannels.tsx:360",href:s.youtubeUrl,target:"_blank",rel:"noopener noreferrer",className:"text-foreground/85 hover:text-primary transition-colors flex-shrink-0",children:e.jsx(O,{"data-loc":"client/src/pages/AdminChannels.tsx:361",className:"w-4 h-4"})}),e.jsx(l,{"data-loc":"client/src/pages/AdminChannels.tsx:365",variant:"ghost",size:"sm",title:s.suppressed?"Unsuppress — make videos visible":"Suppress — hide videos from public",className:`flex-shrink-0 ${s.suppressed?"text-foreground/85 hover:text-amber-500":"text-amber-500 hover:text-destructive"}`,disabled:W.isPending,onClick:()=>W.mutate({id:s.id,suppressed:!s.suppressed}),children:s.suppressed?e.jsx($,{"data-loc":"client/src/pages/AdminChannels.tsx:377",className:"w-4 h-4"}):e.jsx(j,{"data-loc":"client/src/pages/AdminChannels.tsx:377",className:"w-4 h-4"})}),e.jsx(l,{"data-loc":"client/src/pages/AdminChannels.tsx:379",variant:"ghost",size:"sm",title:"Remove from blacklist entirely",className:"text-foreground/85 hover:text-destructive flex-shrink-0",disabled:T.isPending,onClick:()=>{confirm(`Remove "${s.channelName}" from blacklist entirely?
12
13This will allow the channel to be ingested again.`)&&T.mutate({id:s.id})},children:e.jsx(ee,{"data-loc":"client/src/pages/AdminChannels.tsx:391",className:"w-4 h-4"})})]})},s.id)),m.length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminChannels.tsx:397",className:"text-center text-foreground
13/85 py-8 text-sm",children:"No blocked channels."})]})]})]})]})}export{fe 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.