1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8337],{8337:(e,t,i)=>{i.r(t),i.d(t,{default:()=>L});var s=i(23798),r=i(17319),a=i(84802);function c(e){let{position:t,children:i}=e;return(0,s.jsx)("div",{className:"absolute ".concat(t," z-20 text-sm pointer-events-none"),children:i})}var n=i(46001),o=i.n(n),l=i(21462),m=i(22657);function d(){let{t:e}=(0,a.Bd)();return(0,s.jsx)("div",{className:"absolute bottom-2 left-2 z-20 text-red-400 text-xs opacity-75",children:e("widget.api_error")})}function x(e){let{children:t,widget:i,error:r=null,chart:a=!0,className:c=""}=e,{settings:n}=(0,l.useContext)(m.l),x=n.hideErrors||(null==i?void 0:i.hideErrors);return r?x?null:(0,s.jsx)(d,{}):(0,s.jsxs)("div",{className:o()("service-container",a?"chart relative h-[68px]":""),children:[t,(0,s.jsx)("div",{className:"absolute -top-10 right-0 bottom-0 left-0 overflow-clip pointer-events-none ".concat(c)}),a&&(0,s.jsx)("div",{className:"h-[68px] overflow-clip"}),!a&&(0,s.jsx)("div",{className:"h-[16px] overflow-clip"})]})}var h=i(82413);let u={running:(0,s.jsx)(r.A,{icon:"mdi-circle",width:32,height:32}),paused:(0,s.jsx)(r.A,{icon:"mdi-circle-outline",width:32,height:32})};function p(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,refreshInterval:o=1e3,version:l=3}=r,m=3===l?"Id":"id",d=3===l?"Status":"status",{data:p,error:j}=(0,h.A)(t.widget,"".concat(l,"/containers"),{refreshInterval:Math.max(1e3,o)});if(j)return(0,s.jsx)(x,{service:t,widget:r});if(!p)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});p.splice(n?5:1);let v="top-4",f="bottom-4";return n&&(v="-top-6",f="-top-3"),(0,s.jsxs)(x,{chart:n,children:[(0,s.jsx)(c,{position:"".concat(v," right-3 left-3"),children:(0,s.jsxs)("div",{className:"flex items-center text-xs",children:[(0,s.jsx)("div",{className:"grow"}),(0,s.jsx)("div",{className:"w-14 text-right italic",children:i("resources.cpu")}),(0,s.jsx)("div",{className:"w-14 text-right",children:i("resources.mem")})]})}),(0,s.jsx)(c,{position:"".concat(f," right-3 left-3"),children:(0,s.jsx)("div",{className:"pointer-events-none text-theme-900 dark:text-theme-200",children:p.map(e=>(0,s.jsx)("div",{className:"text-[0.75rem] h-[0.8rem]",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-3 h-3 mr-1.5 opacity-50",children:u[e[d]]}),(0,s.jsx)("div",{className:"opacity-75 grow truncate",children:e.name}),(0,s.jsxs)("div",{className:"opacity-25 w-14 text-right",children:[e.cpu_percent.toFixed(1),"%"]}),(0,s.jsx)("div",{className:"opacity-25 w-14 text-right",children:i("common.bytes",{value:e.memory.usage-e.memory.inactive_file,maximumFractionDigits:0})})]})},e[m]))})})]})}var j=i(82136),v=i.n(j);let f=v()(()=>Promise.all([i.e(6682),i.e(9964)]).then(i.bind(i,99964)),{loadableGenerated:{webpack:()=>[99964]},ssr:!1});function b(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,refreshInterval:o=1e3,pointsLimit:m=15,version:d=3}=r,[u,p]=(0,l.useState)(Array(m).fill({value:0},0,m)),{data:j,error:v}=(0,h.A)(t.widget,"".concat(d,"/cpu"),{refreshInterval:Math.max(1e3,o)}),{data:b,error:g}=(0,h.A)(t.widget,"".concat(d,"/quicklook"));return((0,l.useEffect)(()=>{j&&p(e=>{let t=[...e,{value:j.total}];return t.length>m&&t.shift(),t})},[j,m]),v)?(0,s.jsx)(x,{error:v,widget:r}):j?(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)(f,{dataPoints:u,label:[i("resources.used")],formatter:e=>i("common.number",{value:e,style:"unit",unit:"percent",maximumFractionDigits:0})}),!n&&b&&!g&&(0,s.jsx)(c,{position:"top-3 right-3",children:(0,s.jsx)("div",{className:"text-[0.6rem] opacity-50",children:b.cpu_name&&b.cpu_name})}),b&&!g&&(0,s.jsx)(c,{position:"bottom-3 left-3",children:b.cpu_name&&n&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:b.cpu_name})}),(0,s.jsx)(c,{position:"bottom-3 right-3",children:(0,s.jsxs)("div",{className:"text-xs font-bold opacity-75",children:[i("common.number",{value:j.total,style:"unit",unit:"percent",maximumFractionDigits:0})," ",i("resources.used")]})})]}):(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})})}let g=v()(()=>Promise.all([i.e(6682),i.e(7273)]).then(i.bind(i,27273)),{loadableGenerated:{webpack:()=>[27273]},ssr:!1});function y(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,refreshInterval:o=1e3,pointsLimit:m=15,version:d=3}=r,[,u]=r.metric.split(":"),[p,j]=(0,l.useState)(Array(m).fill({read_bytes:0,write_bytes:0,time_since_update:0},0,m)),[v,f]=(0,l.useState)(Array(m).fill({a:0,b:0},0,m)),{data:b,error:y}=(0,h.A)(t.widget,"".concat(d,"/diskio"),{refreshInterval:Math.max(1e3,o)}),N=e=>e.map(e=>({a:e.read_bytes/e.time_since_update,b:e.write_bytes/e.time_since_update}));if((0,l.useEffect)(()=>
1{if(b&&!b.error){let e=b.find(e=>e.disk_name===u);j(t=>{let i=[...t,e];return i.length>m&&i.shift(),i})}},[b,u,m]),(0,l.useEffect)(()=>{f(N(p))},[p]),y||b&&b.error){let e=y||b.error;return(0,s.jsx)(x,{error:e,widget:r})}if(!b)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});let w=b.find(e=>e.disk_name===u);if(!w)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});let _=N(p),k=_[_.length-1];return(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)(g,{dataPoints:v,label:[i("glances.read"),i("glances.write")],max:w.critical,formatter:e=>i("common.bitrate",{value:e})}),k&&!y&&(0,s.jsxs)(c,{position:n?"bottom-3 left-3":"bottom-3 right-3",children:[(0,s.jsxs)("div",{className:"text-xs opacity-50 text-right",children:[i("common.bitrate",{value:k.a})," ",i("glances.read")]}),(0,s.jsxs)("div",{className:"text-xs opacity-50 text-right",children:[i("common.bitrate",{value:k.b})," ",i("glances.write")]})]}),(0,s.jsx)(c,{position:n?"bottom-3 right-3":"bottom-3 left-3",children:(0,s.jsx)("div",{className:"text-xs opacity-75",children:i("common.bitrate",{value:k.a+k.b})})})]})}function N(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,refreshInterval:o=1e3,version:l=3}=r,[,m]=r.metric.split("fs:"),d="bbytes"===r.diskUnits?"common.bbytes":"common.bytes",{data:u,error:p}=(0,h.A)(r,"".concat(l,"/fs"),{refreshInterval:Math.max(1e3,o)});if(p)return(0,s.jsx)(x,{error:p,widget:r});if(!u)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});let j=u.find(e=>e[e.key]===m);return j?(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)("div",{className:"absolute -top-2 -left-2 -right-2 -bottom-2",children:(0,s.jsx)("div",{style:{height:"".concat(Math.max(20,140*(j.size-j.free)/j.size),"px")},className:"absolute bottom-0 border-t border-t-theme-500 bg-linear-to-b from-theme-500/40 to-theme-500/10 w-full"})}),(0,s.jsxs)(c,{position:"bottom-3 left-3",children:[j.used&&n&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i(d,{value:j.used,maximumFractionDigits:1})," ",i("resources.used")]}),(0,s.jsxs)("div",{className:"text-xs opacity-75",children:[i(d,{value:j.free,maximumFractionDigits:1})," ",i("resources.free")]})]}),!n&&(0,s.jsx)(c,{position:"top-3 right-3",children:j.used&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i(d,{value:j.used,maximumFractionDigits:1})," ",i("resources.used")]})}),(0,s.jsx)(c,{position:"bottom-3 right-3",children:(0,s.jsxs)("div",{className:"text-xs opacity-75",children:[i(d,{value:j.size,maximumFractionDigits:1})," ",i("resources.total")]})})]}):(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})})}let w=v()(()=>Promise.all([i.e(6682),i.e(7273)]).then(i.bind(i,27273)),{loadableGenerated:{webpack:()=>[27273]},ssr:!1});function _(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,refreshInterval:o=1e3,pointsLimit:m=15,version:d=3}=r,[,u]=r.metric.split(":"),[p,j]=(0,l.useState)(Array(m).fill({a:0,b:0},0,m)),{data:v,error:f}=(0,h.A)(r,"".concat(d,"/gpu"),{refreshInterval:Math.max(1e3,o)});if((0,l.useEffect)(()=>{if(v&&!v.error){let e=v.find(e=>e[e.key]==u);e&&j(t=>{let i=[...t,{a:e.mem,b:e.proc}];return i.length>m&&i.shift(),i})}},[v,u,m]),f||v&&v.error){let e=f||v.error;return(0,s.jsx)(x,{error:e,widget:r})}if(!v)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});let b=v.find(e=>e[e.key]==u);return b?(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)(w,{dataPoints:p,label:[i("glances.mem"),i("glances.gpu")],stack:["mem","proc"],formatter:e=>i("common.percent",{value:e,maximumFractionDigits:1})}),n&&(0,s.jsxs)(c,{position:"bottom-3 left-3",children:[b&&b.name&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:b.name}),(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("common.number",{value:b.mem,maximumFractionDigits:1}),"% ",i("resources.mem")]})]}),!n&&(0,s.jsx)(c,{position:"bottom-3 left-3",children:(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("common.number",{value:b.temperature,maximumFractionDigits:1}),"\xb0 C"]})}),(0,s.jsx)(c,{position:"bottom-3 right-3",children:(0,s.jsxs)("div",{className:"text-xs opacity-75",children:[!n&&(0,s.jsxs)("div",{className:"inline-block mr-1",children:[i("common.number",{value:b.proc,maximumFractionDigits:1}),"% ",i("glances.gpu")]}),!n&&(0,s.jsx)(s.Fragment,{children:"â¢"}),(0,s.jsxs)("div",{className:"inline-block ml-1",children:[i("common.number",{value:b.proc,maximumFractionDigits:1}),"% ",i("glances.gpu")]})]})}),(0,s.jsxs)(c,{position:"top-3 right-3",children:[n&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("common.number",{value:b.temperature,maximumFractionDigits:1}),"\xb0 C"]}),b&&b.name&&!n&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:b.name})]})]}):(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})})}function k(e){let{quicklookData:t,className:i=""}=e,{t:r}=(0,a.Bd)();return t&&0!==t.swap&&(0,s.jsxs)("div",{className:"text-xs flex place-content-between",children:[(0,s.jsx)("div",{className:i,children:r("glances.swap")}),(0,s.jsx)("div",{className:i,children:r("common.number",{value:t.swap,style:"unit",unit:"percent",maximumFractionDigits:0})})]})}function D(e){let{quicklookData:t,className:i=""}=e,{t:r}=(0,a.Bd)();return t&&void 0!==t.cpu&&null!==t.cpu&&(0,s.jsxs)("div",{className:"text-xs flex place-content-between",children:[(0,s.jsx)("div",{className:i,children:r("glances.cpu")}),(0,s.jsx)("div",{className:i,children:r("common.number",{value:t.cpu,style:"unit",unit:"percent",maximumFractionDigits:0})})]})}function A(e){let{quicklookData:t,className:i=""}=e,{t:r}=(0,a.Bd)();return t&&t.mem&&(0,s.jsxs)("div",{className:"text-xs flex place-content-between",children:[(0,s.jsx)("div",{className:i,children:r("glances.mem")}),(0,s.jsx)("div",{className:i,children:r("common.number",{value:t.mem,style:"unit",unit:"percent",maximumFractionDigits:0})})]})}function F(e){let{service:t}=e,{widget:i}
1=t,{chart:r,refreshInterval:a=1e3,version:n=3}=i,{data:o,errorL:l}=(0,h.A)(t.widget,"".concat(n,"/quicklook"),{refreshInterval:a}),{data:m,errorL:d}=(0,h.A)(t.widget,"".concat(n,"/system"),{refreshInterval:3e4});if(l||o&&o.error){let e=l||o.error;return(0,s.jsx)(x,{error:e,widget:i})}if(d)return(0,s.jsx)(x,{error:d,service:t});let u=[];return o&&o.percpu.forEach((e,t)=>{u.push({name:"CPU ".concat(t),cpu:e.total,mem:o.mem,swap:o.swap,proc:o.cpu})}),(0,s.jsxs)(x,{chart:r,children:[r&&(0,s.jsx)("div",{className:"bg-linear-to-br from-theme-500/30 via-theme-600/20 to-theme-700/10 absolute -top-20 -left-2 -right-2 -bottom-2"}),(0,s.jsxs)(c,{position:r?"-top-6 right-2":"top-3 right-2",children:[o&&o.cpu_name&&r&&(0,s.jsx)("div",{className:"text-[0.6rem] opacity-50",children:o.cpu_name}),!r&&(null==o?void 0:o.swap)===0&&(0,s.jsxs)("div",{className:"text-[0.6rem] opacity-50",children:[m&&m.linux_distro&&"".concat(m.linux_distro," - "),m&&m.os_version]}),(0,s.jsx)("div",{children:!r&&(0,s.jsx)(k,{quicklookData:o,className:"opacity-25 ml-2"})})]}),r&&(0,s.jsxs)(c,{position:"bottom-3 left-2",children:[m&&m.linux_distro&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:m.linux_distro}),m&&m.os_version&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:m.os_version}),m&&m.hostname&&(0,s.jsx)("div",{className:"text-xs opacity-75",children:m.hostname})]}),!r&&(0,s.jsx)(c,{position:"bottom-3 left-3",children:(0,s.jsx)(D,{quicklookData:o,className:"opacity-75 mr-2"})}),(0,s.jsxs)(c,{position:"bottom-3 right-2",children:[r&&(0,s.jsx)(D,{quicklookData:o,className:"opacity-50 ml-2"}),r&&(0,s.jsx)(A,{quicklookData:o,className:"opacity-50 ml-2"}),!r&&(0,s.jsx)(A,{quicklookData:o,className:"opacity-75 ml-2"}),r&&(0,s.jsx)(k,{quicklookData:o,className:"opacity-50 ml-2"})]})]})}let I=v()(()=>Promise.all([i.e(6682),i.e(7273)]).then(i.bind(i,27273)),{loadableGenerated:{webpack:()=>[27273]},ssr:!1}),P=e=>e?1e3:5e3;function B(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n}=r,{refreshInterval:o=P(n),pointsLimit:m=15,version:d=3}=r,[u,p]=(0,l.useState)(Array(m).fill({value:0},0,m)),{data:j,error:v}=(0,h.A)(t.widget,"".concat(d,"/mem"),{refreshInterval:Math.max(P(n),o)});return((0,l.useEffect)(()=>{j&&p(e=>{let t=[...e,{a:j.used,b:j.available}];return t.length>m&&t.shift(),t})},[j,m]),v)?(0,s.jsx)(x,{error:v,widget:r}):j?(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)(I,{dataPoints:u,max:j.total,label:[i("resources.used"),i("resources.free")],formatter:e=>i("common.bytes",{value:e,maximumFractionDigits:0,binary:!0})}),j&&!v&&(0,s.jsxs)(c,{position:"bottom-3 left-3",children:[j.available&&n&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("common.bytes",{value:j.available,maximumFractionDigits:1,binary:!0})," ",i("resources.free")]}),j.total&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("common.bytes",{value:j.total,maximumFractionDigits:1,binary:!0})," ",i("resources.total")]})]}),!n&&(0,s.jsx)(c,{position:"top-3 right-3",children:j.available&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("common.bytes",{value:j.available,maximumFractionDigits:1,binary:!0})," ",i("resources.free")]})}),(0,s.jsx)(c,{position:"bottom-3 right-3",children:(0,s.jsxs)("div",{className:"text-xs font-bold opacity-75",children:[i("common.bytes",{value:j.used,maximumFractionDigits:1,binary:!0})," ",i("resources.used")]})})]}):(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})})}let E=v()(()=>Promise.all([i.e(6682),i.e(7273)]).then(i.bind(i,27273)),{loadableGenerated:{webpack:()=>[27273]},ssr:!1}),S=e=>e?1e3:5e3;function M(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,metric:o}=r,{refreshInterval:m=S(n),pointsLimit:d=15,version:u=3}=r,p=3===u?"rx":"bytes_recv",j=3===u?"tx":"bytes_sent",[,v]=o.split(":"),[f,b]=(0,l.useState)(Array(d).fill({value:0},0,d)),{data:g,error:y}=(0,h.A)(r,"".concat(u,"/network"),{refreshInterval:Math.max(S(n),m)});if((0,l.useEffect)(()=>{if(g&&!g.error){let e=g.find(e=>e[e.key]===v);e&&b(t=>{let i=[...t,{a:8*e[p]/e.time_since_update,b:8*e[j]/e.time_since_update}];return i.length>d&&i.shift(),i})}},[g,v,d,p,j]),y||g&&g.error){let e=y||g.error;return(0,s.jsx)(x,{error:e,widget:r})}if(!g)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});let N=g.find(e=>e[e.key]===v);return N?(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)(E,{dataPoints:f,label:[i("docker.rx"),i("docker.tx")],formatter:e=>i("common.bitrate",{value:e,maximumFractionDigits:0})}),(0,s.jsxs)(c,{position:"bottom-3 left-3",children:[N&&N.interface_name&&n&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:N.interface_name}),(0,s.jsxs)("div",{className:"text-xs opacity-75",children:[i("common.bitrate",{value:8*N[p]/N.time_since_update,maximumFractionDigits:0})," ",i("docker.rx")]})]}),!n&&(0,s.jsx)(c,{position:"top-3 right-3",children:N&&N.interface_name&&(0,s.jsx)("div",{className:"text-xs opacity-50",children:N.interface_name})}),(0,s.jsx)(c,{position:"bottom-3 right-3",children:(0,s.jsxs)("div",{className:"text-xs opacity-75",children:[i("common.bitrate",{value:8*N[j]/N.time_since_update,maximumFractionDigits:0})," ",i("docker.tx")]})})]}):(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})})}let q={R:(0,s.jsx)(r.A,{icon:"mdi-circle",width:32,height:32}),S:(0,s.jsx)(r.A,{icon:"mdi-circle-outline",width:32,height:32}),D:(0,s.jsx)(r.A,{icon:"mdi-circle-double",width:32,height:32}),Z:(0,s.jsx)(r.A,{icon:"mdi-circle-opacity",width:32,height:32}),T:(0,s.jsx)(r.A,{icon:"mdi-decagram-outline",width:32,height:32}),t:(0,s.jsx)(r.A,{icon:"mdi-hexagon-outline",width:32,height:32}),X:(0,s.jsx)(r.A,{icon:"mdi-rhombus-outline",width:32,height:32})};function C(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}
1=t,{chart:n,refreshInterval:o=1e3,version:l=3}=r,m=3===l?0:"rss",{data:d,error:u}=(0,h.A)(t.widget,"".concat(l,"/processlist"),{refreshInterval:Math.max(1e3,o)});if(u)return(0,s.jsx)(x,{service:t,widget:r});if(!d)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});d.splice(n?5:1);let p="top-4",j="bottom-4";return n&&(p="-top-6",j="-top-3"),(0,s.jsxs)(x,{chart:n,children:[(0,s.jsx)(c,{position:"".concat(p," right-3 left-3"),children:(0,s.jsxs)("div",{className:"flex items-center text-xs",children:[(0,s.jsx)("div",{className:"grow"}),(0,s.jsx)("div",{className:"w-14 text-right italic",children:i("resources.cpu")}),(0,s.jsx)("div",{className:"w-14 text-right",children:i("resources.mem")})]})}),(0,s.jsx)(c,{position:"".concat(j," right-3 left-3"),children:(0,s.jsx)("div",{className:"pointer-events-none text-theme-900 dark:text-theme-200",children:d.map(e=>{var t,r;return(0,s.jsx)("div",{className:"text-[0.75rem] h-[0.8rem]",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-3 h-3 mr-1.5 opacity-50",children:q[e.status]}),(0,s.jsx)("div",{className:"opacity-75 grow truncate",children:e.name}),(0,s.jsxs)("div",{className:"opacity-25 w-14 text-right",children:[e.cpu_percent.toFixed(1),"%"]}),(0,s.jsx)("div",{className:"opacity-25 w-14 text-right",children:i("common.bytes",{value:null!=(r=null!=(t=e.memory_info[m])?t:e.memory_info.data)?r:e.memory_info.wset,maximumFractionDigits:0})})]})},e.pid)})})})]})}let G=v()(()=>Promise.all([i.e(6682),i.e(9964)]).then(i.bind(i,99964)),{loadableGenerated:{webpack:()=>[99964]},ssr:!1});function z(e){let{service:t}=e,{t:i}=(0,a.Bd)(),{widget:r}=t,{chart:n,refreshInterval:o=1e3,pointsLimit:m=15,version:d=3}=r,[,u]=r.metric.split(":"),[p,j]=(0,l.useState)(Array(m).fill({value:0},0,m)),{data:v,error:f}=(0,h.A)(t.widget,"".concat(d,"/sensors"),{refreshInterval:Math.max(1e3,o)});if((0,l.useEffect)(()=>{if(v&&!v.error){let e=v.find(e=>e.label===u);e?j(t=>{let i=[...t,{value:e.value}];return i.length>m&&i.shift(),i}):v.error=!0}},[v,u,m]),f||v&&v.error){let e=f||v.error;return(0,s.jsx)(x,{error:e,widget:r})}if(!v)return(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})});let b=v.find(e=>e.label===u);return b?(0,s.jsxs)(x,{chart:n,children:[n&&(0,s.jsx)(G,{dataPoints:p,label:[b.unit],max:b.critical,formatter:e=>i("common.number",{value:e})}),b&&!f&&(0,s.jsxs)(c,{position:"bottom-3 left-3",children:[b.warning&&n&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("glances.warn")," ",b.warning," ",b.unit]}),b.critical&&(0,s.jsxs)("div",{className:"text-xs opacity-50",children:[i("glances.crit")," ",b.critical," ",b.unit]})]}),(0,s.jsxs)(c,{position:"bottom-3 right-3",children:[(0,s.jsx)("div",{className:"text-xs opacity-50",children:b.warning&&!n&&(0,s.jsxs)(s.Fragment,{children:[i("glances.warn")," ",b.warning," ",b.unit]})}),(0,s.jsxs)("div",{className:"text-xs opacity-75",children:[i("glances.temp")," ",i("common.number",{value:b.value})," ",b.unit]})]})]}):(0,s.jsx)(x,{chart:n,children:(0,s.jsx)(c,{position:"bottom-3 left-3",children:"-"})})}function L(e){let{service:t}=e,{widget:i}=t;return"info"===i.metric?(0,s.jsx)(F,{service:t}):"memory"===i.metric?(0,s.jsx)(B,{service:t}):"process"===i.metric?(0,s.jsx)(C,{service:t}):"containers"===i.metric?(0,s.jsx)(p,{service:t}):"cpu"===i.metric?(0,s.jsx)(b,{service:t}):i.metric.match(/^network:/)?(0,s.jsx)(M,{service:t}):i.metric.match(/^sensor:/)?(0,s.jsx)(z,{service:t}):i.metric.match(/^disk:/)?(0,s.jsx)(y,{service:t}):i.metric.match(/^gpu:/)?(0,s.jsx)(_,{service:t}):i.metric.match(/^fs:/)?(0,s.jsx)(N,{service:t}):void 0}},82413:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(59650),r=i(84826);function a(e){for(var t,i,a=arguments.length,c=Array(a>1?a-1:0),n=1;n<a;n++)c[n-1]=arguments[n];let o={};c&&(null==(t=c[1])?void 0:t.refreshInterval)&&(o.refreshInterval=c[1].refreshInterval);let l=(0,r.$C)(e,...c);""===c[0]&&(l=null);let{data:m,error:d,mutate:x}=(0,s.Ay)(l,o);return{data:m,error:null!=(i=null==m?void 0:m.error)?i:d,mutate:x}}},84826:(e,t,i)=>{function s(e,t){let i=new URLSearchParams({group:e.service_group,service:e.service_name,index:e.index});return t&&i.append("endpoint",t),i}function r(e,t,i){let r=s(e,t);return i&&r.append("query",JSON.stringify(i)),"/api/services/proxy?".concat(r.toString())}i.d(t,{$C:()=>r,_V:()=>s})}}]);
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.