gemini-2api / static /assets /Accounts-JKhKShMC.js
xiaoyukkkk's picture
Upload 541 files
b71597d verified
import{g as C,C as zt,h as a,d as Pt,D as Ft,i as N,o as Kt,j as Jt,c as l,a as s,x as U,y as ke,m as V,v as I,A as ft,t as n,n as b,u as S,b as f,f as Ce,F as ie,r as Te,T as Se,w as A,e as r}from"./index-C9KL0lrc.js";import{_ as Ht}from"./SelectMenu.vue_vue_type_script_setup_true_lang-gwg2tONM.js";import{_ as ue}from"./Checkbox.vue_vue_type_script_setup_true_lang-DQLrRLI4.js";import{_ as Gt}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-pFdqEtiD.js";import{u as Yt}from"./useConfirmDialog-DHNXQEiw.js";import{_ as Qt}from"./HelpTip.vue_vue_type_script_setup_true_lang-q6qcDogV.js";const y={list:()=>C.get("/admin/accounts"),getConfig:()=>C.get("/admin/accounts-config"),updateConfig:x=>C.put("/admin/accounts-config",x),delete:x=>C.delete(`/admin/accounts/${x}`),disable:x=>C.put(`/admin/accounts/${x}/disable`),enable:x=>C.put(`/admin/accounts/${x}/enable`),startRegister:(x,_)=>C.post("/admin/register/start",{count:x,domain:_}),getRegisterTask:x=>C.get(`/admin/register/task/${x}`),getRegisterCurrent:()=>C.get("/admin/register/current"),startLogin:x=>C.post("/admin/login/start",x),getLoginTask:x=>C.get(`/admin/login/task/${x}`),getLoginCurrent:()=>C.get("/admin/login/current"),checkLogin:()=>C.post("/admin/login/check")},qt=zt("accounts",()=>{const x=a([]),_=a(!1);async function T(){_.value=!0;try{const u=await y.list();x.value=Array.isArray(u)?u:u.accounts||[]}finally{_.value=!1}}async function X(u){await y.delete(u),await T()}async function k(u){await y.disable(u),await T()}async function Z(u){await y.enable(u),await T()}async function J(u){await Promise.all(u.map(E=>y.enable(E))),await T()}async function g(u){await Promise.all(u.map(E=>y.disable(E))),await T()}async function z(u){await Promise.all(u.map(E=>y.delete(E))),await T()}async function ee(u){await y.updateConfig(u),await T()}return{accounts:x,isLoading:_,loadAccounts:T,deleteAccount:X,disableAccount:k,enableAccount:Z,bulkEnable:J,bulkDisable:g,bulkDelete:z,updateConfig:ee}}),Wt={class:"space-y-8"},Xt={class:"rounded-3xl border border-border bg-card p-6"},Zt={class:"flex flex-wrap items-center justify-between gap-4"},es={class:"grid w-full grid-cols-2 gap-3 sm:flex sm:w-auto sm:items-center"},ts={class:"flex w-full flex-wrap items-center gap-3 text-xs text-muted-foreground sm:w-auto sm:flex-nowrap"},ss={class:"ml-auto flex items-center gap-2 sm:ml-0"},os={class:"mt-4 flex flex-wrap items-center gap-2"},rs=["disabled"],ls=["disabled"],ns={key:0,class:"absolute right-0 z-10 mt-2 w-full space-y-1 rounded-2xl border border-border bg-card p-2 shadow-lg"},as=["disabled"],is=["disabled"],us=["disabled"],ds=["disabled"],cs=["disabled"],vs={key:0,class:"mt-6 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3"},fs=["onClick"],xs={class:"flex items-start justify-between gap-3"},gs={class:"mt-1 font-mono text-xs text-foreground"},ms={class:"flex items-center gap-2"},ps={class:"mt-4 grid grid-cols-2 gap-3 text-xs text-muted-foreground"},bs={key:0,class:"mt-1 text-[11px]"},ys={key:0},_s={key:1},ws={class:"mt-1 text-sm font-semibold text-foreground"},hs={class:"mt-1 text-sm font-semibold text-foreground"},ks={class:"mt-4 flex flex-wrap items-center gap-2"},Cs=["onClick"],Ts=["onClick"],Ss=["onClick"],As=["onClick"],Es={key:0,class:"rounded-2xl border border-border bg-background p-4 text-center text-xs text-muted-foreground"},Ls={key:1,class:"relative mt-6 overflow-x-auto overflow-y-visible"},$s={class:"min-w-full text-left text-sm"},Rs={class:"text-xs uppercase tracking-[0.2em] text-muted-foreground"},Vs={class:"py-3 pr-4"},Is={class:"py-3 pr-6"},js={class:"inline-flex items-center gap-2"},Ds={class:"text-sm text-foreground"},Ms={key:0},Os=["onClick"],Bs={class:"py-4 pr-6 font-mono text-xs text-foreground"},Ns={class:"py-4 pr-6"},Us={class:"py-4 pr-6"},zs={key:0,class:"block text-[11px] text-muted-foreground"},Ps={class:"py-4 pr-6 text-xs"},Fs={class:"py-4 pr-6 text-xs text-muted-foreground"},Ks={class:"py-4 pr-6 text-xs text-muted-foreground"},Js={class:"py-4 text-right"},Hs={class:"flex flex-wrap justify-end gap-2"},Gs=["onClick"],Ys=["onClick"],Qs=["onClick"],qs=["onClick"],Ws={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Xs={class:"w-full max-w-md rounded-3xl border border-border bg-card p-6 shadow-xl"},Zs={class:"mt-4 space-y-4 text-sm"},eo={class:"mt-6 flex items-center justify-end gap-2"},to=["disabled"],so={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},oo={class:"w-full max-w-2xl max-h-[80vh] overflow-y-auto rounded-3xl border border-border bg-card p-6 shadow-xl"},ro={class:"flex items-center justify-between"},lo={class:"flex items-center gap-2"},no=["disabled"],ao={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-3 py-2 text-xs text-destructive"},io={key:1,class:"mt-4 grid gap-2 text-xs text-muted-foreground"},uo={key:0},co={class:"ml-2"},vo={class:"ml-2"},fo={class:"ml-2"},xo={class:"ml-2"},go={key:1},mo={class:"ml-2"},po={class:"ml-2"},bo={class:"ml-2"},yo={class:"ml-2"},_o={key:2,class:"mt-4 grid gap-2"},wo={key:0,class:"rounded-2xl border border-border bg-muted/30 p-3"},ho={class:"mt-2 space-y-1 text-[11px] text-muted-foreground"},ko={key:1,class:"rounded-2xl border border-border bg-muted/30 p-3"},Co={class:"mt-2 space-y-1 text-[11px] text-muted-foreground"},To={key:3,class:"mt-4 rounded-2xl border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground"},So={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Ao={class:"w-full max-w-lg rounded-3xl border border-border bg-card p-6 shadow-xl"},Eo={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-4 py-3 text-sm text-destructive"},Lo={class:"mt-4 space-y-3 text-sm"},$o={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},Ro={class:"w-full max-w-3xl rounded-3xl border border-border bg-card p-6 shadow-xl"},Vo={class:"flex items-center justify-between"},Io={class:"flex items-center gap-2"},jo={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-4 py-3 text-sm text-destructive"},Do={class:"mt-4"},Mo=["readonly"],Oo={class:"mt-6 flex items-center justify-end gap-2"},Bo=["disabled"],De="accounts-register-task-cache",Me="accounts-login-task-cache",Oe="accounts-register-log-clear",Be="accounts-login-log-clear",Ne="accounts-register-task-cleared-id",Ue="accounts-login-task-cleared-id",Jo=Pt({__name:"Accounts",setup(x){const _=qt(),{accounts:T,isLoading:X}=Ft(_),k=Yt(),Z=a(""),J=a("all"),g=a(new Set),z=a("table"),ee=a(!1),u=a(""),E=a(!1),L=a(""),H=a(""),j=a(!1),te=a([]),se=a(1),de=a(!1),oe=a(!1),D=a(!1),Ae=a(null),ce=a(null),ve=a(null),M=a(null),O=a(null),G=a(0),Y=a(0),fe=a(!1),d=a(null),c=a(null),$=a(!1),h=a(!1),m=a(""),p=a({id:"",secure_c_ses:"",csesidx:"",config_id:"",host_c_oses:"",expires_at:""}),xe=a(null),ze=a([]),xt=[{label:"全部状态",value:"all"},{label:"正常",value:"正常"},{label:"即将过期",value:"即将过期"},{label:"已过期",value:"已过期"},{label:"手动禁用",value:"手动禁用"},{label:"错误禁用",value:"错误禁用"},{label:"429限流",value:"429限流"}],B=N(()=>{const e=Z.value.trim().toLowerCase();return T.value.filter(t=>{const o=!e||t.id.toLowerCase().includes(e),i=J.value==="all"||re(t)===J.value;return o&&i})}),R=N(()=>g.value.size),Ee=N(()=>B.value.length>0&&B.value.every(e=>g.value.has(e.id))),ge=async()=>{await _.loadAccounts(),g.value=new Set,D.value=!1},Pe=e=>{try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}},Fe=e=>{try{return localStorage.getItem(e)||null}catch{return null}},me=(e,t)=>{try{if(t){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{}},Ke=(e,t)=>{try{localStorage.setItem(e,JSON.stringify(t))}catch{}},Je=e=>{try{localStorage.removeItem(e)}catch{}},He=e=>{const t=localStorage.getItem(e),o=Number(t);return Number.isFinite(o)?o:0},pe=(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},Le=(e,t=!0)=>{e&&(e.id&&e.id===M.value||(e.id&&M.value&&e.id!==M.value&&(M.value=null,me(Ne,null)),d.value=e,e.id&&e.id!==ce.value&&(ce.value=e.id,G.value=0,pe(Oe,0)),t&&Ke(De,e)))},be=(e,t=!0)=>{e&&(e.id&&e.id===O.value||(e.id&&O.value&&e.id!==O.value&&(O.value=null,me(Ue,null)),c.value=e,e.id&&e.id!==ve.value&&(ve.value=e.id,Y.value=0,pe(Be,0)),t&&Ke(Me,e)))},gt=()=>{G.value=He(Oe),Y.value=He(Be),M.value=Fe(Ne),O.value=Fe(Ue);const e=Pe(De);e&&e.id!==M.value&&(d.value=e,ce.value=e.id||null);const t=Pe(Me);t&&t.id!==O.value&&(c.value=t,ve.value=t.id||null)},mt=()=>{de.value=!0,fe.value=!1},Ge=()=>{de.value=!1},pt=async()=>{try{const e=[],t=d.value?.id,o=c.value?.id;if(t&&!ye(t)&&e.push(dt(t)),o&&!_e(o)&&e.push(ct(o)),!e.length){await je();return}await Promise.all(e)}catch(e){m.value=e?.message||"任务状态更新失败"}},bt=async()=>{oe.value=!0,await pt()},yt=()=>{oe.value=!1},_t=()=>{const e=d.value?.id||null,t=c.value?.id||null;M.value=e,O.value=t,me(Ne,e),me(Ue,t),G.value=d.value?.logs?.length||0,Y.value=c.value?.logs?.length||0,pe(Oe,G.value),pe(Be,Y.value),d.value=null,c.value=null,ce.value=null,ve.value=null,m.value="",$.value=!1,h.value=!1,P(),F(),Je(De),Je(Me)},ye=e=>!!(e&&e===M.value),_e=e=>!!(e&&e===O.value),wt=()=>{D.value=!D.value},Q=()=>{D.value=!1},Ye=e=>{if(!D.value)return;const t=e.target;Ae.value&&!Ae.value.contains(t)&&(D.value=!1)};Kt(async()=>{gt(),await ge(),await je(),Ot(),document.addEventListener("click",Ye)});const q=N(()=>{const e=d.value?.logs||[];return G.value?e.slice(G.value):e}),W=N(()=>{const e=c.value?.logs||[];return Y.value?e.slice(Y.value):e}),ht=N(()=>!!m.value||!!d.value||!!c.value||q.value.length>0||W.value.length>0),kt=N(()=>{const e=d.value?.status,t=c.value?.status;return e==="running"||e==="pending"||t==="running"||t==="pending"}),Ct=N(()=>{if(m.value)return"bg-rose-500";if(kt.value)return"bg-sky-400";const e=[];if(d.value){const v=d.value.success_count??0,w=d.value.fail_count??0,K=d.value.count??v+w;e.push({success:v,fail:w,total:K,status:d.value.status})}if(c.value){const v=c.value.success_count??0,w=c.value.fail_count??0,K=c.value.account_ids?.length??v+w;e.push({success:v,fail:w,total:K,status:c.value.status})}if(!e.length)return"bg-muted-foreground";const t=e.reduce((v,w)=>v+w.success,0),o=e.reduce((v,w)=>v+w.fail,0),i=e.reduce((v,w)=>v+(w.total||0),0);if(t>0&&o>0)return"bg-amber-400";if(o>0&&t===0)return"bg-rose-500";if(t>0&&o===0)return"bg-emerald-400";if(i===0){const v=e.every(K=>K.status==="success");if(e.some(K=>K.status==="failed"))return"bg-rose-500";if(v)return"bg-emerald-400"}return"bg-muted-foreground"});Jt(()=>{P(),F(),Mt(),document.removeEventListener("click",Ye)});const re=e=>e.cooldown_reason?.includes("429")&&e.cooldown_seconds>0?"429限流":e.cooldown_reason==="错误禁用"?"错误禁用":e.disabled?"手动禁用":e.status==="已过期"?"已过期":e.status==="即将过期"?"即将过期":"正常",Qe=e=>{const t=re(e);return t==="429限流"||t==="即将过期"?"bg-amber-200 text-amber-900":t==="错误禁用"||t==="已过期"?"bg-destructive/10 text-destructive":t==="手动禁用"?"bg-muted text-muted-foreground":"bg-emerald-500 text-white"},qe=e=>e.cooldown_reason?.includes("429")&&e.cooldown_seconds>0?!0:e.disabled||e.cooldown_reason==="错误禁用",We=e=>e==="已过期"?"过期":e==="未设置"?"未设置":e,Xe=e=>e.status==="已过期"?"text-rose-600":e.status==="即将过期"?"text-amber-700":e.status==="未设置"?"text-muted-foreground":"text-emerald-600",Ze=e=>e<60?`${e} 秒`:e<3600?`${Math.ceil(e/60)} 分钟`:`${(e/3600).toFixed(1)} 小时`,$e=e=>e.cooldown_seconds>0?"text-amber-700":e.cooldown_reason==="错误禁用"?"text-rose-600":"text-muted-foreground",et=e=>{const t=re(e);return t==="手动禁用"||t==="已过期"?"bg-muted/70":""},we=e=>{const t=new Set(g.value);t.has(e)?t.delete(e):t.add(e),g.value=t},tt=()=>{if(Ee.value){g.value=new Set;return}g.value=new Set(B.value.map(e=>e.id))},Tt=(e,t)=>e.id||`account_${t+1}`,St=async()=>(await y.getConfig()).accounts.map((t,o)=>({...t,id:Tt(t,o)})),st=e=>`${e.time} [${e.level}] ${e.message}`,At=(e,t)=>{let o=-1;for(let v=0;v<e.length;v+=1)if(e[v].id===t){o=v;break}if(o===-1)return u.value="未找到对应账号配置。",!1;const i=e[o];return p.value={id:i.id,secure_c_ses:i.secure_c_ses,csesidx:i.csesidx,config_id:i.config_id,host_c_oses:i.host_c_oses,expires_at:i.expires_at},ze.value=e,xe.value=o,ee.value=!0,!0},ot=async e=>{u.value="";try{const t=await St();At(t,e)}catch(t){u.value=t.message||"加载账号配置失败"}},Et=async()=>{L.value="";try{const e=await y.getConfig();te.value=Array.isArray(e.accounts)?e.accounts:[],H.value=JSON.stringify(lt(te.value),null,2),j.value=!0,E.value=!0}catch(e){L.value=e.message||"加载账号配置失败"}},Re=()=>{E.value=!1,L.value="",j.value=!1},rt=()=>{const e=JSON.parse(H.value);if(!Array.isArray(e))throw new Error("配置格式必须是数组。");return e},Lt=e=>typeof e!="string"||!e?e:e.length<=6?`${e.slice(0,2)}****`:`${e.slice(0,3)}****`,lt=e=>{const t=new Set(["secure_c_ses","csesidx","config_id","host_c_oses","mail_password"]);return e.map(o=>{const i={...o};return t.forEach(v=>{const w=i[v];w&&(i[v]=Lt(w))}),i})},$t=()=>{if(L.value="",!j.value){try{te.value=rt()}catch(e){L.value=e.message||"JSON 格式错误";return}H.value=JSON.stringify(lt(te.value),null,2),j.value=!0;return}H.value=JSON.stringify(te.value,null,2),j.value=!1},Rt=async()=>{L.value="";try{const e=rt();await _.updateConfig(e),Re()}catch(e){L.value=e.message||"保存失败"}},Ve=()=>{ee.value=!1,u.value=""},Vt=async()=>{if(xe.value===null)return;const e=[...ze.value];e[xe.value]={...e[xe.value],id:p.value.id,secure_c_ses:p.value.secure_c_ses,csesidx:p.value.csesidx,config_id:p.value.config_id,host_c_oses:p.value.host_c_oses||void 0,expires_at:p.value.expires_at||void 0};try{await _.updateConfig(e),Ve()}catch(t){u.value=t.message||"保存失败"}},It=async()=>{await _.bulkEnable(Array.from(g.value)),g.value=new Set},jt=async()=>{await k.ask({title:"批量禁用",message:"确定要批量禁用选中的账号吗?"})&&(await _.bulkDisable(Array.from(g.value)),g.value=new Set)},Dt=async()=>{await k.ask({title:"批量删除",message:"确定要批量删除选中的账号吗?",confirmText:"删除"})&&(await _.bulkDelete(Array.from(g.value)),g.value=new Set)},nt=async e=>{await _.enableAccount(e)},at=async e=>{await k.ask({title:"禁用账号",message:"确定要禁用该账号吗?"})&&await _.disableAccount(e)},it=async e=>{await k.ask({title:"删除账号",message:"确定要删除该账号吗?",confirmText:"删除"})&&await _.deleteAccount(e)};let le=null,ne=null,ae=null,he=!1;const P=()=>{le!==null&&(window.clearInterval(le),le=null)},F=()=>{ne!==null&&(window.clearInterval(ne),ne=null)},Mt=()=>{ae!==null&&(window.clearInterval(ae),ae=null),he=!1},ut=e=>e==="pending"?"等待中":e==="running"?"执行中":e==="success"?"成功":e==="failed"?"失败":e,dt=async e=>{if(ye(e)){P();return}const t=await y.getRegisterTask(e);if(ye(t.id)){P();return}Le(t),t.status!=="running"&&t.status!=="pending"&&($.value=!1,P(),await ge())},ct=async e=>{if(_e(e)){F();return}const t=await y.getLoginTask(e);if(_e(t.id)){F();return}be(t),t.status!=="running"&&t.status!=="pending"&&(h.value=!1,F(),await ge())},vt=e=>{P(),le=window.setInterval(()=>{dt(e).catch(t=>{m.value=t?.message||"注册任务更新失败",P(),$.value=!1})},3e3)},Ie=e=>{F(),ne=window.setInterval(()=>{ct(e).catch(t=>{m.value=t?.message||"刷新任务更新失败",F(),h.value=!1})},3e3)},Ot=()=>{ae===null&&(ae=window.setInterval(async()=>{if(!he&&!oe.value&&!(le!==null||ne!==null)&&!(!$.value&&!h.value&&!d.value&&!c.value)){he=!0;try{await je()}catch(e){m.value=e?.message||"后台刷新失败"}finally{he=!1}}},6e3))},je=async()=>{try{const e=await y.getRegisterCurrent();e&&"id"in e&&!ye(e.id)&&(Le(e),(e.status==="running"||e.status==="pending")&&($.value=!0,vt(e.id)))}catch(e){m.value=e.message||"加载注册任务失败"}try{const e=await y.getLoginCurrent();e&&"id"in e&&!_e(e.id)&&(be(e),(e.status==="running"||e.status==="pending")&&(h.value=!0,Ie(e.id)))}catch(e){m.value=e.message||"加载刷新任务失败"}},Bt=async()=>{m.value="",$.value=!0;try{const e=Number.isFinite(se.value)&&se.value>0?se.value:void 0,t=await y.startRegister(e);Le(t),vt(t.id),de.value=!1,oe.value=!0}catch(e){m.value=e.message||"启动注册失败",$.value=!1}},Nt=async()=>{if(g.value.size){m.value="",h.value=!0;try{const e=await y.startLogin(Array.from(g.value));be(e),Ie(e.id)}catch(e){m.value=e.message||"启动刷新失败",h.value=!1}}},Ut=async()=>{m.value="",h.value=!0;try{await y.checkLogin();const e=await y.getLoginCurrent();if(e&&"id"in e){be(e),Ie(e.id);return}h.value=!1}catch(e){m.value=e.message||"触发刷新失败",h.value=!1}};return(e,t)=>(r(),l(ie,null,[s("div",Wt,[s("section",Xt,[s("div",Zt,[s("div",es,[V(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>Z.value=o),type:"text",placeholder:"搜索账号 ID",class:"w-full rounded-full border border-input bg-background px-4 py-2 text-sm sm:w-48"},null,512),[[I,Z.value]]),U(Ht,{modelValue:J.value,"onUpdate:modelValue":t[1]||(t[1]=o=>J.value=o),options:xt},null,8,["modelValue"])]),s("div",ts,[U(ue,{modelValue:Ee.value,"onUpdate:modelValue":tt},{default:ft(()=>[...t[24]||(t[24]=[Ce(" 全选 ",-1)])]),_:1},8,["modelValue"]),s("span",null,"已选 "+n(R.value)+" / "+n(B.value.length)+" 个账号",1),s("div",ss,[s("button",{type:"button",class:b(["inline-flex h-8 w-8 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:border-primary hover:text-primary",z.value==="table"?"bg-accent text-accent-foreground":""]),onClick:t[2]||(t[2]=o=>z.value="table"),"aria-label":"列表视图"},[...t[25]||(t[25]=[s("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4",fill:"currentColor"},[s("path",{d:"M4 6h16v2H4V6zm0 5h16v2H4v-2zm0 5h16v2H4v-2z"})],-1)])],2),s("button",{type:"button",class:b(["inline-flex h-8 w-8 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:border-primary hover:text-primary",z.value==="card"?"bg-accent text-accent-foreground":""]),onClick:t[3]||(t[3]=o=>z.value="card"),"aria-label":"卡片视图"},[...t[26]||(t[26]=[s("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4",fill:"currentColor"},[s("path",{d:"M4 6h7v6H4V6zm9 0h7v6h-7V6zM4 14h7v4H4v-4zm9 0h7v4h-7v-4z"})],-1)])],2)])])]),s("div",os,[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:S(X),onClick:ge}," 刷新列表 ",8,rs),s("button",{class:"rounded-full border border-border px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary hover:text-primary",onClick:Et}," 账户配置 "),s("button",{class:"rounded-full border border-border bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:$.value,onClick:mt}," 添加账户 ",8,ls),s("div",{ref_key:"moreActionsRef",ref:Ae,class:"relative"},[s("button",{class:b(["flex items-center gap-2 rounded-full border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary",D.value?"bg-accent text-accent-foreground":""]),onClick:wt},[t[27]||(t[27]=Ce(" 更多操作 ",-1)),t[28]||(t[28]=s("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",class:"h-4 w-4",fill:"currentColor"},[s("path",{d:"M5 7l5 6 5-6H5z"})],-1)),ht.value?(r(),l("span",{key:0,class:b(["ml-1 h-2 w-2 rounded-full",Ct.value]),"aria-hidden":"true"},null,2)):f("",!0)],2),D.value?(r(),l("div",ns,[s("button",{type:"button",class:"flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm text-foreground transition-colors hover:bg-accent",onClick:t[4]||(t[4]=o=>{bt(),Q()})}," 任务状态 "),t[29]||(t[29]=s("div",{class:"my-1 border-t border-border/60"},null,-1)),s("button",{type:"button",class:b(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",h.value?"cursor-not-allowed text-muted-foreground":"text-foreground hover:bg-accent"]),disabled:h.value,onClick:t[5]||(t[5]=o=>{Ut(),Q()})}," 刷新过期 ",10,as),s("button",{type:"button",class:b(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",!R.value||h.value?"cursor-not-allowed text-muted-foreground":"text-foreground hover:bg-accent"]),disabled:!R.value||h.value,onClick:t[6]||(t[6]=o=>{Nt(),Q()})}," 刷新选中 ",10,is),t[30]||(t[30]=s("div",{class:"my-1 border-t border-border/60"},null,-1)),s("button",{type:"button",class:b(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",R.value?"text-foreground hover:bg-accent":"cursor-not-allowed text-muted-foreground"]),disabled:!R.value,onClick:t[7]||(t[7]=o=>{It(),Q()})}," 批量启用 ",10,us),s("button",{type:"button",class:b(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",R.value?"text-foreground hover:bg-accent":"cursor-not-allowed text-muted-foreground"]),disabled:!R.value,onClick:t[8]||(t[8]=o=>{jt(),Q()})}," 批量禁用 ",10,ds),s("button",{type:"button",class:b(["flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",R.value?"text-destructive hover:bg-destructive/10":"cursor-not-allowed text-muted-foreground"]),disabled:!R.value,onClick:t[9]||(t[9]=o=>{Dt(),Q()})}," 批量删除 ",10,cs)])):f("",!0)],512)]),z.value==="card"?(r(),l("div",vs,[(r(!0),l(ie,null,Te(B.value,o=>(r(),l("div",{key:o.id,class:b(["rounded-2xl border border-border bg-card p-4",et(o)]),onClick:i=>we(o.id)},[s("div",xs,[s("div",null,[t[31]||(t[31]=s("p",{class:"text-xs text-muted-foreground"},"账号 ID",-1)),s("p",gs,n(o.id),1)]),s("div",ms,[U(ue,{modelValue:g.value.has(o.id),"onUpdate:modelValue":i=>we(o.id),onClick:t[10]||(t[10]=A(()=>{},["stop"]))},null,8,["modelValue","onUpdate:modelValue"]),s("span",{class:b(["inline-flex items-center rounded-full border border-border px-3 py-1 text-xs",Qe(o)])},n(re(o)),3)])]),s("div",ps,[s("div",null,[t[32]||(t[32]=s("p",null,"剩余时间",-1)),s("p",{class:b(["mt-1 text-sm font-semibold",Xe(o)])},n(We(o.remaining_display)),3),o.expires_at?(r(),l("p",bs,n(o.expires_at),1)):f("",!0)]),s("div",null,[t[33]||(t[33]=s("p",null,"冷却",-1)),s("p",{class:b(["mt-1",$e(o)])},[o.cooldown_seconds>0?(r(),l("span",ys,n(Ze(o.cooldown_seconds))+" · "+n(o.cooldown_reason),1)):(r(),l("span",_s,n(o.cooldown_reason||"无冷却"),1))],2)]),s("div",null,[t[34]||(t[34]=s("p",null,"失败数",-1)),s("p",ws,n(o.error_count),1)]),s("div",null,[t[35]||(t[35]=s("p",null,"会话数",-1)),s("p",hs,n(o.conversation_count),1)])]),s("div",ks,[s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:A(i=>ot(o.id),["stop"])}," 编辑 ",8,Cs),qe(o)?(r(),l("button",{key:0,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:[t[11]||(t[11]=A(()=>{},["stop"])),i=>nt(o.id)]}," 启用 ",8,Ts)):(r(),l("button",{key:1,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:[t[12]||(t[12]=A(()=>{},["stop"])),i=>at(o.id)]}," 禁用 ",8,Ss)),s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-destructive transition-colors hover:border-destructive hover:text-destructive",onClick:[t[13]||(t[13]=A(()=>{},["stop"])),i=>it(o.id)]}," 删除 ",8,As)])],10,fs))),128)),!B.value.length&&!S(X)?(r(),l("div",Es," 暂无账号数据,请检查后台配置。 ")):f("",!0)])):(r(),l("div",Ls,[s("table",$s,[s("thead",Rs,[s("tr",null,[s("th",Vs,[U(ue,{modelValue:Ee.value,"onUpdate:modelValue":tt},null,8,["modelValue"])]),t[37]||(t[37]=s("th",{class:"py-3 pr-6"},"账号 ID",-1)),t[38]||(t[38]=s("th",{class:"py-3 pr-6"},"状态",-1)),s("th",Is,[s("span",js,[t[36]||(t[36]=Ce(" 剩余/过期 ",-1)),U(Qt,{text:"过期时间为 12 小时,账户过期以北京时间为准。"})])]),t[39]||(t[39]=s("th",{class:"py-3 pr-6"},"冷却",-1)),t[40]||(t[40]=s("th",{class:"py-3 pr-6"},"失败数",-1)),t[41]||(t[41]=s("th",{class:"py-3 pr-6"},"会话数",-1)),t[42]||(t[42]=s("th",{class:"py-3 text-right"},"操作",-1))])]),s("tbody",Ds,[!B.value.length&&!S(X)?(r(),l("tr",Ms,[...t[43]||(t[43]=[s("td",{colspan:"8",class:"py-8 text-center text-muted-foreground"}," 暂无账号数据,请检查后台配置。 ",-1)])])):f("",!0),(r(!0),l(ie,null,Te(B.value,o=>(r(),l("tr",{key:o.id,class:b(["border-t border-border",et(o)]),onClick:i=>we(o.id)},[s("td",{class:"py-4 pr-4",onClick:t[14]||(t[14]=A(()=>{},["stop"]))},[U(ue,{modelValue:g.value.has(o.id),"onUpdate:modelValue":i=>we(o.id)},null,8,["modelValue","onUpdate:modelValue"])]),s("td",Bs,n(o.id),1),s("td",Ns,[s("span",{class:b(["inline-flex items-center rounded-full border border-border px-3 py-1 text-xs",Qe(o)])},n(re(o)),3)]),s("td",Us,[s("div",{class:b(["text-sm font-semibold",Xe(o)])},n(We(o.remaining_display)),3),o.expires_at?(r(),l("span",zs,n(o.expires_at),1)):f("",!0)]),s("td",Ps,[o.cooldown_seconds>0?(r(),l("span",{key:0,class:b($e(o))},n(Ze(o.cooldown_seconds))+" · "+n(o.cooldown_reason),3)):(r(),l("span",{key:1,class:b($e(o))},n(o.cooldown_reason||"无冷却"),3))]),s("td",Fs,n(o.error_count),1),s("td",Ks,n(o.conversation_count),1),s("td",Js,[s("div",Hs,[s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:A(i=>ot(o.id),["stop"])}," 编辑 ",8,Gs),qe(o)?(r(),l("button",{key:0,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:A(i=>nt(o.id),["stop"])}," 启用 ",8,Ys)):(r(),l("button",{key:1,class:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition-colors hover:border-primary hover:text-primary",onClick:A(i=>at(o.id),["stop"])}," 禁用 ",8,Qs)),s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-destructive transition-colors hover:border-destructive hover:text-destructive",onClick:A(i=>it(o.id),["stop"])}," 删除 ",8,qs)])])],10,Os))),128))])])]))])]),U(Gt,{open:S(k).open.value,title:S(k).title.value,message:S(k).message.value,"confirm-text":S(k).confirmText.value,"cancel-text":S(k).cancelText.value,onConfirm:S(k).confirm,onCancel:S(k).cancel},null,8,["open","title","message","confirm-text","cancel-text","onConfirm","onCancel"]),(r(),ke(Se,{to:"body"},[de.value?(r(),l("div",Ws,[s("div",Xs,[s("div",{class:"flex items-center justify-between"},[t[44]||(t[44]=s("div",null,[s("p",{class:"text-sm font-medium text-foreground"},"添加账户"),s("p",{class:"mt-1 text-xs text-muted-foreground"},"创建 DuckMail 账号并自动注册")],-1)),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:Ge}," 关闭 ")]),s("div",Zs,[t[46]||(t[46]=s("label",{class:"block text-xs text-muted-foreground"},"注册数量",-1)),V(s("input",{"onUpdate:modelValue":t[15]||(t[15]=o=>se.value=o),type:"number",min:"1",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[I,se.value,void 0,{number:!0}]]),t[47]||(t[47]=s("div",{class:"rounded-2xl border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground"}," 默认域名来自设置面板(可在“配置面板”中修改) ",-1)),t[48]||(t[48]=s("div",{class:"rounded-2xl border border-border bg-muted/30 px-3 py-2 text-[11px] leading-relaxed text-muted-foreground"},[s("div",{class:"space-y-2"},[s("p",{class:"font-semibold text-rose-600"},"使用限制:禁止将本工具用于商业用途或大规模滥用。"),s("p",null,"用途说明:本项目仅用于学习、研究和技术交流,旨在探索浏览器自动化与系统集成。"),s("p",null,"使用责任:因使用本工具产生的一切后果由使用者自行承担,包括但不限于账号封禁、数据损失及法律责任。"),s("p",null,"合规要求:使用者应遵守所在国家/地区法律法规及 Google 服务条款,作者不对任何违规使用行为负责。"),s("p",null,"无担保:本项目按“现状”提供,不提供任何明示或暗示的担保,包括适销性或特定用途适用性。"),s("p",null,"第三方服务:本项目依赖 DuckMail API 等第三方服务,其可用性与稳定性不受作者控制。"),s("p",null,"维护声明:作者保留随时停止维护或变更功能的权利,恕不另行通知。")])],-1)),U(ue,{modelValue:fe.value,"onUpdate:modelValue":t[16]||(t[16]=o=>fe.value=o)},{default:ft(()=>[...t[45]||(t[45]=[Ce(" 我已阅读并同意上述说明与限制 ",-1)])]),_:1},8,["modelValue"])]),s("div",eo,[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary",onClick:Ge}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",disabled:$.value||!fe.value,onClick:Bt}," 开始注册 ",8,to)])])])):f("",!0)])),(r(),ke(Se,{to:"body"},[oe.value?(r(),l("div",so,[s("div",oo,[s("div",ro,[t[49]||(t[49]=s("div",null,[s("p",{class:"text-sm font-medium text-foreground"},"任务状态"),s("p",{class:"mt-1 text-xs text-muted-foreground"},"注册与刷新任务的状态与日志")],-1)),s("div",lo,[s("button",{class:"rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:border-primary hover:text-primary",disabled:!q.value.length&&!W.value.length&&!d.value&&!c.value&&!m.value,onClick:_t}," 清空日志 ",8,no),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:yt}," 关闭 ")])]),m.value?(r(),l("div",ao,n(m.value),1)):f("",!0),d.value||c.value?(r(),l("div",io,[d.value?(r(),l("div",uo,[t[50]||(t[50]=s("span",{class:"font-medium text-foreground"},"注册任务",-1)),s("span",co,"状态:"+n(ut(d.value.status)),1),s("span",vo,"进度:"+n(d.value.progress)+"/"+n(d.value.count),1),s("span",fo,"成功:"+n(d.value.success_count),1),s("span",xo,"失败:"+n(d.value.fail_count),1)])):f("",!0),c.value?(r(),l("div",go,[t[51]||(t[51]=s("span",{class:"font-medium text-foreground"},"刷新任务",-1)),s("span",mo,"状态:"+n(ut(c.value.status)),1),s("span",po,"进度:"+n(c.value.progress)+"/"+n(c.value.account_ids.length),1),s("span",bo,"成功:"+n(c.value.success_count),1),s("span",yo,"失败:"+n(c.value.fail_count),1)])):f("",!0)])):f("",!0),q.value.length||W.value.length?(r(),l("div",_o,[q.value.length?(r(),l("div",wo,[t[52]||(t[52]=s("p",{class:"text-xs font-semibold text-foreground"},"注册日志",-1)),s("div",ho,[(r(!0),l(ie,null,Te(q.value,(o,i)=>(r(),l("div",{key:`reg-${i}`,class:"font-mono"},n(st(o)),1))),128))])])):f("",!0),W.value.length?(r(),l("div",ko,[t[53]||(t[53]=s("p",{class:"text-xs font-semibold text-foreground"},"刷新日志",-1)),s("div",Co,[(r(!0),l(ie,null,Te(W.value,(o,i)=>(r(),l("div",{key:`login-${i}`,class:"font-mono"},n(st(o)),1))),128))])])):f("",!0)])):f("",!0),!m.value&&!d.value&&!c.value&&!q.value.length&&!W.value.length?(r(),l("div",To," 暂无任务 ")):f("",!0)])])):f("",!0)])),(r(),ke(Se,{to:"body"},[ee.value?(r(),l("div",So,[s("div",Ao,[s("div",{class:"flex items-center justify-between"},[t[54]||(t[54]=s("p",{class:"text-sm font-medium text-foreground"},"编辑账号",-1)),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:Ve}," 关闭 ")]),u.value?(r(),l("div",Eo,n(u.value),1)):f("",!0),s("div",Lo,[t[55]||(t[55]=s("label",{class:"block text-xs text-muted-foreground"},"账号 ID",-1)),V(s("input",{"onUpdate:modelValue":t[17]||(t[17]=o=>p.value.id=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm",disabled:""},null,512),[[I,p.value.id]]),t[56]||(t[56]=s("label",{class:"block text-xs text-muted-foreground"},"secure_c_ses",-1)),V(s("textarea",{"onUpdate:modelValue":t[18]||(t[18]=o=>p.value.secure_c_ses=o),class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm",rows:"3"},null,512),[[I,p.value.secure_c_ses]]),t[57]||(t[57]=s("label",{class:"block text-xs text-muted-foreground"},"csesidx",-1)),V(s("input",{"onUpdate:modelValue":t[19]||(t[19]=o=>p.value.csesidx=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[I,p.value.csesidx]]),t[58]||(t[58]=s("label",{class:"block text-xs text-muted-foreground"},"config_id",-1)),V(s("input",{"onUpdate:modelValue":t[20]||(t[20]=o=>p.value.config_id=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[I,p.value.config_id]]),t[59]||(t[59]=s("label",{class:"block text-xs text-muted-foreground"},"host_c_oses",-1)),V(s("input",{"onUpdate:modelValue":t[21]||(t[21]=o=>p.value.host_c_oses=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm"},null,512),[[I,p.value.host_c_oses]]),t[60]||(t[60]=s("label",{class:"block text-xs text-muted-foreground"},"expires_at",-1)),V(s("input",{"onUpdate:modelValue":t[22]||(t[22]=o=>p.value.expires_at=o),type:"text",class:"w-full rounded-2xl border border-input bg-background px-3 py-2 text-sm",placeholder:"2025-12-23 10:59:21"},null,512),[[I,p.value.expires_at]])]),s("div",{class:"mt-6 flex items-center justify-end gap-2"},[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary",onClick:Ve}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:Vt}," 保存 ")])])])):f("",!0)])),(r(),ke(Se,{to:"body"},[E.value?(r(),l("div",$o,[s("div",Ro,[s("div",Vo,[t[61]||(t[61]=s("p",{class:"text-sm font-medium text-foreground"},"账户配置(JSON)",-1)),s("div",Io,[s("button",{class:"rounded-full bg-foreground px-3 py-1 text-xs text-background transition-opacity hover:opacity-90",onClick:$t},n(j.value?"显示原文":"脱敏显示"),1),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:Re}," 关闭 ")])]),L.value?(r(),l("div",jo,n(L.value),1)):f("",!0),s("div",Do,[V(s("textarea",{"onUpdate:modelValue":t[23]||(t[23]=o=>H.value=o),class:"h-96 w-full rounded-2xl border border-input bg-background px-4 py-3 font-mono text-xs text-foreground",spellcheck:"false",readonly:j.value},null,8,Mo),[[I,H.value]])]),s("div",Oo,[s("button",{class:"rounded-full border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary",onClick:Re}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:Rt,disabled:j.value}," 保存 ",8,Bo)])])])):f("",!0)]))],64))}});export{Jo as default};