Files
WGDashboard/src/static/dist/WGDashboardAdmin/assets/systemStatus-CH4yiBLc.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2025-09-01 22:36:00 +08:00
import{_ as T,c as l,f as t,a as e,t as u,B as X,q as _,G as x,e as w,d as S,s as b,b as i,u as N,D as Y,r as v,o as Z,x as ee,H as se,g as te,F as g,i as y,w as L,T as D,j as k}from"./index-DUyYv-wF.js";import{L as c}from"./localeText-DOAWxDtC.js";import{C as ae}from"./storageMount.vue_vue_type_style_index_0_scoped_9509d7a0_lang-C3k1Q_1a.js";import{C as V,L as E,B as R,a as j,b as G,c as H,p as W,d as q,e as F,f as z,P as A,i as J,g as M}from"./index-C1ugFTFN.js";import{d as oe}from"./dayjs.min-DGjbp2Ra.js";const le={class:"mb-1 d-flex gap-5"},re={class:"title"},ie={class:"ms-auto"},ne={__name:"process",props:["process","cpu"],setup(a){return(m,p)=>(t(),l("div",le,[e("small",re,[p[0]||(p[0]=e("i",{class:"bi bi-code-square me-2"},null,-1)),e("samp",null,u(a.process.command?a.process.command:a.process.name),1)]),e("small",ie,u(Math.round((a.process.percent+Number.EPSILON)*10)/10)+"% ",1)]))}},O=T(ne,[["__scopeId","data-v-ffe5ad8f"]]),ce={class:"col-sm-6 fadeIn d-flex gap-2 flex-column"},de={class:"d-flex mb-2"},ue={class:"mb-0"},he={class:"mb-0 ms-auto d-flex gap-2"},me={class:"text-info"},pe={class:"text-warning"},_e={class:"progress",role:"progressbar",style:{height:"10px"}},be={class:"card rounded-3"},fe={class:"card-header d-flex align-items-center gap-3"},ve={class:"text-info ms-auto"},ge={class:"text-warning"},ye={class:"card-body"},xe=X({__name:"networkInterface",props:["historicalChartTimestamp","historicalNetworkSpeed","interfaceName","interface"],setup(a){V.register(E,R,j,G,H,W,q,F,z,A,J);const m=a,p=_(()=>({responsive:!0,plugins:{legend:{display:!0},tooltip:{callbacks:{label:h=>`${h.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(h,n)=>`${Math.round(h*1e4)/1e4} MB/s`},grid:{display:!1}}}})),s=_(()=>{let h=[],n=[];return m.historicalNetworkSpeed.bytes_recv&&m.historicalNetworkSpeed.bytes_sent&&(h=[...m.historicalNetworkSpeed.bytes_recv],n=[...m.historicalNetworkSpeed.bytes_sent]),{labels:[...m.historicalChartTimestamp],datasets:[{label:x("Real Time Received Data Usage"),data:h,fill:"origin",borderColor:"#0dcaf0",backgroundColor:"#0dcaf090",tension:0,pointRadius:2,borderWidth:1},{label:x("Real Time Sent Data Usage"),data:n,fill:"origin",backgroundColor:"#ffc10790",borderColor:"#ffc107",tension:0,pointRadius:2,borderWidth:1}]}});return(h,n)=>(t(),l("div",ce,[e("div",null,[e("div",de,[e("h6",ue,[e("samp",null,u(a.interfaceName),1)]),e("h6",he,[e("span",me,[n[0]||(n[0]=e("i",{class:"bi bi-arrow-down"},null,-1)),w(" "+u(Math.round((a.interface.bytes_recv/1024e6+Number.EPSILON)*1e4)/1e4)+" GB ",1)]),e("span",pe,[n[1]||(n[1]=e("i",{class:"bi bi-arrow-up"},null,-1)),w(" "+u(Math.round((a.interface.bytes_sent/1024e6+Number.EPSILON)*1e4)/1e4)+" GB ",1)])])]),e("div",_e,[a.interface.bytes_recv>0?(t(),l("div",{key:0,class:"progress-bar bg-info",style:b({width:`${a.interface.bytes_recv/(a.interface.bytes_sent+a.interface.bytes_recv)*100}%`})},null,4)):S("",!0),a.interface.bytes_sent>0?(t(),l("div",{key:1,class:"progress-bar bg-warning",style:b({width:`${a.interface.bytes_sent/(a.interface.bytes_sent+a.interface.bytes_recv)*100}%`})},null,4)):S("",!0)])]),e("div",be,[e("div",fe,[e("small",null,[i(c,{t:"Realtime Speed"})]),e("small",ve,[n[2]||(n[2]=e("i",{class:"bi bi-arrow-down-circle me-2"},null,-1)),w(" "+u(a.historicalNetworkSpeed.bytes_recv[a.historicalNetworkSpeed.bytes_recv.length-1])+" MB/s ",1)]),e("small",ge,[n[3]||(n[3]=e("i",{class:"bi bi-arrow-up-circle me-2"},null,-1)),w(" "+u(a.historicalNetworkSpeed.bytes_sent[a.historicalNetworkSpeed.bytes_sent.length-1])+" MB/s ",1)])]),e("div",ye,[i(N(M),{options:p.value,data:s.value,style:{width:"100%",height:"300px","max-height":"300px"}},null,8,["options","data"])])])]))}}),we={class:"text-body row g-2 mb-2"},ke={class:"col-sm-6"},Se={class:"card rounded-3 h-100 shadow"},Ce={class:"card-body p-4"},Ne={class:"d-flex flex-column gap-3"},Me={class:"d-flex flex-column gap-3",style:{height:"130px"}},$e={class:"d-flex align-items-center"},Pe={class:"text-muted mb-0"},Ie={class:"ms-auto mb-0"},Ue={key:0},Be={key:1,class:"spinner-bor