import{_ as U,b as q,r as k,E as F,bc as y,e as O,o as _,f as S,w as t,c as a,i as g,t as c,g as h,F as A,h as E,J as N,a2 as I,a3 as M,a1 as T,n as V,v as J,a0 as L,a7 as P,B as R,a8 as j}from"./app-DGDivIsO.js";import{a as z}from"./apiAdmin-D4J8O5cP.js";import{S as G}from"./SaveOutlined-saF8VQQc.js";const H={components:{SaveOutlined:G},setup(){const{addEditRequestAdmin:l,loading:s,rules:p}=z(),{t:e}=q(),d=k({}),f=k([]);return F(()=>{axiosAdmin.get(y("settings/storage")).then(n=>{d.value=n.data.storage,f.value=n.data.regions})}),{loading:s,rules:p,awsRegions:f,formData:d,onSubmit:()=>{l({url:y("settings/storage/update"),data:d.value,successMessage:e("storage_settings.updated"),success:n=>{}})}}}},Q={key:0};function W(l,s,p,e,d,f){const i=I,n=M,r=T,u=V,m=J,v=L,w=P,D=O("SaveOutlined"),B=R,C=j;return _(),S(C,{layout:"vertical"},{default:t(()=>[a(m,{gutter:16},{default:t(()=>[a(u,{span:24},{default:t(()=>[a(r,{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(n,{value:e.formData.filesystem,"onUpdate:value":s[0]||(s[0]=o=>e.formData.filesystem=o),placeholder:l.$t("common.select_default_text",[l.$t("storage_settings.storage")])},{default:t(()=>[a(i,{key:"local",value:"local"},{default:t(()=>[g(c(l.$t("storage_settings.local")),1)]),_:1}),a(i,{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(m,{gutter:16},{default:t(()=>[a(u,{xs:24,sm:24,md:12,lg:12},{default:t(()=>[a(r,{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":s[1]||(s[1]=o=>e.formData.key=o),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(r,{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":s[2]||(s[2]=o=>e.formData.secret=o),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(m,{gutter:16},{default:t(()=>[a(u,{xs:24,sm:24,md:12,lg:12},{default:t(()=>[a(r,{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(n,{value:e.formData.region,"onUpdate:value":s[3]||(s[3]=o=>e.formData.region=o),placeholder:l.$t("common.select_default_text",[l.$t("storage_settings.aws_region")]),allowClear:!0,optionFilterProp:"label","show-search":""},{default:t(()=>[(_(!0),h(A,null,E(e.awsRegions,(o,b)=>(_(),S(i,{key:b,value:b,label:o},{default:t(()=>[g(c(o),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(r,{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":s[4]||(s[4]=o=>e.formData.bucket=o),placeholder:l.$t("common.placeholder_default_text",[l.$t("storage_settings.aws_bucket")])},null,8,["value","placeholder"])]),_:1},8,["label","help","validateStatus"])]),_:1})]),_:1})])):N("",!0),a(m,{gutter:16},{default:t(()=>[a(u,{xs:24,sm:24,md:24,lg:24},{default:t(()=>[a(r,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 K=U(H,[["render",W]]);export{K as S};
