Files
FileRelay/web/assets/ConfigManagement-DKtU2SIn.js

2 lines
26 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{P as I,r as N,c as L,t as D,d as E,b as V,_,a as J}from"./Sonner.vue_vue_type_script_setup_true_lang-BwfWndxy.js";import{d as C,c as $,w as K,h as x,g,l as A,f as w,i as U,F as z,J as W,U as Q,z as o,k as T,u as l,V as Z,P as G,I as t,n as O,A as X,B as Y,v as P,Z as ee,o as le,T as H,j as a,C as r}from"./index-BhaIiTEj.js";import{_ as B,a as S,b as q}from"./CardTitle.vue_vue_type_script_setup_true_lang-DBp3brf1.js";import{_ as p}from"./Input.vue_vue_type_script_setup_true_lang-CD5fb2oW.js";import{_ as te}from"./Textarea.vue_vue_type_script_setup_true_lang-CwxB1PfH.js";import{_ as i}from"./Label.vue_vue_type_script_setup_true_lang-D-_Evs0_.js";import{c as se,a as ae}from"./Teleport-DV_BGdH0.js";import{u as oe,V as de,f as re,_ as ne,b as ue,c as ie,d as me,e as j}from"./SelectValue.vue_vue_type_script_setup_true_lang-Dkj-rl5_.js";import{d as pe,u as F}from"./useForwardExpose-CRFbVhil.js";import{_ as fe}from"./AdminLayout.vue_vue_type_script_setup_true_lang-B_6YVjYZ.js";import"./PopperContent-MQwziWLW.js";import"./utils-BNRHOSl8.js";var ve=C({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(k){const n=k,{primitiveElement:m,currentElement:f}=oe(),u=$(()=>n.checked??n.value);return K(u,(s,v)=>{if(!f.value)return;const y=f.value,c=window.HTMLInputElement.prototype,e=Object.getOwnPropertyDescriptor(c,"value").set;if(e&&s!==v){const d=new Event("input",{bubbles:!0}),h=new Event("change",{bubbles:!0});e.call(y,s),y.dispatchEvent(d),y.dispatchEvent(h)}}),(s,v)=>(g(),x(de,A({ref_key:"primitiveElement",ref:m},{...n,...s.$attrs},{as:"input"}),null,16))}}),R=ve,ge=C({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(k){const n=k,m=$(()=>typeof n.value=="object"&&Array.isArray(n.value)&&n.value.length===0&&n.required),f=$(()=>typeof n.value=="string"||typeof n.value=="number"||typeof n.value=="boolean"||n.value===null||n.value===void 0?[{name:n.name,value:n.value}]:typeof n.value=="object"&&Array.isArray(n.value)?n.value.flatMap((u,s)=>typeof u=="object"?Object.entries(u).map(([v,y])=>({name:`${n.name}[${s}][${v}]`,value:y})):{name:`${n.name}[${s}]`,value:u}):n.value!==null&&typeof n.value=="object"&&!Array.isArray(n.value)?Object.entries(n.value).map(([u,s])=>({name:`${n.name}[${u}]`,value:s})):[]);return(u,s)=>(g(),w(z,null,[U(" We render single input if it's required "),m.value?(g(),x(R,A({key:u.name},{...n,...u.$attrs},{name:u.name,value:u.value}),null,16,["name","value"])):(g(!0),w(z,{key:1},W(f.value,v=>(g(),x(R,A({key:v.name},{ref_for:!0},{...n,...u.$attrs},{name:v.name,value:v.value}),null,16,["name","value"]))),128))],2112))}}),be=ge;const[ye,ke]=se("SwitchRoot");var ce=C({__name:"SwitchRoot",props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:"on"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(k,{emit:n}){const m=k,f=n,{disabled:u}=Q(m),s=pe(m,"modelValue",f,{defaultValue:m.defaultValue,passive:m.modelValue===void 0});function v(){u.value||(s.value=!s.value)}const{forwardRef:y,currentElement:c}=F(),b=re(c),e=$(()=>m.id&&c.value?document.querySelector(`[for="${m.id}"]`)?.innerText:void 0);return ke({modelValue:s,toggleCheck:v,disabled:u}),(d,h)=>(g(),x(l(I),A(d.$attrs,{id:d.id,ref:l(y),role:"switch",type:d.as==="button"?"button":void 0,value:d.value,"aria-label":d.$attrs["aria-label"]||e.value,"aria-checked":l(s),"aria-required":d.required,"data-state":l(s)?"checked":"unchecked","data-disabled":l(u)?"":void 0,"as-child":d.asChild,as:d.as,disabled:l(u),onClick:v,onKeydown:Z(G(v,["prevent"]),["enter"])}),{default:o(()=>[T(d.$slots,"default",{modelValue:l(s)}),l(b)&&d.name?(g(),x(l(be),{key:0,type:"checkbox",name:d.name,disabled:l(u),required:d.required,value:d.value,checked:!!l(s)},null,8,["name","disabled","required","value","checked"])):U("v-if",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),xe=ce,we=C({__name:"SwitchThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(k){const n=ye();return F(),(m,f)=>(g(),x(l(I),{"data-state":l(n).modelValue?.value?"checked":"unchecked","data-disabled":l(n).disabled.value?"":void 0,"as-child":m.asChild,as:m.as},{default:o(()=>[T(m.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"]))}}),Ve=we;const M=C({__name:"Switch",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null]},disabled:{type:Boolean},id:{},value:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(k,{emit:n}){const m=k,f=n,u=N(m,"class"),s=ae(u,f);return(v,y)=>(g(),x(l(xe),A({"data-slot":"switch"},l(s),{class:l(L)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",m.class)}),{default:o(c=>[t(l(Ve),{"data-slot":"switch-thumb",class:O(l(L)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"))},{default:o(()=>[T(v.$slots,"thumb",X(Y(c)))]),_:2},1032,["class"])]),_:3},16,["class"]))}}),_e={class:"space-y-8"},Be={class:"flex items-center justify-between"},Se={class:"flex space-x-3"},qe={key:0,class:"flex items-center"},Ce={key:1,class:"flex items-center"},Ue={class:"grid grid-cols-1 xl:grid-cols-2 gap-6"},Ae={class:"flex items-center justify-between p-4 rounded-lg bg-muted/50"},Me={class:"flex items-center justify-between p-4 rounded-lg bg-muted/50"},$e={class:"flex items-center justify-between p-4 rounded-lg bg-muted/50"},Pe={key:0,class:"space-y-4 border rounded-lg p-6 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-950/20 dark:to-indigo-950/20"},je={key:1,class:"space-y-6 border rounded-lg p-6 bg-gradient-to-r from-green-50 to-emerald-50 dark:from-green-950/20 dark:to-emerald-950/20"},Te={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},he={class:"md:col-span-2"},Le={class:"md:col-span-2"},Ee={class:"flex items-center justify-between p-4 rounded-lg bg-white/80 dark:bg-gray-900/50"},ze={key:2,class:"space-y-6 border rounded-lg p-6 bg-gradient-to-r from-purple-50 to-violet-50 dark:from-purple-950/20 dark:to-violet-950/20"},He={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Xe=C({__name:"ConfigManagement",setup(k){const n=D,m=P(!1),f=P(""),u=P(),s=ee({site:{name:"",description:"",logo:""},upload:{max_file_size_mb:100,max_batch_files:20,max_retention_days:30,require_token:!1},storage:{type:"local",local:{path:"storage_data"},s3:{endpoint:"s3.amazonaws.com",region:"us-east-1",bucket:"file-relay-bucket",access_key:"your-access-key",secret_key:"your-secret-key",use_ssl:!1},webdav:{url:"https://dav.example.com",username:"user",password:"pass",root:"/file-relay"}},security:{pickup_code_length:6,pickup_fail_limit:5,admin_password_hash:"",jwt_secret:""},database:{path:"file_relay.db"},api_token:{enabled:!0,max_tokens:20,allow_admin_api:!1}}),v=async()=>{try{m.value=!0;const e=(await H.getConfig()).data.data;Object.assign(s,e),u.value=JSON.parse(JSON.stringify(s)),console.log("配置加载成功:",s)}catch(b){console.error("加载配置失败:",b),n.error("加载配置失败,请检查网络连接或重新登录")}finally{m.value=!1}},y=()=>{u.value&&(Object.assign(s,JSON.parse(JSON.stringify(u.value))),f.value="",n.success("表单已重置,配置已恢复到最后一次保存的状态"))},c=async()=>{try{m.value=!0;const b=JSON.parse(JSON.stringify(s));f.value&&(b.security.admin_password=f.value),await H.updateConfig(b),u.value=JSON.parse(JSON.stringify(s)),f.value="",n.success("配置保存成功")}catch(b){console.error("保存配置失败:",b),n.error(b.response?.data?.msg||"保存配置失败")}finally{m.value=!1}};return le(()=>{v()}),(b,e)=>(g(),x(fe,null,{default:o(()=>[a("div",_e,[a("div",Be,[e[29]||(e[29]=a("div",null,[a("h1",{class:"text-3xl font-bold tracking-tight"},"系统配置管理"),a("p",{class:"text-muted-foreground mt-2"},"管理系统的全局配置参数")],-1)),a("div",Se,[t(l(E),{variant:"outline",onClick:y,disabled:m.value,class:"min-w-20"},{default:o(()=>[...e[26]||(e[26]=[a("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),r(" 重置 ",-1)])]),_:1},8,["disabled"]),t(l(E),{onClick:c,disabled:m.value,class:"min-w-24"},{default:o(()=>[m.value?(g(),w("span",qe,[...e[27]||(e[27]=[a("svg",{class:"animate-spin -ml-1 mr-3 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),r(" 保存中... ",-1)])])):(g(),w("span",Ce,[...e[28]||(e[28]=[a("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1),r(" 保存配置 ",-1)])]))]),_:1},8,["disabled"])])]),a("div",Ue,[t(l(_),{class:"shadow-sm border-l-4 border-l-blue-500"},{default:o(()=>[t(l(B),null,{default:o(()=>[t(l(S),{class:"flex items-center"},{default:o(()=>[...e[30]||(e[30]=[a("svg",{class:"w-5 h-5 mr-2 text-blue-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9v-9m0-9v9"})],-1),r(" 站点配置 ",-1)])]),_:1}),t(l(q),null,{default:o(()=>[...e[31]||(e[31]=[r("配置站点基本信息和显示内容",-1)])]),_:1})]),_:1}),t(l(V),{class:"space-y-5"},{default:o(()=>[a("div",null,[t(l(i),{for:"siteName",class:"text-sm font-medium"},{default:o(()=>[...e[32]||(e[32]=[r("站点名称",-1)])]),_:1}),t(l(p),{id:"siteName",modelValue:s.site.name,"onUpdate:modelValue":e[0]||(e[0]=d=>s.site.name=d),placeholder:"输入站点名称,例如:文件暂存柜",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"siteDescription",class:"text-sm font-medium"},{default:o(()=>[...e[33]||(e[33]=[r("站点描述",-1)])]),_:1}),t(l(te),{id:"siteDescription",modelValue:s.site.description,"onUpdate:modelValue":e[1]||(e[1]=d=>s.site.description=d),placeholder:"输入站点描述,例如:临时文件中转服务",class:"mt-2 resize-none",rows:"3"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"siteLogo",class:"text-sm font-medium"},{default:o(()=>[...e[34]||(e[34]=[r("站点 Logo URL",-1)])]),_:1}),t(l(p),{id:"siteLogo",modelValue:s.site.logo,"onUpdate:modelValue":e[2]||(e[2]=d=>s.site.logo=d),placeholder:"输入站点 Logo 图片地址例如https://example.com/logo.png",class:"mt-2"},null,8,["modelValue"]),e[35]||(e[35]=a("p",{class:"text-xs text-muted-foreground mt-1"},"留空将使用默认图标,建议使用正方形图片",-1))])]),_:1})]),_:1}),t(l(_),{class:"shadow-sm border-l-4 border-l-green-500"},{default:o(()=>[t(l(B),null,{default:o(()=>[t(l(S),{class:"flex items-center"},{default:o(()=>[...e[36]||(e[36]=[a("svg",{class:"w-5 h-5 mr-2 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})],-1),r(" 上传配置 ",-1)])]),_:1}),t(l(q),null,{default:o(()=>[...e[37]||(e[37]=[r("配置文件上传的限制和规则",-1)])]),_:1})]),_:1}),t(l(V),{class:"space-y-5"},{default:o(()=>[a("div",null,[t(l(i),{for:"maxFileSizeMB",class:"text-sm font-medium"},{default:o(()=>[...e[38]||(e[38]=[r("单文件大小限制 (MB)",-1)])]),_:1}),t(l(p),{id:"maxFileSizeMB",modelValue:s.upload.max_file_size_mb,"onUpdate:modelValue":e[3]||(e[3]=d=>s.upload.max_file_size_mb=d),modelModifiers:{number:!0},type:"number",min:"1",placeholder:"100",class:"mt-2"},null,8,["modelValue"]),e[39]||(e[39]=a("p",{class:"text-xs text-muted-foreground mt-1"},"允许上传的单个文件最大大小",-1))]),a("div",null,[t(l(i),{for:"maxBatchFiles",class:"text-sm font-medium"},{default:o(()=>[...e[40]||(e[40]=[r("批次最大文件数",-1)])]),_:1}),t(l(p),{id:"maxBatchFiles",modelValue:s.upload.max_batch_files,"onUpdate:modelValue":e[4]||(e[4]=d=>s.upload.max_batch_files=d),modelModifiers:{number:!0},type:"number",min:"1",placeholder:"20",class:"mt-2"},null,8,["modelValue"]),e[41]||(e[41]=a("p",{class:"text-xs text-muted-foreground mt-1"},"单次批量上传允许的最大文件数量",-1))]),a("div",null,[t(l(i),{for:"maxRetentionDays",class:"text-sm font-medium"},{default:o(()=>[...e[42]||(e[42]=[r("最大保存天数",-1)])]),_:1}),t(l(p),{id:"maxRetentionDays",modelValue:s.upload.max_retention_days,"onUpdate:modelValue":e[5]||(e[5]=d=>s.upload.max_retention_days=d),modelModifiers:{number:!0},type:"number",min:"1",placeholder:"30",class:"mt-2"},null,8,["modelValue"]),e[43]||(e[43]=a("p",{class:"text-xs text-muted-foreground mt-1"},"文件在系统中的最大保存时间",-1))]),a("div",Ae,[a("div",null,[t(l(i),{for:"requireToken",class:"text-base font-medium"},{default:o(()=>[...e[44]||(e[44]=[r("强制要求 Token",-1)])]),_:1}),e[45]||(e[45]=a("p",{class:"text-sm text-muted-foreground mt-1"},"上传时必须提供 API Token",-1))]),t(l(M),{id:"requireToken",modelValue:s.upload.require_token,"onUpdate:modelValue":e[6]||(e[6]=d=>s.upload.require_token=d)},null,8,["modelValue"])])]),_:1})]),_:1}),t(l(_),{class:"shadow-sm border-l-4 border-l-red-500"},{default:o(()=>[t(l(B),null,{default:o(()=>[t(l(S),{class:"flex items-center"},{default:o(()=>[...e[46]||(e[46]=[a("svg",{class:"w-5 h-5 mr-2 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})],-1),r(" 安全配置 ",-1)])]),_:1}),t(l(q),null,{default:o(()=>[...e[47]||(e[47]=[r("配置系统安全参数和验证规则",-1)])]),_:1})]),_:1}),t(l(V),{class:"space-y-5"},{default:o(()=>[a("div",null,[t(l(i),{for:"pickupCodeLength",class:"text-sm font-medium"},{default:o(()=>[...e[48]||(e[48]=[r("取件码长度",-1)])]),_:1}),t(l(p),{id:"pickupCodeLength",modelValue:s.security.pickup_code_length,"onUpdate:modelValue":e[7]||(e[7]=d=>s.security.pickup_code_length=d),modelModifiers:{number:!0},type:"number",min:"4",max:"20",placeholder:"6",class:"mt-2"},null,8,["modelValue"]),e[49]||(e[49]=a("p",{class:"text-xs text-muted-foreground mt-1"},"生成取件码的字符长度4-20位",-1))]),a("div",null,[t(l(i),{for:"pickupFailLimit",class:"text-sm font-medium"},{default:o(()=>[...e[50]||(e[50]=[r("取件失败限制次数",-1)])]),_:1}),t(l(p),{id:"pickupFailLimit",modelValue:s.security.pickup_fail_limit,"onUpdate:modelValue":e[8]||(e[8]=d=>s.security.pickup_fail_limit=d),modelModifiers:{number:!0},type:"number",min:"1",placeholder:"5",class:"mt-2"},null,8,["modelValue"]),e[51]||(e[51]=a("p",{class:"text-xs text-muted-foreground mt-1"},"连续取件失败后锁定的次数阈值",-1))]),a("div",null,[t(l(i),{for:"adminPassword",class:"text-sm font-medium"},{default:o(()=>[...e[52]||(e[52]=[r("管理员密码",-1)])]),_:1}),t(l(p),{id:"adminPassword",modelValue:f.value,"onUpdate:modelValue":e[9]||(e[9]=d=>f.value=d),type:"password",placeholder:"留空表示不修改密码",class:"mt-2"},null,8,["modelValue"]),e[53]||(e[53]=a("p",{class:"text-xs text-muted-foreground mt-1"}," 留空表示不修改当前密码,输入新密码将更新管理员登录密码 ",-1))])]),_:1})]),_:1}),t(l(_),{class:"shadow-sm border-l-4 border-l-purple-500"},{default:o(()=>[t(l(B),null,{default:o(()=>[t(l(S),{class:"flex items-center"},{default:o(()=>[...e[54]||(e[54]=[a("svg",{class:"w-5 h-5 mr-2 text-purple-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1),r(" API Token 配置 ",-1)])]),_:1}),t(l(q),null,{default:o(()=>[...e[55]||(e[55]=[r("配置 API Token 功能和权限控制",-1)])]),_:1})]),_:1}),t(l(V),{class:"space-y-6"},{default:o(()=>[a("div",Me,[a("div",null,[t(l(i),{for:"apiTokenEnabled",class:"text-base font-medium"},{default:o(()=>[...e[56]||(e[56]=[r("启用 API Token",-1)])]),_:1}),e[57]||(e[57]=a("p",{class:"text-sm text-muted-foreground mt-1"},"允许使用 API Token 进行身份验证",-1))]),t(l(M),{id:"apiTokenEnabled",modelValue:s.api_token.enabled,"onUpdate:modelValue":e[10]||(e[10]=d=>s.api_token.enabled=d)},null,8,["modelValue"])]),a("div",{class:O(["space-y-5",{"opacity-50":!s.api_token.enabled}])},[a("div",null,[t(l(i),{for:"maxTokens",class:"text-sm font-medium"},{default:o(()=>[...e[58]||(e[58]=[r("最大 Token 数量",-1)])]),_:1}),t(l(p),{id:"maxTokens",modelValue:s.api_token.max_tokens,"onUpdate:modelValue":e[11]||(e[11]=d=>s.api_token.max_tokens=d),modelModifiers:{number:!0},type:"number",min:"1",placeholder:"20",class:"mt-2",disabled:!s.api_token.enabled},null,8,["modelValue","disabled"]),e[59]||(e[59]=a("p",{class:"text-xs text-muted-foreground mt-1"}," 系统中最多可以创建的 API Token 数量 ",-1))]),a("div",$e,[a("div",null,[t(l(i),{for:"allowAdminAPI",class:"text-base font-medium"},{default:o(()=>[...e[60]||(e[60]=[r("允许管理员权限",-1)])]),_:1}),e[61]||(e[61]=a("p",{class:"text-sm text-muted-foreground mt-1"},"允许 Token 访问管理员接口",-1))]),t(l(M),{id:"allowAdminAPI",modelValue:s.api_token.allow_admin_api,"onUpdate:modelValue":e[12]||(e[12]=d=>s.api_token.allow_admin_api=d),disabled:!s.api_token.enabled},null,8,["modelValue","disabled"])])],2)]),_:1})]),_:1}),t(l(_),{class:"xl:col-span-2 shadow-sm border-l-4 border-l-orange-500"},{default:o(()=>[t(l(B),null,{default:o(()=>[t(l(S),{class:"flex items-center"},{default:o(()=>[...e[62]||(e[62]=[a("svg",{class:"w-5 h-5 mr-2 text-orange-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"})],-1),r(" 存储配置 ",-1)])]),_:1}),t(l(q),null,{default:o(()=>[...e[63]||(e[63]=[r("配置文件存储方式和参数",-1)])]),_:1})]),_:1}),t(l(V),{class:"space-y-6"},{default:o(()=>[a("div",null,[t(l(i),{class:"text-sm font-medium"},{default:o(()=>[...e[64]||(e[64]=[r("存储类型",-1)])]),_:1}),t(l(ne),{modelValue:s.storage.type,"onUpdate:modelValue":e[13]||(e[13]=d=>s.storage.type=d),class:"mt-2"},{default:o(()=>[t(l(ue),null,{default:o(()=>[t(l(ie),{placeholder:"选择存储类型"})]),_:1}),t(l(me),null,{default:o(()=>[t(l(j),{value:"local"},{default:o(()=>[...e[65]||(e[65]=[r("本地存储",-1)])]),_:1}),t(l(j),{value:"s3"},{default:o(()=>[...e[66]||(e[66]=[r("S3 兼容存储",-1)])]),_:1}),t(l(j),{value:"webdav"},{default:o(()=>[...e[67]||(e[67]=[r("WebDAV",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),s.storage.type==="local"?(g(),w("div",Pe,[e[70]||(e[70]=a("h4",{class:"font-semibold text-lg flex items-center"},[a("svg",{class:"w-5 h-5 mr-2 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})]),r(" 本地存储配置 ")],-1)),a("div",null,[t(l(i),{for:"localPath",class:"text-sm font-medium"},{default:o(()=>[...e[68]||(e[68]=[r("存储路径",-1)])]),_:1}),t(l(p),{id:"localPath",modelValue:s.storage.local.path,"onUpdate:modelValue":e[14]||(e[14]=d=>s.storage.local.path=d),placeholder:"storage_data",class:"mt-2"},null,8,["modelValue"]),e[69]||(e[69]=a("p",{class:"text-xs text-muted-foreground mt-1"},"相对或绝对路径,用于保存上传的文件",-1))])])):U("",!0),s.storage.type==="s3"?(g(),w("div",je,[e[78]||(e[78]=a("h4",{class:"font-semibold text-lg flex items-center"},[a("svg",{class:"w-5 h-5 mr-2 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 12l2 2 4-4"})]),r(" S3 存储配置 ")],-1)),a("div",Te,[a("div",null,[t(l(i),{for:"s3Endpoint",class:"text-sm font-medium"},{default:o(()=>[...e[71]||(e[71]=[r("Endpoint",-1)])]),_:1}),t(l(p),{id:"s3Endpoint",modelValue:s.storage.s3.endpoint,"onUpdate:modelValue":e[15]||(e[15]=d=>s.storage.s3.endpoint=d),placeholder:"s3.amazonaws.com",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"s3Region",class:"text-sm font-medium"},{default:o(()=>[...e[72]||(e[72]=[r("Region",-1)])]),_:1}),t(l(p),{id:"s3Region",modelValue:s.storage.s3.region,"onUpdate:modelValue":e[16]||(e[16]=d=>s.storage.s3.region=d),placeholder:"us-east-1",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"s3Bucket",class:"text-sm font-medium"},{default:o(()=>[...e[73]||(e[73]=[r("Bucket",-1)])]),_:1}),t(l(p),{id:"s3Bucket",modelValue:s.storage.s3.bucket,"onUpdate:modelValue":e[17]||(e[17]=d=>s.storage.s3.bucket=d),placeholder:"file-relay-bucket",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"s3AccessKey",class:"text-sm font-medium"},{default:o(()=>[...e[74]||(e[74]=[r("Access Key",-1)])]),_:1}),t(l(p),{id:"s3AccessKey",modelValue:s.storage.s3.access_key,"onUpdate:modelValue":e[18]||(e[18]=d=>s.storage.s3.access_key=d),placeholder:"your-access-key",class:"mt-2"},null,8,["modelValue"])]),a("div",he,[t(l(i),{for:"s3SecretKey",class:"text-sm font-medium"},{default:o(()=>[...e[75]||(e[75]=[r("Secret Key",-1)])]),_:1}),t(l(p),{id:"s3SecretKey",modelValue:s.storage.s3.secret_key,"onUpdate:modelValue":e[19]||(e[19]=d=>s.storage.s3.secret_key=d),type:"password",placeholder:"your-secret-key",class:"mt-2"},null,8,["modelValue"])]),a("div",Le,[a("div",Ee,[a("div",null,[t(l(i),{for:"s3UseSSL",class:"text-base font-medium"},{default:o(()=>[...e[76]||(e[76]=[r("使用 SSL",-1)])]),_:1}),e[77]||(e[77]=a("p",{class:"text-sm text-muted-foreground mt-1"},"启用 HTTPS 连接加密",-1))]),t(l(M),{id:"s3UseSSL",modelValue:s.storage.s3.use_ssl,"onUpdate:modelValue":e[20]||(e[20]=d=>s.storage.s3.use_ssl=d)},null,8,["modelValue"])])])])])):U("",!0),s.storage.type==="webdav"?(g(),w("div",ze,[e[83]||(e[83]=a("h4",{class:"font-semibold text-lg flex items-center"},[a("svg",{class:"w-5 h-5 mr-2 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5.636 18.364a9 9 0 010-12.728m12.728 0a9 9 0 010 12.728m-9.9-2.829a5 5 0 010-7.07m7.072 0a5 5 0 010 7.07M13 12a1 1 0 11-2 0 1 1 0 012 0z"})]),r(" WebDAV 存储配置 ")],-1)),a("div",He,[a("div",null,[t(l(i),{for:"webdavUrl",class:"text-sm font-medium"},{default:o(()=>[...e[79]||(e[79]=[r("WebDAV URL",-1)])]),_:1}),t(l(p),{id:"webdavUrl",modelValue:s.storage.webdav.url,"onUpdate:modelValue":e[21]||(e[21]=d=>s.storage.webdav.url=d),placeholder:"https://dav.example.com",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"webdavRoot",class:"text-sm font-medium"},{default:o(()=>[...e[80]||(e[80]=[r("根目录",-1)])]),_:1}),t(l(p),{id:"webdavRoot",modelValue:s.storage.webdav.root,"onUpdate:modelValue":e[22]||(e[22]=d=>s.storage.webdav.root=d),placeholder:"/file-relay",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"webdavUsername",class:"text-sm font-medium"},{default:o(()=>[...e[81]||(e[81]=[r("用户名",-1)])]),_:1}),t(l(p),{id:"webdavUsername",modelValue:s.storage.webdav.username,"onUpdate:modelValue":e[23]||(e[23]=d=>s.storage.webdav.username=d),placeholder:"user",class:"mt-2"},null,8,["modelValue"])]),a("div",null,[t(l(i),{for:"webdavPassword",class:"text-sm font-medium"},{default:o(()=>[...e[82]||(e[82]=[r("密码",-1)])]),_:1}),t(l(p),{id:"webdavPassword",modelValue:s.storage.webdav.password,"onUpdate:modelValue":e[24]||(e[24]=d=>s.storage.webdav.password=d),type:"password",placeholder:"pass",class:"mt-2"},null,8,["modelValue"])])])])):U("",!0)]),_:1})]),_:1}),t(l(_),{class:"xl:col-span-2 shadow-sm border-l-4 border-l-indigo-500"},{default:o(()=>[t(l(B),null,{default:o(()=>[t(l(S),{class:"flex items-center"},{default:o(()=>[...e[84]||(e[84]=[a("svg",{class:"w-5 h-5 mr-2 text-indigo-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1),r(" 数据库配置 ",-1)])]),_:1}),t(l(q),null,{default:o(()=>[...e[85]||(e[85]=[r("配置 SQLite 数据库存储路径",-1)])]),_:1})]),_:1}),t(l(V),null,{default:o(()=>[a("div",null,[t(l(i),{for:"databasePath",class:"text-sm font-medium"},{default:o(()=>[...e[86]||(e[86]=[r("数据库文件路径",-1)])]),_:1}),t(l(p),{id:"databasePath",modelValue:s.database.path,"onUpdate:modelValue":e[25]||(e[25]=d=>s.database.path=d),placeholder:"file_relay.db",class:"mt-2"},null,8,["modelValue"]),e[87]||(e[87]=a("p",{class:"text-xs text-muted-foreground mt-1"},"SQLite 数据库文件的存储路径",-1))])]),_:1})]),_:1})]),t(l(J))])]),_:1}))}});export{Xe as default};