PageSourceSearch

https://nelpi.co.uk/_next/static/chunks/7501.958f84ea739e943b.js

js nelpi.co.uk collected 2026-09-28 09:27:21 UTC 2,424 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7501],{7501:(e,r,l)=>{l.r(r),l.d(r,{default:()=>a});var n=l(89142),t=l(27030),s=l(42416),u=l(56833),o=l(68e3);function c(e,r){return"running"===r.status?e+1:e}function a({service:e}){let{t:r}=(0,u.Bd)(),{widget:l}=e,{data:i,error:x}=(0,o.A)(l,"cluster/resources");if(x)return(0,n.jsx)(s.A,{service:e,error:x});if(!i||!i.data)return(0,n.jsxs)(s.A,{service:e,children:[(0,n.jsx)(t.A,{label:"proxmox.vms"}),(0,n.jsx)(t.A,{label:"proxmox.lxc"}),(0,n.jsx)(t.A,{label:"resources.cpu"}),(0,n.jsx)(t.A,{label:"resources.mem"})]});let{data:d}=i,m=d.filter(e=>"qemu"===e.type&&0===e.template&&(void 0===l.node||l.node===e.node))||[],p=d.filter(e=>"lxc"===e.type&&0===e.template&&(void 0===l.node||l.node===e.node))||[],v=d.filter(e=>"node"===e.type&&"online"===e.status&&(void 0===l.node||l.node===e.node))||[],f=m.reduce(c,0),h=p.reduce(c,0);if(0===v.length)return(0,n.jsxs)(s.A,{service:e,children:[(0,n.jsx)(t.A,{label:"proxmox.vms",value:`${f} / ${m.length}`}),(0,n.jsx)(t.A,{label:"proxmox.lxc",value:`${h} / ${p.length}`}),(0,n.jsx)(t.A,{label:"resources.cpu"}),(0,n.jsx)(t.A,{label:"resources.mem"})]});let A=v.reduce((e,r)=>r.maxmem+e,0),b=v.reduce((e,r)=>r.mem+e,0),g=v.reduce((e,r)=>r.maxcpu+e,0),j=v.reduce((e,r)=>r.cpu*r.maxcpu+e,0);return(0,n.jsxs)(s.A,{service:e,children:[(0,n.jsx)(t.A,{label:"proxmox.vms",value:`${f} / ${m.length}`}),(0,n.jsx)(t.A,{label:"proxmox.lxc",value:`${h} / ${p.length}`}),(0,n.jsx)(t.A,{label:"resources.cpu",value:r("common.percent",{value:j/g*100}),highlightValue:j/g*100}),(0,n.jsx)(t.A,{label:"resources.mem",value:r("common.percent",{value:b/A*100}),highlightValue:b/A*100})]})}},18165:(e,r,l)=>{function n(e,r=null){return null==e||""===e?r:"number"==typeof e?Number.isInteger(e)&&e>=0?e:r:"string"==typeof e&&/^\d+$/.test(e)?Number(e):r}function t(e,r){let l=new URLSearchParams({group:e.service_group,service:e.service_name,index:e.index});return r&&l.append("endpoint",r),l}function s(e,r,l){let n=t(e,r);return l&&n.append("query",JSON.stringify(l)),`/api/services/proxy?${n.toString()}`}l.d(r,{$C:()=>s,Sk:()=>n,_V:()=>t})},68e3:(e,r,l)=>{l.d(r,{A:()=>s});var n=l(45911),t=l(18165);function s(e,...r){let l={};r&&r[1]?.refreshInterval&&(l.refreshInterval=r[1].refreshInterval);let u=(0,t.$C)(e,...r);""===r[0]&&(u=null);let{data:o,error:c,mutate:a}=(0,n.Ay)(u,l);return{data:o,error:o?.error??c,mutate:a}}}}]);

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.