← Back
Editing: index30.js
import{_ as e}from"./index103.js?v=VERSION_NUMBER";import{_ as a}from"./index101.js?v=VERSION_NUMBER";import{k as t,r as i,c as n,e as s,aQ as r,ba as l,w as o,p as c,a4 as m,q as p,v as u,A as d,y as _,x as h,O as b}from"./base-lib.js?v=VERSION_NUMBER";import{ay as f,a8 as v,K as y,b_ as C,p as w,bZ as g,n as j,L as k,u as x,aM as R,a6 as E,A as L,w as T,R as D,N as I,e as O}from"./utils-lib.js?v=VERSION_NUMBER";import{o as A,b as V,a as P,N as B}from"./useMethods.js?v=VERSION_NUMBER";import{c as N,a as q,u as z}from"./column.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";const{refs:{customLimit:H,isRefreshTableList:J},getCurrentCon:K}=f(),M=t({search:"",isRefresh:!0}),S=i([]),Q=[{active:!0,label:"从仓库中拉取",type:"button",onClick:()=>{j({component:()=>k((()=>import("./index218.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"拉取镜像",area:64})}},{active:!1,label:"导入镜像",type:"button",onClick:()=>{j({component:()=>k((()=>import("./index219.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"导入镜像",area:43,btn:"导入"})}},{active:!1,label:"构建镜像",type:"button",onClick:()=>{j({component:()=>k((()=>import("./index220.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"构建镜像",area:54,btn:"提交"})}},{active:!1,label:"线上镜像",type:"button",onClick:()=>{j({component:()=>k((()=>import("./index29.js?v=VERSION_NUMBER").then((e=>e.a))),__vite__mapDeps([]),import.meta.url),title:"Docker线上镜像搜索",area:80})}},{active:!1,label:"清理镜像",type:"button",onClick:async()=>{j({component:()=>k((()=>import("./clear-confirm.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"清理镜像",area:35,btn:!0})}}],U=e=>{j({component:()=>k((()=>import("./index221.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"推送【".concat(e.name,"】到仓库"),area:43,btn:!0,compData:{row:e}})},W=e=>{j({component:()=>k((()=>import("./index222.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"导出【".concat(e.name,"】镜像"),area:43,btn:"导出",compData:{row:e}})},Z=async e=>{P({image:e.name})},F=v([{label:"删除项目",value:"delete",event:async(e,a,t,i,n)=>{const{label:s,value:r}=i,l=async(e,a)=>{const{id:t,name:i}=e;if("delete"===r){const e={id:t,name:i,force:"0"};return await g({data:JSON.stringify(e)})}};await e({title:"批量".concat(s,"镜像"),content:"批量".concat(s,"已选的镜像,是否继续操作!"),column:[{label:"镜像名",prop:"name"},N()],onConfirm:async()=>(await a(l),J.value=!0,!1)})}}]),G=async(e,a)=>{if(J.value=!1,a)return(async(e,a)=>{try{const t=e.toLowerCase(),i=["name","id","container"],n=S.value.filter((e=>{const a={...e,container:e.containers.map((e=>e.container_name)).join("")||""};return i.some((e=>{var i;return null==(i=a[e])?void 0:i.toLowerCase().includes(t)}))}));return{data:V({limit:a.limit,list:n,p:a.p})||[],total:n.length}}catch(t){return{data:[],total:0}}})(e.search,e);if(!M.isRefresh)return{data:V({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length};M.isRefresh=!1;const t=await y({request:C(),data:Array});return S.value=t,{data:V({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length}},X=(e,a)=>{setTimeout((()=>{H.value.images||((e,a)=>{setTimeout((()=>{e.value>900?a.value.limit=20:a.value.limit=10}),0)})(e,a)}),0)},Y={class:"relative"},$={class:"flex items-center"},ee=O(n({__name:"index",setup(t){const{refs:{isRefreshTableList:i}}=f(),{mainHeight:n}=x(),{BtOperation:v}=R({options:Q});let C=!1;const j=(e,a)=>{M.isRefresh=!0,e&&!isNaN(e)&&(H.value.p=e),a?(H.value.search=a,C=!0):C=!1,N()},{BtTable:k,BtPage:O,BtBatch:V,BtColumn:P,refresh:N,param:H}=E({request:e=>G(e,C),columns:[q(),{label:"ID",prop:"id",width:110,render:e=>{const a=e.id.slice(7);return s(r,{placement:"top"},{default:()=>s("div",{onClick:()=>L({value:e.id})},[a.slice(0,12)]),content:()=>s("div",null,[e.id])})}},{label:"镜像名",prop:"name",isCustom:!0},{label:"大小",prop:"size",width:100,isCustom:!0,render:e=>T(e.size)},{label:"创建时间",prop:"time",width:160,isCustom:!0,render:e=>D(e.time)},{label:"使用镜像的容器",prop:"used",minWidth:180,isCustom:!0,render:e=>1!==e.used?"--":I(e.containers)&&e.containers.length>0?s("span",{class:"flex items-center whitespace-pre-wrap gap-4 min-h-[3rem]"},[e.containers.map((e=>s(l,{class:"mr-1 cursor-pointer",type:"success",size:"small",onClick:()=>(async e=>{const a={id:e.container_id,name:e.container_name};await K(a.id),A(a)})(e)},{default:()=>[e.container_name]})))]):"--"},z([{onClick:Z,width:80,title:"创建容器"},{onClick:U,title:"推送"},{onClick:W,title:"导出"},{onClick:e=>(async(e,a)=>{const t={id:e.id,name:e.name,force:"0"};try{await w({type:"calc",title:"删除镜像【".concat(e.name,"】"),width:"35rem",content:"您真的要删除镜像【".concat(e.name,"】吗?")}),y({request:g({data:JSON.stringify(t)}),message:!0,success:()=>{a()}})}catch(i){}})(e,j),title:"删除"}])],extension:[F]});return o((()=>i.value),(e=>{e&&(j(),i.value=!1)})),c((async()=>{X(n,H)})),m((()=>{M.search="",M.isRefresh=!0,S.value=[]})),(t,i)=>{const r=a,l=e;return p(),u("div",Y,[s(l,null,{"header-left":d((()=>[_("div",$,[s(h(v)),_("a",{class:"ml-[1rem] bt-link",onClick:i[0]||(i[0]=(...e)=>h(B)&&h(B)(...e))},"需求反馈")])])),"header-right":d((()=>[s(r,{icon:"el-search",class:"!mr-[1rem] !w-[26rem]",modelValue:h(M).search,"onUpdate:modelValue":i[1]||(i[1]=e=>h(M).search=e),clearable:"",placeholder:"镜像名、ID、使用的容器",onIconClick:i[2]||(i[2]=e=>j(1,h(M).search)),onClear:i[3]||(i[3]=e=>j(1)),onKeyup:i[4]||(i[4]=b((e=>j(1,h(M).search)),["enter"]))},null,8,["modelValue"]),s(h(P))])),content:d((()=>[s(h(k),{key:"ImageTable","max-height":h(n)-220},null,8,["max-height"])])),"footer-left":d((()=>[s(h(V))])),"footer-right":d((()=>[s(h(O))])),popup:d((()=>i[5]||(i[5]=[]))),_:1})])}}}),[["__scopeId","data-v-71d635d4"]]);export{ee as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel