← Back
Editing: index225.js
import{_ as t}from"./index103.js?v=VERSION_NUMBER";import{ay as e,n as a,L as s,K as i,i9 as l,ia as n,p as o,a8 as r,gI as m,aM as c,a6 as p}from"./utils-lib.js?v=VERSION_NUMBER";import{b as u,k as d,N as f}from"./useMethods.js?v=VERSION_NUMBER";import{c as _,a as h,u as v}from"./column.js?v=VERSION_NUMBER";import{k as b,r as y,c as g,w as j,a4 as k,q as C,v as R,e as w,A as x,y as E,x as O}from"./base-lib.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";const{refs:{isRefreshTemplateList:T}}=e(),q=b({isRefresh:!0}),B=y([]),D=[{active:!0,label:"添加",type:"button",onClick:()=>{d((()=>T.value=!0))}},{label:"需求反馈",type:"link",class:"ml-[2rem]",onClick:()=>{f()}}],L=(t={})=>a({component:()=>s((()=>import("./add-compose-template.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"编辑Yaml模板",area:64,btn:"保存",compData:{row:t}}),A=async t=>{a({component:()=>s((()=>import("./pull-mirror-select-dialog.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),compData:t,title:"拉取镜像",btn:"确定",area:60})},I=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=VERSION_NUMBER")),__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(),T.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:()=>T.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"},_()],onConfirm:async()=>(await e(o),T.value=!0,!1)})}}]),P={class:"relative p-2rem"},J={class:"flex items-center"},M=g({__name:"index",setup(a){const{refs:{isRefreshTemplateList:s}}=e(),{BtOperation:l}=c({options:D});j((()=>s.value),(t=>{s.value&&(q.isRefresh=!0,f())}));const{BtTable:n,BtPage:o,BtBatch:r,BtColumn:d,refresh:f,param:_}=p({request:t=>(async t=>{if(T.value=!1,!q.isRefresh)return{data:u({limit:t.limit,list:B.value,p:t.p})||[],total:B.value.length};q.isRefresh=!1;const e=await i({request:m(),data:Array});return B.value=e,{data:u({limit:t.limit,list:B.value,p:t.p})||[],total:B.value.length}})(t),columns:[h(),{label:"模板名",prop:"name",minWidth:100},{label:"路径",prop:"path",minWidth:100,isCustom:!0},{label:"备注",prop:"remark",minWidth:100,isCustom:!0},v([{onClick:L,title:"编辑"},{onClick:A,width:60,title:"拉取镜像"},{onClick:I,title:"删除"}])],extension:[N]});return k((()=>{q.isRefresh=!0,B.value=[]})),(e,a)=>{const s=t;return C(),R("div",P,[w(s,null,{"header-left":x((()=>[E("div",J,[w(O(l))])])),"header-right":x((()=>[w(O(d))])),content:x((()=>[w(O(n),{key:"templateTable","max-height":410})])),"footer-left":x((()=>[w(O(r))])),"footer-right":x((()=>[w(O(o))])),popup:x((()=>a[0]||(a[0]=[]))),_:1})])}}});export{M as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel