import{m as e,n as s}from"./wsl.js?v=20260328163632";import{t as a,x as t,l,cj as r}from"./utils-lib.js?v=20260328163632";import{g as m}from"./index49.js?v=20260328163632";import{k as n,r as i,c as u,o,V as p,_ as c,Y as d}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./index97.js?v=20260328163632";import"./index92.js?v=20260328163632";const v=n({__name:"index",setup(n,{expose:v}){const y=i([]),_={labelStyle:"min-width: 100px"},g=i({formAttrs:{labelWidth:"auto"},formItems:[]}),j=u((()=>({label:l("子系统名称"),attrs:_,ruleKey:"system_name",rules:[{required:!0,message:l("请选择子系统名称"),trigger:["blur","change"]}],children:[{key:"system_name",type:"select",attrs:{placeholder:l("请选择子系统名称"),class:"!w-[320px]",options:y.value}}]}))),x=u((()=>({label:l("子系统别名"),attrs:_,ruleKey:"name",rules:[{required:!0,message:l("请输入子系统别名"),trigger:["blur","change"]}],children:[{key:"name",type:"input",attrs:{class:"!w-[320px]",placeholder:l("请输入子系统别名")}}]}))),b=u((()=>(g.value.formItems=[j.value,x.value],g.value))),[f,h,w]=a(b);return o((()=>(async()=>{t({request:e({}),success:e=>{y.value=e.data.map((e=>({label:e.friendly+" ( ".concat(e.name," )"),value:e.name}))),y.value.length&&(h.value.system_name=y.value[0].value)}})})())),v({onConfirm:async()=>{var e;try{await(null==(e=w.value)?void 0:e.validate());return(await t({loading:l("正在安装，请稍后..."),request:s({system_name:h.value.system_name,name:h.value.name}),message:!0,success:e=>{e.status&&r(l("WSL安装日志"),{name:"install_wsl",onRefresh:m}),m()}})).status}catch(a){}}}),(e,s)=>(p(),c(d(f),{class:"p-20px"}))}});export{v as default};
