import{_ as q}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{C as S}from"./index-BTglIPU2.js?v=1773287522785";import{m as V,a as U}from"./config-nDHibUqX.js?v=1773287522785";import{a1 as D,au as M,b as j,av as E,_ as L,g as m}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as P,e as T,r as Z,$ as g,Z as v,a0 as e,a9 as o,_ as i,S as a,j as z,aa as u,ak as A}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const F={class:"px-20px py-24px"},G={class:"w-160px"},H={class:"w-160px"},I={class:"text-error"},J={key:0},et=P({__name:"quota-config",props:{data:{}},setup(C,{expose:w}){const y=C,{type:_,info:p,callback:d}=y.data,n=T({used:"0",size:0}),c=Z("MB"),Q=()=>{const t=m(p,"quota.used",0);if(t>0){const l=S(t).split(" ");n.used=l[0],c.value=l[1]}n.size=m(p,"quota.size",0)},$=async({hide:t})=>{(_==="site"||_==="ftp")&&await V({size:n.size,quota_type:_,path:m(p,"path","")}),_==="database"&&await U({size:n.size,db_name:m(p,"name","")}),d==null||d(),t()};return Q(),w({onConfirm:$}),(t,s)=>{const l=j,f=E,x=M,b=D,h=L,B=N,k=q;return g(),v("div",F,[e(B,{"label-width":"180"},{default:o(()=>[e(b,{label:t.$t("Component.Quota.index_6")},{default:o(()=>[i("div",G,[e(x,null,{default:o(()=>[e(l,{value:a(n).used,"onUpdate:value":s[0]||(s[0]=r=>a(n).used=r),disabled:!0},null,8,["value"]),e(f,{class:"w-44px text-center"},{default:o(()=>[z(u(a(c)),1)]),_:1})]),_:1})])]),_:1},8,["label"]),e(b,{label:t.$t("Component.Quota.index_7")},{default:o(()=>[i("div",H,[e(x,null,{default:o(()=>[e(h,{value:a(n).size,"onUpdate:value":s[1]||(s[1]=r=>a(n).size=r),min:0,"show-button":!1},null,8,["value"]),e(f,{class:"w-44px text-center"},{default:o(()=>s[2]||(s[2]=[z("MB")])),_:1,__:[2]})]),_:1})])]),_:1},8,["label"])]),_:1}),e(k,{class:"mt-8px"},{default:o(()=>[i("li",I,u(t.$t("Component.Quota.index_8")),1),i("li",null,u(t.$t("Component.Quota.index_9")),1),a(_)!=="database"?(g(),v("li",J,u(t.$t("Component.Quota.index_10")),1)):A("",!0),i("li",null,u(t.$t("Component.Quota.index_11")),1)]),_:1})])}}});export{et as default};
