import{aa as a,l as e,am as t,a4 as s,$ as l,ac as o,x as r,A as i,a7 as n,z as u,M as c,a2 as m}from"./utils-lib.js?v=20260328163632";import{B as d}from"./index91.js?v=20260328163632";import{U as p,r as _}from"./wsl.js?v=20260328163632";import{u as f,a as g}from"./index50.js?v=20260328163632";import{p as y}from"./useMethod9.js?v=20260328163632";import{r as h,k,w as v,o as b,J as w,V as j,_ as x,a3 as R,Y as C,O as A,N as E,j as O,Z as T}from"./base-lib.js?v=20260328163632";import{b as z,B,aT as D,au as L}from"./naive-ui.js?v=20260328163632";const{sid:P}=f(),V=h(!1),q=h(""),F=h([]),I=a=>a.id,M=async()=>{if(!q.value)return c.error(e("镜像名称不能为空"));const a=await y(q.value);a&&a.status&&(q.value="")},U=()=>i({title:e("导入镜像"),area:440,component:()=>n((()=>import("./import-image.js?v=20260328163632")),[],import.meta.url),showFooter:!0,btn:[e("导入"),e("取消")]}),K=()=>i({title:e("构建镜像"),area:540,component:()=>n((()=>import("./build-image.js?v=20260328163632")),[],import.meta.url),showFooter:!0}),S=h({columns:[a(),{title:e("镜像名"),key:"name",render:a=>a.name+(a.tag?":"+a.tag:"")},{title:e("大小"),key:"size",render:a=>t(a.size)},s([{onClick:async a=>{i({title:e("导出镜像【{0}】",[a.name+(a.tag?":"+a.tag:"")]),area:"auto",component:()=>n((()=>import("./export-image.js?v=20260328163632")),[],import.meta.url),showFooter:!0,compData:a,btn:[e("导出"),e("取消")]})},title:e("导出")},{onClick:async a=>{await u({title:e("删除镜像【{0}】",[a.name]),content:e("您真的要删除镜像【{0}】吗？",[a.name]),type:"calc"}),r({loading:e("正在删除镜像，请稍后..."),request:_({image_id:a.id,sid:P.value}),message:!0,success:Z})},title:e("删除")}])],data:[]}),[J,N]=l(S),{BtBatch:Y}=o({tableRef:N,checkedRowKeys:F,options:[{label:e("删除镜像"),value:"delete",event:g}]}),Z=async()=>{r({loading:V,request:p({sid:P.value}),success:a=>{S.value.data=Array.isArray(a.data)?a.data:[]}})},$=()=>{V.value=!1,S.value.data=[]},G=k({__name:"index",setup(a){const{isRefreshList:t}=f();return v((()=>t.value),(a=>{a&&(Z(),t.value=!1)})),b(Z),w($),(a,t)=>{const s=z,l=B,o=D,r=L;return j(),x(C(m),null,{"header-left":R((()=>[A(r,{align:"center",class:"!gap-10px"},{default:R((()=>[A(s,{value:C(q),"onUpdate:value":t[0]||(t[0]=a=>E(q)?q.value=a:null),placeholder:C(e)("请输入镜像名称，支持官方和第三方镜像(如:library/nginx:latest)"),class:"!w-380px"},null,8,["value","placeholder"]),A(l,{type:"primary",onClick:C(M)},{default:R((()=>[O(T(C(e)("拉取镜像")),1)])),_:1},8,["onClick"]),A(o,{href:"https://1ms.run/search?query=nginx",target:"_blank"},{default:R((()=>[O(T(C(e)("查找镜像"))+" >>",1)])),_:1}),A(l,{class:"ml-10pxs",onClick:C(U)},{default:R((()=>[O(T(C(e)("导入镜像")),1)])),_:1},8,["onClick"]),A(l,{onClick:C(K)},{default:R((()=>[O(T(C(e)("构建镜像")),1)])),_:1},8,["onClick"])])),_:1})])),"header-right":R((()=>[A(C(d),{onRefresh:C(Z)},null,8,["onRefresh"])])),content:R((()=>[A(C(J),{"checked-row-keys":C(F),"onUpdate:checkedRowKeys":t[1]||(t[1]=a=>E(F)?F.value=a:null),"row-key":C(I),loading:C(V)},null,8,["checked-row-keys","row-key","loading"])])),"footer-left":R((()=>[A(C(Y))])),_:1})}}}),H=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{Z as g,H as i};
