import{u as e,bq as a,P as l,K as s}from"./utils-lib.js?v=1761009159";import{s as t,g as o,e as n,T as u,C as r,aS as m,c as i,q as p,v as d,x as c,y as v}from"./base-lib.js?v=1761009159";import{u as b}from"./useController5.js?v=1761009159";import{o as h}from"./form-item.js?v=1761009159";import{E as w}from"./useMethod5.js?v=1761009159";import{p as x}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./site.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./useStore4.js?v=1761009159";import"./useController6.js?v=1761009159";const{payment:f}=e(),{localRow:g,cloneLocalForm:y,isRefreshLocalList:j}=t(b()),D={class:"p-[2rem]"},_=i({__name:"index",setup(e,{expose:i}){const{cloneLocalForm:_}=t(b()),{resetCloneLocalForm:P}=b(),{BtForm:V,submit:L}=s({data:()=>_.value,options:o(()=>{const e={type:"custom",key:"subDomain",render:()=>n(a,{label:" ",prop:"subDomain"},{default:()=>[n(u,{style:"min-width: 220px; max-width: 300px",modelValue:y.value.subDomain,"onUpdate:modelValue":e=>y.value.subDomain=e},{append:()=>n("span",null,[r("."),g.value.name])}),n(u,{style:"width: 120px",class:"ml-[1rem]",modelValue:y.value.subPath,"onUpdate:modelValue":e=>y.value.subPath=e,placeholder:"克隆路径"},{prepend:()=>n("span",null,[r("/")])}),n(m,{content:"空克隆路径意味着克隆在根目录中",placement:"top"},{default:()=>[n("span",{class:"svgtofont-el-warning !text-extraLarge ml-[1rem] !text-warning"},null)]})]}),rules:{subDomain:[{required:!0,message:"请输入子域名",trigger:"blur"}]}},l={type:"custom",render:()=>n(a,{label:" ",prop:"newDomain"},{default:()=>[n(u,{style:"width: 200px",modelValue:y.value.newDomain,"onUpdate:modelValue":e=>y.value.newDomain=e,placeholder:"新域名"},null),n(u,{style:"width: 120px",class:"ml-[1rem]",modelValue:y.value.newPath,"onUpdate:modelValue":e=>y.value.newPath=e,placeholder:"克隆路径"},{prepend:()=>n("span",null,[r("/")])}),n(m,{content:"空克隆路径意味着克隆在根目录中",placement:"top"},{default:()=>[n("span",{class:"svgtofont-el-warning !text-extraLarge ml-[1rem] !text-warning"},null)]})]}),rules:{newDomain:[{required:!0,message:"请输入新的域名",trigger:"blur"}]}};return[{type:"custom",render:()=>n(a,{label:"来源站点"},{default:()=>[n("span",null,[g.value.name])]})},{label:"目标站点",key:"method",type:"radio:button",options:[{label:"创建子域名",value:1},{label:"创建新域名",value:2}]},1===y.value.method?e:l,h("FastCGI缓存","cache_status",{attrs:{class:"!w-[100px]"}})]}),submit:async(e,a,l)=>{await a()}});return p(()=>{P()}),i({onConfirm:async e=>{await L(),(async e=>{"ltd"===f.value.authType?l({loading:"正在克隆站点...",request:w({domain:1===y.value.method?"".concat(y.value.subDomain,".").concat(g.value.name):y.value.newDomain,s_id:g.value.id,sub_path:1===y.value.method?y.value.subPath:y.value.newPath,enable_cache:y.value.cache_status?1:0}),message:!0,success:a=>{a.status&&(e(),j.value=!0)}}):x({disablePro:!0,sourceId:335})})(e)}}),(e,a)=>(d(),c("div",D,[n(v(V))]))}});export{_ as default};
