import{_ as U,u as F,k,T as q,an as y,e as S,w as t,b as O,o as _,g as a,c as h,h as A,i as g,t as c,F as I,j as N}from"./app-D7zH3Nl5.js";import{a as T}from"./apiAdmin-B6-2qm0d.js";import{S as E}from"./SaveOutlined-jkHaLNj1.js";import{F as M,_ as V}from"./index-DZxk72Vu.js";import{S as j,a as L}from"./index-DnrvHM6n.js";import{I as P,_ as R}from"./index-Cu62pBdq.js";import{B as z}from"./useFlexGapSupport-CpBR-RD-.js";import{_ as G,a as H}from"./index-Cv7zOydE.js";const J={components:{SaveOutlined:E},setup(){const{addEditRequestAdmin:l,loading:o,rules:p}=T(),{t:e}=F(),m=k({}),f=k([]);return q(()=>{axiosAdmin.get(y("settings/storage")).then(r=>{m.value=r.data.storage,f.value=r.data.regions})}),{loading:o,rules:p,awsRegions:f,formData:m,onSubmit:()=>{l({url:y("settings/storage/update"),data:m.value,successMessage:e("storage_settings.updated"),success:r=>{}})}}}},Q={key:0};function W(l,o,p,e,m,f){const d=L,r=j,n=V,u=H,i=G,v=P,w=R,D=O("SaveOutlined"),B=z,C=M;return _(),S(C,{layout:"vertical"},{default:t(()=>[a(i,{gutter:16},{default:t(()=>[a(u,{span:24},{default:t(()=>[a(n,{label:l.$t("storage_settings.storage"),name:"filesystem",help:e.rules.filesystem?e.rules.filesystem.message:null,validateStatus:e.rules.filesystem?"error":null},{default:t(()=>[a(r,{value:e.formData.filesystem,"onUpdate:value":o[0]||(o[0]=s=>e.formData.filesystem=s),placeholder:l.$t("common.select_default_text",[l.$t("storage_settings.storage")])},{default:t(()=>[a(d,{key:"local",value:"local"},{default:t(()=>[g(c(l.$t("storage_settings.local")),1)]),_:1}),a(d,{key:"aws",value:"aws"},{default:t(()=>[g(c(l.$t("storage_settings.aws")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1}),e.formData.filesystem=="aws"?(_(),h("div",Q,[a(i,{gutter:16},{default:t(()=>[a(u,{xs:24,sm:24,md:12,lg:12},{default:t(()=>[a(n,{label:l.$t("storage_settings.aws_key"),name:"key",help:e.rules.key?e.rules.key.message:null,validateStatus:e.rules.key?"error":null,class:"required"},{default:t(()=>[a(v,{value:e.formData.key,"onUpdate:value":o[1]||(o[1]=s=>e.formData.key=s),placeholder:l.$t("common.placeholder_default_text",[l.$t("storage_settings.aws_key")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1}),a(u,{xs:24,sm:24,md:12,lg:12},{default:t(()=>[a(n,{label:l.$t("storage_settings.aws_secret"),name:"secret",help:e.rules.secret?e.rules.secret.message:null,validateStatus:e.rules.secret?"error":null,class:"required"},{default:t(()=>[a(w,{value:e.formData.secret,"onUpdate:value":o[2]||(o[2]=s=>e.formData.secret=s),placeholder:l.$t("common.placeholder_default_text",[l.$t("storage_settings.aws_secret")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1}),a(i,{gutter:16},{default:t(()=>[a(u,{xs:24,sm:24,md:12,lg:12},{default:t(()=>[a(n,{label:l.$t("storage_settings.aws_region"),name:"region",help:e.rules.region?e.rules.region.message:null,validateStatus:e.rules.region?"error":null},{default:t(()=>[a(r,{value:e.formData.region,"onUpdate:value":o[3]||(o[3]=s=>e.formData.region=s),placeholder:l.$t("common.select_default_text",[l.$t("storage_settings.aws_region")]),allowClear:!0,optionFilterProp:"label","show-search":""},{default:t(()=>[(_(!0),h(I,null,N(e.awsRegions,(s,b)=>(_(),S(d,{key:b,value:b,label:s},{default:t(()=>[g(c(s),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1}),a(u,{xs:24,sm:24,md:12,lg:12},{default:t(()=>[a(n,{label:l.$t("storage_settings.aws_bucket"),name:"bucket",help:e.rules.bucket?e.rules.bucket.message:null,validateStatus:e.rules.bucket?"error":null,class:"required"},{default:t(()=>[a(v,{value:e.formData.bucket,"onUpdate:value":o[4]||(o[4]=s=>e.formData.bucket=s),placeholder:l.$t("common.placeholder_default_text",[l.$t("storage_settings.aws_bucket")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1})])):A("",!0),a(i,{gutter:16},{default:t(()=>[a(u,{xs:24,sm:24,md:24,lg:24},{default:t(()=>[a(n,null,{default:t(()=>[a(B,{type:"primary",onClick:e.onSubmit,loading:e.loading},{icon:t(()=>[a(D)]),default:t(()=>[g(" "+c(l.$t("common.update")),1)]),_:1},8,["onClick","loading"])]),_:1})]),_:1})]),_:1})]),_:1})}const te=U(J,[["render",W]]);export{te as S};
