import{aa as a}from"./wsl.js?v=20260328163632";import{u as e,l as t,K as l,dj as s,t as r,x as o}from"./utils-lib.js?v=20260328163632";import{u as i}from"./index50.js?v=20260328163632";import{B as m}from"./index85.js?v=20260328163632";import{B as p}from"./index84.js?v=20260328163632";import{k as n,a9 as u,r as d,c,O as h,V as v,_ as f,Y as x}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index97.js?v=20260328163632";const j=n({__name:"export-image",props:{compData:{default:()=>{}}},setup(n,{expose:j}){const b=n,{panel:y}=e(),{sitePath:g}=u(y.value),{sid:_}=i(),w={labelStyle:"min-width: 100px"},k=d({formAttrs:{labelWidth:"auto"},formItems:[]}),V=c((()=>({label:t("导出路径"),attrs:w,ruleKey:"path",rules:[l({message:t("请选择导出路径"),trigger:["blur","input"]})],children:[{type:"custom",key:"path",render:()=>h(m,{modelValue:C.value.path,"onUpdate:modelValue":a=>C.value.path=a,onIconClick:()=>s({type:"dir",path:g.value,callback:a=>C.value.path=a}),placeholder:t("请选择导出路径"),width:"220px",icon:"el-folder-opened"},null)}]}))),I=c((()=>({label:t("文件名"),attrs:w,ruleKey:"name",rules:[l({message:t("请选择文件名"),trigger:["blur","input"]})],children:[{type:"custom",key:"name\t",render:()=>h(p,{modelValue:C.value.name,"onUpdate:modelValue":a=>C.value.name=a,placeholder:t("请输入导出的文件名"),width:"220px","text-type":".tar"},null)}]}))),K=c((()=>(k.value.formItems=[V.value,I.value],k.value))),[B,C,D]=r(K);return j({onConfirm:async()=>{var e;try{await(null==(e=D.value)?void 0:e.validate());const{path:l,name:s}=C.value;return(await o({loading:t("正在导出镜像，请稍后..."),request:a({file_path:"".concat(l).concat(l.endsWith("/")?"":"/").concat(s,".tar"),image_name:b.compData.name,sid:_.value}),message:!0})).status}catch(l){}}}),(a,e)=>(v(),f(x(B),{class:"p-20px pr-40px"}))}});export{j as default};
