import{_ as e}from"./index107.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang24.js?v=1763625242172";import{c as t,d as s,h as o,_ as r}from"./public.js?v=1763625242172";import{_ as l}from"./index.vue_vue_type_script_setup_true_lang10.js?v=1763625242172";import{m as n,hB as d,x as i,hC as p}from"./page_layout.js?v=1763625242172";import{_ as c,aC as m}from"./naive.js?v=1763625242172";import{k as _,P as u,e as k,r as x,R as f,S as h,U as v,X as y,a3 as j,V as g,j as D,a4 as T,aj as b,N as w}from"./vue.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import"./index100.js?v=1763625242172";import"./theme-monokai.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./file.js?v=1763625242172";import"./common.js?v=1763625242172";import"./index98.js?v=1763625242172";const C={class:"px-16px"},R={class:"flex mb-10px"},U={class:"flex-1"},$={class:"ml-16px"},L={class:"text-error"},z=_({__name:"index",setup(e,{expose:a}){const{t:_}=u(),z=k({path:"",checked:!1}),B=x([]),{keys:P,table:S,columns:H}=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:K,setLoading:N}=s(),V=async()=>{if(""!==z.path.trim())try{N(!0);const{message:e}=await d({path:z.path,sub_dir:z.checked?"1":"0"});S.data=i(e)?e:[]}finally{P.value=[],B.value=[],N(!1)}else n.error(_("Docker.Template.add.index_11"))},X=(e,a)=>{B.value=a};return a({onConfirm:async()=>{0!==B.value.length?await p({template_list:w(B.value)}):n.error(_("Docker.Template.add.index_12"))}}),(e,a)=>{const t=c,s=l,n=m,d=o,i=r;return f(),h("div",C,[v("div",R,[v("div",U,[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"])]),v("div",$,[y(n,{type:"primary",onClick:V},{default:j((()=>[D(T(e.$t("Public.Btn.Search")),1)])),_:1})])]),y(d,{"checked-row-keys":g(P),"onUpdate:checkedRowKeys":[a[2]||(a[2]=e=>b(P)?P.value=e:null),X],"row-key":"project_name",loading:g(K),"loading-num":7,columns:g(H),data:g(S).data},null,8,["checked-row-keys","loading","columns","data"]),y(i,{class:"mt-20px"},{default:j((()=>[v("li",L,T(e.$t("Docker.Template.add.index_8",[g(P).length])),1)])),_:1})])}}}),B={class:"p-16px"},P=_({__name:"index",emits:["refresh"],setup(t,{expose:s,emit:o}){const r=o,{t:l}=u(),n=x(),d=x("normal"),i=[{key:"normal",label:l("Docker.Template.add.index_13"),isLazy:!0,data:{onRefresh:()=>{r("refresh")}},component:a},{key:"command",label:l("Docker.Template.add.index_14"),isLazy:!0,data:{onRefresh:()=>{r("refresh")}},component:z}];return s({onConfirm:async()=>{var e;await(null==(e=n.value)?void 0:e.onConfirm()),r("refresh")}}),(a,t)=>{const s=e;return f(),h("div",B,[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{P as default};
