PageSourceSearch

https://fedia.social/assets/index-BhPcIFEP.js

js fedia.social collected 2026-10-02 06:57:51 UTC 9,620 bytes, 2 lines download raw bytes

1import{u as J}from"./widget-BrT_NbSR.js";import{v as T}from"./v4-Dnyct6Ft.js";import{b as S,c as Y,Z as q,j as r,p as x,q as e,u as t,t as R,J as I,D as f,a as s,f as L,k as V,o as W,g as C,i as G,H as z}from"./vue-Cm77DuTi.js";import{_ as N,T as Z,B as K,b as O}from"./app-BC9vAXdb.js";import{b as B}from"./bytes-C39hD0JB.js";import{M as Q}from"./MkContainer-DxaGjVnE.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const ee={class:"lcfyofjk"},te=["viewBox"],oe=["id"],ne=["id","width","height"],le=["points"],se=["points"],ae=["cx","cy"],ie=["width","height"],ue={x:"1",y:"5"},ce=["viewBox"],re=["id"],ve=["id","width","height"],de=["points"],pe=["points"],fe=["cx","cy"],me=["width","height"],he={x:"1",y:"5"},_e=S({__name:"cpu-mem",props:{connection:{},meta:{}},setup(v){const a=v,l=s(50),n=s(30),o=s([]),c=T(),u=T(),d=T(),$=T();let p=s(""),P=s(""),h=s(""),b=s(""),_=s(null),X=s(null),H=s(null),j=s(null),w=s(""),g=s("");Y(()=>{a.connection.on("stats",D),a.connection.on("statsLog",M),a.connection.send("requestLog",{id:Math.random().toString().substr(2,8)})}),q(()=>{a.connection.off("stats",D),a.connection.off("statsLog",M)});function D(m){o.value.push(m),o.value.length>50&&o.value.shift();const i=o.value.map((y,F)=>[l.value-(o.value.length-1-F),(1-y.cpu)*n.value]),k=o.value.map((y,F)=>[l.value-(o.value.length-1-F),(1-y.mem.active/y.mem.total)*n.value]);p.value=i.map(y=>`${y[0]},${y[1]}`).join(" "),P.value=k.map(y=>`${y[0]},${y[1]}`).join(" "),h.value=`${l.value-(o.value.length-1)},${n.value} ${p.value} ${l.value},${n.value}`,b.value=`${l.value-(o.value.length-1)},${n.value} ${P.value} ${l.value},${n.value}`,_.value=i[i.length-1][0],X.value=i[i.length-1][1],H.value=k[k.length-1][0],j.value=k[k.length-1][1],w.value=(m.cpu*100).toFixed(0),g.value=(m.mem.active/m.mem.total*100).toFixed(0)}function M(m){for(const i of[...m].reverse())D(i)}return(m,i)=>(r(),x("div",ee,[(r(),x("svg",{viewBox:`0 0 ${l.value} ${n.value}`},[e("defs",null,[e("linearGradient",{id:t(c),x1:"0",x2:"0",y1:"1",y2:"0"},[...i[0]||(i[0]=[e("stop",{offset:"0%","stop-color":"hsl(189, 43%, 73%)"},null,-1),e("stop",{offset:"100%","stop-color":"hsl(343, 76%, 68%)"},null,-1)])],8,oe),e("mask",{id:t(u),x:"0",y:"0",width:l.value,height:n.value},[e("polygon",{points:t(h),fill:"#fff","fill-opacity":"0.5"},null,8,le),e("polyline",{points:t(p),fill:"none",stroke:"#fff","stroke-width":"1"},null,8,se),e("circle",{cx:t(_),cy:t(X),r:"1.5",fill:"#fff"},null,8,ae)],8,ne)]),e("rect",{x:"-2",y:"-2",width:l.value+4,height:n.value+4,style:R(`stroke: none; fill: url(#${t(c)}); mask: url(#${t(u)})`)},null,12,ie),e("text",ue,[i[1]||(i[1]=I(" CPU ",-1)),e("tspan",null,f(t(w))+"%",1)])],8,te)),(r(),x("svg",{viewBox:`0 0 ${l.value} ${n.value}`},[e("defs",null,[e("linearGradient",{id:t(d),x1:"0",x2:"0",y1:"1",y2:"0"},[...i[2]||(i[2]=[e("stop",{offset:"0%","stop-color":"hsl(189, 43%, 73%)"},null,-1),e("stop",{offset:"100%","stop-color":"hsl(343, 76%, 68%)"},null,-1)])],8,re),e("mask",{id:t($),x:"0",y:"0",width:l.value,height:n.value},[e("polygon",{points:t(b),fill:"#fff","fill-opacity":"0.5"},null,8,de),e("polyline",{points:t(P),fill:"none",stroke:"#fff","stroke-width":"1"},null,8,pe),e("circle",{cx:t(H),cy:t(j),r:"1.5",fill:"#fff"},null,8,fe)],8,ve)]),e("rect",{x:"-2",y:"-2",width:l.value+4,height:n.value+4,style:R(`stroke: none; fill: url(#${t(d)}); mask: url(#${t($)})`)},null,12,me),e("text",he,[i[3]||(i[3]=I(" MEM ",-1)),e("tspan",null,f(t(g))+"%",1)])],8,ce))]))}}),ge=N(_e,[["__scopeId","data-v-0a0d3160"]]),xe={class:"oxxrhrto"},$e=["viewBox"],ye=["points"],we=["points"],ke=["cx","cy"],Pe={x:"1",y:"5"},be=["viewBox"],Me=["points"],Be=["points"],Ie=["cx","cy"],Se={x:"1",y:"5"},Xe=S({__name:"net",props:{connection:{},meta:{}},setup(v){const a=v,l=s(50),n=s(30),o=s([]);let c=s(""),u=s(""),d=s(""),$=s(""),p=s(null),P=s(null),h=s(null),b=s(null),_=s(0),X=s(0);Y(()=>{a.connection.on("stats",H),a.connection.on("statsLog",j),a.connection.send("requestLog",{id:Math.random().toString().substr(2,8)})}),q(()=>{a.connection.off("stats",H),a.connection.off("statsLog",j)});function H(w){o.value.push(w),o.value.length>50&&o.value.shift();const g=Math.max(1024*64,Math.max(...o.value.map(i=>i.net.rx))),D=Math.max(1024*64,Math.max(...o.value.map(i=>i.net.tx))),M=o.value.map((i,k)=>[l.value-(o.value.length-1-k),(1-i.net.rx/g)*n.value]),m=o.value.map((i,k)=>[l.value-(o.value.length-1-k),(1-i.net.tx/D)*n.value]);c.value=M.map(i=>`${i[0]},${i[1]}`).join(" "),u.value=m.map(i=>`${i[0]},${i[1]}`).join(" "),d.value=`${l.value-(o.value.length-1)},${n.value} ${c.value} ${l.value},${n.value}`,$.value=`${l.value-(o.value.length-1)},${n.value} ${u.value} ${l.value},${n.value}`,p.value=M[M.length-1][0],P.value=M[M.length-1][1],h.value=m[m.length-1][0],b.value=m[m.length-1][1],_.value=w.net.rx,X.value=w.net.tx}function j(w){for(const g of[...w].reverse())H(g)}return(w,g)=>(r(),x("div",xe,[(r(),x("svg",{viewBox:`0 0 ${l.value} ${n.value}`},[e("polygon",{points:t(d),fill:"#f6c177","fill-opacity":"0.5"},null,8,ye),e("polyline",{points:t(c),fill:"none",stroke:"#f6c177","stroke-width":"1"},null,8,we),e("circle",{cx:t(p),cy:t(P),r:"1.5",fill:"#f6c177"},null,8,ke),e("text",Pe,[g[0]||(g[0]=I(" NET rx ",-1)),e("tspan",null,f(t(B)(t(_))),1)])],8,$e)),(r(),x("svg",{viewBox:`0 0 ${l.value} ${n.value}`},[e("polygon",{points:t($),fill:"#31748f","fill-opacity":"0.5"},null,8,Me),e("polyline",{points:t(u),fill:"none",stroke:"#31748f","stroke-width":"1"},null,8,Be),e("circle",{cx:t(h),cy:t(b),r:"1.5",fill:"#31748f"},null,8,Ie),e("text",Se,[g[1]||(g[1]=I(" NET tx ",-1)),e("tspan",null,f(t(B)(t(X))),1)])],8,be))]))}}
1),He=N(Xe,[["__scopeId","data-v-6cb27edf"]]),Ce={class:"hsalcinq",viewBox:"0 0 1 1",preserveAspectRatio:"none"},Le=["stroke-dasharray","stroke-dashoffset","stroke"],Ne={x:"50%",y:"50%",dy:"0.05","text-anchor":"middle"},U=.45,je=S({__name:"pie",props:{value:{},reverse:{type:Boolean}},setup(v){const a=v,l=L(()=>`hsl(${a.reverse?a.value*180:180-a.value*180}, 80%, 70%)`),n=L(()=>(1-a.value)*(Math.PI*(U*2)));return(o,c)=>(r(),x("svg",Ce,[e("circle",{r:U,cx:"50%",cy:"50%",fill:"none","stroke-width":"0.1",stroke:"rgba(0, 0, 0, 0.05)"}),e("circle",{r:U,cx:"50%",cy:"50%","stroke-dasharray":Math.PI*(U*2),"stroke-dashoffset":n.value,fill:"none","stroke-width":"0.1",stroke:l.value},null,8,Le),e("text",Ne,f((v.value*100).toFixed(0))+"% ",1)]))}}),E=N(je,[["__scopeId","data-v-11908b0c"]]),De={class:"vrvdvrys"},Te=S({__name:"cpu",props:{connection:{},meta:{}},setup(v){const a=v;let l=s(0);function n(o){l.value=o.cpu}return Y(()=>{a.connection.on("stats",n)}),q(()=>{a.connection.off("stats",n)}),(o,c)=>(r(),x("div",De,[V(E,{class:"pie",value:t(l)},null,8,["value"]),e("div",null,[c[0]||(c[0]=e("p",null,[e("i",{class:"ph-cpu ph-bold ph-lg"}),I("CPU")],-1)),e("p",null,f(v.meta.cpu.cores)+" Logical cores",1),e("p",null,f(v.meta.cpu.model),1)])]))}}),Ue=N(Te,[["__scopeId","data-v-58727d94"]]),Ye={class:"zlxnikvl"},qe=S({__name:"mem",props:{connection:{},meta:{}},setup(v){const a=v;let l=s(0),n=s(0),o=s(0),c=s(0);function u(d){l.value=d.mem.active/d.mem.total,n.value=d.mem.total,o.value=d.mem.active,c.value=n.value-o.value}return Y(()=>{a.connection.on("stats",u)}),q(()=>{a.connection.off("stats",u)}),(d,$)=>(r(),x("div",Ye,[V(E,{class:"pie",value:t(l)},null,8,["value"]),e("div",null,[$[0]||($[0]=e("p",null,[e("i",{class:"ph-microchip ph-bold ph-lg"}),I("RAM")],-1)),e("p",null,"Total: "+f(t(B)(t(n),1)),1),e("p",null,"Used: "+f(t(B)(t(o),1)),1),e("p",null,"Free: "+f(t(B)(t(c),1)),1)])]))}}),Fe=N(qe,[["__scopeId","data-v-3a758a4f"]]),Ge={class:"zbwaqsat"},Ve=S({__name:"disk",props:{meta:{}},setup(v){const a=v,l=L(()=>a.meta.fs.used/a.meta.fs.total),n=L(()=>a.meta.fs.total),o=L(()=>a.meta.fs.used),c=L(()=>a.meta.fs.total-a.meta.fs.used);return(u,d)=>(r(),x("div",Ge,[V(E,{class:"pie",value:l.value},null,8,["value"]),e("div",null,[d[0]||(d[0]=e("p",null,[e("i",{class:"ph-hard-drives ph-bold ph-lg"}),I("Disk")],-1)),e("p",null,"Total: "+f(t(B)(n.value,1)),1),e("p",null,"Free: "+f(t(B)(c.value,1)),1),e("p",null,"Used: "+f(t(B)(o.value,1)),1)])]))}}),Ee=N(Ve,[["__scopeId","data-v-b3df0aa2"]]),Re={key:0,class:"mkw-serverMetric"},A="serverMetric",et=S({__name:"index",props:{widget:{}},emits:["updateProps"],setup(v,{expose:a,emit:l}){const n={showHeader:{type:"boolean",default:!0},transparent:{type:"boolean",default:!1},view:{type:"number",default:0,hidden:!0}},o=v,c=l,{widgetProps:u,configure:d,save:$}=J(A,n,o,c),p=s(null);Z("server-info",{}).then(b=>{p.value=b});const P=()=>{u.view===5?u.view=0:u.view++,$()},h=K.useChannel("serverStats");return W(()=>{h.dispose()}),a({name:A,configure:d,id:o.widget?o.widget.id:null}),(b,_)=>(r(),C(Q,{"show-header":t(u).showHeader,naked:t(u).transparent},{header:G(()=>[_[1]||(_[1]=e("i",{class:"ph-hard-drives ph-bold ph-lg"},null,-1)),I(f(t(O).ts._widgets.serverMetric),1)]),func:G(()=>[e("button",{class:"_button",onClick:_[0]||(_[0]=X=>P())},[..._[2]||(_[2]=[e("i",{class:"ph-sort-ascending ph-bold ph-lg"},null,-1)])])]),default:G(()=>[p.value?(r(),x("div",Re,[t(u).view===0?(r(),C(ge,{key:0,connection:t(h),meta:p.value},null,8,["connection","meta"])):t(u).view===1?(r(),C(He,{key:1,connection:t(h),meta:p.value},null,8,["connection","meta"])):t(u).view===2?(r(),C(Ue,{key:2,connection:t(h),meta:p.value},null,8,["connection","meta"])):t(u).view===3?(r(),C(Fe,{key:3,connection:t(h),meta:p.value},null,8,["connection","meta"])):t(u).view===4?(r(),C(Ee,{key:4,connection:t(h),meta:p.value},null,8,["connection","meta"])):z("",!0)])):z("",!0)]),_:1},8,["show-header","naked"]))}});export{et as default};
2//# sourceMappingURL=index-BhPcIFEP.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.