import{_ as S}from"./index-BRQskX9P.js?v=1773287522785";import{_ as V}from"./index.vue_vue_type_script_setup_true_lang-CWBVpTDn.js?v=1773287522785";import{_ as z}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as K}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{_ as A}from"./index.vue_vue_type_script_setup_true_lang-CgKUoL60.js?v=1773287522785";import{m as b,ij as E,n as I,ik as P}from"./index-BTglIPU2.js?v=1773287522785";import{u as X}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as Z}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{al as q,B as F}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as T,R as D,e as G,r as x,$,Z as w,_ as d,a0 as l,a9 as _,S as t,j as g,aa as h,X as C,N as H}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import"./index-Cy3Gp9Hk.js?v=1773287522785";import"./theme-monokai-Bqt0uTuQ.js?v=1773287522785";import"./ace-CNnfDSio.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./file-B5PwfK2h.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-K4YGya6V.js?v=1773287522785";const J={class:"px-16px"},M={class:"flex mb-10px"},O={class:"flex-1"},Q={class:"ml-16px"},W={class:"text-error"},Y=T({__name:"index",setup(R,{expose:u}){const{t:s}=D(),e=G({path:"",checked:!1}),r=x([]),{keys:a,table:i,columns:f}=Z([{type:"selection",width:40},{key:"project_name",title:s("Docker.Template.add.index_9")},{key:"conf_file",title:s("Docker.Template.add.index_10")},{key:"remark",title:s("Docker.Template.add.index_3")}]),{loading:y,setLoading:c}=X(),p=async()=>{if(e.path.trim()===""){b.error(s("Docker.Template.add.index_11"));return}try{c(!0);const{message:o}=await E({path:e.path,sub_dir:e.checked?"1":"0"});i.data=I(o)?o:[]}finally{a.value=[],r.value=[],c(!1)}},k=(o,n)=>{r.value=n};return u({onConfirm:async()=>{if(r.value.length===0){b.error(s("Docker.Template.add.index_12"));return}await P({template_list:H(r.value)})}}),(o,n)=>{const B=q,L=A,U=F,j=K,N=z;return $(),w("div",J,[d("div",M,[d("div",O,[l(L,{value:t(e).path,"onUpdate:value":n[1]||(n[1]=m=>t(e).path=m),placeholder:o.$t("Docker.Template.add.index_5")},{suffix:_(()=>[l(B,{checked:t(e).checked,"onUpdate:checked":n[0]||(n[0]=m=>t(e).checked=m),class:"mr-8px"},{default:_(()=>[g(h(o.$t("Docker.Template.add.index_6")),1)]),_:1},8,["checked"])]),_:1},8,["value","placeholder"])]),d("div",Q,[l(U,{type:"primary",onClick:p},{default:_(()=>[g(h(o.$t("Public.Btn.Search")),1)]),_:1})])]),l(j,{"checked-row-keys":t(a),"onUpdate:checkedRowKeys":[n[2]||(n[2]=m=>C(a)?a.value=m:null),k],"row-key":"project_name",loading:t(y),"loading-num":7,columns:t(f),data:t(i).data},null,8,["checked-row-keys","loading","columns","data"]),l(N,{class:"mt-20px"},{default:_(()=>[d("li",W,h(o.$t("Docker.Template.add.index_8",[t(a).length])),1)]),_:1})])}}}),ee={class:"p-16px"},ye=T({__name:"index",emits:["refresh"],setup(R,{expose:u,emit:s}){const e=s,{t:r}=D(),a=x(),i=x("normal"),f=[{key:"normal",label:r("Docker.Template.add.index_13"),isLazy:!0,data:{onRefresh:()=>{e("refresh")}},component:V},{key:"command",label:r("Docker.Template.add.index_14"),isLazy:!0,data:{onRefresh:()=>{e("refresh")}},component:Y}];return u({onConfirm:async()=>{var c;await((c=a.value)==null?void 0:c.onConfirm()),e("refresh")}}),(c,p)=>{const k=S;return $(),w("div",ee,[l(k,{ref_key:"tabsRef",ref:a,value:t(i),"onUpdate:value":p[0]||(p[0]=v=>C(i)?i.value=v:null),options:f},null,8,["value"])])}}});export{ye as default};
