import{c as e,s as a,o as t,r as l,q as s,v as o,x as c,e as r,B as m,y as i,C as n,T as d,ab as u,a9 as p}from"./base-lib.js?v=1761009159";import{b as f,k as y}from"./utils-lib.js?v=1761009159";import{D as b}from"./ssl.js?v=1761009159";import{u as h}from"./useStore11.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const v={class:"p-2rem"},_=e({__name:"index",props:{compData:{default:()=>{}}},emits:["close"],setup(e,{expose:_,emit:D}){const g=e,x=D,{activeTabs:j,sslIsRefresh:V,testIsRefresh:w,encryptIsRefresh:I,otherIsRefresh:N}=a(h()),R=t({title:"",cycle:30}),q=l({cycle:[{required:!0,message:"请输入剩余天数",trigger:"blur"},{validator:(e,a,t)=>{/^[1-9]\d*$/.test(a)?t():t(new Error("请输入大于0的正整数"))},trigger:["blur","change"]}]});return s(()=>{(()=>{var e;if((null==(e=g.compData)?void 0:e.domainName)&&g.compData.domainName.length>0){const e=g.compData.domainName.slice(0,2).join("|"),a=g.compData.domainName.length>2?"|...":"";R.title="".concat(g.compData.title," (").concat(e).concat(a,")")}else R.title=g.compData.title})()}),_({onConfirm:async()=>{var e;let a;try{a=f().load("正在配置证书自动续期，请稍候...");const t=await b({index:g.compData.index,cycle:R.cycle,name:R.title});if(f().request(t),t.status){const a={ssl:()=>V.value=!0,test:()=>w.value=!0,encrypt:()=>I.value=!0,other:()=>N.value=!0};null==(e=a[j.value])||e.call(a),x("close")}}catch(t){}finally{a&&a.close()}}}),(e,a)=>{const t=d,l=u,s=y,f=p;return o(),c("div",v,[r(f,{rules:i(q),model:i(R),"label-width":"100px"},{default:m(()=>[r(l,{label:"证书"},{default:m(()=>[r(t,{class:"!w-[28rem]",modelValue:i(R).title,"onUpdate:modelValue":a[0]||(a[0]=e=>i(R).title=e),disabled:""},null,8,["modelValue"])]),_:1}),r(l,{label:"剩余天数",prop:"cycle"},{default:m(()=>[r(s,{modelValue:i(R).cycle,"onUpdate:modelValue":a[1]||(a[1]=e=>i(R).cycle=e),width:"14rem",textType:"天",min:"1",type:"number"},{append:m(()=>a[2]||(a[2]=[n(" 天 ",-1)])),_:1},8,["modelValue"])]),_:1})]),_:1},8,["rules","model"])])}}});export{_ as default};
