import{P as e,$ as a}from"./utils-lib.js?v=1761009159";import{c as s,r as l,o as r,v as d,x as o,e as t,B as i,z as m,y as u,a7 as n,T as p,ab as c,a9 as g}from"./base-lib.js?v=1761009159";import{modifyDirAuthPass as b,setDirAuth as _}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const f={class:"p-20px"},w={class:"w-280px"},V={class:"w-280px"},v={class:"w-280px"},x={class:"w-280px"},h=s({__name:"limit-form",props:{compData:{}},setup(s,{expose:h}){const j=s,{isEdit:q,siteId:U,row:y,getList:D}=j.compData,k=l(null),z=r({name:"",site_dir:"",username:"",password:""}),B={name:[{required:!0,message:"名称不能为空",trigger:"blur"},{min:3,message:"名称至少需要3个字符",trigger:"blur"}],site_dir:[{required:!0,message:"路径不能为空",trigger:"blur"}],username:[{required:!0,message:"用户名不能为空",trigger:"blur"},{min:3,message:"用户名至少需要3个字符",trigger:"blur"}],password:[{required:!0,message:"密码不能为空",trigger:"blur"},{min:3,message:"密码至少需要3个字符",trigger:"blur"}]};return q&&y&&(z.name=y.name,z.site_dir=y.site_dir),h({onConfirm:async a=>{var s;await(null==(s=k.value)?void 0:s.validate()),e({request:q?b({id:U,name:z.name,username:z.username,password:z.password}):_({...n(z),id:U}),loading:q?"修改中...":"添加中...",message:!0,success:()=>{null==D||D(),a&&a()}})}}),(e,s)=>{const l=p,r=c,n=g,b=a;return d(),o("div",f,[t(n,{ref_key:"formRef",ref:k,model:u(z),rules:B},{default:i(()=>[t(r,{label:"名称",prop:"name"},{default:i(()=>[m("div",w,[t(l,{modelValue:u(z).name,"onUpdate:modelValue":s[0]||(s[0]=e=>u(z).name=e),disabled:u(q),placeholder:"请输入名称"},null,8,["modelValue","disabled"])])]),_:1}),t(r,{label:"路径",prop:"site_dir"},{default:i(()=>[m("div",V,[t(l,{modelValue:u(z).site_dir,"onUpdate:modelValue":s[1]||(s[1]=e=>u(z).site_dir=e),disabled:u(q),placeholder:"请输入路径：/text/"},null,8,["modelValue","disabled"])])]),_:1}),t(r,{label:"用户名",prop:"username"},{default:i(()=>[m("div",v,[t(l,{modelValue:u(z).username,"onUpdate:modelValue":s[2]||(s[2]=e=>u(z).username=e),placeholder:"请输入用户名"},null,8,["modelValue"])])]),_:1}),t(r,{label:"密码",prop:"password"},{default:i(()=>[m("div",x,[t(l,{modelValue:u(z).password,"onUpdate:modelValue":s[3]||(s[3]=e=>u(z).password=e),placeholder:"请输入密码"},null,8,["modelValue"])])]),_:1})]),_:1},8,["model"]),t(b,{options:[{content:"目录设置加密访问后，会导致目录及子目录下的“反向代理”失效"},{content:"目录设置加密访问后，访问时需要输入账号密码才能访问"},{content:"例如我设置了加密访问 /test/ ,那我访问 http://aaa.com/test/ 时就要输入账号密码才能访问"}],class:"mt-4px"})])}}});export{h as default};
