You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
23 KiB

import{g as F,c as l,H as L,a as e,F as g,r as k,t as n,d as x,G as S,k as d,q as P,l as u,m as _,p as J,B as U,s as q,x as $,A as T,o,n as m,D as A,_ as Q}from"./CTAruH_8.js";import{u as Z}from"./lLLegusN.js";import"./yUUyh6cG.js";const W={class:"flex gap-4",style:{"align-items":"flex-start"}},X={style:{width:"208px","flex-shrink":"0"}},Y={class:"flex flex-col gap-1.5"},ee=["onClick"],te={width:"17",height:"17",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},se=["d"],le={class:"flex-1 min-w-0"},oe={class:"text-sm font-medium text-slate-700"},ae={class:"text-[11px] text-slate-400 truncate"},ne={key:0,class:"dot-on",title:"已启用"},ie={class:"flex-1 min-w-0"},de={key:0},re={class:"rounded-xl px-4 py-3 mb-4 flex items-center gap-3",style:{background:"linear-gradient(135deg,#ecfdf5,#f0fdfa)",border:"1px solid #a7f3d0"}},ue={style:{width:"36px",height:"36px","border-radius":"10px",background:"#10b981",display:"flex","align-items":"center","justify-content":"center","flex-shrink":"0"}},ce={style:{width:"19px",height:"19px",color:"#fff"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},pe={class:"flex-1"},me={class:"text-sm font-semibold text-emerald-800"},xe={class:"grid grid-cols-4 gap-3 mb-4"},ve=["onClick"],be={class:"flex items-center justify-between"},ye={key:0,class:"text-[10px] text-emerald-500 font-semibold"},he={key:1,class:"text-[10px] text-slate-300 font-semibold"},fe={class:"text-sm font-semibold text-slate-700 mt-2"},ge={class:"text-[11px] text-slate-400 mb-2.5"},ke=["onClick"],_e=["checked","onClick"],we={class:"bg-white rounded-2xl border border-slate-100 shadow-sm p-6"},Ce={class:"flex items-center justify-between mb-5"},Se={class:"flex items-center gap-3"},qe={class:"text-base font-semibold text-slate-800"},Ke={class:"text-xs text-slate-400 mt-0.5"},Me={class:"flex items-center gap-2"},Te={class:"flex items-center gap-2 mr-1"},Ae={class:"grid grid-cols-2 gap-x-5 gap-y-4"},Ve={class:"label py-1"},Ie={class:"label-text text-sm"},je={key:0,class:"text-rose-500 ml-0.5"},Pe={key:1,class:"lock-tag ml-1.5"},Ue={class:"relative"},$e=["onUpdate:modelValue","type","placeholder"],De=["onClick"],Le={key:0,class:"text-[11px] text-slate-400 mt-1"},Be={key:1},ze={class:"rounded-xl px-4 py-3 mb-4 flex items-center gap-3",style:{background:"#fffbeb",border:"1px solid #fde68a"}},Oe={style:{width:"36px",height:"36px","border-radius":"10px",background:"#f59e0b",display:"flex","align-items":"center","justify-content":"center","flex-shrink":"0"}},Ne={style:{width:"19px",height:"19px",color:"#fff"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Re={class:"bg-white rounded-2xl border border-slate-100 shadow-sm p-6"},Ee={class:"flex items-center justify-between mb-5"},He={class:"flex items-center gap-2"},Ge={class:"flex items-center gap-2 mr-1"},Fe={class:"grid grid-cols-2 gap-x-5 gap-y-4"},Je={class:"form-control"},Qe={class:"form-control"},Ze={class:"form-control"},We=["value"],Xe={class:"form-control"},Ye={class:"form-control"},et={class:"form-control"},tt={class:"relative"},st=["type"],lt={class:"form-control col-span-2"},ot={class:"flex items-end gap-3"},at={class:"form-control flex-1"},nt={key:2},it={class:"rounded-xl px-4 py-3 mb-4 flex items-center gap-3",style:{background:"#f0fdfa",border:"1px solid #99f6e4"}},dt={style:{width:"36px",height:"36px","border-radius":"10px",background:"#14b8a6",display:"flex","align-items":"center","justify-content":"center","flex-shrink":"0"}},rt={style:{width:"19px",height:"19px",color:"#fff"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},ut={class:"badge badge-sm text-white",style:{background:"#14b8a6",border:"none"}},ct={class:"grid grid-cols-4 gap-3 mb-4"},pt=["onClick"],mt={class:"flex items-center justify-between"},xt={key:0,class:"text-[10px] text-emerald-500 font-semibold"},vt={key:1,class:"text-[10px] text-slate-300 font-semibold"},bt={class:"text-sm font-semibold text-slate-700 mt-2"},yt={class:"text-[11px] text-slate-400 mb-2.5"},ht=["onClick"],ft=["checked","onClick"],gt={class:"bg-white rounded-2xl border border-slate-100 shadow-sm p-6"},kt={class:"flex items-center justify-between mb-5"},_t={class:"flex items-center gap-3"},wt={class:"text-base font-semibold text-slate-800"},Ct={class:"text-xs text-slate-400 mt-0.5"},St={class:"flex items-center gap-2"},qt={class:"flex items-center gap-2 mr-1"},Kt={class:"grid grid-cols-2 gap-x-5 gap-y-4"},Mt={class:"label py-1"},Tt={class:"label-text text-sm"},At={key:0,class:"text-rose-500 ml-0.5"},Vt={key:1,class:"lock-tag ml-1.5"},It={class:"relative"},jt=["onUpdate:modelValue","type","placeholder"],Pt=["onClick"],Ut={key:0,class:"text-[11px] text-slate-400 mt-1"},$t=F({__name:"systemconfig",setup(Dt){const{success:v,info:w}=Z(),B=[{id:"storage",label:"对象存储",desc:"固件 / 头像 / 文件",color:"#6366f1",icon:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8"},{id:"mail",label:"邮件服务",desc:"生产通知 / 厂家发信",color:"#f59e0b",icon:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},{id:"translate",label:"翻译服务",desc:"后台文案多语言同步",color:"#14b8a6",icon:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"}],C=q("storage"),a=$({enable:!0,host:"smtp.exmail.qq.com",port:"465",secure:"SSL",user:"noreply@yunyan.com",pass:"",_showPass:!1,fromName:"云岩科技",cc:"ops@yunyan.com",testTo:""}),z=["SSL","STARTTLS","不加密"];function O(){if(!a.testTo){w("请先填测试收件邮箱");return}w(`正在向 ${a.testTo} 发送测试邮件…(演示)`),setTimeout(()=>v(`测试邮件已发送至 ${a.testTo}`),600)}function N(i){return i==="storage"?!0:i==="mail"?a.enable:i==="translate"?D.value?.enable??!1:!1}const K=$([{id:"volc",name:"火山引擎翻译",short:"火山",tag:"Volcengine MT",color:"#1664ff",enable:!0,fields:[{key:"region",label:"Region",value:"cn-beijing",mono:!0,required:!0},{key:"accessKey",label:"AccessKey",value:"AKLTZjJmODdk****",mono:!0,encrypted:!0,required:!0},{key:"secretKey",label:"SecretKey",value:"",mono:!0,encrypted:!0,required:!0,hint:"留空保留原密文"}]},{id:"aliyun",name:"阿里云翻译",short:"阿里",tag:"Aliyun MT",color:"#ff6a00",enable:!0,fields:[{key:"region",label:"Region",value:"cn-hangzhou",mono:!0,required:!0},{key:"accessKeyId",label:"AccessKey ID",value:"LTAI5txxxxxxxx",mono:!0,encrypted:!0,required:!0},{key:"accessKeySecret",label:"AccessKey Secret",value:"",mono:!0,encrypted:!0,required:!0,hint:"留空保留原密文"},{key:"scene",label:"翻译场景",value:"general",mono:!0,hint:"general / social / ecommerce / tech"}]},{id:"google",name:"Google 翻译",short:"G",tag:"Cloud Translation",color:"#ea4335",enable:!1,fields:[{key:"project",label:"Project ID",value:"",mono:!0,required:!0},{key:"apiKey",label:"API Key",value:"",mono:!0,encrypted:!0,required:!0}]},{id:"deepl",name:"DeepL",short:"DL",tag:"DeepL API",color:"#0f2b46",enable:!1,fields:[{key:"authKey",label:"Auth Key",value:"",mono:!0,encrypted:!0,required:!0},{key:"plan",label:"套餐",value:"free",mono:!0,hint:"free / pro"}]}]),b=q("volc"),h=q("volc"),c=T(()=>K.find(i=>i.id===h.value)),D=T(()=>K.find(i=>i.id===b.value));function V(i){const s=K.find(t=>t.id===i);s&&(b.value=i,h.value=i,s.enable=!0,v(`已将「${s.name}」设为默认翻译服务,后台多语言同步将走该服务`))}function R(){w(`正在测试 ${c.value.name} …(演示)`),setTimeout(()=>v(`${c.value.name} 连接正常,可调用翻译`),600)}const M=$([{id:"aliyun",name:"阿里云 OSS",short:"OSS",tag:"Aliyun",color:"#ff6a00",enable:!0,fields:[{key:"region",label:"Region",value:"oss-cn-shanghai",placeholder:"oss-cn-shanghai",mono:!0,required:!0},{key:"endpoint",label:"Endpoint",value:"oss-cn-shanghai.aliyuncs.com",mono:!0,required:!0},{key:"bucket",label:"Bucket",value:"yunyan-firmware",mono:!0,required:!0},{key:"accessKeyId",label:"AccessKey ID",value:"LTAI5txxxxxxxx",mono:!0,encrypted:!0,required:!0},{key:"accessKeySecret",label:"AccessKey Secret",value:"",mono:!0,encrypted:!0,required:!0,hint:"留空保留原密文"},{key:"domain",label:"自定义域名 (CDN)",value:"https://cdn.yunyan.com",wide:!0,hint:"可选,配置后文件 URL 走该域名"}]},{id:"tencent",name:"腾讯云 COS",short:"COS",tag:"Tencent",color:"#00a4ff",enable:!0,fields:[{key:"region",label:"Region",value:"ap-guangzhou",mono:!0,required:!0},{key:"appid",label:"AppId",value:"1253517901",mono:!0,required:!0},{key:"bucket",label:"Bucket",value:"yunyan-1253517901",mono:!0,required:!0},{key:"secretId",label:"SecretId",value:"AKIDxxxxxxxx",mono:!0,encrypted:!0,required:!0},{key:"secretKey",label:"SecretKey",value:"",mono:!0,encrypted:!0,required:!0,hint:"留空保留原密文"},{key:"domain",label:"自定义域名 (CDN)",value:"",wide:!0,hint:"可选"}]},{id:"qiniu",name:"七牛云 Kodo",short:"KODO",tag:"Qiniu",color:"#00aaff",enable:!1,fields:[{key:"zone",label:"存储区域",value:"",mono:!0,required:!0},{key:"bucket",label:"Bucket",value:"",mono:!0,required:!0},{key:"accessKey",label:"AccessKey",value:"",mono:!0,encrypted:!0,required:!0},{key:"secretKey",label:"SecretKey",value:"",mono:!0,encrypted:!0,required:!0},{key:"domain",label:"加速域名",value:"",wide:!0}]},{id:"minio",name:"MinIO",short:"S3",tag:"S3 兼容",color:"#c72e49",enable:!1,fields:[{key:"endpoint",label:"Endpoint",value:"",mono:!0,required:!0,placeholder:"minio.内网:9000"},{key:"bucket",label:"Bucket",value:"",mono:!0,required:!0},{key:"accessKey",label:"AccessKey",value:"",mono:!0,encrypted:!0,required:!0},{key:"secretKey",label:"SecretKey",value:"",mono:!0,encrypted:!0,required:!0},{key:"useSSL",label:"使用 HTTPS",value:"false",mono:!0}]}]),y=q("aliyun"),f=q("aliyun"),p=T(()=>M.find(i=>i.id===f.value)),E=T(()=>M.find(i=>i.id===y.value));function H(){I(f.value)}function I(i){const s=M.find(t=>t.id===i);s&&(y.value=i,f.value=i,s.enable=!0,v(`已将「${s.name}」设为默认对象存储,固件 / 头像等文件上传将指向该存储桶`))}function G(){w?w(`正在测试 ${p.value.name} 连接…(演示)`):v("连接测试通过(演示)"),setTimeout(()=>v(`${p.value.name} 连接正常,Bucket 可写`),600)}function j(){v("配置已保存(演示,未落库)")}return(i,s)=>(o(),l("div",null,[s[39]||(s[39]=L('<div class="mb-4 rounded-lg px-4 py-2.5 text-xs flex items-center gap-2" style="background:#eef2ff;border:1px solid #c7d2fe;color:#4338ca;" data-v-96602b99><span class="font-semibold" data-v-96602b99>演示效果</span><span class="text-indigo-400" data-v-96602b99>·</span><span data-v-96602b99>本页为 UI 演示,数据为本地 mock,未连接后端。确认方向后再接 console 接口。</span></div><div class="flex items-center justify-between mb-5" data-v-96602b99><div data-v-96602b99><h2 class="text-lg font-semibold text-slate-800" data-v-96602b99>系统配置</h2><p class="text-xs text-slate-400 mt-1" data-v-96602b99>平台级服务配置:① 对象存储(固件 / 头像等文件,默认阿里云 OSS);② 邮件服务(生产环节给厂家发通知邮件);③ 翻译服务(后台配置多语言同步)。</p></div></div>',2)),e("div",W,[e("div",X,[e("div",Y,[(o(),l(g,null,k(B,t=>e("div",{key:t.id,class:m(["cat-item",{active:C.value===t.id}]),onClick:r=>C.value=t.id},[e("div",{class:"cat-icon",style:S({background:t.color})},[(o(),l("svg",te,[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:t.icon},null,8,se)]))],4),e("div",le,[e("div",oe,n(t.label),1),e("div",ae,n(t.desc),1)]),N(t.id)?(o(),l("span",ne)):u("",!0)],10,ee)),64))])]),e("div",ie,[C.value==="storage"?(o(),l("div",de,[e("div",re,[e("div",ue,[(o(),l("svg",ce,[...s[13]||(s[13]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"},null,-1)])]))]),e("div",pe,[e("div",me,"设备固件上传当前指向:"+n(E.value.name),1),s[14]||(s[14]=e("div",{class:"text-[11px] text-emerald-600 mt-0.5"},"固件包、用户头像等文件均上传至此存储桶。切换默认存储不影响历史文件 URL。",-1))]),s[15]||(s[15]=e("span",{class:"badge badge-success badge-sm text-white"},"运行中",-1))]),s[19]||(s[19]=e("div",{class:"flex items-center justify-between mb-2"},[e("span",{class:"text-xs font-semibold text-slate-500"},[x("选择默认对象存储 "),e("span",{class:"text-slate-400 font-normal"},"(固件 / 头像等文件上传指向此服务)")])],-1)),e("div",xe,[(o(!0),l(g,null,k(M,t=>(o(),l("div",{key:t.id,class:m(["provider-card",{active:f.value===t.id,"is-default":t.id===y.value}]),onClick:r=>f.value=t.id},[e("div",be,[e("div",{class:"provider-logo",style:S({background:t.color})},n(t.short),5),t.enable?(o(),l("span",ye,"已配置")):(o(),l("span",he,"未配置"))]),e("div",fe,n(t.name),1),e("div",ge,n(t.tag),1),e("label",{class:m(["default-pick",{on:t.id===y.value}]),onClick:A(r=>I(t.id),["stop"])},[e("input",{type:"radio",class:"radio radio-xs radio-primary",checked:t.id===y.value,onClick:A(r=>I(t.id),["stop"])},null,8,_e),e("span",null,n(t.id===y.value?"默认使用":"设为默认"),1)],10,ke)],10,ve))),128))]),e("div",we,[e("div",Ce,[e("div",Se,[e("div",{class:"provider-logo",style:S({background:p.value.color,width:"44px",height:"44px",fontSize:"15px"})},n(p.value.short),5),e("div",null,[e("h3",qe,n(p.value.name),1),e("p",Ke,n(p.value.tag)+" · 对象存储",1)])]),e("div",Me,[e("label",Te,[s[16]||(s[16]=e("span",{class:"text-xs text-slate-500"},"启用",-1)),d(e("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>p.value.enable=t),type:"checkbox",class:"toggle toggle-primary toggle-sm"},null,512),[[P,p.value.enable]])]),e("button",{class:"btn btn-outline btn-sm",onClick:G},"测试连接"),f.value!==y.value?(o(),l("button",{key:0,class:"btn btn-ghost btn-sm text-indigo-600",onClick:H},"设为默认存储")):u("",!0),e("button",{class:"btn btn-primary btn-sm text-white",onClick:j},"保存")])]),s[17]||(s[17]=e("div",{class:"divider text-xs text-slate-400 my-3"},"连接配置",-1)),e("div",Ae,[(o(!0),l(g,null,k(p.value.fields,t=>(o(),l("div",{key:t.key,class:m(["form-control",{"col-span-2":t.wide}])},[e("label",Ve,[e("span",Ie,[x(n(t.label),1),t.required?(o(),l("span",je,"*")):u("",!0),t.encrypted?(o(),l("span",Pe,"🔒 加密存储")):u("",!0)])]),e("div",Ue,[d(e("input",{"onUpdate:modelValue":r=>t.value=r,type:t.encrypted&&!t._show?"password":"text",class:m(["input input-bordered input-sm w-full",{"font-mono":t.mono,"pr-14":t.encrypted}]),placeholder:t.placeholder},null,10,$e),[[U,t.value]]),t.encrypted?(o(),l("button",{key:0,type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-slate-400 hover:text-slate-700",onClick:r=>t._show=!t._show},n(t._show?"隐藏":"显示"),9,De)):u("",!0)]),t.hint?(o(),l("span",Le,n(t.hint),1)):u("",!0)],2))),128))]),s[18]||(s[18]=L('<div class="divider text-xs text-slate-400 my-4" data-v-96602b99>上传规则</div><div class="grid grid-cols-3 gap-4" data-v-96602b99><div class="rule-box" data-v-96602b99><div class="text-[11px] text-slate-400" data-v-96602b99>固件包路径前缀</div><div class="font-mono text-sm text-slate-700 mt-1" data-v-96602b99>/firmware/</div></div><div class="rule-box" data-v-96602b99><div class="text-[11px] text-slate-400" data-v-96602b99>头像路径前缀</div><div class="font-mono text-sm text-slate-700 mt-1" data-v-96602b99>/userAvatar/</div></div><div class="rule-box" data-v-96602b99><div class="text-[11px] text-slate-400" data-v-96602b99>签名 URL 有效期</div><div class="font-mono text-sm text-slate-700 mt-1" data-v-96602b99>3600 s</div></div></div>',2))])])):C.value==="mail"?(o(),l("div",Be,[e("div",ze,[e("div",Oe,[(o(),l("svg",Ne,[...s[20]||(s[20]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])]))]),s[21]||(s[21]=e("div",{class:"flex-1"},[e("div",{class:"text-sm font-semibold text-amber-800"},"生产环节邮件通知"),e("div",{class:"text-[11px] text-amber-600 mt-0.5"},"用于给目标厂家发送授权信息、公码批次、设备出货等通知邮件;账号告警也走此通道。")],-1))]),e("div",Re,[e("div",Ee,[s[23]||(s[23]=e("div",{class:"flex items-center gap-3"},[e("div",{class:"provider-logo",style:{background:"#f59e0b",width:"44px",height:"44px",fontSize:"13px"}},"SMTP"),e("div",null,[e("h3",{class:"text-base font-semibold text-slate-800"},"邮件服务"),e("p",{class:"text-xs text-slate-400 mt-0.5"},"SMTP 发信")])],-1)),e("div",He,[e("label",Ge,[s[22]||(s[22]=e("span",{class:"text-xs text-slate-500"},"启用",-1)),d(e("input",{"onUpdate:modelValue":s[1]||(s[1]=t=>a.enable=t),type:"checkbox",class:"toggle toggle-primary toggle-sm"},null,512),[[P,a.enable]])]),e("button",{class:"btn btn-primary btn-sm text-white",onClick:j},"保存")])]),s[32]||(s[32]=e("div",{class:"divider text-xs text-slate-400 my-3"},"发信配置",-1)),e("div",Fe,[e("div",Je,[s[24]||(s[24]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},[x("SMTP 主机 "),e("span",{class:"text-rose-500"},"*")])],-1)),d(e("input",{"onUpdate:modelValue":s[2]||(s[2]=t=>a.host=t),class:"input input-bordered input-sm font-mono",placeholder:"smtp.exmail.qq.com"},null,512),[[_,a.host]])]),e("div",Qe,[s[25]||(s[25]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},[x("端口 "),e("span",{class:"text-rose-500"},"*")])],-1)),d(e("input",{"onUpdate:modelValue":s[3]||(s[3]=t=>a.port=t),class:"input input-bordered input-sm font-mono",placeholder:"465"},null,512),[[_,a.port]])]),e("div",Ze,[s[26]||(s[26]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},"加密方式")],-1)),d(e("select",{"onUpdate:modelValue":s[4]||(s[4]=t=>a.secure=t),class:"select select-bordered select-sm"},[(o(),l(g,null,k(z,t=>e("option",{key:t,value:t},n(t),9,We)),64))],512),[[J,a.secure]])]),e("div",Xe,[s[27]||(s[27]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},"发件人显示名")],-1)),d(e("input",{"onUpdate:modelValue":s[5]||(s[5]=t=>a.fromName=t),class:"input input-bordered input-sm",placeholder:"云岩科技"},null,512),[[_,a.fromName]])]),e("div",Ye,[s[28]||(s[28]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},[x("发信账号 "),e("span",{class:"text-rose-500"},"*")])],-1)),d(e("input",{"onUpdate:modelValue":s[6]||(s[6]=t=>a.user=t),class:"input input-bordered input-sm font-mono",placeholder:"noreply@yunyan.com"},null,512),[[_,a.user]])]),e("div",et,[s[29]||(s[29]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},[x("授权码 / 密码 "),e("span",{class:"lock-tag ml-1.5"},"🔒 加密存储")])],-1)),e("div",tt,[d(e("input",{"onUpdate:modelValue":s[7]||(s[7]=t=>a.pass=t),type:a._showPass?"text":"password",class:"input input-bordered input-sm w-full font-mono pr-14",placeholder:"留空保留原密文"},null,8,st),[[U,a.pass]]),e("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-slate-400 hover:text-slate-700",onClick:s[8]||(s[8]=t=>a._showPass=!a._showPass)},n(a._showPass?"隐藏":"显示"),1)])]),e("div",lt,[s[30]||(s[30]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},"默认抄送 (CC)")],-1)),d(e("input",{"onUpdate:modelValue":s[9]||(s[9]=t=>a.cc=t),class:"input input-bordered input-sm font-mono",placeholder:"多个邮箱用逗号分隔,可留空"},null,512),[[_,a.cc]])])]),s[33]||(s[33]=e("div",{class:"divider text-xs text-slate-400 my-4"},"测试发信",-1)),e("div",ot,[e("div",at,[s[31]||(s[31]=e("label",{class:"label py-1"},[e("span",{class:"label-text text-sm"},"测试收件邮箱")],-1)),d(e("input",{"onUpdate:modelValue":s[10]||(s[10]=t=>a.testTo=t),class:"input input-bordered input-sm font-mono",placeholder:"填一个邮箱,发送一封测试邮件验证配置"},null,512),[[_,a.testTo]])]),e("button",{class:"btn btn-outline btn-sm",onClick:O},"发送测试")])])])):C.value==="translate"?(o(),l("div",nt,[e("div",it,[e("div",dt,[(o(),l("svg",rt,[...s[34]||(s[34]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"},null,-1)])]))]),s[35]||(s[35]=e("div",{class:"flex-1"},[e("div",{class:"text-sm font-semibold text-teal-800"},"后台配置多语言同步"),e("div",{class:"text-[11px] text-teal-600 mt-0.5"},"应用文案、通知 / 邮件模板、公告等后台配置内容,按目标语种自动翻译,保证多语言版本一致。")],-1)),e("span",ut,"默认 "+n(D.value.name),1)]),s[38]||(s[38]=e("div",{class:"flex items-center justify-between mb-2"},[e("span",{class:"text-xs font-semibold text-slate-500"},[x("选择默认翻译服务 "),e("span",{class:"text-slate-400 font-normal"},"(后台多语言同步走此服务)")])],-1)),e("div",ct,[(o(!0),l(g,null,k(K,t=>(o(),l("div",{key:t.id,class:m(["provider-card",{active:h.value===t.id,"is-default":t.id===b.value}]),onClick:r=>h.value=t.id},[e("div",mt,[e("div",{class:"provider-logo",style:S({background:t.color})},n(t.short),5),t.enable?(o(),l("span",xt,"已配置")):(o(),l("span",vt,"未配置"))]),e("div",bt,n(t.name),1),e("div",yt,n(t.tag),1),e("label",{class:m(["default-pick",{on:t.id===b.value}]),onClick:A(r=>V(t.id),["stop"])},[e("input",{type:"radio",class:"radio radio-xs radio-primary",checked:t.id===b.value,onClick:A(r=>V(t.id),["stop"])},null,8,ft),e("span",null,n(t.id===b.value?"默认使用":"设为默认"),1)],10,ht)],10,pt))),128))]),e("div",gt,[e("div",kt,[e("div",_t,[e("div",{class:"provider-logo",style:S({background:c.value.color,width:"44px",height:"44px",fontSize:"13px"})},n(c.value.short),5),e("div",null,[e("h3",wt,n(c.value.name),1),e("p",Ct,n(c.value.tag)+" · 机器翻译",1)])]),e("div",St,[e("label",qt,[s[36]||(s[36]=e("span",{class:"text-xs text-slate-500"},"启用",-1)),d(e("input",{"onUpdate:modelValue":s[11]||(s[11]=t=>c.value.enable=t),type:"checkbox",class:"toggle toggle-primary toggle-sm"},null,512),[[P,c.value.enable]])]),e("button",{class:"btn btn-outline btn-sm",onClick:R},"测试连接"),h.value!==b.value?(o(),l("button",{key:0,class:"btn btn-ghost btn-sm text-indigo-600",onClick:s[12]||(s[12]=t=>V(h.value))},"设为默认")):u("",!0),e("button",{class:"btn btn-primary btn-sm text-white",onClick:j},"保存")])]),s[37]||(s[37]=e("div",{class:"divider text-xs text-slate-400 my-3"},"连接配置",-1)),e("div",Kt,[(o(!0),l(g,null,k(c.value.fields,t=>(o(),l("div",{key:t.key,class:m(["form-control",{"col-span-2":t.wide}])},[e("label",Mt,[e("span",Tt,[x(n(t.label),1),t.required?(o(),l("span",At,"*")):u("",!0),t.encrypted?(o(),l("span",Vt,"🔒 加密存储")):u("",!0)])]),e("div",It,[d(e("input",{"onUpdate:modelValue":r=>t.value=r,type:t.encrypted&&!t._show?"password":"text",class:m(["input input-bordered input-sm w-full",{"font-mono":t.mono,"pr-14":t.encrypted}]),placeholder:t.placeholder},null,10,jt),[[U,t.value]]),t.encrypted?(o(),l("button",{key:0,type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-slate-400 hover:text-slate-700",onClick:r=>t._show=!t._show},n(t._show?"隐藏":"显示"),9,Pt)):u("",!0)]),t.hint?(o(),l("span",Ut,n(t.hint),1)):u("",!0)],2))),128))])])])):u("",!0)])])]))}}),Ot=Q($t,[["__scopeId","data-v-96602b99"]]);export{Ot as default};