gemini-2api / static /assets /Accounts-CWTZ3Utf.js
xiaoyukkkk's picture
Upload 541 files
b71597d verified
import{g as b,C as Qe,h as d,d as qe,D as Ge,i as ne,o as Ke,j as We,c as l,a as s,x as R,y as Ce,m as C,v as V,b as g,A as Xe,t as r,n as h,u as $,F as le,r as Ve,f as $e,T as Ae,w as A,e as n}from"./index-gD6QQiOu.js";import{_ as Ye}from"./SelectMenu.vue_vue_type_script_setup_true_lang-B2Zu3W0l.js";import{_ as Y}from"./Checkbox.vue_vue_type_script_setup_true_lang-DT0LWHxC.js";import{_ as Ze}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D2ZZ5gFD.js";import{u as et}from"./useConfirmDialog-DEfIwwMt.js";import{_ as tt}from"./HelpTip.vue_vue_type_script_setup_true_lang-Cur056hv.js";const x={list:()=>b.get("/admin/accounts"),getConfig:()=>b.get("/admin/accounts-config"),updateConfig:u=>b.put("/admin/accounts-config",u),delete:u=>b.delete(`/admin/accounts/${u}`),disable:u=>b.put(`/admin/accounts/${u}/disable`),enable:u=>b.put(`/admin/accounts/${u}/enable`),startRegister:(u,m)=>b.post("/admin/register/start",{count:u,domain:m}),getRegisterTask:u=>b.get(`/admin/register/task/${u}`),getRegisterCurrent:()=>b.get("/admin/register/current"),startLogin:u=>b.post("/admin/login/start",u),getLoginTask:u=>b.get(`/admin/login/task/${u}`),getLoginCurrent:()=>b.get("/admin/login/current"),checkLogin:()=>b.post("/admin/login/check")},st=Qe("accounts",()=>{const u=d([]),m=d(!1);async function w(){m.value=!0;try{const a=await x.list();u.value=Array.isArray(a)?a:a.accounts||[]}finally{m.value=!1}}async function I(a){await x.delete(a),await w()}async function f(a){await x.disable(a),await w()}async function M(a){await x.enable(a),await w()}async function j(a){await Promise.all(a.map(S=>x.enable(S))),await w()}async function c(a){await Promise.all(a.map(S=>x.disable(S))),await w()}async function E(a){await Promise.all(a.map(S=>x.delete(S))),await w()}async function O(a){await x.updateConfig(a),await w()}return{accounts:u,isLoading:m,loadAccounts:w,deleteAccount:I,disableAccount:f,enableAccount:M,bulkEnable:j,bulkDisable:c,bulkDelete:E,updateConfig:O}}),ot={class:"space-y-8"},rt={class:"rounded-3xl border border-border bg-card p-6"},nt={class:"flex flex-wrap items-center justify-between gap-4"},lt={class:"grid w-full grid-cols-2 gap-3 sm:flex sm:w-auto sm:items-center"},at={class:"flex w-full flex-wrap items-center gap-3 text-xs text-muted-foreground sm:w-auto sm:flex-nowrap"},it={key:0},dt={class:"ml-auto flex items-center gap-2 sm:ml-0"},ut={class:"mt-4 flex flex-wrap items-center gap-3"},ct=["disabled"],pt=["disabled"],xt=["disabled"],mt=["disabled"],ft={class:"mt-4 rounded-2xl border border-border bg-background p-4"},vt={class:"flex flex-wrap items-center gap-3"},bt={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},gt=["disabled"],yt=["disabled"],_t=["disabled"],ht={key:0,class:"mt-3 rounded-2xl bg-destructive/10 px-3 py-2 text-xs text-destructive"},wt={key:1,class:"mt-3 grid gap-2 text-xs text-muted-foreground"},kt={key:0},Ct={class:"ml-2"},Vt={class:"ml-2"},$t={class:"ml-2"},At={class:"ml-2"},St={key:1},Tt={class:"ml-2"},Dt={class:"ml-2"},Lt={class:"ml-2"},Et={class:"ml-2"},Ut={key:0,class:"mt-6 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3"},Rt=["onClick"],jt={class:"flex items-start justify-between gap-3"},zt={class:"mt-1 font-mono text-xs text-foreground"},Nt={class:"flex items-center gap-2"},Bt={class:"mt-4 grid grid-cols-2 gap-3 text-xs text-muted-foreground"},It={key:0,class:"mt-1 text-[11px]"},Mt={key:0},Ot={key:1},Pt={class:"mt-1 text-sm font-semibold text-foreground"},Ft={class:"mt-1 text-sm font-semibold text-foreground"},Jt={class:"mt-4 flex flex-wrap items-center gap-2"},Ht=["onClick"],Qt=["onClick"],qt=["onClick"],Gt=["onClick"],Kt={key:0,class:"rounded-2xl border border-border bg-background p-4 text-center text-xs text-muted-foreground"},Wt={key:1,class:"relative mt-6 overflow-x-auto overflow-y-visible"},Xt={class:"min-w-full text-left text-sm"},Yt={class:"text-xs uppercase tracking-[0.2em] text-muted-foreground"},Zt={class:"py-3 pr-4"},es={class:"py-3 pr-6"},ts={class:"inline-flex items-center gap-2"},ss={class:"text-sm text-foreground"},os={key:0},rs=["onClick"],ns={class:"py-4 pr-6 font-mono text-xs text-foreground"},ls={class:"py-4 pr-6"},as={class:"py-4 pr-6"},is={key:0,class:"block text-[11px] text-muted-foreground"},ds={class:"py-4 pr-6 text-xs"},us={class:"py-4 pr-6 text-xs text-muted-foreground"},cs={class:"py-4 pr-6 text-xs text-muted-foreground"},ps={class:"py-4 text-right"},xs={class:"flex flex-wrap justify-end gap-2"},ms=["onClick"],fs=["onClick"],vs=["onClick"],bs=["onClick"],gs={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},ys={class:"w-full max-w-lg rounded-3xl border border-border bg-card p-6 shadow-xl"},_s={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-4 py-3 text-sm text-destructive"},hs={class:"mt-4 space-y-3 text-sm"},ws={key:0,class:"fixed inset-0 z-[100] flex items-center justify-center bg-black/30 px-4"},ks={class:"w-full max-w-3xl rounded-3xl border border-border bg-card p-6 shadow-xl"},Cs={class:"flex items-center justify-between"},Vs={class:"flex items-center gap-2"},$s={key:0,class:"mt-4 rounded-2xl bg-destructive/10 px-4 py-3 text-sm text-destructive"},As={class:"mt-4"},Ss=["readonly"],Ts={class:"mt-6 flex items-center justify-end gap-2"},Ds=["disabled"],Ns=qe({__name:"Accounts",setup(u){const m=st(),{accounts:w,isLoading:I}=Ge(m),f=et(),M=d(""),j=d("all"),c=d(new Set),E=d("table"),O=d(!1),a=d(""),S=d(!1),T=d(""),z=d(""),D=d(!1),P=d([]),F=d(1),Z=d(""),_=d(null),v=d(null),N=d(!1),k=d(!1),y=d(""),p=d({id:"",secure_c_ses:"",csesidx:"",config_id:"",host_c_oses:"",expires_at:""}),H=d(null),ae=d([]),Se=[{label:"全部状态",value:"all"},{label:"正常",value:"正常"},{label:"即将过期",value:"即将过期"},{label:"已过期",value:"已过期"},{label:"手动禁用",value:"手动禁用"},{label:"错误禁用",value:"错误禁用"},{label:"429限流",value:"429限流"}],L=ne(()=>{const t=M.value.trim().toLowerCase();return w.value.filter(e=>{const o=!t||e.id.toLowerCase().includes(t),i=j.value==="all"||J(e)===j.value;return o&&i})}),B=ne(()=>c.value.size),ee=ne(()=>L.value.length>0&&L.value.every(t=>c.value.has(t.id))),Q=async()=>{await m.loadAccounts(),c.value=new Set};Ke(async()=>{await Q(),await Pe()}),We(()=>{W(),X()});const J=t=>t.cooldown_reason?.includes("429")&&t.cooldown_seconds>0?"429限流":t.cooldown_reason==="错误禁用"?"错误禁用":t.disabled?"手动禁用":t.status==="已过期"?"已过期":t.status==="即将过期"?"即将过期":"正常",ie=t=>{const e=J(t);return e==="429限流"||e==="即将过期"?"bg-amber-200 text-amber-900":e==="错误禁用"||e==="已过期"?"bg-destructive/10 text-destructive":e==="手动禁用"?"bg-muted text-muted-foreground":"bg-emerald-500 text-white"},de=t=>t.cooldown_reason?.includes("429")&&t.cooldown_seconds>0?!0:t.disabled||t.cooldown_reason==="错误禁用",ue=t=>t==="已过期"?"过期":t==="未设置"?"未设置":t,ce=t=>t.status==="已过期"?"text-rose-600":t.status==="即将过期"?"text-amber-700":t.status==="未设置"?"text-muted-foreground":"text-emerald-600",pe=t=>t<60?`${t} 秒`:t<3600?`${Math.ceil(t/60)} 分钟`:`${(t/3600).toFixed(1)} 小时`,te=t=>t.cooldown_seconds>0?"text-amber-700":t.cooldown_reason==="错误禁用"?"text-rose-600":"text-muted-foreground",xe=t=>{const e=J(t);return e==="手动禁用"||e==="已过期"?"bg-muted/70":""},q=t=>{const e=new Set(c.value);e.has(t)?e.delete(t):e.add(t),c.value=e},me=()=>{if(ee.value){c.value=new Set;return}c.value=new Set(L.value.map(t=>t.id))},Te=(t,e)=>t.id||`account_${e+1}`,De=async()=>(await x.getConfig()).accounts.map((e,o)=>({...e,id:Te(e,o)})),Le=(t,e)=>{let o=-1;for(let U=0;U<t.length;U+=1)if(t[U].id===e){o=U;break}if(o===-1)return a.value="未找到对应账号配置。",!1;const i=t[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},ae.value=t,H.value=o,O.value=!0,!0},fe=async t=>{a.value="";try{const e=await De();Le(e,t)}catch(e){a.value=e.message||"加载账号配置失败"}},Ee=async()=>{T.value="";try{const t=await x.getConfig();P.value=Array.isArray(t.accounts)?t.accounts:[],z.value=JSON.stringify(be(P.value),null,2),D.value=!0,S.value=!0}catch(t){T.value=t.message||"加载账号配置失败"}},se=()=>{S.value=!1,T.value="",D.value=!1},ve=()=>{const t=JSON.parse(z.value);if(!Array.isArray(t))throw new Error("配置格式必须是数组。");return t},Ue=t=>typeof t!="string"||!t?t:t.length<=6?`${t.slice(0,2)}****`:`${t.slice(0,3)}****`,be=t=>{const e=new Set(["secure_c_ses","csesidx","config_id","host_c_oses","mail_password"]);return t.map(o=>{const i={...o};return e.forEach(U=>{const ke=i[U];ke&&(i[U]=Ue(ke))}),i})},Re=()=>{if(T.value="",!D.value){try{P.value=ve()}catch(t){T.value=t.message||"JSON 格式错误";return}z.value=JSON.stringify(be(P.value),null,2),D.value=!0;return}z.value=JSON.stringify(P.value,null,2),D.value=!1},je=async()=>{T.value="";try{const t=ve();await m.updateConfig(t),se()}catch(t){T.value=t.message||"保存失败"}},oe=()=>{O.value=!1,a.value=""},ze=async()=>{if(H.value===null)return;const t=[...ae.value];t[H.value]={...t[H.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 m.updateConfig(t),oe()}catch(e){a.value=e.message||"保存失败"}},Ne=async()=>{await m.bulkEnable(Array.from(c.value)),c.value=new Set},Be=async()=>{await f.ask({title:"批量禁用",message:"确定要批量禁用选中的账号吗?"})&&(await m.bulkDisable(Array.from(c.value)),c.value=new Set)},Ie=async()=>{await f.ask({title:"批量删除",message:"确定要批量删除选中的账号吗?",confirmText:"删除"})&&(await m.bulkDelete(Array.from(c.value)),c.value=new Set)},ge=async t=>{await m.enableAccount(t)},ye=async t=>{await f.ask({title:"禁用账号",message:"确定要禁用该账号吗?"})&&await m.disableAccount(t)},_e=async t=>{await f.ask({title:"删除账号",message:"确定要删除该账号吗?",confirmText:"删除"})&&await m.deleteAccount(t)};let G=null,K=null;const W=()=>{G!==null&&(window.clearInterval(G),G=null)},X=()=>{K!==null&&(window.clearInterval(K),K=null)},he=t=>t==="pending"?"等待中":t==="running"?"执行中":t==="success"?"成功":t==="failed"?"失败":t,Me=async t=>{const e=await x.getRegisterTask(t);_.value=e,e.status!=="running"&&e.status!=="pending"&&(N.value=!1,W(),await Q())},Oe=async t=>{const e=await x.getLoginTask(t);v.value=e,e.status!=="running"&&e.status!=="pending"&&(k.value=!1,X(),await Q())},we=t=>{W(),G=window.setInterval(()=>{Me(t).catch(e=>{y.value=e?.message||"注册任务更新失败",W(),N.value=!1})},3e3)},re=t=>{X(),K=window.setInterval(()=>{Oe(t).catch(e=>{y.value=e?.message||"刷新任务更新失败",X(),k.value=!1})},3e3)},Pe=async()=>{try{const t=await x.getRegisterCurrent();t&&"id"in t?(_.value=t,(t.status==="running"||t.status==="pending")&&(N.value=!0,we(t.id))):_.value=null}catch(t){y.value=t.message||"加载注册任务失败"}try{const t=await x.getLoginCurrent();t&&"id"in t?(v.value=t,(t.status==="running"||t.status==="pending")&&(k.value=!0,re(t.id))):v.value=null}catch(t){y.value=t.message||"加载刷新任务失败"}},Fe=async()=>{y.value="",N.value=!0;const t=Z.value.trim();try{const e=Number.isFinite(F.value)&&F.value>0?F.value:void 0,o=await x.startRegister(e,t||void 0);_.value=o,we(o.id)}catch(e){y.value=e.message||"启动注册失败",N.value=!1}},Je=async()=>{if(c.value.size){y.value="",k.value=!0;try{const t=await x.startLogin(Array.from(c.value));v.value=t,re(t.id)}catch(t){y.value=t.message||"启动刷新失败",k.value=!1}}},He=async()=>{y.value="",k.value=!0;try{await x.checkLogin();const t=await x.getLoginCurrent();if(t&&"id"in t){v.value=t,re(t.id);return}v.value=null,k.value=!1}catch(t){y.value=t.message||"触发刷新失败",k.value=!1}};return(t,e)=>(n(),l(le,null,[s("div",ot,[s("section",rt,[s("div",nt,[s("div",lt,[C(s("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>M.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),[[V,M.value]]),R(Ye,{modelValue:j.value,"onUpdate:modelValue":e[1]||(e[1]=o=>j.value=o),options:Se},null,8,["modelValue"])]),s("div",at,[R(Y,{modelValue:ee.value,"onUpdate:modelValue":me},{default:Xe(()=>[...e[18]||(e[18]=[$e(" 全选 ",-1)])]),_:1},8,["modelValue"]),s("span",null,"共 "+r(L.value.length)+" 个账号",1),B.value?(n(),l("span",it,"已选 "+r(B.value)+" 个",1)):g("",!0),s("div",dt,[s("button",{type:"button",class:h(["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",E.value==="table"?"bg-accent text-accent-foreground":""]),onClick:e[2]||(e[2]=o=>E.value="table"),"aria-label":"列表视图"},[...e[19]||(e[19]=[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:h(["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",E.value==="card"?"bg-accent text-accent-foreground":""]),onClick:e[3]||(e[3]=o=>E.value="card"),"aria-label":"卡片视图"},[...e[20]||(e[20]=[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",ut,[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:Ee}," 账户配置 "),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:$(I),onClick:Q}," 刷新列表 ",8,ct),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:!B.value,onClick:Ne}," 批量启用 ",8,pt),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:!B.value,onClick:Be}," 批量禁用 ",8,xt),s("button",{class:"rounded-full border border-border px-4 py-2 text-sm font-medium text-destructive transition-colors hover:border-destructive hover:text-destructive",disabled:!B.value,onClick:Ie}," 批量删除 ",8,mt)]),s("div",ft,[s("div",vt,[s("div",bt,[e[21]||(e[21]=s("span",{class:"text-foreground"},"自动注册",-1)),C(s("input",{"onUpdate:modelValue":e[4]||(e[4]=o=>F.value=o),type:"number",min:"1",class:"w-20 rounded-full border border-input bg-background px-3 py-1 text-xs"},null,512),[[V,F.value,void 0,{number:!0}]]),C(s("input",{"onUpdate:modelValue":e[5]||(e[5]=o=>Z.value=o),type:"text",class:"w-40 rounded-full border border-input bg-background px-3 py-1 text-xs",placeholder:"指定域名(可选)"},null,512),[[V,Z.value]])]),s("button",{class:"rounded-full border border-border px-4 py-2 text-xs font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:N.value,onClick:Fe}," 开始注册 ",8,gt),s("button",{class:"rounded-full border border-border px-4 py-2 text-xs font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:k.value,onClick:He}," 刷新过期 ",8,yt),s("button",{class:"rounded-full border border-border px-4 py-2 text-xs font-medium text-foreground transition-colors hover:border-primary hover:text-primary",disabled:!B.value||k.value,onClick:Je}," 刷新选中 ",8,_t)]),y.value?(n(),l("div",ht,r(y.value),1)):g("",!0),_.value||v.value?(n(),l("div",wt,[_.value?(n(),l("div",kt,[e[22]||(e[22]=s("span",{class:"font-medium text-foreground"},"注册任务",-1)),s("span",Ct,"状态:"+r(he(_.value.status)),1),s("span",Vt,"进度:"+r(_.value.progress)+"/"+r(_.value.count),1),s("span",$t,"成功:"+r(_.value.success_count),1),s("span",At,"失败:"+r(_.value.fail_count),1)])):g("",!0),v.value?(n(),l("div",St,[e[23]||(e[23]=s("span",{class:"font-medium text-foreground"},"刷新任务",-1)),s("span",Tt,"状态:"+r(he(v.value.status)),1),s("span",Dt,"进度:"+r(v.value.progress)+"/"+r(v.value.account_ids.length),1),s("span",Lt,"成功:"+r(v.value.success_count),1),s("span",Et,"失败:"+r(v.value.fail_count),1)])):g("",!0)])):g("",!0)]),E.value==="card"?(n(),l("div",Ut,[(n(!0),l(le,null,Ve(L.value,o=>(n(),l("div",{key:o.id,class:h(["rounded-2xl border border-border bg-card p-4",xe(o)]),onClick:i=>q(o.id)},[s("div",jt,[s("div",null,[e[24]||(e[24]=s("p",{class:"text-xs text-muted-foreground"},"账号 ID",-1)),s("p",zt,r(o.id),1)]),s("div",Nt,[R(Y,{modelValue:c.value.has(o.id),"onUpdate:modelValue":i=>q(o.id),onClick:e[6]||(e[6]=A(()=>{},["stop"]))},null,8,["modelValue","onUpdate:modelValue"]),s("span",{class:h(["inline-flex items-center rounded-full border border-border px-3 py-1 text-xs",ie(o)])},r(J(o)),3)])]),s("div",Bt,[s("div",null,[e[25]||(e[25]=s("p",null,"剩余时间",-1)),s("p",{class:h(["mt-1 text-sm font-semibold",ce(o)])},r(ue(o.remaining_display)),3),o.expires_at?(n(),l("p",It,r(o.expires_at),1)):g("",!0)]),s("div",null,[e[26]||(e[26]=s("p",null,"冷却",-1)),s("p",{class:h(["mt-1",te(o)])},[o.cooldown_seconds>0?(n(),l("span",Mt,r(pe(o.cooldown_seconds))+" · "+r(o.cooldown_reason),1)):(n(),l("span",Ot,r(o.cooldown_reason||"无冷却"),1))],2)]),s("div",null,[e[27]||(e[27]=s("p",null,"失败数",-1)),s("p",Pt,r(o.error_count),1)]),s("div",null,[e[28]||(e[28]=s("p",null,"会话数",-1)),s("p",Ft,r(o.conversation_count),1)])]),s("div",Jt,[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=>fe(o.id),["stop"])}," 编辑 ",8,Ht),de(o)?(n(),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:[e[7]||(e[7]=A(()=>{},["stop"])),i=>ge(o.id)]}," 启用 ",8,Qt)):(n(),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:[e[8]||(e[8]=A(()=>{},["stop"])),i=>ye(o.id)]}," 禁用 ",8,qt)),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:[e[9]||(e[9]=A(()=>{},["stop"])),i=>_e(o.id)]}," 删除 ",8,Gt)])],10,Rt))),128)),!L.value.length&&!$(I)?(n(),l("div",Kt," 暂无账号数据,请检查后台配置。 ")):g("",!0)])):(n(),l("div",Wt,[s("table",Xt,[s("thead",Yt,[s("tr",null,[s("th",Zt,[R(Y,{modelValue:ee.value,"onUpdate:modelValue":me},null,8,["modelValue"])]),e[30]||(e[30]=s("th",{class:"py-3 pr-6"},"账号 ID",-1)),e[31]||(e[31]=s("th",{class:"py-3 pr-6"},"状态",-1)),s("th",es,[s("span",ts,[e[29]||(e[29]=$e(" 剩余/过期 ",-1)),R(tt,{text:"过期时间为 12 小时,账户过期以北京时间为准。"})])]),e[32]||(e[32]=s("th",{class:"py-3 pr-6"},"冷却",-1)),e[33]||(e[33]=s("th",{class:"py-3 pr-6"},"失败数",-1)),e[34]||(e[34]=s("th",{class:"py-3 pr-6"},"会话数",-1)),e[35]||(e[35]=s("th",{class:"py-3 text-right"},"操作",-1))])]),s("tbody",ss,[!L.value.length&&!$(I)?(n(),l("tr",os,[...e[36]||(e[36]=[s("td",{colspan:"8",class:"py-8 text-center text-muted-foreground"}," 暂无账号数据,请检查后台配置。 ",-1)])])):g("",!0),(n(!0),l(le,null,Ve(L.value,o=>(n(),l("tr",{key:o.id,class:h(["border-t border-border",xe(o)]),onClick:i=>q(o.id)},[s("td",{class:"py-4 pr-4",onClick:e[10]||(e[10]=A(()=>{},["stop"]))},[R(Y,{modelValue:c.value.has(o.id),"onUpdate:modelValue":i=>q(o.id)},null,8,["modelValue","onUpdate:modelValue"])]),s("td",ns,r(o.id),1),s("td",ls,[s("span",{class:h(["inline-flex items-center rounded-full border border-border px-3 py-1 text-xs",ie(o)])},r(J(o)),3)]),s("td",as,[s("div",{class:h(["text-sm font-semibold",ce(o)])},r(ue(o.remaining_display)),3),o.expires_at?(n(),l("span",is,r(o.expires_at),1)):g("",!0)]),s("td",ds,[o.cooldown_seconds>0?(n(),l("span",{key:0,class:h(te(o))},r(pe(o.cooldown_seconds))+" · "+r(o.cooldown_reason),3)):(n(),l("span",{key:1,class:h(te(o))},r(o.cooldown_reason||"无冷却"),3))]),s("td",us,r(o.error_count),1),s("td",cs,r(o.conversation_count),1),s("td",ps,[s("div",xs,[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=>fe(o.id),["stop"])}," 编辑 ",8,ms),de(o)?(n(),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=>ge(o.id),["stop"])}," 启用 ",8,fs)):(n(),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=>ye(o.id),["stop"])}," 禁用 ",8,vs)),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=>_e(o.id),["stop"])}," 删除 ",8,bs)])])],10,rs))),128))])])]))])]),R(Ze,{open:$(f).open.value,title:$(f).title.value,message:$(f).message.value,"confirm-text":$(f).confirmText.value,"cancel-text":$(f).cancelText.value,onConfirm:$(f).confirm,onCancel:$(f).cancel},null,8,["open","title","message","confirm-text","cancel-text","onConfirm","onCancel"]),(n(),Ce(Ae,{to:"body"},[O.value?(n(),l("div",gs,[s("div",ys,[s("div",{class:"flex items-center justify-between"},[e[37]||(e[37]=s("p",{class:"text-sm font-medium text-foreground"},"编辑账号",-1)),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:oe}," 关闭 ")]),a.value?(n(),l("div",_s,r(a.value),1)):g("",!0),s("div",hs,[e[38]||(e[38]=s("label",{class:"block text-xs text-muted-foreground"},"账号 ID",-1)),C(s("input",{"onUpdate:modelValue":e[11]||(e[11]=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),[[V,p.value.id]]),e[39]||(e[39]=s("label",{class:"block text-xs text-muted-foreground"},"secure_c_ses",-1)),C(s("textarea",{"onUpdate:modelValue":e[12]||(e[12]=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),[[V,p.value.secure_c_ses]]),e[40]||(e[40]=s("label",{class:"block text-xs text-muted-foreground"},"csesidx",-1)),C(s("input",{"onUpdate:modelValue":e[13]||(e[13]=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),[[V,p.value.csesidx]]),e[41]||(e[41]=s("label",{class:"block text-xs text-muted-foreground"},"config_id",-1)),C(s("input",{"onUpdate:modelValue":e[14]||(e[14]=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),[[V,p.value.config_id]]),e[42]||(e[42]=s("label",{class:"block text-xs text-muted-foreground"},"host_c_oses",-1)),C(s("input",{"onUpdate:modelValue":e[15]||(e[15]=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),[[V,p.value.host_c_oses]]),e[43]||(e[43]=s("label",{class:"block text-xs text-muted-foreground"},"expires_at",-1)),C(s("input",{"onUpdate:modelValue":e[16]||(e[16]=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),[[V,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:oe}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:ze}," 保存 ")])])])):g("",!0)])),(n(),Ce(Ae,{to:"body"},[S.value?(n(),l("div",ws,[s("div",ks,[s("div",Cs,[e[44]||(e[44]=s("p",{class:"text-sm font-medium text-foreground"},"账户配置(JSON)",-1)),s("div",Vs,[s("button",{class:"rounded-full bg-foreground px-3 py-1 text-xs text-background transition-opacity hover:opacity-90",onClick:Re},r(D.value?"显示原文":"脱敏显示"),1),s("button",{class:"text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:se}," 关闭 ")])]),T.value?(n(),l("div",$s,r(T.value),1)):g("",!0),s("div",As,[C(s("textarea",{"onUpdate:modelValue":e[17]||(e[17]=o=>z.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:D.value},null,8,Ss),[[V,z.value]])]),s("div",Ts,[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:se}," 取消 "),s("button",{class:"rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90",onClick:je,disabled:D.value}," 保存 ",8,Ds)])])])):g("",!0)]))],64))}});export{Ns as default};