mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-08-17 21:25:47 +02:00
2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
import{y as F}from"./index-Cr9LAN38.js?v=1777002971908";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-C1I51b-0.js?v=1777002971908";import{y as T,a0 as B,t as C,P}from"./FileIcon-BRzsOvVw.js?v=1777002971908";import{k as V,R as q,r as D,i as E,al as K,e as L,$ as _,a8 as v,a9 as n,a0 as a,S as o,_ as d,ak as S,X as $,N as j}from"./vue-core-BlDeWrD6.js?v=1777002971908";import{a1 as G,b as I,a6 as O}from"./naive-ui-rbGGSgyg.js?v=1777002971908";import"./prismjs-BZPoR7_J.js?v=1777002971908";import"./files-k9g1xcH5.js?v=1777002971908";import"./copy-CiK19cyX.js?v=1777002971908";const X={class:"w-310px"},A={class:"w-310px"},H={class:"w-310px"},J={class:"w-310px"},ae=V({__name:"Decompress",setup(Q,{expose:w}){const{t:l}=q(),r=D(!1),f=E("fileStore"),{choosedKeys:g,currentPath:b,fileList:y}=f,m=T(y.value,g.value)[0],c=K("formRef"),e=L({sfile:"",dfile:"",type:"zip",coding:"UTF-8",password:""}),h=[{label:"UTF-8",value:"UTF-8"},{label:"GBK",value:"gb18030"}],x={sfile:{trigger:["input","blur"],validator:()=>e.sfile.trim()===""?new Error(l("file.decompressModal.validation.fileNameRequired")):!0},dfile:{trigger:["input","blur"],validator:()=>e.dfile.trim()===""?new Error(l("file.decompressModal.validation.pathRequired")):!0}},R=(i,s)=>{if(r.value=!0,e.dfile=b.value,e.coding="UTF-8",i){e.sfile=i,s==="tar.gz"?e.type="tar":e.type="zip";return}e.sfile=m.path,m.ext==="tar.gz"?e.type="tar":e.type="zip"},U=async()=>{var i;await((i=c.value)==null?void 0:i.validate()),await B(j(e)),C(f),P(f)};return w({open:R}),(i,s)=>{const u=I,p=G,k=O,M=N,z=F;return _(),v(z,{show:o(r),"onUpdate:show":s[4]||(s[4]=t=>$(r)?r.value=t:null),title:o(l)("file.decompressModal.title"),width:"520",footer:!0,onConfirm:U},{default:n(()=>[a(M,{ref_key:"formRef",ref:c,class:"p-24px",model:o(e),rules:x},{default:n(()=>[a(p,{label:o(l)("file.decompressModal.fileName"),path:"sfile"},{default:n(()=>[d("div",X,[a(u,{value:o(e).sfile,"onUpdate:value":s[0]||(s[0]=t=>o(e).sfile=t)},null,8,["value"])])]),_:1},8,["label"]),a(p,{label:o(l)("file.decompressModal.compressPath"),path:"dfile"},{default:n(()=>[d("div",A,[a(u,{value:o(e).dfile,"onUpdate:value":s[1]||(s[1]=t=>o(e).dfile=t)},null,8,["value"])])]),_:1},8,["label"]),o(e).type==="zip"?(_(),v(p,{key:0,label:o(l)("file.decompressModal.password")},{default:n(()=>[d("div",H,[a(u,{value:o(e).password,"onUpdate:value":s[2]||(s[2]=t=>o(e).password=t),placeholder:o(l)("file.decompressModal.passwordPlaceholder")},null,8,["value","placeholder"])])]),_:1},8,["label"])):S("",!0),a(p,{label:o(l)("file.decompressModal.encoding"),"show-feedback":!1},{default:n(()=>[d("div",J,[a(k,{value:o(e).coding,"onUpdate:value":s[3]||(s[3]=t=>o(e).coding=t),options:h},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}});export{ae as default};
|