import{o as i,c as p,w as c,b as r,a as t,u as s,f as d,g as l,D as f,t as _,F as h,h as v,i as k}from"./app-SC54XQDl.js";import{P as x}from"./app-BGgVpkqZ.js";import{i as P,c as V}from"./app-Ba7ZqSpq.js";import{_ as $}from"./app-CVQkwzlf.js";import{_ as w}from"./app-DFulsyXy.js";import{_ as C,a as u}from"./app-PrSv7rSt.js";import{_ as y}from"./app-T1ysvErZ.js";import{_ as I}from"./app-DWUwCFNm.js";import{D as B}from"./app-ZeVDYyDS.js";import"./app-yUrwy8EY.js";import"./app-DnXuoh8P.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-CCkWSX4Q.js";import"./app-CNHjdV6U.js";function b(){const{utils:m,Tea:e}=P(this);this.selectedProvider=null,this.accounts=[],this.accountId=0,this.changeProvider=function(){if(this.accountId=0,this.providerCode.length==0)return;let n=this,a=this.providers.$find(function(o,g){return g.code==n.providerCode});a!=null&&(this.selectedProvider=a,this.$post(".accountsWithCode").params({code:a.code}).success(function(o){this.accounts=o.data.accounts}))},this.addAccount=function(){let n=this;m.popup("/servers/certs/acme/accounts/createPopup?providerCode="+this.providerCode,{height:"24em",callback:function(){m.successToast("创建成功，已自动选中",1500,function(){n.$post(".accountsWithCode").params({code:n.providerCode}).success(function(a){n.accounts=a.data.accounts,n.accounts.length>0&&(n.accountId=n.accounts[0].id)})})}})}}const A=t("header",null,"创建用户",-1),D=t("td",{class:"title"},"用户邮箱 *",-1),N=t("p",{class:"comment"},"用于自动注册用户的邮箱。",-1),T=t("td",null,"所属证书服务商 *",-1),S={key:0},E={key:0},F={key:1},L={class:"ui fields inline"},U={key:0,class:"ui field"},W={class:"ui field"},q=t("td",null,"备注",-1),it={__name:"createPopup",setup(m){const e=V(new b);return(n,a)=>(i(),p(x,null,{default:c(()=>[A,r(w,{onSuccess:s(e).success,action:"$"},{default:c(()=>[r(B,null,{default:c(()=>[t("tbody",null,[t("tr",null,[D,t("td",null,[r($,{name:"email",maxlength:"100",autofocus:"",class:"w-full"}),N])]),t("tr",null,[T,t("td",null,[r(C,{name:"providerCode",modelValue:s(e).providerCode,"onUpdate:modelValue":a[0]||(a[0]=o=>s(e).providerCode=o),onChange:s(e).changeProvider},{default:c(()=>[r(u,{value:""},{default:c(()=>[d("[选择服务商]")]),_:1}),(i(!0),l(h,null,f(s(e).providers,o=>(i(),p(u,{value:o.code},{default:c(()=>[d(_(o.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue","onChange"])])]),s(e).selectedProvider!=null?(i(),l("tr",S,[t("td",null,[d("所属服务商账号 "),s(e).selectedProvider.requireEAB?(i(),l("span",E,"*")):(i(),l("em",F,"（可选）"))]),t("td",null,[t("div",L,[s(e).accounts.length>0?(i(),l("div",U,[r(C,{name:"accountId",modelValue:s(e).accountId,"onUpdate:modelValue":a[1]||(a[1]=o=>s(e).accountId=o)},{default:c(()=>[r(u,{value:"0"},{default:c(()=>[d("[选择账号]")]),_:1}),(i(!0),l(h,null,f(s(e).accounts,o=>(i(),p(u,{value:o.id},{default:c(()=>[d(_(o.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])):v("",!0),t("div",W,[t("a",{href:"",onClick:a[2]||(a[2]=k((...o)=>s(e).addAccount&&s(e).addAccount(...o),["prevent"]))},"[添加]")])])])])):v("",!0),t("tr",null,[q,t("td",null,[r(y,{name:"description",rows:"3",maxlength:"100",class:"w-full"})])])])]),_:1}),r(I)]),_:1},8,["onSuccess"])]),_:1}))}};export{it as default};
