import{_ as t}from"./index105.js?v=1761009159";import{aP as e,n as a,Q as s,P as i,iG as l,iH as n,p as o,ap as r,hb as m,b2 as c,an as p}from"./utils-lib.js?v=1761009159";import{b as u,k as d,N as f}from"./useMethods.js?v=1761009159";import{c as h,a as _,u as v}from"./column.js?v=1761009159";import{o as b,r as y,c as g,w as j,a6 as k,v as C,x as R,e as w,B as x,z as B,y as E}from"./base-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const{refs:{isRefreshTemplateList:O}}=e(),T=b({isRefresh:!0}),D=y([]),P=[{active:!0,label:"添加",type:"button",onClick:()=>{d(()=>O.value=!0)}},{label:"需求反馈",type:"link",class:"ml-[2rem]",onClick:()=>{f()}}],q=(t={})=>a({component:()=>s(()=>import("./add-compose-template.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),title:"编辑Yaml模板",area:64,btn:"保存",compData:{row:t}}),L=async t=>{a({component:()=>s(()=>import("./pull-mirror-select-dialog.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:t,title:"拉取镜像",btn:"确定",area:60})},A=async t=>{try{const e=await i({request:l({id:t.id})});if(e.status)return void a({component:()=>s(()=>import("./clear-confirm.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),title:"删除编排模板【".concat(t.name,"】"),area:55,btn:!0,compData:{confirmMsg:"检测到编排模板【".concat(t.name,"】，已应用到容器编排【").concat(e.msg,"】"),confirmCheck:"删除编排模板【".concat(t.name,"】以及已应用的容器编排和创建的容器"),confirmEvent:async(e,a)=>{i({request:n({data:JSON.stringify({template_id:t.id,status:e})}),message:!0,success:()=>{a(),O.value=!0}})}}});await o({type:"calc",title:"删除编排模板【".concat(t.name,"】"),content:"删除编排模板【".concat(t.name,"】，是否继续操作？")}),i({request:n({data:JSON.stringify({template_id:t.id})}),message:!0,success:()=>O.value=!0})}catch(e){}},N=r([{label:"删除模板",value:"delete",event:async(t,e,a,s)=>{const{label:i,value:l}=s,o=async(t,e)=>{const{id:a}=t;if("delete"===l)return await n({data:JSON.stringify({template_id:a})})};await t({title:"批量".concat(i,"编排模板"),content:"批量".concat(i,"已选的编排模板，是否继续操作！"),column:[{label:"模板名",prop:"name"},h()],onConfirm:async()=>(await e(o),O.value=!0,!1)})}}]),I={class:"relative p-2rem"},J={class:"flex items-center"},S=g({__name:"index",setup(a){const{refs:{isRefreshTemplateList:s}}=e(),{BtOperation:l}=c({options:P});j(()=>s.value,t=>{s.value&&(T.isRefresh=!0,f())});const{BtTable:n,BtPage:o,BtBatch:r,BtColumn:d,refresh:f,param:h}=p({request:t=>(async t=>{if(O.value=!1,!T.isRefresh)return{data:u({limit:t.limit,list:D.value,p:t.p})||[],total:D.value.length};T.isRefresh=!1;const e=await i({request:m(),data:Array});return D.value=e,{data:u({limit:t.limit,list:D.value,p:t.p})||[],total:D.value.length}})(t),columns:[_(),{label:"模板名",prop:"name",minWidth:100},{label:"路径",prop:"path",minWidth:100,isCustom:!0},{label:"备注",prop:"remark",minWidth:100,isCustom:!0},v([{onClick:q,title:"编辑"},{onClick:L,width:60,title:"拉取镜像"},{onClick:A,title:"删除"}])],extension:[N]});return k(()=>{T.isRefresh=!0,D.value=[]}),(e,a)=>{const s=t;return C(),R("div",I,[w(s,null,{"header-left":x(()=>[B("div",J,[w(E(l))])]),"header-right":x(()=>[w(E(d))]),content:x(()=>[w(E(n),{key:"templateTable","max-height":410})]),"footer-left":x(()=>[w(E(r))]),"footer-right":x(()=>[w(E(o))]),popup:x(()=>a[0]||(a[0]=[])),_:1})])}}});export{S as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
