import"./rolldown-runtime-BM3Ffeng.js";import{D as e,O as t,a as n,ot as r,p as i}from"./element-plus-vendor-BF9PNysW.js";import{A as a,D as o,E as s,N as c,O as l,P as u,Pt as d,Xt as f,et as p,gt as m,ht as h,j as g,k as _,s as v}from"./vue-vendor-DMUmTARL.js";import{$t as y,Wt as b,or as x}from"./icons-vendor-Db5MGAkr.js";import{I as S,l as C}from"./index-kSn5YXd0.js";import{t as w}from"./pro-capability-BR-p0W7Z.js";import{t as T}from"./useCapability-DVpkmSeo.js";import{v as E,x as D,z as O}from"./admin-setting-DlllwIAe.js";import{t as k}from"./useAdminConfigPage-H7ClvMry.js";import{t as A}from"./ProBadge-C3e4Zz30.js";import{t as j}from"./AdminSettingLayout-CzCwKa9p.js";import{t as M}from"./route-block-D7Rwj2No.js";import{t as N}from"./AdminSettingSection-DspiL7_Z.js";import{t as P}from"./ProGuard-B3_o-Ekd.js";import{t as F}from"./ZInfoCard-B6aw3tMJ.js";var I={class:`flex h-full flex-col`},L={class:`el-form-item-tips`},R={class:`select-all`},z={class:`select-all`},B={class:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`},V={__name:`webdav-setting`,setup(M){let{isCapabilityEnabled:V}=T(),H=s(()=>V(w.webdav)),{configData:U,saveData:W,saveLoading:G}=k(D,O,void 0,{cacheKey:`admin-config-webdav`,ready:H}),{configData:K}=k(E,void 0,void 0,{cacheKey:`admin-config-site`,ready:H}),q={webdavEnable:!1,webdavProxy:!1},J=s(()=>U.value??q),Y=C(),X=s(()=>S(K.value?.forceBackendAddress||Y.serverAddress,`webdav`)),Z=v(),Q=()=>{Z.push(`/admin/user-list`)};return(s,v)=>{let S=i,C=t,T=r,E=F,D=N,O=j,k=e,M=n;return p(),a(`div`,I,[d(U)||!d(H)?m((p(),l(k,{key:0,ref:`settingFormRef`,model:d(J),"label-width":d(Y).adminForm.labelWidth,"label-position":d(Y).adminForm.labelPosition,size:d(Y).adminForm.size,class:`admin-form-label-style flex min-h-0 flex-1 flex-col`},{default:h(()=>[u(O,null,g({default:h(()=>[u(D,{pro:``,title:`WebDAV 设置`,icon:d(y),"icon-class":`bg-indigo-50 text-indigo-600`},{default:h(()=>[u(P,{capability:d(w).webdav},{default:h(()=>[u(C,{label:`启用`},{label:h(()=>[v[2]||=c(` 启用 WebDAV `,-1),u(A)]),default:h(()=>[u(S,{id:`webdavEnable`,modelValue:d(J).webdavEnable,"onUpdate:modelValue":v[0]||=e=>d(J).webdavEnable=e},null,8,[`modelValue`]),o(`div`,L,[o(`div`,null,[v[3]||=c(` 是否启用 webdav 功能, 启用后可通过 `,-1),o(`span`,R,f(d(X)),1),v[4]||=c(` 访问 webdav. `,-1)]),o(`div`,null,[v[5]||=c(` 或者可以访问指定存储源 `,-1),o(`span`,z,f(d(X))+`/存储源别名`,1)]),v[6]||=o(`br`,null,null,-1),v[7]||=o(`div`,null,` * 提示 1：受限于 webdav 协议，密码文件夹将无法访问（因为没有输入密码的地方，也不能放开不输入密码就能访问）。 `,-1),v[8]||=o(`div`,null,` * 提示 2：Windows 不支持 HTTP 协议的 WebDAV，如 Windows 使用请为 ZFile 配置 HTTPS. (如要启用 Windows HTTP WebDAV 支持，需修改注册表，请自行搜索修改方法)。 `,-1)])]),_:1}),u(C,{label:`WebDAV 下载代理`},{label:h(()=>[v[9]||=c(` 中转下载 `,-1),u(A)]),default:h(()=>[u(S,{id:`webdavProxy`,modelValue:d(J).webdavProxy,"onUpdate:modelValue":v[1]||=e=>d(J).webdavProxy=e},null,8,[`modelValue`]),v[10]||=o(`div`,{class:`el-form-item-tips`},[o(`div`,null,`启用：使用服务器中转下载，下载速度会受限于服务器带宽，兼容性更好。`),o(`div`,null,` 关闭：下载会 301 重定向到实际下载地址，但部分客户端可能不支持. 兼容性较差。 `)],-1)]),_:1}),u(E,{title:`WebDAV 账号密码已迁移至用户管理`,type:`info`,class:`mt-2`},{default:h(()=>[o(`div`,B,[v[12]||=o(`div`,{class:`min-w-0 break-words leading-relaxed`},[c(` WebDAV 账号密码现在按用户配置，请在「用户管理」中编辑对应用户。匿名访问请使用 `),o(`span`,{class:`select-all font-medium`},`guest`),c(` 用户名 + 任意密码访问。 `)],-1),u(T,{type:`primary`,icon:d(x),class:`shrink-0 self-start sm:self-auto`,onClick:Q},{default:h(()=>[...v[11]||=[c(` 前往用户管理 `,-1)]]),_:1},8,[`icon`])])]),_:1})]),_:1},8,[`capability`])]),_:1},8,[`icon`])]),_:2},[d(H)?{name:`footer`,fn:h(()=>[u(T,{class:`ml-auto`,type:`primary`,icon:d(b),onClick:d(W)},{default:h(()=>[...v[13]||=[c(`保存设置`,-1)]]),_:1},8,[`icon`,`onClick`])]),key:`0`}:void 0,d(H)?{name:`floatButton`,fn:h(()=>[u(T,{type:`primary`,icon:d(b),loading:d(G),size:`large`,class:`!rounded-full !px-5 shadow-lg`,onClick:d(W)},{default:h(()=>[...v[14]||=[c(` 保存 `,-1)]]),_:1},8,[`icon`,`loading`,`onClick`])]),key:`1`}:void 0]),1024)]),_:1},8,[`model`,`label-width`,`label-position`,`size`])),[[M,d(G)]]):_(``,!0)])}}};typeof M==`function`&&M(V);export{V as default};