import{_ as e}from"./index102.js?v=1753954525509";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang25.js?v=1753954525509";import{b as t,c as s,f as r,_ as l}from"./public.js?v=1753954525509";import{_ as o}from"./index.vue_vue_type_script_setup_true_lang9.js?v=1753954525509";import{m as n,gu as d,w as i,gv as p}from"./page_layout.js?v=1753954525509";import{_ as c,ay as m}from"./naive.js?v=1753954525509";import{k as _,P as u,e as f,r as k,U as v,V as x,W as h,Q as y,a2 as j,X as g,j as D,a3 as T,ah as b,N as w}from"./vue.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509";import"./theme-chrome.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./file2.js?v=1753954525509";import"./common.js?v=1753954525509";import"./index96.js?v=1753954525509";const U={class:"px-16px"},C={class:"flex mb-10px"},R={class:"flex-1"},$={class:"ml-16px"},L={class:"text-error"},z=_({__name:"index",setup(e,{expose:a}){const{t:_}=u(),z=f({path:"",checked:!1}),P=k([]),{keys:B,table:H,columns:K}=t([{type:"selection",width:40},{key:"project_name",title:_("Docker.Template.add.index_9")},{key:"conf_file",title:_("Docker.Template.add.index_10")},{key:"remark",title:_("Docker.Template.add.index_3")}]),{loading:N,setLoading:Q}=s(),S=async()=>{if(""!==z.path.trim())try{Q(!0);const{message:e}=await d({path:z.path,sub_dir:z.checked?"1":"0"});H.data=i(e)?e:[]}finally{B.value=[],P.value=[],Q(!1)}else n.error(_("Docker.Template.add.index_11"))},V=(e,a)=>{P.value=a};return a({onConfirm:async()=>{0!==P.value.length?await p({template_list:w(P.value)}):n.error(_("Docker.Template.add.index_12"))}}),(e,a)=>{const t=c,s=o,n=m,d=r,i=l;return v(),x("div",U,[h("div",C,[h("div",R,[y(s,{value:g(z).path,"onUpdate:value":a[1]||(a[1]=e=>g(z).path=e),placeholder:e.$t("Docker.Template.add.index_5")},{suffix:j((()=>[y(t,{checked:g(z).checked,"onUpdate:checked":a[0]||(a[0]=e=>g(z).checked=e),class:"mr-8px"},{default:j((()=>[D(T(e.$t("Docker.Template.add.index_6")),1)])),_:1},8,["checked"])])),_:1},8,["value","placeholder"])]),h("div",$,[y(n,{type:"primary",onClick:S},{default:j((()=>[D(T(e.$t("Public.Btn.Search")),1)])),_:1})])]),y(d,{"checked-row-keys":g(B),"onUpdate:checkedRowKeys":[a[2]||(a[2]=e=>b(B)?B.value=e:null),V],"row-key":"project_name",loading:g(N),"loading-num":7,columns:g(K),data:g(H).data},null,8,["checked-row-keys","loading","columns","data"]),y(i,{class:"mt-20px"},{default:j((()=>[h("li",L,T(e.$t("Docker.Template.add.index_8",[g(B).length])),1)])),_:1})])}}}),P={class:"p-16px"},B=_({__name:"index",emits:["refresh"],setup(t,{expose:s,emit:r}){const l=r,{t:o}=u(),n=k(),d=k("normal"),i=[{key:"normal",label:o("Docker.Template.add.index_13"),isLazy:!0,data:{onRefresh:()=>{l("refresh")}},component:a},{key:"command",label:o("Docker.Template.add.index_14"),isLazy:!0,data:{onRefresh:()=>{l("refresh")}},component:z}];return s({onConfirm:async()=>{var e;await(null==(e=n.value)?void 0:e.onConfirm()),l("refresh")}}),(a,t)=>{const s=e;return v(),x("div",P,[y(s,{ref_key:"tabsRef",ref:n,value:g(d),"onUpdate:value":t[0]||(t[0]=e=>b(d)?d.value=e:null),options:i},null,8,["value"])])}}});export{B as default};
