ehsan-dashboards/dashboards/VPN_chanel/frontend/.next/server/app/channels/page.js

1 line
No EOL
14 KiB
JavaScript

(()=>{var e={};e.id=864,e.ids=[864],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},2170:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>n.a,__next_app__:()=>h,originalPathname:()=>x,pages:()=>c,routeModule:()=>p,tree:()=>o}),s(5996),s(1506),s(5866);var a=s(3191),l=s(8716),r=s(7922),n=s.n(r),i=s(5231),d={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(d[e]=()=>i[e]);s.d(t,d);let o=["",{children:["channels",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,5996)),"/workspace/personal/dashboards/VPN_chanel/frontend/app/channels/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,1506)),"/workspace/personal/dashboards/VPN_chanel/frontend/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,5866,23)),"next/dist/client/components/not-found-error"]}],c=["/workspace/personal/dashboards/VPN_chanel/frontend/app/channels/page.tsx"],x="/channels/page",h={require:s,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:l.x.APP_PAGE,page:"/channels/page",pathname:"/channels",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:o}})},7572:(e,t,s)=>{Promise.resolve().then(s.bind(s,3921))},3156:()=>{},6376:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,2994,23)),Promise.resolve().then(s.t.bind(s,6114,23)),Promise.resolve().then(s.t.bind(s,9727,23)),Promise.resolve().then(s.t.bind(s,9671,23)),Promise.resolve().then(s.t.bind(s,1868,23)),Promise.resolve().then(s.t.bind(s,4759,23))},3921:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(326),l=s(7577),r=s(1405),n=s(2881);let i=(0,n.Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),d=(0,n.Z)("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]),o=(0,n.Z)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]),c=(0,n.Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),x=(0,n.Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var h=s(256);let p=process.env.NEXT_PUBLIC_API_URL||"";function m(){let[e,t]=(0,l.useState)([]),[s,n]=(0,l.useState)(!0),[m,u]=(0,l.useState)(""),[b,f]=(0,l.useState)(""),[g,j]=(0,l.useState)("VPN & Proxy"),[v,N]=(0,l.useState)(!1),y=async()=>{n(!0);try{let e=await fetch(`${p}/api/v1/channels`);if(e.ok){let s=await e.json();t(s)}}catch(e){console.error("Failed to load channels",e)}finally{n(!1)}},w=async e=>{if(e.preventDefault(),m){N(!0);try{(await fetch(`${p}/api/v1/channels`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({telegram_handle:m,title:b||m,niche:g,subscriber_count:5e3,is_active:!0})})).ok?(u(""),f(""),y()):alert("این کانال قبلاً اضافه شده است.")}catch(e){alert("خطا در افزودن کانال")}finally{N(!1)}}};return(0,a.jsxs)("div",{className:"max-w-7xl mx-auto space-y-8",dir:"rtl",children:[(0,a.jsxs)("div",{className:"bg-slate-900 border border-slate-800 p-6 rounded-3xl shadow-xl flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"text-2xl font-black text-white tracking-tight",children:"کانال‌های تلگرامی تحت پایش"}),a.jsx(h.b,{title:"دیسکاوری و رصد عمومی",text:"لیست کانال‌های تلگرام که Agent A به صورت دوره‌ای محتوا، عکس و ویدیوهای عمومی آن‌ها را بدون نیاز به عضویت اسکرپ می‌کند."})]}),a.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"دسترسی از طریق Telegram Web Preview (بدون مسدودی اکانت کاربری)"})]}),(0,a.jsxs)("button",{onClick:y,className:"flex items-center gap-2 px-4 py-2.5 bg-slate-800 hover:bg-slate-700 text-slate-200 rounded-xl text-xs font-medium transition",children:[a.jsx(r.Z,{className:`w-4 h-4 ${s?"animate-spin":""}`}),"بروزرسانی لیست"]})]}),(0,a.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 p-6 rounded-3xl shadow-lg",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-white text-sm font-bold",children:[a.jsx(i,{className:"w-4 h-4 text-indigo-400"}),a.jsx("span",{children:"افزودن کانال تلگرامی جدید به پایپ‌لاین"}),a.jsx(h.b,{text:"شناسه کانال عمومی تلگرام (بدون @ یا با @) را وارد کنید."})]}),(0,a.jsxs)("form",{onSubmit:w,className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,a.jsxs)("div",{children:[a.jsx("label",{className:"block text-[11px] text-slate-400 mb-1",children:"شناسه کانال (Handle)"}),a.jsx("input",{type:"text",placeholder:"@example_channel",value:m,onChange:e=>u(e.target.value),className:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3.5 py-2 text-xs text-slate-100 focus:outline-none focus:border-indigo-500 font-mono",required:!0})]}),(0,a.jsxs)("div",{children:[a.jsx("label",{className:"block text-[11px] text-slate-400 mb-1",children:"عنوان کانال (اختیاری)"}),a.jsx("input",{type:"text",placeholder:"کانال اخبار VPN و سرور",value:b,onChange:e=>f(e.target.value),className:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3.5 py-2 text-xs text-slate-100 focus:outline-none focus:border-indigo-500"})]}),(0,a.jsxs)("div",{children:[a.jsx("label",{className:"block text-[11px] text-slate-400 mb-1",children:"دسته‌بندی (Niche)"}),(0,a.jsxs)("select",{value:g,onChange:e=>j(e.target.value),className:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3.5 py-2 text-xs text-slate-100 focus:outline-none focus:border-indigo-500",children:[a.jsx("option",{value:"VPN & Proxy",children:"VPN & Proxy"}),a.jsx("option",{value:"Bypass Censorship",children:"Bypass Censorship"}),a.jsx("option",{value:"AI Tools",children:"AI Tools"}),a.jsx("option",{value:"Tech Tips",children:"Tech Tips"})]})]}),a.jsx("div",{className:"flex items-end",children:(0,a.jsxs)("button",{type:"submit",disabled:v,className:"w-full h-9 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white rounded-xl text-xs font-semibold shadow-md shadow-indigo-600/20 transition flex items-center justify-center gap-1.5",children:[a.jsx(i,{className:"w-4 h-4"}),v?"در حال ثبت...":"افزودن به رصد"]})})]})]}),(0,a.jsxs)("div",{className:"bg-slate-900/90 border border-slate-800 rounded-3xl overflow-hidden shadow-xl",children:[(0,a.jsxs)("div",{className:"p-6 border-b border-slate-800 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(d,{className:"w-5 h-5 text-indigo-400"}),a.jsx("h2",{className:"text-base font-bold text-white",children:"کانال‌های ثبت‌شده در دیتابیس"}),a.jsx(h.b,{text:"کانال‌های فعال در هر چرخه اسکژولر جهت استخراج پست‌های جدید اسکرپ می‌شوند."})]}),(0,a.jsxs)("span",{className:"text-xs text-slate-400 font-mono",children:[e.length," کانال فعال"]})]}),s?a.jsx("div",{className:"text-center py-20 text-slate-500 text-xs",children:"در حال بارگذاری لیست..."}):a.jsx("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-right text-xs",children:[a.jsx("thead",{className:"bg-slate-950/60 text-slate-400 border-b border-slate-800 font-medium",children:(0,a.jsxs)("tr",{children:[a.jsx("th",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["آیدی تلگرام",a.jsx(h.b,{text:"هندل عمومی کانال در تلگرام."})]})}),a.jsx("th",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["عنوان",a.jsx(h.b,{text:"نام نمایشی یا تعریف‌شده کانال."})]})}),a.jsx("th",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["دسته‌بندی",a.jsx(h.b,{text:"حوزه موضوعی جهت دسته‌بندی و تحلیل ترافیک."})]})}),a.jsx("th",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["وضعیت رصد",a.jsx(h.b,{text:"فعال یا غیرفعال بودن برای اجرای اسکرپر."})]})}),a.jsx("th",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1",children:["آخرین پایش",a.jsx(h.b,{text:"زمان آخرین اجرای موفقیت‌آمیز استخراج اطلاعات توسط Agent A."})]})}),a.jsx("th",{className:"py-4 px-6",children:"لینک منبع"})]})}),a.jsx("tbody",{className:"divide-y divide-slate-800/60 text-slate-200",children:e.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-slate-800/40 transition",children:[(0,a.jsxs)("td",{className:"py-4 px-6 font-mono font-medium text-indigo-400",children:["@",e.telegram_handle]}),a.jsx("td",{className:"py-4 px-6 font-medium text-slate-200",children:e.title||"-"}),a.jsx("td",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 bg-slate-800 text-slate-300 rounded-md text-[11px]",children:[a.jsx(o,{className:"w-3 h-3 text-slate-400"}),e.niche]})}),a.jsx("td",{className:"py-4 px-6",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-[11px] font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[a.jsx(c,{className:"w-3 h-3"}),"فعال"]})}),a.jsx("td",{className:"py-4 px-6 font-mono text-slate-400",children:e.last_scraped_at?new Date(e.last_scraped_at).toLocaleString("fa-IR"):a.jsx("span",{className:"text-slate-600",children:"هنوز پایش نشده"})}),a.jsx("td",{className:"py-4 px-6",children:(0,a.jsxs)("a",{href:`https://t.me/${e.telegram_handle}`,target:"_blank",rel:"noreferrer",className:"text-slate-400 hover:text-indigo-400 transition inline-flex items-center gap-1",children:["کانال ",a.jsx(x,{className:"w-3 h-3"})]})})]},e.id))})]})})]})]})}},256:(e,t,s)=>{"use strict";s.d(t,{b:()=>n});var a=s(326),l=s(7577);let r=(0,s(2881).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),n=({text:e,title:t,className:s=""})=>{let[n,i]=(0,l.useState)(!1);return(0,a.jsxs)("div",{className:`relative inline-flex items-center align-middle ${s}`,children:[a.jsx("button",{type:"button",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>i(!n),className:"p-1 rounded-full text-slate-400 hover:text-indigo-400 hover:bg-slate-800 transition focus:outline-none","aria-label":"راهنما و نحوه محاسبه",children:a.jsx(r,{className:"w-3.5 h-3.5"})}),n&&(0,a.jsxs)("div",{className:"absolute z-50 bottom-full right-0 mb-2 w-64 p-3 bg-slate-900 border border-slate-700/80 rounded-xl shadow-2xl text-xs text-slate-200 backdrop-blur-md transition-all pointer-events-none text-right",dir:"rtl",children:[t&&a.jsx("div",{className:"font-bold text-indigo-400 mb-1 border-b border-slate-800 pb-1",children:t}),a.jsx("p",{className:"leading-relaxed text-slate-300",children:e})]})]})}},2881:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var a=s(7577);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=(...e)=>e.filter((e,t,s)=>!!e&&s.indexOf(e)===t).join(" ");var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:i="",children:d,iconNode:o,...c},x)=>(0,a.createElement)("svg",{ref:x,...n,width:t,height:t,stroke:e,strokeWidth:l?24*Number(s)/Number(t):s,className:r("lucide",i),...c},[...o.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(d)?d:[d]])),d=(e,t)=>{let s=(0,a.forwardRef)(({className:s,...n},d)=>(0,a.createElement)(i,{ref:d,iconNode:t,className:r(`lucide-${l(e)}`,s),...n}));return s.displayName=`${e}`,s}},1405:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},5996:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(8570).createProxy)(String.raw`/workspace/personal/dashboards/VPN_chanel/frontend/app/channels/page.tsx#default`)},1506:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r,metadata:()=>l});var a=s(9510);s(7272);let l={title:"رادار تلگرام و کیوریشن محتوای NetVibe VPN",description:"سیستم چندعاملی هوش مصنوعی برای پایش، تحلیل، بازآفرینی و انتشار خودکار محتوای VPN و آزادی اینترنت"};function r({children:e}){return a.jsx("html",{lang:"fa",dir:"rtl",children:a.jsx("body",{className:"min-h-screen bg-[#F8FAFC] text-[#0F172A] flex flex-col font-sans",children:a.jsx("main",{className:"flex-1",children:e})})})}},7272:()=>{}};var t=require("../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[819],()=>s(2170));module.exports=a})();