2025-05-02 21:35:27 +08:00
|
|
|
import{_ as E,a as l,c as o,b as e,t as d,D as j,q as _,o as H,x as W,r as p,g as q,d as r,s as h,F as b,h as v,u as N,w as O,T as $,f as x,e as g,i as C,G as y}from"./index-BrDQpjl3.js";import{L as c}from"./localeText-CwFQjfiv.js";import{C as F}from"./storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-BxXh694G.js";import{C as z,L as A,B as J,a as K,b as Q,c as X,p as Y,d as Z,e as ee,f as se,P as te,i as ae,g as M}from"./index-MJ8VOCIu.js";import{d as le}from"./dayjs.min-BJhZZO6D.js";const oe={class:"mb-1 d-flex gap-5"},re={class:"title"},ne={class:"ms-auto"},ie={__name:"process",props:["process","cpu"],setup(m){return(w,s)=>(l(),o("div",oe,[e("small",re,[s[0]||(s[0]=e("i",{class:"bi bi-code-square me-2"},null,-1)),e("samp",null,d(m.process.command?m.process.command:m.process.name),1)]),e("small",ne,d(Math.round((m.process.percent+Number.EPSILON)*10)/10)+"% ",1)]))}},D=E(ie,[["__scopeId","data-v-ffe5ad8f"]]),ce={class:"text-body row g-2 mb-2"},de={class:"col-sm-6"},ue={class:"card rounded-3 h-100 shadow"},_e={class:"card-body p-4"},pe={class:"d-flex flex-column gap-3"},he={class:"d-flex flex-column gap-3",style:{height:"130px"}},me={class:"d-flex align-items-center"},be={class:"text-muted mb-0"},ve={class:"ms-auto mb-0"},ge={key:0},ye={key:1,class:"spinner-border"},fe={class:"progress",role:"progressbar",style:{height:"10px"}},xe={class:"d-flex gap-1"},we={class:"d-flex align-items-center"},ke={class:"mb-0"},Ne={class:"mb-0 ms-auto text-muted"},Ce={class:"position-relative"},Me={class:"col-sm-6"},Se={class:"card rounded-3 h-100 shadow"},Ie={class:"card-body p-4"},Pe={class:"d-flex flex-column gap-3"},Ue={class:"d-flex flex-column gap-3",style:{height:"130px"}},Le={class:"d-flex align-items-center"},Be={class:"text-muted"},Oe={class:"ms-auto"},$e={key:0},De={key:1,class:"spinner-border"},Ee={class:"progress",role:"progressbar",style:{height:"10px"}},Ve={class:"d-flex align-items-center"},Re={class:"mb-0"},Ge={class:"mb-0 ms-auto"},Te={class:"progress",role:"progressbar",style:{height:"10px"}},je={class:"d-flex align-items-center"},He={class:"mb-0"},We={class:"mb-0 ms-auto text-muted"},qe={class:"position-relative"},Fe={class:"col-sm-12"},ze={class:"card rounded-3 h-100 shadow"},Ae={class:"card-body p-4 d-flex gap-3 flex-column"},Je={class:"d-flex align-items-center gap-3"},Ke={class:"text-muted mb-0"},Qe={class:"ms-auto mb-0"},Xe={key:0},Ye={key:1,class:"spinner-border"},Ze={key:0,class:"mb-0 text-end"},es={class:"text-info"},ss={class:"text-warning"},ts={key:0,class:"row g-3"},as={class:"col-sm-6 fadeIn"},ls={class:"d-flex mb-2"},os={class:"mb-0"},rs={class:"mb-0 ms-auto d-flex gap-2"},ns={class:"text-info"},is={class:"text-warning"},cs={class:"progress",role:"progressbar",style:{height:"10px"}},ds={class:"col-sm-12"},us={class:"card rounded-3 h-100 shadow"},_s={class:"card-body p-4 d-flex gap-3 flex-column"},ps={class:"d-flex align-items-center"},hs={class:"text-muted mb-0"},ms={class:"ms-auto mb-0"},bs={key:0},vs={key:1,class:"spinner-border"},gs={class:"row g-3"},ys={class:"col-sm-6 fadeIn"},fs={class:"d-flex mb-2"},xs={class:"mb-0"},ws={class:"mb-0 ms-auto d-flex gap-2"},ks={class:"text-success"},Ns={class:"progress",role:"progressbar",style:{height:"20px"}},Cs={__name:"systemStatus",setup(m){const w=j(),s=_(()=>w.SystemStatus);let S=null;z.register(A,J,K,Q,X,Y,Z,ee,se,te,ae),H(()=>{L(),S=setInterval(()=>{L()},5e3)}),W(()=>{clearInterval(S)});const f=p([]),I=p([]),P=p([]),U=p([]),i=p({bytes_recv:[],bytes_sent:[]}),u=p({bytes_recv:[],bytes_sent:[]}),L=()=>{q("/api/systemStatus",{},n=>{if(f.value.push(le().format("HH:mm:ss A")),w.SystemStatus=n.data,I.value.push(n.data.CPU.cpu_percent),P.value.push(n.data.Memory.VirtualMemory.percent),U.value.push(n.data.Memory.SwapMemory.percent),i.value.bytes_recv.push(Object.values(n.data.NetworkInterfaces).map(t=>t.bytes_recv).reduce((t,a)=>t+a)),i.value.bytes_sent.push(Object.values(n.data.NetworkInterfaces).map(t=>t.bytes_sent).reduce((t,a)=>t+a)),i.value.bytes_recv.length===1&&i.value.bytes_sent.length===1)u.value.bytes_recv.push(0),u.value.bytes_sent.push(0);else{le
|