import{Er as e,I as t,Ir as n,Kn as r,Lt as i,M as a,N as o,Pr as s,Qn as c,Xn as l,Y as u,Yn as d,br as f,dr as p,fr as m,mr as h,rr as g,tr as _}from"./index-ociiHzMi.js";import{n as v,t as y}from"./VRow-Bj9GMKOo.js";import{t as b}from"./_plugin-vue_export-helper-BDNMzG2s.js";function x(){let t=e([]),n=e(!1),r=e(1),a=e(20),o=e(0),s=e(``);async function c(){n.value=!0;try{let e=await i.get(`/servers/`,{page:r.value,per_page:a.value,search:s.value||void 0});t.value=e.items||[],o.value=e.total||0}catch(e){throw t.value=[],o.value=0,e}finally{n.value=!1}}let l;p(()=>clearTimeout(l));function u(){clearTimeout(l),l=setTimeout(()=>{r.value=1,c()},300)}function d(e){r.value=e,c()}function f(e){a.value=e,r.value=1,c()}return{servers:t,loading:n,page:r,itemsPerPage:a,total:o,search:s,loadServers:c,onSearch:u,onPageChange:d,onItemsPerPageChange:f}}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(g({__name:`StatCardsRow`,props:{items:{}},setup(e){return(i,p)=>(m(),l(y,null,{default:f(()=>[(m(!0),c(r,null,h(e.items,(e,r)=>(m(),l(v,{key:r,cols:`6`,sm:`3`},{default:f(()=>[_(a,{elevation:`0`,rounded:`xl`,border:``,class:`stat-card`},{default:f(()=>[_(o,{class:`pa-4 d-flex align-center justify-space-between`},{default:f(()=>[d(`div`,null,[d(`div`,T,n(e.subtitle),1),d(`div`,{class:s([`font-weight-bold`,`text-`+e.color]),style:{"font-size":`36px`,"line-height":`1.1`}},n(e.title),3)]),_(t,{color:e.color,size:`48`,rounded:`lg`,class:`stat-icon`},{default:f(()=>[_(u,{icon:e.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};