import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{a as t,at as n,ot as r}from"./element-plus-vendor-BF9PNysW.js";import{A as i,D as a,E as o,I as s,N as c,P as l,Pt as u,Tt as d,Xt as f,Z as p,et as m,gt as h,ht as g,k as _,qt as v,r as y}from"./vue-vendor-DMUmTARL.js";import{K as b,Na as x,ar as S,wa as C}from"./icons-vendor-Db5MGAkr.js";import{t as w}from"./_plugin-vue_export-helper-CWyGVBf-.js";import{t as T}from"./runtime-env-K07czKyS.js";import{t as E}from"./docker-meta-DxpjtDLZ.js";import{t as D}from"./RuntimeMountTable-BVcY2liv.js";import{t as O}from"./AdminSettingCard-DuOduG1o.js";import{t as k}from"./RuntimeDockerMeta-Dp-m2Po2.js";var A={key:0,id:`runtime-env`,class:`mt-8`},j={class:`mb-4 grid grid-cols-1 gap-4 sm:grid-cols-3`},M={class:`docker-stat-card group`},N={class:`flex items-start justify-between`},P={class:`mt-2`},F={class:`flex h-10 w-10 items-center justify-center rounded-lg bg-blue-50 text-blue-500 dark:bg-blue-500/20 dark:text-blue-300`},I={class:`docker-stat-card group`},L={class:`flex items-start justify-between`},R={class:`mt-2 text-xl font-semibold text-primary`},z={class:`flex h-10 w-10 items-center justify-center rounded-lg bg-green-50 text-green-500 dark:bg-emerald-500/20 dark:text-emerald-300`},B={class:`docker-stat-card group`},V={class:`flex items-start justify-between`},H=s({__name:`RuntimeEnvSection`,setup(e){let s=T(),{env:w,loading:H}=y(s),U=E(),{meta:W,loading:G}=y(U),K=d(!1),q=o(()=>!!w.value?.inContainer),J=o(()=>{let e=w.value?.runtime||`unknown`;return{docker:`Docker`,podman:`Podman`,kubernetes:`Kubernetes`,containerd:`containerd`,lxc:`LXC`,unknown:`未知容器`}[e]||e}),Y=o(()=>(w.value?.criticalPaths??[]).filter(e=>(e.severity===`HIGH`||e.severity===`MEDIUM`)&&(e.status===`UNMOUNTED`||e.status===`READ_ONLY`||e.status===`ANON_VOLUME`)).length),X=async()=>{K.value=!0;try{s.loaded=!1,await Promise.all([s.ensureLoaded(),U.fetch()])}finally{K.value=!1}};return p(()=>{s.ensureLoaded(),U.ensureLoaded()}),(e,o)=>{let s=x,d=r,p=n,y=O,T=t;return q.value?(m(),i(`div`,A,[l(y,{title:`运行环境`,icon:u(b),"icon-class":`bg-blue-50 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300`,description:`容器运行时类型、Docker 元数据与关键路径映射检测`},{action:g(()=>[l(d,{size:`small`,link:``,type:`primary`,loading:K.value,onClick:X},{default:g(()=>[l(s,{class:`mr-1 h-4 w-4`}),o[0]||=c(` 刷新 `,-1)]),_:1},8,[`loading`])]),default:g(()=>[h((m(),i(`div`,j,[a(`div`,M,[a(`div`,N,[a(`div`,null,[o[1]||=a(`p`,{class:`text-xs font-medium text-secondary`},`容器运行时`,-1),a(`div`,P,[l(p,{size:`small`,type:`info`},{default:g(()=>[c(f(J.value),1)]),_:1})])]),a(`div`,F,[l(u(b),{class:`h-5 w-5`})])])]),a(`div`,I,[a(`div`,L,[a(`div`,null,[o[2]||=a(`p`,{class:`text-xs font-medium text-secondary`},`挂载点数`,-1),a(`p`,R,f(u(w)?.bindMounts.length??0),1)]),a(`div`,z,[l(u(C),{class:`h-5 w-5`})])])]),a(`div`,B,[a(`div`,V,[a(`div`,null,[o[3]||=a(`p`,{class:`text-xs font-medium text-secondary`},`关键路径异常`,-1),a(`p`,{class:v([`mt-2 text-xl font-semibold`,Y.value>0?`text-red-500`:`text-primary`])},f(Y.value),3)]),a(`div`,{class:v([`flex h-10 w-10 items-center justify-center rounded-lg`,Y.value>0?`bg-red-50 text-red-500 dark:bg-red-500/20 dark:text-red-300`:`bg-blue-50 text-blue-500 dark:bg-blue-500/20 dark:text-blue-300`])},[l(u(S),{class:`h-5 w-5`})],2)])])])),[[T,u(H)]]),l(k,{"docker-meta":u(W),loading:u(G)},null,8,[`docker-meta`,`loading`]),l(D,{env:u(w),"docker-meta":u(W),loading:u(H)||u(G)},null,8,[`env`,`docker-meta`,`loading`])]),_:1},8,[`icon`])])):_(``,!0)}}}),U=e({default:()=>W}),W=w(H,[[`__scopeId`,`data-v-aa5a3d76`]]);export{U as n,W as t};