import{_ as a}from"./public.js?v=1764830988434";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{n as t}from"./page_layout.js?v=1764830988434";import{m as s,a as l}from"./config.js?v=1764830988434";import{dR as o,av as n,au as u,dZ as i,df as p,d5 as d}from"./naive.js?v=1764830988434";import{k as _,e as m,r,R as c,V as f,W as x,a3 as v,S as b,U as j,j as z,a4 as w,an as y}from"./vue.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";const C={class:"px-20px py-24px"},Q={class:"w-160px"},$={class:"w-160px"},h={class:"text-error"},g={key:0},q=_({__name:"quota-config",props:{data:{}},setup(_,{expose:q}){const k=_,{type:U,info:B,callback:M}=k.data,R=m({used:"0",size:0}),H=r("MB");return(()=>{const a=d(B,"quota.used",0);if(a>0){const e=t(a).split(" ");R.used=e[0],H.value=e[1]}R.size=d(B,"quota.size",0)})(),q({onConfirm:async({hide:a})=>{"site"!==U&&"ftp"!==U||await s({size:R.size,quota_type:U,path:d(B,"path","")}),"database"===U&&await l({size:R.size,db_name:d(B,"name","")}),null==M||M(),a()}}),(t,s)=>{const l=u,d=i,_=n,m=o,r=p,q=e,k=a;return f(),c("div",C,[x(q,{"label-width":"180"},{default:v(()=>[x(m,{label:t.$t("Component.Quota.index_6")},{default:v(()=>[b("div",Q,[x(_,null,{default:v(()=>[x(l,{value:j(R).used,"onUpdate:value":s[0]||(s[0]=a=>j(R).used=a),disabled:!0},null,8,["value"]),x(d,{class:"w-44px text-center"},{default:v(()=>[z(w(j(H)),1)]),_:1})]),_:1})])]),_:1},8,["label"]),x(m,{label:t.$t("Component.Quota.index_7")},{default:v(()=>[b("div",$,[x(_,null,{default:v(()=>[x(r,{value:j(R).size,"onUpdate:value":s[1]||(s[1]=a=>j(R).size=a),min:0,"show-button":!1},null,8,["value"]),x(d,{class:"w-44px text-center"},{default:v(()=>s[2]||(s[2]=[z("MB",-1)])),_:1,__:[2]})]),_:1})])]),_:1},8,["label"])]),_:1}),x(k,{class:"mt-8px"},{default:v(()=>[b("li",h,w(t.$t("Component.Quota.index_8")),1),b("li",null,w(t.$t("Component.Quota.index_9")),1),"database"!==j(U)?(f(),c("li",g,w(t.$t("Component.Quota.index_10")),1)):y("",!0),b("li",null,w(t.$t("Component.Quota.index_11")),1)]),_:1})])}}});export{q as default};
