2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
|
|
import{a4 as oe,R as ue,a0 as a,F as Y,k as $,am as me,r as g,c as le,$ as j,a8 as B,a9 as U,S as Q,Z as _e,ak as J,_ as pe,j as q,e as y,a6 as fe,s as b,o as Z,l as H,v as C,w as W,u as ge,t as be}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as ke}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{Y as Ae,i as R,T as ve,Z as ye,C as E,m as I,$ as he,a0 as K,a1 as Fe,h as X,a2 as xe,a3 as f,L as we,a4 as Se,l as ee}from"./index-BTglIPU2.js?v=1773287522785";import{g as De}from"./ssl-Bm8jcneQ.js?v=1773287522785";import{k as Ve,ad as se,B as qe,a1 as v,a3 as te,a4 as O,b as z,a9 as Pe,a8 as He,a7 as Ce,_ as $e,ah as Ne,al as Le,a6 as Ue}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{_ as ae}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{a as ne}from"./quota-CnIxokiE.js?v=1773287522785";import{c as Ee}from"./copy-D-wIKr0q.js?v=1773287522785";import{u as Me}from"./useLoading-CZ2gSAW7.js?v=1773287522785";const je=oe("yakpanelsub-account-store",()=>{const e=Ze(),{t}=ue(),c=async()=>{try{o(!0);const{message:l}=await Ae(e.search);R(l)&&(e.table.data=l.list,e.table.total=l.page.count,e.account_total=l.account_total)}finally{o(!1)}},{loading:_,setLoading:o}=Me(),u=async()=>{const{message:l}=await ve();R(l)&&(e.packageSourceList=l.list,e.packageList=l.list.map(p=>({label:p.package_name,value:p.package_id})),l.list.length>0&&(e.expendFormState.package_id=l.list[0].package_id,r(e.expendFormState.package_id)))},n=l=>{const{url:p,user:m,pass:h}=l;Ee("Access address: ".concat(p,"\nUsername: ").concat(m,"\ninit Password: ").concat(h))},d=async()=>{const l=await ye();if(R(l)){let p={};e.diskMountSourceList=l.message,e.diskMountPointList=l.message.map(m=>(m.is_default&&(p=m),{label:"".concat(m.mountpoint," (").concat(E(m.used),"/").concat(E(m.total),") ").concat(t("Account.Account.account_533924-7"),":").concat(m.is_group_quota?t("Account.Account.account_533924-5"):t("Account.Account.account_533924-6")),value:m.mountpoint})),l.message.length>0&&(e.expendFormState.mountpoint=p.mountpoint||l.message[0].mountpoint,e.currentChangeDisk=Object.keys(p).length===0?l.message[0]:p)}},r=async l=>{const p=e.packageSourceList.find(m=>m.package_id===l);if(p){const{package_name:m,disk_space_quota:h,monthly_bandwidth_limit:F,max_site_limit:w,max_database:V,php_start_children:N,php_max_children:s,remark:L}=p;e.wpForData.package_name=m,e.wpForData.disk_space_quota=h==0?{value:"",unlimited:!0}:{value:h/1024/1024,unlimited:!1},e.wpForData.monthly_bandwidth_limit=F==0?{value:"",unlimited:!0}:{value:F/1024/1024,unlimited:!1},e.wpForData.max_site_limit=w===0?{value:"",unlimited:!0}:{value:w,unlimited:!1},e.wpForData.max_database=V==0?{value:"",unlimited:!0}:{value:V,unlimited:!1},e.wpForData.php_start_children=N,e.wpForData.php_max_children=s,e.wpForData.remark=L}},i=async()=>{if(e.table.total>=30)return I.error(t("Account.Account.account_533924-9",[30])),!1;x(),await u(),await d(),e.addVisible=!0,e.isEdit=!1},A=async l=>{const{message:p}=await he({account_id:l});R(p)&&window.open(p.login_url+"?token="+p.token)};function k(){const{package_id:l,mountpoint:p}=e.expendFormState,{username:m,password:h,email:F,expire_date:w,remark:V}=e.acForData,{disk_space_quota:N,monthly_bandwidth_limit:s,max_site_limit:L,max_database:G,php_start_children:re,php_max_children:de}=e.wpForData;return Object.assign({},{username:m,password:h,email:F,expire_date:w,package_id:l,mountpoint:p,disk_space_quota:N.unlimited?0:String(Number(N.value)*1024*1024),monthly_bandwidth_limit:s.unlimited?0:String(Number(s.value)*1024*1024),max_site_limit:L.unlimited?0:L.value,max_database:G.unlimited?0:G.value,php_start_children:re,php_max_children:de,remark:V})}const D=async()=>{var h,F;e.domainForData.website_and_email==="yes"&&!e.isEdit&&await((h=e.accountDomainFormRef)==null?void 0:h.validate()),await((F=e.accountFormRef)==null?void 0:F.validate());const{domainForData:l,isSupportAuto:p}=e;if(!p&&e.domainForData.website_and_email==="yes"&&!e.isEdit)return I.error("Your domain name does not support Create a website and email"),!1;const m=k();
|