import{$n as e,L as t,N as n,P as r,Rt as i,Vr as a,X as o,Xn as s,ar as c,er as l,gr as u,hr as d,jr as f,nr as p,sr as m,vr as h,wr as g,zr as _}from"./index-kchFdHMQ.js";import{n as v,t as y}from"./VRow-4ngSW_Us.js";import{t as b}from"./_plugin-vue_export-helper-BDNMzG2s.js";function x(){let e=f([]),t=f(!1),n=f(1),r=f(20),a=f(0),o=f(``);async function s(){t.value=!0;try{let t=await i.get(`/servers/`,{page:n.value,per_page:r.value,search:o.value||void 0});e.value=t.items||[],a.value=t.total||0}catch(t){throw e.value=[],a.value=0,t}finally{t.value=!1}}let c;d(()=>clearTimeout(c));function l(){clearTimeout(c),c=setTimeout(()=>{n.value=1,s()},300)}function u(e){n.value=e,s()}function p(e){r.value=e,n.value=1,s()}return{servers:e,loading:t,page:n,itemsPerPage:r,total:a,search:o,loadServers:s,onSearch:l,onPageChange:u,onItemsPerPageChange:p}}function S(e){switch(e){case`online`:return`success`;case`offline`:return`error`;default:return`warning`}}function C(e){switch(e){case`online`:return`在线`;case`offline`:return`离线`;default:return`未知`}}function w(e){if(!e)return`—`;let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=Date.now()-t.getTime();return n<6e4?`刚刚`:n<36e5?`${Math.floor(n/6e4)} 分钟前`:n<864e5?`${Math.floor(n/36e5)} 小时前`:`${Math.floor(n/864e5)} 天前`}var T={class:`text-caption text-medium-emphasis mb-1`,style:{"font-size":`14px`,"letter-spacing":`0.5px`,"text-transform":`uppercase`}},E=b(m({__name:`StatCardsRow`,props:{items:{}},setup(i){return(d,f)=>(u(),l(y,null,{default:g(()=>[(u(!0),p(s,null,h(i.items,(i,s)=>(u(),l(v,{key:s,cols:`6`,sm:`3`},{default:g(()=>[c(n,{elevation:`0`,rounded:`xl`,border:``,class:`stat-card`},{default:g(()=>[c(r,{class:`pa-4 d-flex align-center justify-space-between`},{default:g(()=>[e(`div`,null,[e(`div`,T,a(i.subtitle),1),e(`div`,{class:_([`font-weight-bold`,`text-`+i.color]),style:{"font-size":`36px`,"line-height":`1.1`}},a(i.title),3)]),c(t,{color:i.color,size:`48`,rounded:`lg`,class:`stat-icon`},{default:g(()=>[c(o,{icon:i.icon,size:`24`,color:`white`},null,8,[`icon`])]),_:2},1032,[`color`])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}))}}),[[`__scopeId`,`data-v-1847a1b4`]]);export{x as a,C as i,w as n,S as r,E as t};