From d48f4588b29023c09ee2b0ec996d5e1efe1d3905 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 30 Apr 2024 15:33:36 +0200 Subject: [PATCH 1/7] Align WebUI and Curses interface display for mem containers --- glances/outputs/static/js/components/plugin-containers.vue | 6 +++--- glances/outputs/static/public/glances.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glances/outputs/static/js/components/plugin-containers.vue b/glances/outputs/static/js/components/plugin-containers.vue index 0470909d..25641b5f 100644 --- a/glances/outputs/static/js/components/plugin-containers.vue +++ b/glances/outputs/static/js/components/plugin-containers.vue @@ -29,7 +29,7 @@ > MEM -
/MAX
+
/MAX
IOR/s
IOW/s
RX/s
@@ -56,8 +56,8 @@
{{ $filters.bytes(container.memory_usage) }}
-
- {{ $filters.bytes(container.limit) }} +
+ /{{ $filters.bytes(container.limit) }}
{{ $filters.bytes(container.io_rx) }} diff --git a/glances/outputs/static/public/glances.js b/glances/outputs/static/public/glances.js index 95d9065e..af6005c1 100644 --- a/glances/outputs/static/public/glances.js +++ b/glances/outputs/static/public/glances.js @@ -28,4 +28,4 @@ function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object * https://jaywcjlove.github.io/hotkeys-js * Licensed under the MIT license */ -var mo="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function bo(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function vo(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var wo={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":mo?173:189,"=":mo?61:187,";":mo?59:186,"'":222,"[":219,"]":221,"\\":220},xo={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},_o={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},ko={16:!1,18:!1,17:!1,91:!1},So={},Co=1;Co<20;Co++)wo["f".concat(Co)]=111+Co;var To=[],Ao=!1,Eo="all",Oo=[],Io=function(e){return wo[e.toLowerCase()]||xo[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Po(e){Eo=e||"all"}function No(){return Eo||"all"}var Lo=function(e){var t=e.key,n=e.scope,r=e.method,i=e.splitKey,s=void 0===i?"+":i;yo(t).forEach((function(e){var t=e.split(s),i=t.length,o=t[i-1],a="*"===o?"*":Io(o);if(So[a]){n||(n=No());var l=i>1?vo(xo,t):[];So[a]=So[a].filter((function(e){return!((!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s0,ko)Object.prototype.hasOwnProperty.call(ko,s)&&(!ko[s]&&t.mods.indexOf(+s)>-1||ko[s]&&-1===t.mods.indexOf(+s))&&(i=!1);(0!==t.mods.length||ko[16]||ko[18]||ko[17]||ko[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(To),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Mo(e,t){var n=So["*"],r=e.keyCode||e.which||e.charCode;if(jo.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===To.indexOf(r)&&229!==r&&To.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=_o[t];e[t]&&-1===To.indexOf(n)?To.push(n):!e[t]&&To.indexOf(n)>-1?To.splice(To.indexOf(n),1):"metaKey"===t&&e[t]&&3===To.length&&(e.ctrlKey||e.shiftKey||e.altKey||(To=To.slice(To.indexOf(n))))})),r in ko){for(var i in ko[r]=!0,xo)xo[i]===r&&(jo[i]=!0);if(!n)return}for(var s in ko)Object.prototype.hasOwnProperty.call(ko,s)&&(ko[s]=e[_o[s]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===To.indexOf(17)&&To.push(17),-1===To.indexOf(18)&&To.push(18),ko[17]=!0,ko[18]=!0);var o=No();if(n)for(var a=0;a1&&(i=vo(xo,e)),(e="*"===(e=e[e.length-1])?"*":Io(e))in So||(So[e]=[]),So[e].push({keyup:l,keydown:c,scope:s,mods:i,shortcut:r[a],method:n,key:r[a],splitKey:u,element:o});void 0!==o&&!function(e){return Oo.indexOf(e)>-1}(o)&&window&&(Oo.push(o),bo(o,"keydown",(function(e){Mo(e,o)}),d),Ao||(Ao=!0,bo(window,"focus",(function(){To=[]}),d)),bo(o,"keyup",(function(e){Mo(e,o),function(e){var t=e.keyCode||e.which||e.charCode,n=To.indexOf(t);if(n>=0&&To.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&To.splice(0,To.length),93!==t&&224!==t||(t=91),t in ko)for(var r in ko[t]=!1,xo)xo[r]===t&&(jo[r]=!1)}(e)}),d))}var Ro={getPressedKeyString:function(){return To.map((function(e){return t=e,Object.keys(wo).find((function(e){return wo[e]===t}))||function(e){return Object.keys(xo).find((function(t){return xo[t]===e}))}(e)||String.fromCharCode(e);var t}))},setScope:Po,getScope:No,deleteScope:function(e,t){var n,r;for(var i in e||(e=No()),So)if(Object.prototype.hasOwnProperty.call(So,i))for(n=So[i],r=0;r1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(So).forEach((function(n){So[n].filter((function(n){return n.scope===t&&n.shortcut===e})).forEach((function(e){e&&e.method&&e.method()}))}))},unbind:function(e){if(void 0===e)Object.keys(So).forEach((function(e){return delete So[e]}));else if(Array.isArray(e))e.forEach((function(e){e.key&&Lo(e)}));else if("object"==typeof e)e.key&&Lo(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=this.limits[e][l]){var c=l.lastIndexOf("_");return l.substring(c+1)+s}}return"ok"+s}getAlertLog(e,t,n,r){return this.getAlert(e,t,n,r,!0)}};const Ho=new class{data=void 0;init(e=60){let t;const n=()=>(Uo.status="PENDING",Promise.all([fetch("api/4/all",{method:"GET"}).then((e=>e.json())),fetch("api/4/all/views",{method:"GET"}).then((e=>e.json()))]).then((e=>{const t={stats:e[0],views:e[1],isBsd:"FreeBSD"===e[0].system.os_name,isLinux:"Linux"===e[0].system.os_name,isSunOS:"SunOS"===e[0].system.os_name,isMac:"Darwin"===e[0].system.os_name,isWindows:"Windows"===e[0].system.os_name};this.data=t,Uo.data=t,Uo.status="SUCCESS"})).catch((e=>{console.log(e),Uo.status="FAILURE"})).then((()=>{t&&clearTimeout(t),t=setTimeout(n,1e3*e)})));n(),fetch("api/4/all/limits",{method:"GET"}).then((e=>e.json())).then((e=>{$o.setLimits(e)})),fetch("api/4/args",{method:"GET"}).then((e=>e.json())).then(((e={})=>{Uo.args={...Uo.args,...e}})),fetch("api/4/config",{method:"GET"}).then((e=>e.json())).then(((e={})=>{Uo.config={...Uo.config,...e}}))}getData(){return this.data}};const Vo=new class{constructor(){this.favico=new(zo())({animation:"none"})}badge(e){this.favico.badge(e)}reset(){this.favico.reset()}},Go={key:0},Wo={class:"container-fluid"},Zo={class:"row"},Ko={class:"col-sm-12 col-lg-24"},Qo=wi("div",{class:"row"}," ",-1),Xo={class:"row"},Jo={class:"col-sm-12 col-lg-24"},Yo=wi("div",{class:"row"}," ",-1),ea={class:"divTable",style:{width:"100%"}},ta={class:"divTableBody"},na={class:"divTableRow"},ra={class:"divTableHead"},ia={class:"divTableHead"},sa={class:"divTableHead"},oa={class:"divTableHead"},aa={class:"divTableRow"},la={class:"divTableCell"},ca={class:"divTableCell"},ua={class:"divTableCell"},da={class:"divTableCell"},fa={class:"divTableRow"},pa={class:"divTableCell"},ha={class:"divTableCell"},ga={class:"divTableCell"},ma={class:"divTableCell"},ba={class:"divTableRow"},va={class:"divTableCell"},ya={class:"divTableCell"},wa={class:"divTableCell"},xa={class:"divTableCell"},_a={class:"divTableRow"},ka={class:"divTableCell"},Sa={class:"divTableCell"},Ca={class:"divTableCell"},Ta={class:"divTableCell"},Aa={class:"divTableRow"},Ea={class:"divTableCell"},Oa={class:"divTableCell"},Ia={class:"divTableCell"},Pa={class:"divTableCell"},Na={class:"divTableRow"},La={class:"divTableCell"},Da={class:"divTableCell"},Ma={class:"divTableCell"},ja={class:"divTableCell"},Ra={class:"divTableRow"},qa={class:"divTableCell"},Ba={class:"divTableCell"},Ua={class:"divTableCell"},Fa={class:"divTableCell"},za={class:"divTableRow"},$a=wi("div",{class:"divTableCell"}," ",-1),Ha={class:"divTableCell"},Va={class:"divTableCell"},Ga={class:"divTableCell"},Wa={class:"divTableRow"},Za=wi("div",{class:"divTableCell"}," ",-1),Ka={class:"divTableCell"},Qa={class:"divTableCell"},Xa={class:"divTableCell"},Ja={class:"divTableRow"},Ya=wi("div",{class:"divTableCell"}," ",-1),el={class:"divTableCell"},tl={class:"divTableCell"},nl={class:"divTableCell"},rl={class:"divTableRow"},il=wi("div",{class:"divTableCell"}," ",-1),sl={class:"divTableCell"},ol=wi("div",{class:"divTableCell"}," ",-1),al={class:"divTableCell"},ll={class:"divTableRow"},cl=wi("div",{class:"divTableCell"}," ",-1),ul={class:"divTableCell"},dl=wi("div",{class:"divTableCell"}," ",-1),fl=wi("div",{class:"divTableCell"}," ",-1),pl={class:"divTableRow"},hl=wi("div",{class:"divTableCell"}," ",-1),gl={class:"divTableCell"},ml=wi("div",{class:"divTableCell"}," ",-1),bl=wi("div",{class:"divTableCell"}," ",-1),vl={class:"divTableRow"},yl=wi("div",{class:"divTableCell"}," ",-1),wl={class:"divTableCell"},xl=wi("div",{class:"divTableCell"}," ",-1),_l=wi("div",{class:"divTableCell"}," ",-1),kl={class:"divTableRow"},Sl=wi("div",{class:"divTableCell"}," ",-1),Cl={class:"divTableCell"},Tl=wi("div",{class:"divTableCell"}," ",-1),Al=wi("div",{class:"divTableCell"}," ",-1),El={class:"divTableRow"},Ol=wi("div",{class:"divTableCell"}," ",-1),Il={class:"divTableCell"},Pl=wi("div",{class:"divTableCell"}," ",-1),Nl=wi("div",{class:"divTableCell"}," ",-1),Ll={class:"divTableRow"},Dl=wi("div",{class:"divTableCell"}," ",-1),Ml={class:"divTableCell"},jl=wi("div",{class:"divTableCell"}," ",-1),Rl=wi("div",{class:"divTableCell"}," ",-1),ql={class:"divTableRow"},Bl=wi("div",{class:"divTableCell"}," ",-1),Ul={class:"divTableCell"},Fl=wi("div",{class:"divTableCell"}," ",-1),zl=wi("div",{class:"divTableCell"}," ",-1),$l={class:"divTableRow"},Hl=wi("div",{class:"divTableCell"}," ",-1),Vl={class:"divTableCell"},Gl=wi("div",{class:"divTableCell"}," ",-1),Wl=wi("div",{class:"divTableCell"}," ",-1),Zl={class:"divTableRow"},Kl=wi("div",{class:"divTableCell"}," ",-1),Ql={class:"divTableCell"},Xl=wi("div",{class:"divTableCell"}," ",-1),Jl=wi("div",{class:"divTableCell"}," ",-1),Yl=wi("div",null,[wi("p",null,[Si(" For an exhaustive list of key bindings, "),wi("a",{href:"https://glances.readthedocs.io/en/latest/cmds.html#interactive-commands"},"click here"),Si(". ")])],-1),ec=wi("div",null,[wi("p",null,[Si("Press "),wi("b",null,"h"),Si(" to came back to Glances.")])],-1);const tc={data:()=>({help:void 0}),mounted(){fetch("api/4/help",{method:"GET"}).then((e=>e.json())).then((e=>this.help=e))}};var nc=n(3744);const rc=(0,nc.Z)(tc,[["render",function(e,t,n,r,i,s){return i.help?(li(),pi("div",Go,[wi("div",Wo,[wi("div",Zo,[wi("div",Ko,pe(i.help.version)+" "+pe(i.help.psutil_version),1)]),Qo,wi("div",Xo,[wi("div",Jo,pe(i.help.configuration_file),1)]),Yo]),wi("div",ea,[wi("div",ta,[wi("div",na,[wi("div",ra,pe(i.help.header_sort.replace(":","")),1),wi("div",ia,pe(i.help.header_show_hide.replace(":","")),1),wi("div",sa,pe(i.help.header_toggle.replace(":","")),1),wi("div",oa,pe(i.help.header_miscellaneous.replace(":","")),1)]),wi("div",aa,[wi("div",la,pe(i.help.sort_auto),1),wi("div",ca,pe(i.help.show_hide_application_monitoring),1),wi("div",ua,pe(i.help.toggle_bits_bytes),1),wi("div",da,pe(i.help.misc_erase_process_filter),1)]),wi("div",fa,[wi("div",pa,pe(i.help.sort_cpu),1),wi("div",ha,pe(i.help.show_hide_diskio),1),wi("div",ga,pe(i.help.toggle_count_rate),1),wi("div",ma,pe(i.help.misc_generate_history_graphs),1)]),wi("div",ba,[wi("div",va,pe(i.help.sort_io_rate),1),wi("div",ya,pe(i.help.show_hide_containers),1),wi("div",wa,pe(i.help.toggle_used_free),1),wi("div",xa,pe(i.help.misc_help),1)]),wi("div",_a,[wi("div",ka,pe(i.help.sort_mem),1),wi("div",Sa,pe(i.help.show_hide_top_extended_stats),1),wi("div",Ca,pe(i.help.toggle_bar_sparkline),1),wi("div",Ta,pe(i.help.misc_accumulate_processes_by_program),1)]),wi("div",Aa,[wi("div",Ea,pe(i.help.sort_process_name),1),wi("div",Oa,pe(i.help.show_hide_filesystem),1),wi("div",Ia,pe(i.help.toggle_separate_combined),1),wi("div",Pa,pe(i.help.misc_kill_process)+" - N/A in WebUI ",1)]),wi("div",Na,[wi("div",La,pe(i.help.sort_cpu_times),1),wi("div",Da,pe(i.help.show_hide_gpu),1),wi("div",Ma,pe(i.help.toggle_live_cumulative),1),wi("div",ja,pe(i.help.misc_reset_processes_summary_min_max),1)]),wi("div",Ra,[wi("div",qa,pe(i.help.sort_user),1),wi("div",Ba,pe(i.help.show_hide_ip),1),wi("div",Ua,pe(i.help.toggle_linux_percentage),1),wi("div",Fa,pe(i.help.misc_quit),1)]),wi("div",za,[$a,wi("div",Ha,pe(i.help.show_hide_tcp_connection),1),wi("div",Va,pe(i.help.toggle_cpu_individual_combined),1),wi("div",Ga,pe(i.help.misc_reset_history),1)]),wi("div",Wa,[Za,wi("div",Ka,pe(i.help.show_hide_alert),1),wi("div",Qa,pe(i.help.toggle_gpu_individual_combined),1),wi("div",Xa,pe(i.help.misc_delete_warning_alerts),1)]),wi("div",Ja,[Ya,wi("div",el,pe(i.help.show_hide_network),1),wi("div",tl,pe(i.help.toggle_short_full),1),wi("div",nl,pe(i.help.misc_delete_warning_and_critical_alerts),1)]),wi("div",rl,[il,wi("div",sl,pe(i.help.sort_cpu_times),1),ol,wi("div",al,pe(i.help.misc_edit_process_filter_pattern)+" - N/A in WebUI ",1)]),wi("div",ll,[cl,wi("div",ul,pe(i.help.show_hide_irq),1),dl,fl]),wi("div",pl,[hl,wi("div",gl,pe(i.help.show_hide_raid_plugin),1),ml,bl]),wi("div",vl,[yl,wi("div",wl,pe(i.help.show_hide_sensors),1),xl,_l]),wi("div",kl,[Sl,wi("div",Cl,pe(i.help.show_hide_wifi_module),1),Tl,Al]),wi("div",El,[Ol,wi("div",Il,pe(i.help.show_hide_processes),1),Pl,Nl]),wi("div",Ll,[Dl,wi("div",Ml,pe(i.help.show_hide_left_sidebar),1),jl,Rl]),wi("div",ql,[Bl,wi("div",Ul,pe(i.help.show_hide_quick_look),1),Fl,zl]),wi("div",$l,[Hl,wi("div",Vl,pe(i.help.show_hide_cpu_mem_swap),1),Gl,Wl]),wi("div",Zl,[Kl,wi("div",Ql,pe(i.help.show_hide_all),1),Xl,Jl])])]),Yl,ec])):Ti("v-if",!0)}]]),ic={class:"plugin"},sc={id:"alerts"},oc={key:0,class:"title"},ac={key:1,class:"title"},lc={id:"alert"},cc={class:"table"},uc={class:"table-cell text-left"};var dc=n(6486);const fc={props:{data:{type:Object}},computed:{stats(){return this.data.stats.alert},alerts(){return(this.stats||[]).map((e=>{const t={};var n=(new Date).getTimezoneOffset();if(t.state=e.state,t.type=e.type,t.begin=1e3*e.begin-60*n*1e3,t.end=1e3*e.end-60*n*1e3,t.ongoing=-1==e.end,t.min=e.min,t.avg=e.avg,t.max=e.max,t.top=e.top.join(", "),!t.ongoing){const e=t.end-t.begin,n=parseInt(e/1e3%60),r=parseInt(e/6e4%60),i=parseInt(e/36e5%24);t.duration=(0,dc.padStart)(i,2,"0")+":"+(0,dc.padStart)(r,2,"0")+":"+(0,dc.padStart)(n,2,"0")}return t}))},hasAlerts(){return this.countAlerts>0},countAlerts(){return this.alerts.length},hasOngoingAlerts(){return this.countOngoingAlerts>0},countOngoingAlerts(){return this.alerts.filter((({ongoing:e})=>e)).length}},watch:{countOngoingAlerts(){this.countOngoingAlerts?Vo.badge(this.countOngoingAlerts):Vo.reset()}},methods:{formatDate:e=>new Date(e).toLocaleString()}},pc=(0,nc.Z)(fc,[["render",function(e,t,n,r,i,s){return li(),pi("div",ic,[wi("section",sc,[s.hasAlerts?(li(),pi("span",oc," Warning or critical alerts (last "+pe(s.countAlerts)+" entries) ",1)):(li(),pi("span",ac,"No warning or critical alert detected"))]),wi("section",lc,[wi("div",cc,[(li(!0),pi(ni,null,pr(s.alerts,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",uc,[Si(pe(s.formatDate(t.begin))+" "+pe(t.tz)+" ("+pe(t.ongoing?"ongoing":t.duration)+") - ",1),On(wi("span",null,pe(t.state)+" on ",513),[[Ds,!t.ongoing]]),wi("span",{class:ce(t.state.toLowerCase())},pe(t.type),3),Si(" ("+pe(e.$filters.number(t.max,1))+") "+pe(t.top),1)])])))),128))])])])}]]),hc={key:0,id:"cloud",class:"plugin"},gc={class:"title"};const mc={props:{data:{type:Object}},computed:{stats(){return this.data.stats.cloud},provider(){return void 0!==this.stats.id?`${stats.platform}`:null},instance(){const{stats:e}=this;return void 0!==this.stats.id?`${e.type} instance ${e.name} (${e.region})`:null}}},bc=(0,nc.Z)(mc,[["render",function(e,t,n,r,i,s){return s.instance||s.provider?(li(),pi("section",hc,[wi("span",gc,pe(s.provider),1),Si(" "+pe(s.instance),1)])):Ti("v-if",!0)}]]),vc={class:"plugin",id:"connections"},yc=wi("div",{class:"table-row"},[wi("div",{class:"table-cell text-left title"},"TCP CONNECTIONS"),wi("div",{class:"table-cell"})],-1),wc={class:"table-row"},xc=wi("div",{class:"table-cell text-left"},"Listen",-1),_c=wi("div",{class:"table-cell"},null,-1),kc={class:"table-cell"},Sc={class:"table-row"},Cc=wi("div",{class:"table-cell text-left"},"Initiated",-1),Tc=wi("div",{class:"table-cell"},null,-1),Ac={class:"table-cell"},Ec={class:"table-row"},Oc=wi("div",{class:"table-cell text-left"},"Established",-1),Ic=wi("div",{class:"table-cell"},null,-1),Pc={class:"table-cell"},Nc={class:"table-row"},Lc=wi("div",{class:"table-cell text-left"},"Terminated",-1),Dc=wi("div",{class:"table-cell"},null,-1),Mc={class:"table-cell"},jc={class:"table-row"},Rc=wi("div",{class:"table-cell text-left"},"Tracked",-1),qc=wi("div",{class:"table-cell"},null,-1);const Bc={props:{data:{type:Object}},computed:{stats(){return this.data.stats.connections},view(){return this.data.views.connections},listen(){return this.stats.LISTEN},initiated(){return this.stats.initiated},established(){return this.stats.ESTABLISHED},terminated(){return this.stats.terminated},tracked(){return{count:this.stats.nf_conntrack_count,max:this.stats.nf_conntrack_max}}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Uc=(0,nc.Z)(Bc,[["render",function(e,t,n,r,i,s){return li(),pi("section",vc,[yc,wi("div",wc,[xc,_c,wi("div",kc,pe(s.listen),1)]),wi("div",Sc,[Cc,Tc,wi("div",Ac,pe(s.initiated),1)]),wi("div",Ec,[Oc,Ic,wi("div",Pc,pe(s.established),1)]),wi("div",Nc,[Lc,Dc,wi("div",Mc,pe(s.terminated),1)]),wi("div",jc,[Rc,qc,wi("div",{class:ce(["table-cell",s.getDecoration("nf_conntrack_percent")])},pe(s.tracked.count)+"/"+pe(s.tracked.max),3)])])}]]),Fc={id:"cpu",class:"plugin"},zc={class:"row"},$c={class:"col-sm-24 col-md-12 col-lg-8"},Hc={class:"table"},Vc={class:"table-row"},Gc=wi("div",{class:"table-cell text-left title"},"CPU",-1),Wc={class:"table-row"},Zc=wi("div",{class:"table-cell text-left"},"user:",-1),Kc={class:"table-row"},Qc=wi("div",{class:"table-cell text-left"},"system:",-1),Xc={class:"table-row"},Jc=wi("div",{class:"table-cell text-left"},"iowait:",-1),Yc={class:"table-row"},eu=wi("div",{class:"table-cell text-left"},"dpc:",-1),tu={class:"hidden-xs hidden-sm col-md-12 col-lg-8"},nu={class:"table"},ru={class:"table-row"},iu=wi("div",{class:"table-cell text-left"},"idle:",-1),su={class:"table-cell"},ou={class:"table-row"},au=wi("div",{class:"table-cell text-left"},"irq:",-1),lu={class:"table-cell"},cu={class:"table-row"},uu=wi("div",{class:"table-cell text-left"},"inter:",-1),du={class:"table-cell"},fu={class:"table-row"},pu=wi("div",{class:"table-cell text-left"},"nice:",-1),hu={class:"table-cell"},gu={key:0,class:"table-row"},mu=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),bu={class:"table-row"},vu=wi("div",{class:"table-cell text-left"},"steal:",-1),yu={key:1,class:"table-row"},wu=wi("div",{class:"table-cell text-left"},"syscal:",-1),xu={class:"table-cell"},_u={class:"hidden-xs hidden-sm hidden-md col-lg-8"},ku={class:"table"},Su={key:0,class:"table-row"},Cu=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),Tu={key:1,class:"table-row"},Au=wi("div",{class:"table-cell text-left"},"inter:",-1),Eu={class:"table-cell"},Ou={key:2,class:"table-row"},Iu=wi("div",{class:"table-cell text-left"},"sw_int:",-1),Pu={class:"table-cell"},Nu={key:3,class:"table-row"},Lu=wi("div",{class:"table-cell text-left"},"guest:",-1),Du={class:"table-cell"};const Mu={props:{data:{type:Object}},computed:{stats(){return this.data.stats.cpu},view(){return this.data.views.cpu},isLinux(){return this.data.isLinux},isSunOS(){return this.data.isSunOS},isWindows(){return this.data.isWindows},total(){return this.stats.total},user(){return this.stats.user},system(){return this.stats.system},idle(){return this.stats.idle},nice(){return this.stats.nice},irq(){return this.stats.irq},iowait(){return this.stats.iowait},dpc(){return this.stats.dpc},steal(){return this.stats.steal},guest(){return this.stats.guest},ctx_switches(){const{stats:e}=this;return e.ctx_switches?Math.floor(e.ctx_switches/e.time_since_update):null},interrupts(){const{stats:e}=this;return e.interrupts?Math.floor(e.interrupts/e.time_since_update):null},soft_interrupts(){const{stats:e}=this;return e.soft_interrupts?Math.floor(e.soft_interrupts/e.time_since_update):null},syscalls(){const{stats:e}=this;return e.syscalls?Math.floor(e.syscalls/e.time_since_update):null}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},ju=(0,nc.Z)(Mu,[["render",function(e,t,n,r,i,s){return li(),pi("section",Fc,[wi("div",zc,[wi("div",$c,[wi("div",Hc,[wi("div",Vc,[Gc,wi("div",{class:ce(["table-cell",s.getDecoration("total")])},pe(s.total)+"%",3)]),wi("div",Wc,[Zc,wi("div",{class:ce(["table-cell",s.getDecoration("user")])},pe(s.user)+"%",3)]),wi("div",Kc,[Qc,wi("div",{class:ce(["table-cell",s.getDecoration("system")])},pe(s.system)+"%",3)]),On(wi("div",Xc,[Jc,wi("div",{class:ce(["table-cell",s.getDecoration("iowait")])},pe(s.iowait)+"%",3)],512),[[Ds,null!=s.iowait]]),On(wi("div",Yc,[eu,wi("div",{class:ce(["table-cell",s.getDecoration("dpc")])},pe(s.dpc)+"%",3)],512),[[Ds,null==s.iowait&&null!=s.dpc]])])]),wi("div",tu,[wi("div",nu,[wi("div",ru,[iu,wi("div",su,pe(s.idle)+"%",1)]),On(wi("div",ou,[au,wi("div",lu,pe(s.irq)+"%",1)],512),[[Ds,null!=s.irq]]),Ti(" If no irq, display interrupts "),On(wi("div",cu,[uu,wi("div",du,pe(s.interrupts),1)],512),[[Ds,null==s.irq]]),On(wi("div",fu,[pu,wi("div",hu,pe(s.nice)+"%",1)],512),[[Ds,null!=s.nice]]),Ti(" If no nice, display ctx_switches "),null==s.nice&&null!=s.ctx_switches?(li(),pi("div",gu,[mu,wi("div",{class:ce(["table-cell",s.getDecoration("ctx_switches")])},pe(s.ctx_switches),3)])):Ti("v-if",!0),On(wi("div",bu,[vu,wi("div",{class:ce(["table-cell",s.getDecoration("steal")])},pe(s.steal)+"%",3)],512),[[Ds,null!=s.steal]]),s.isLinux||null==s.syscalls?Ti("v-if",!0):(li(),pi("div",yu,[wu,wi("div",xu,pe(s.syscalls),1)]))])]),wi("div",_u,[wi("div",ku,[Ti(" If not already display instead of nice, then display ctx_switches "),null!=s.nice&&null!=s.ctx_switches?(li(),pi("div",Su,[Cu,wi("div",{class:ce(["table-cell",s.getDecoration("ctx_switches")])},pe(s.ctx_switches),3)])):Ti("v-if",!0),Ti(" If not already display instead of irq, then display interrupts "),null!=s.irq&&null!=s.interrupts?(li(),pi("div",Tu,[Au,wi("div",Eu,pe(s.interrupts),1)])):Ti("v-if",!0),s.isWindows||s.isSunOS||null==s.soft_interrupts?Ti("v-if",!0):(li(),pi("div",Ou,[Iu,wi("div",Pu,pe(s.soft_interrupts),1)])),s.isLinux&&null!=s.guest?(li(),pi("div",Nu,[Lu,wi("div",Du,pe(s.guest)+"%",1)])):Ti("v-if",!0)])])])])}]]),Ru={class:"plugin",id:"diskio"},qu={key:0,class:"table-row"},Bu=wi("div",{class:"table-cell text-left title"},"DISK I/O",-1),Uu={class:"table-cell"},Fu={class:"table-cell"},zu={class:"table-cell"},$u={class:"table-cell"},Hu={class:"table-cell text-left"};var Vu=n(1036),Gu=n.n(Vu);function Wu(e,t){return Zu(e=8*Math.round(e),t)+"b"}function Zu(e,t){if(t=t||!1,isNaN(parseFloat(e))||!isFinite(e)||0==e)return e;const n=["Y","Z","E","P","T","G","M","K"],r={Y:12089258196146292e8,Z:11805916207174113e5,E:0x1000000000000000,P:0x4000000000000,T:1099511627776,G:1073741824,M:1048576,K:1024};for(var i=0;i1){var a=0;return o<10?a=2:o<100&&(a=1),t?a="MK"==s?0:(0,dc.min)([1,a]):"K"==s&&(a=0),parseFloat(o).toFixed(a)+s}}return e.toFixed(0)}function Ku(e){return void 0===e||""===e?"?":e}function Qu(e,t,n){return t=t||0,n=n||" ",String(e).padStart(t,n)}function Xu(e,t){return"function"!=typeof e.slice&&(e=String(e)),e.slice(0,t)}function Ju(e,t,n=!0){return t=t||8,e.length>t?n?e.substring(0,t-1)+"_":"_"+e.substring(e.length-t+1):e}function Yu(e){if(void 0===e)return e;var t=function(e){var t=document.createElement("div");return t.innerText=e,t.innerHTML}(e),n=t.replace(/\n/g,"
");return Gu()(n)}function ed(e,t){return new Intl.NumberFormat(void 0,"number"==typeof t?{maximumFractionDigits:t}:t).format(e)}function td(e){for(var t=0,n=0;n({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.diskio},disks(){const e=this.stats.map((e=>{const t=e.time_since_update;return{name:e.disk_name,bitrate:{txps:Zu(e.read_bytes/t),rxps:Zu(e.write_bytes/t)},count:{txps:Zu(e.read_count/t),rxps:Zu(e.write_count/t)},alias:void 0!==e.alias?e.alias:null}}));return(0,dc.orderBy)(e,["name"])}}},id=(0,nc.Z)(rd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ru,[s.disks.length>0?(li(),pi("div",qu,[Bu,On(wi("div",Uu,"R/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",Fu,"W/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",zu,"IOR/s",512),[[Ds,s.args.diskio_iops]]),On(wi("div",$u,"IOW/s",512),[[Ds,s.args.diskio_iops]])])):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.disks,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Hu,pe(e.$filters.minSize(t.alias?t.alias:t.name,32)),1),On(wi("div",{class:"table-cell"},pe(t.bitrate.txps),513),[[Ds,!s.args.diskio_iops]]),On(wi("div",{class:"table-cell"},pe(t.bitrate.rxps),513),[[Ds,!s.args.diskio_iops]]),On(wi("div",{class:"table-cell"},pe(t.count.txps),513),[[Ds,s.args.diskio_iops]]),On(wi("div",{class:"table-cell"},pe(t.count.rxps),513),[[Ds,s.args.diskio_iops]])])))),128))])}]]),sd={key:0,id:"containers-plugin",class:"plugin"},od=wi("span",{class:"title"},"CONTAINERS",-1),ad={class:"table"},ld={class:"table-row"},cd={class:"table-cell text-left"},ud={class:"table-cell text-left"},dd=wi("div",{class:"table-cell"},"Status",-1),fd=wi("div",{class:"table-cell"},"Uptime",-1),pd=Ci('
/MAX
IOR/s
IOW/s
RX/s
TX/s
Command
',6),hd={class:"table-cell text-left"},gd={class:"table-cell"},md={class:"table-cell"},bd={class:"table-cell"},vd={class:"table-cell"},yd={class:"table-cell"},wd={class:"table-cell"},xd={class:"table-cell"},_d={class:"table-cell"},kd={class:"table-cell text-left"};const Sd={props:{data:{type:Object}},data:()=>({store:Uo,sorter:void 0}),computed:{args(){return this.store.args||{}},sortProcessesKey(){return this.args.sort_processes_key},stats(){return this.data.stats.containers},views(){return this.data.views.containers},containers(){const{sorter:e}=this,t=(this.stats||[]).map((e=>({id:e.id,name:e.name,status:e.status,uptime:e.uptime,cpu_percent:e.cpu.total,memory_usage:null!=e.memory.usage?e.memory.usage:"?",limit:null!=e.memory.limit?e.memory.limit:"?",io_rx:null!=e.io_rx?e.io_rx:"?",io_wx:null!=e.io_wx?e.io_wx:"?",network_rx:null!=e.network_rx?e.network_rx:"?",network_tx:null!=e.network_tx?e.network_tx:"?",command:e.command,image:e.image,engine:e.engine,pod_id:e.pod_id})));return(0,dc.orderBy)(t,[e.column].reduce(((e,t)=>("memory_percent"===t&&(t=["memory_usage"]),e.concat(t))),[]),[e.isReverseColumn(e.column)?"desc":"asc"])},showEngine(){return this.views.show_engine_name},showPod(){return this.views.show_pod_name}},watch:{sortProcessesKey:{immediate:!0,handler(e){e&&!["cpu_percent","memory_percent","name"].includes(e)||(this.sorter={column:this.args.sort_processes_key||"cpu_percent",auto:!this.args.sort_processes_key,isReverseColumn:function(e){return!["name"].includes(e)},getColumnLabel:function(e){return{io_counters:"disk IO",cpu_percent:"CPU consumption",memory_usage:"memory consumption",cpu_times:"uptime",name:"container name",None:"None"}[e]||e}})}}}},Cd=(0,nc.Z)(Sd,[["render",function(e,t,n,r,i,s){return s.containers.length?(li(),pi("section",sd,[od,Si(" "+pe(s.containers.length)+" sorted by "+pe(i.sorter.getColumnLabel(i.sorter.column))+" ",1),wi("div",ad,[wi("div",ld,[On(wi("div",cd,"Engine",512),[[Ds,s.showEngine]]),On(wi("div",ud,"Pod",512),[[Ds,s.showPod]]),wi("div",{class:ce(["table-cell text-left",["sortable","name"===i.sorter.column&&"sort"]]),onClick:t[0]||(t[0]=e=>s.args.sort_processes_key="name")}," Name ",2),dd,fd,wi("div",{class:ce(["table-cell",["sortable","cpu_percent"===i.sorter.column&&"sort"]]),onClick:t[1]||(t[1]=e=>s.args.sort_processes_key="cpu_percent")}," CPU% ",2),wi("div",{class:ce(["table-cell",["sortable","memory_percent"===i.sorter.column&&"sort"]]),onClick:t[2]||(t[2]=e=>s.args.sort_processes_key="memory_percent")}," MEM ",2),pd]),(li(!0),pi(ni,null,pr(s.containers,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[On(wi("div",{class:"table-cell text-left"},pe(t.engine),513),[[Ds,s.showEngine]]),On(wi("div",{class:"table-cell text-left"},pe(t.pod_id||"-"),513),[[Ds,s.showPod]]),wi("div",hd,pe(t.name),1),wi("div",{class:ce(["table-cell","Paused"==t.status?"careful":"ok"])},pe(t.status),3),wi("div",gd,pe(t.uptime),1),wi("div",md,pe(e.$filters.number(t.cpu_percent,1)),1),wi("div",bd,pe(e.$filters.bytes(t.memory_usage)),1),wi("div",vd,pe(e.$filters.bytes(t.limit)),1),wi("div",yd,pe(e.$filters.bytes(t.io_rx)),1),wi("div",wd,pe(e.$filters.bytes(t.io_wx)),1),wi("div",xd,pe(e.$filters.bits(t.network_rx)),1),wi("div",_d,pe(e.$filters.bits(t.network_tx)),1),wi("div",kd,pe(t.command),1)])))),128))])])):Ti("v-if",!0)}]]),Td={class:"plugin",id:"folders"},Ad={key:0,class:"table-row"},Ed=[wi("div",{class:"table-cell text-left title"},"FOLDERS",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"Size",-1)],Od={class:"table-cell text-left"},Id=wi("div",{class:"table-cell"},null,-1),Pd={key:0,class:"visible-lg-inline"};const Nd={props:{data:{type:Object}},computed:{stats(){return this.data.stats.folders},folders(){return this.stats.map((e=>({path:e.path,size:e.size,errno:e.errno,careful:e.careful,warning:e.warning,critical:e.critical})))}},methods:{getDecoration:e=>e.errno>0?"error":null!==e.critical&&e.size>1e6*e.critical?"critical":null!==e.warning&&e.size>1e6*e.warning?"warning":null!==e.careful&&e.size>1e6*e.careful?"careful":"ok"}},Ld=(0,nc.Z)(Nd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Td,[s.folders.length>0?(li(),pi("div",Ad,Ed)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.folders,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Od,pe(t.path),1),Id,wi("div",{class:ce(["table-cell",s.getDecoration(t)])},[t.errno>0?(li(),pi("span",Pd," ? ")):Ti("v-if",!0),Si(" "+pe(e.$filters.bytes(t.size)),1)],2)])))),128))])}]]),Dd={class:"plugin",id:"fs"},Md={class:"table-row"},jd=wi("div",{class:"table-cell text-left title"},"FILE SYS",-1),Rd={class:"table-cell"},qd=wi("div",{class:"table-cell"},"Total",-1),Bd={class:"table-cell text-left"},Ud={key:0,class:"visible-lg-inline"},Fd={class:"table-cell"};const zd={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.fs},view(){return this.data.views.fs},fileSystems(){const e=this.stats.map((e=>({name:e.device_name,mountPoint:e.mnt_point,percent:e.percent,size:e.size,used:e.used,free:e.free,alias:void 0!==e.alias?e.alias:null})));return(0,dc.orderBy)(e,["mnt_point"])}},methods:{getDecoration(e,t){if(null!=this.view[e][t])return this.view[e][t].decoration.toLowerCase()}}},$d=(0,nc.Z)(zd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Dd,[wi("div",Md,[jd,wi("div",Rd,[On(wi("span",null,"Used",512),[[Ds,!s.args.fs_free_space]]),On(wi("span",null,"Free",512),[[Ds,s.args.fs_free_space]])]),qd]),(li(!0),pi(ni,null,pr(s.fileSystems,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Bd,[Si(pe(e.$filters.minSize(t.alias?t.alias:t.mountPoint,26,e.begin=!1))+" ",1),(t.alias?t.alias:t.mountPoint).length+t.name.length<=24?(li(),pi("span",Ud," ("+pe(t.name)+") ",1)):Ti("v-if",!0)]),wi("div",{class:ce(["table-cell",s.getDecoration(t.mountPoint,"used")])},[On(wi("span",null,pe(e.$filters.bytes(t.used)),513),[[Ds,!s.args.fs_free_space]]),On(wi("span",null,pe(e.$filters.bytes(t.free)),513),[[Ds,s.args.fs_free_space]])],2),wi("div",Fd,pe(e.$filters.bytes(t.size)),1)])))),128))])}]]),Hd={id:"gpu",class:"plugin"},Vd={class:"gpu-name title"},Gd={class:"table"},Wd={key:0,class:"table-row"},Zd=wi("div",{class:"table-cell text-left"},"proc:",-1),Kd={key:1,class:"table-cell"},Qd={key:1,class:"table-row"},Xd=wi("div",{class:"table-cell text-left"},"mem:",-1),Jd={key:1,class:"table-cell"},Yd={key:2,class:"table-row"},ef=wi("div",{class:"table-cell text-left"},"temperature:",-1),tf={key:1,class:"table-cell"},nf={class:"table-cell text-left"},rf={key:1},sf={key:3},of={key:5};const af={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.gpu},view(){return this.data.views.gpu},gpus(){return this.stats},name(){let e="GPU";const{stats:t}=this;return 1===t.length?e=t[0].name:t.length&&(e=`${t.length} GPU ${t[0].name}`),e},mean(){const e={proc:null,mem:null,temperature:null},{stats:t}=this;if(!t.length)return e;for(let n of t)e.proc+=n.proc,e.mem+=n.mem,e.temperature+=n.temperature;return e.proc=e.proc/t.length,e.mem=e.mem/t.length,e.temperature=e.temperature/t.length,e}},methods:{getDecoration(e,t){if(void 0!==this.view[e][t])return this.view[e][t].decoration.toLowerCase()},getMeanDecoration(e){return this.getDecoration(0,e)}}},lf=(0,nc.Z)(af,[["render",function(e,t,n,r,i,s){return li(),pi("section",Hd,[wi("div",Vd,pe(s.name),1),wi("div",Gd,[s.args.meangpu||1===s.gpus.length?(li(),pi("div",Wd,[Zd,null!=s.mean.proc?(li(),pi("div",{key:0,class:ce(["table-cell",s.getMeanDecoration("proc")])},pe(e.$filters.number(s.mean.proc,0))+"% ",3)):Ti("v-if",!0),null==s.mean.proc?(li(),pi("div",Kd,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),s.args.meangpu||1===s.gpus.length?(li(),pi("div",Qd,[Xd,null!=s.mean.mem?(li(),pi("div",{key:0,class:ce(["table-cell",s.getMeanDecoration("mem")])},pe(e.$filters.number(s.mean.mem,0))+"% ",3)):Ti("v-if",!0),null==s.mean.mem?(li(),pi("div",Jd,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),s.args.meangpu||1===s.gpus.length?(li(),pi("div",Yd,[ef,null!=s.mean.temperature?(li(),pi("div",{key:0,class:ce(["table-cell",s.getMeanDecoration("temperature")])},pe(e.$filters.number(s.mean.temperature,0))+"° ",3)):Ti("v-if",!0),null==s.mean.temperature?(li(),pi("div",tf,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),!s.args.meangpu&&s.gpus.length>1?(li(!0),pi(ni,{key:3},pr(s.gpus,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",nf,[Si(pe(t.gpu_id)+": ",1),null!=t.proc?(li(),pi("span",{key:0,class:ce(s.getDecoration(t.gpu_id,"proc"))},pe(e.$filters.number(t.proc,0))+"% ",3)):Ti("v-if",!0),null==t.proc?(li(),pi("span",rf,"N/A")):Ti("v-if",!0),Si(" mem: "),null!=t.mem?(li(),pi("span",{key:2,class:ce(s.getDecoration(t.gpu_id,"mem"))},pe(e.$filters.number(t.mem,0))+"% ",3)):Ti("v-if",!0),null==t.mem?(li(),pi("span",sf,"N/A")):Ti("v-if",!0),Si(" temp: "),null!=t.temperature?(li(),pi("span",{key:4,class:ce(s.getDecoration(t.gpu_id,"temperature"))},pe(e.$filters.number(t.temperature,0))+"C ",3)):Ti("v-if",!0),null==t.temperature?(li(),pi("span",of,"N/A")):Ti("v-if",!0)])])))),128)):Ti("v-if",!0)])])}]]),cf={key:0,class:"plugin",id:"ip"},uf={key:0,class:"title"},df={key:1},ff={key:2,class:"title"},pf={key:3},hf={key:4};const gf={props:{data:{type:Object}},computed:{ipStats(){return this.data.stats.ip},address(){return this.ipStats.address},gateway(){return this.ipStats.gateway},maskCdir(){return this.ipStats.mask_cidr},publicAddress(){return this.ipStats.public_address},publicInfo(){return this.ipStats.public_info_human}}},mf=(0,nc.Z)(gf,[["render",function(e,t,n,r,i,s){return s.address?(li(),pi("section",cf,[s.address?(li(),pi("span",uf,"IP")):Ti("v-if",!0),s.address?(li(),pi("span",df,pe(s.address)+"/"+pe(s.maskCdir),1)):Ti("v-if",!0),s.publicAddress?(li(),pi("span",ff,"Pub")):Ti("v-if",!0),s.publicAddress?(li(),pi("span",pf,pe(s.publicAddress),1)):Ti("v-if",!0),s.publicInfo?(li(),pi("span",hf,pe(s.publicInfo),1)):Ti("v-if",!0)])):Ti("v-if",!0)}]]),bf={class:"plugin",id:"irq"},vf={key:0,class:"table-row"},yf=[wi("div",{class:"table-cell text-left title"},"IRQ",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"Rate/s",-1)],wf={class:"table-cell text-left"},xf=wi("div",{class:"table-cell"},null,-1),_f={class:"table-cell"};const kf={props:{data:{type:Object}},computed:{stats(){return this.data.stats.irq},irqs(){return this.stats.map((e=>({irq_line:e.irq_line,irq_rate:e.irq_rate})))}}},Sf=(0,nc.Z)(kf,[["render",function(e,t,n,r,i,s){return li(),pi("section",bf,[s.irqs.length>0?(li(),pi("div",vf,yf)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.irqs,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",wf,pe(e.irq_line),1),xf,wi("div",_f,[wi("span",null,pe(e.irq_rate),1)])])))),128))])}]]),Cf={key:0,id:"load",class:"plugin"},Tf={class:"table"},Af={class:"table-row"},Ef=wi("div",{class:"table-cell text-left title"},"LOAD",-1),Of={class:"table-cell"},If={class:"table-row"},Pf=wi("div",{class:"table-cell text-left"},"1 min:",-1),Nf={class:"table-cell"},Lf={class:"table-row"},Df=wi("div",{class:"table-cell text-left"},"5 min:",-1),Mf={class:"table-row"},jf=wi("div",{class:"table-cell text-left"},"15 min:",-1);const Rf={props:{data:{type:Object}},computed:{stats(){return this.data.stats.load},view(){return this.data.views.load},cpucore(){return this.stats.cpucore},min1(){return this.stats.min1},min5(){return this.stats.min5},min15(){return this.stats.min15}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},qf=(0,nc.Z)(Rf,[["render",function(e,t,n,r,i,s){return null!=s.cpucore?(li(),pi("section",Cf,[wi("div",Tf,[wi("div",Af,[Ef,wi("div",Of,pe(s.cpucore)+"-core",1)]),wi("div",If,[Pf,wi("div",Nf,pe(e.$filters.number(s.min1,2)),1)]),wi("div",Lf,[Df,wi("div",{class:ce(["table-cell",s.getDecoration("min5")])},pe(e.$filters.number(s.min5,2)),3)]),wi("div",Mf,[jf,wi("div",{class:ce(["table-cell",s.getDecoration("min15")])},pe(e.$filters.number(s.min15,2)),3)])])])):Ti("v-if",!0)}]]),Bf={id:"mem",class:"plugin"},Uf={class:"table"},Ff={class:"table-row"},zf=wi("div",{class:"table-cell text-left title"},"MEM",-1),$f={class:"table-row"},Hf=wi("div",{class:"table-cell text-left"},"total:",-1),Vf={class:"table-cell"},Gf={class:"table-row"},Wf=wi("div",{class:"table-cell text-left"},"used:",-1),Zf={class:"table-row"},Kf=wi("div",{class:"table-cell text-left"},"free:",-1),Qf={class:"table-cell"};const Xf={props:{data:{type:Object}},computed:{stats(){return this.data.stats.mem},view(){return this.data.views.mem},percent(){return this.stats.percent},total(){return this.stats.total},used(){return this.stats.used},free(){return this.stats.free}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Jf=(0,nc.Z)(Xf,[["render",function(e,t,n,r,i,s){return li(),pi("section",Bf,[wi("div",Uf,[wi("div",Ff,[zf,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",$f,[Hf,wi("div",Vf,pe(e.$filters.bytes(s.total)),1)]),wi("div",Gf,[Wf,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used,2)),3)]),wi("div",Zf,[Kf,wi("div",Qf,pe(e.$filters.bytes(s.free)),1)])])])}]]),Yf={id:"mem-more",class:"plugin"},ep={class:"table"},tp={class:"table-row"},np=wi("div",{class:"table-cell text-left"},"active:",-1),rp={class:"table-cell"},ip={class:"table-row"},sp=wi("div",{class:"table-cell text-left"},"inactive:",-1),op={class:"table-cell"},ap={class:"table-row"},lp=wi("div",{class:"table-cell text-left"},"buffers:",-1),cp={class:"table-cell"},up={class:"table-row"},dp=wi("div",{class:"table-cell text-left"},"cached:",-1),fp={class:"table-cell"};const pp={props:{data:{type:Object}},computed:{stats(){return this.data.stats.mem},active(){return this.stats.active},inactive(){return this.stats.inactive},buffers(){return this.stats.buffers},cached(){return this.stats.cached}}},hp=(0,nc.Z)(pp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Yf,[wi("div",ep,[On(wi("div",tp,[np,wi("div",rp,pe(e.$filters.bytes(s.active)),1)],512),[[Ds,null!=s.active]]),On(wi("div",ip,[sp,wi("div",op,pe(e.$filters.bytes(s.inactive)),1)],512),[[Ds,null!=s.inactive]]),On(wi("div",ap,[lp,wi("div",cp,pe(e.$filters.bytes(s.buffers)),1)],512),[[Ds,null!=s.buffers]]),On(wi("div",up,[dp,wi("div",fp,pe(e.$filters.bytes(s.cached)),1)],512),[[Ds,null!=s.cached]])])])}]]),gp={id:"memswap",class:"plugin"},mp={class:"table"},bp={class:"table-row"},vp=wi("div",{class:"table-cell text-left title"},"SWAP",-1),yp={class:"table-row"},wp=wi("div",{class:"table-cell text-left"},"total:",-1),xp={class:"table-cell"},_p={class:"table-row"},kp=wi("div",{class:"table-cell text-left"},"used:",-1),Sp={class:"table-row"},Cp=wi("div",{class:"table-cell text-left"},"free:",-1),Tp={class:"table-cell"};const Ap={props:{data:{type:Object}},computed:{stats(){return this.data.stats.memswap},view(){return this.data.views.memswap},percent(){return this.stats.percent},total(){return this.stats.total},used(){return this.stats.used},free(){return this.stats.free}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Ep=(0,nc.Z)(Ap,[["render",function(e,t,n,r,i,s){return li(),pi("section",gp,[wi("div",mp,[wi("div",bp,[vp,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",yp,[wp,wi("div",xp,pe(e.$filters.bytes(s.total)),1)]),wi("div",_p,[kp,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used)),3)]),wi("div",Sp,[Cp,wi("div",Tp,pe(e.$filters.bytes(s.free)),1)])])])}]]),Op={class:"plugin",id:"network"},Ip={class:"table-row"},Pp=wi("div",{class:"table-cell text-left title"},"NETWORK",-1),Np={class:"table-cell"},Lp={class:"table-cell"},Dp={class:"table-cell"},Mp={class:"table-cell"},jp={class:"table-cell"},Rp={class:"table-cell"},qp={class:"table-cell"},Bp={class:"table-cell"},Up={class:"table-cell text-left"},Fp={class:"visible-lg-inline"},zp={class:"hidden-lg"},$p={class:"table-cell"},Hp={class:"table-cell"};const Vp={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.network},networks(){const e=this.stats.map((e=>{const t=void 0!==e.alias?e.alias:null;return{interfaceName:e.interface_name,ifname:t||e.interface_name,bytes_recv_rate_per_sec:e.bytes_recv_rate_per_sec,bytes_sent_rate_per_sec:e.bytes_sent_rate_per_sec,bytes_all_rate_per_sec:e.bytes_all_rate_per_sec,bytes_recv:e.bytes_recv,bytes_sent:e.bytes_sent,bytes_all:e.bytes_all}}));return(0,dc.orderBy)(e,["interfaceName"])}}},Gp=(0,nc.Z)(Vp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Op,[wi("div",Ip,[Pp,On(wi("div",Np,"Rx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Lp,"Tx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Dp,null,512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Mp,"Rx+Tx/s",512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",jp,"Rx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Rp,"Tx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",qp,null,512),[[Ds,s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Bp,"Rx+Tx",512),[[Ds,s.args.network_cumul&&s.args.network_sum]])]),(li(!0),pi(ni,null,pr(s.networks,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Up,[wi("span",Fp,pe(t.ifname),1),wi("span",zp,pe(e.$filters.minSize(t.ifname)),1)]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_recv_rate_per_sec):e.$filters.bits(t.bytes_recv_rate_per_sec)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_sent_rate_per_sec):e.$filters.bits(t.bytes_sent_rate_per_sec)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",$p,null,512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_all_rate_per_sec):e.$filters.bits(t.bytes_all_rate_per_sec)),513),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_recv):e.$filters.bits(t.bytes_recv)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_sent):e.$filters.bits(t.bytes_sent)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Hp,null,512),[[Ds,s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_all):e.$filters.bits(t.bytes_all)),513),[[Ds,s.args.network_cumul&&s.args.network_sum]])])))),128))])}]]),Wp={id:"now",class:"plugin"},Zp={class:"table-row"},Kp={class:"table-cell text-left"};const Qp={props:{data:{type:Object}},computed:{date_iso(){return this.data.stats.now.iso}},methods:{localDate:e=>new Date(e).toLocaleString()}},Xp=(0,nc.Z)(Qp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Wp,[wi("div",Zp,[wi("div",Kp,pe(s.localDate(s.date_iso)),1)])])}]]),Jp={id:"percpu",class:"plugin"},Yp={class:"table"},eh={class:"table-row"},th={key:0,class:"table-cell text-left title"},nh={key:1,class:"table-cell"},rh=Ci('
user
system
idle
iowait
steal
',5),ih={key:0,class:"table-cell text-left"},sh={key:1,class:"table-cell"};const oh={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},percpuStats(){return this.data.stats.percpu}},methods:{getUserAlert:e=>$o.getAlert("percpu","percpu_user_",e.user),getSystemAlert:e=>$o.getAlert("percpu","percpu_system_",e.system),getIOWaitAlert:e=>$o.getAlert("percpu","percpu_iowait_",e.system)}},ah=(0,nc.Z)(oh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Jp,[wi("div",Yp,[wi("div",eh,[s.args.disable_quicklook?(li(),pi("div",th,"CPU")):Ti("v-if",!0),s.args.disable_quicklook?(li(),pi("div",nh,"total")):Ti("v-if",!0),rh]),(li(!0),pi(ni,null,pr(s.percpuStats,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[s.args.disable_quicklook?(li(),pi("div",ih," CPU"+pe(e.cpu_number),1)):Ti("v-if",!0),s.args.disable_quicklook?(li(),pi("div",sh,pe(e.total)+"% ",1)):Ti("v-if",!0),wi("div",{class:ce(["table-cell",s.getUserAlert(e)])},pe(e.user)+"% ",3),wi("div",{class:ce(["table-cell",s.getSystemAlert(e)])},pe(e.system)+"% ",3),On(wi("div",{class:"table-cell"},pe(e.idle)+"% ",513),[[Ds,null!=e.idle]]),On(wi("div",{class:ce(["table-cell",s.getIOWaitAlert(e)])},pe(e.iowait)+"% ",3),[[Ds,null!=e.iowait]]),On(wi("div",{class:"table-cell"},pe(e.steal)+"% ",513),[[Ds,null!=e.steal]])])))),128))])])}]]),lh={class:"plugin",id:"ports"},ch={class:"table-cell text-left"},uh=wi("div",{class:"table-cell"},null,-1),dh={key:0},fh={key:1},ph={key:2},hh={key:3},gh={key:0},mh={key:1},bh={key:2};const vh={props:{data:{type:Object}},computed:{stats(){return this.data.stats.ports},ports(){return this.stats}},methods:{getPortDecoration:e=>null===e.status?"careful":!1===e.status?"critical":null!==e.rtt_warning&&e.status>e.rtt_warning?"warning":"ok",getWebDecoration:e=>null===e.status?"careful":-1===[200,301,302].indexOf(e.status)?"critical":null!==e.rtt_warning&&e.elapsed>e.rtt_warning?"warning":"ok"}},yh=(0,nc.Z)(vh,[["render",function(e,t,n,r,i,s){return li(),pi("section",lh,[(li(!0),pi(ni,null,pr(s.ports,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",ch,[Ti(" prettier-ignore "),Si(" "+pe(e.$filters.minSize(t.description?t.description:t.host+" "+t.port,20)),1)]),uh,t.host?(li(),pi("div",{key:0,class:ce([s.getPortDecoration(t),"table-cell"])},["null"==t.status?(li(),pi("span",dh,"Scanning")):"false"==t.status?(li(),pi("span",fh,"Timeout")):"true"==t.status?(li(),pi("span",ph,"Open")):(li(),pi("span",hh,pe(e.$filters.number(1e3*t.status,0))+"ms",1))],2)):Ti("v-if",!0),t.url?(li(),pi("div",{key:1,class:ce([s.getWebDecoration(t),"table-cell"])},["null"==t.status?(li(),pi("span",gh,"Scanning")):"Error"==t.status?(li(),pi("span",mh,"Error")):(li(),pi("span",bh,"Code "+pe(t.status),1))],2)):Ti("v-if",!0)])))),128))])}]]),wh={key:0},xh={key:1},_h={key:0,class:"row"},kh={class:"col-lg-18"};const Sh={id:"amps",class:"plugin"},Ch={class:"table"},Th={key:0,class:"table-cell text-left"},Ah=["innerHTML"];const Eh={props:{data:{type:Object}},computed:{stats(){return this.data.stats.amps},processes(){return this.stats.filter((e=>null!==e.result))}},methods:{getNameDecoration(e){const t=e.count,n=e.countmin,r=e.countmax;let i="ok";return i=t>0?(null===n||t>=n)&&(null===r||t<=r)?"ok":"careful":null===n?"ok":"critical",i}}},Oh=(0,nc.Z)(Eh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Sh,[wi("div",Ch,[(li(!0),pi(ni,null,pr(s.processes,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",{class:ce(["table-cell text-left",s.getNameDecoration(t)])},pe(t.name),3),t.regex?(li(),pi("div",Th,pe(t.count),1)):Ti("v-if",!0),wi("div",{class:"table-cell text-left process-result",innerHTML:e.$filters.nl2br(t.result)},null,8,Ah)])))),128))])])}]]),Ih={id:"processcount",class:"plugin"},Ph=wi("span",{class:"title"},"TASKS",-1),Nh={class:"title"};const Lh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.processcount},total(){return this.stats.total||0},running(){return this.stats.running||0},sleeping(){return this.stats.sleeping||0},stopped(){return this.stats.stopped||0},thread(){return this.stats.thread||0}}},Dh=(0,nc.Z)(Lh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ih,[Ph,wi("span",null,pe(s.total)+" ("+pe(s.thread)+" thr),",1),wi("span",null,pe(s.running)+" run,",1),wi("span",null,pe(s.sleeping)+" slp,",1),wi("span",null,pe(s.stopped)+" oth",1),wi("span",null,pe(s.args.programs?"Programs":"Threads"),1),wi("span",Nh,pe(n.sorter.auto?"sorted automatically":"sorted"),1),wi("span",null,"by "+pe(n.sorter.getColumnLabel(n.sorter.column)),1)])}]]),Mh={id:"processlist-plugin",class:"plugin"},jh={class:"table"},Rh={class:"table-row"},qh=wi("div",{class:"table-cell width-80 hidden-xs hidden-sm"},"VIRT",-1),Bh=wi("div",{class:"table-cell width-80 hidden-xs hidden-sm"},"RES",-1),Uh=wi("div",{class:"table-cell width-80"},"PID",-1),Fh=wi("div",{class:"table-cell width-60"},"NI",-1),zh=wi("div",{class:"table-cell width-60"},"S",-1),$h={class:"table-cell width-80"},Hh={class:"table-cell width-80"},Vh={class:"table-cell width-80"},Gh={class:"table-cell width-100 text-left"},Wh={key:0,class:"table-cell width-100 hidden-xs hidden-sm"},Zh={key:1,class:"table-cell width-80 hidden-xs hidden-sm"},Kh={class:"table-cell width-80 text-left hidden-xs hidden-sm"};const Qh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},stats(){return this.data.stats.processlist},processes(){const{sorter:e}=this,t=this.data.stats.isWindows,n=(this.stats||[]).map((e=>(e.memvirt="?",e.memres="?",e.memory_info&&(e.memvirt=e.memory_info.vms,e.memres=e.memory_info.rss),t&&null!==e.username&&(e.username=(0,dc.last)(e.username.split("\\"))),e.timeplus="?",e.timemillis="?",e.cpu_times&&(e.timeplus=nd(e.cpu_times),e.timemillis=td(e.cpu_times)),null===e.num_threads&&(e.num_threads=-1),null===e.cpu_percent&&(e.cpu_percent=-1),null===e.memory_percent&&(e.memory_percent=-1),e.io_read=null,e.io_write=null,e.io_counters&&(e.io_read=(e.io_counters[0]-e.io_counters[2])/e.time_since_update,e.io_write=(e.io_counters[1]-e.io_counters[3])/e.time_since_update),e.isNice=void 0!==e.nice&&(t&&32!=e.nice||!t&&0!=e.nice),Array.isArray(e.cmdline)&&(e.cmdline=e.cmdline.join(" ").replace(/\n/g," ")),null!==e.cmdline&&0!==e.cmdline.length||(e.cmdline=e.name),e)));return(0,dc.orderBy)(n,[e.column].reduce(((e,t)=>("io_counters"===t&&(t=["io_read","io_write"]),e.concat(t))),[]),[e.isReverseColumn(e.column)?"desc":"asc"]).slice(0,this.limit)},ioReadWritePresent(){return(this.stats||[]).some((({io_counters:e})=>e))},limit(){return void 0!==this.config.outputs?this.config.outputs.max_processes_display:void 0}},methods:{getCpuPercentAlert:e=>$o.getAlert("processlist","processlist_cpu_",e.cpu_percent),getMemoryPercentAlert:e=>$o.getAlert("processlist","processlist_mem_",e.cpu_percent)}},Xh={components:{GlancesPluginAmps:Oh,GlancesPluginProcesscount:Dh,GlancesPluginProcesslist:(0,nc.Z)(Qh,[["render",function(e,t,n,r,i,s){return li(),pi(ni,null,[Ti(" prettier-ignore "),wi("section",Mh,[wi("div",jh,[wi("div",Rh,[wi("div",{class:ce(["table-cell width-60",["sortable","cpu_percent"===n.sorter.column&&"sort"]]),onClick:t[0]||(t[0]=t=>e.$emit("update:sorter","cpu_percent"))}," CPU% ",2),wi("div",{class:ce(["table-cell width-60",["sortable","memory_percent"===n.sorter.column&&"sort"]]),onClick:t[1]||(t[1]=t=>e.$emit("update:sorter","memory_percent"))}," MEM% ",2),qh,Bh,Uh,wi("div",{class:ce(["table-cell width-100 text-left",["sortable","username"===n.sorter.column&&"sort"]]),onClick:t[2]||(t[2]=t=>e.$emit("update:sorter","username"))}," USER ",2),wi("div",{class:ce(["table-cell width-100 hidden-xs hidden-sm",["sortable","timemillis"===n.sorter.column&&"sort"]]),onClick:t[3]||(t[3]=t=>e.$emit("update:sorter","timemillis"))}," TIME+ ",2),wi("div",{class:ce(["table-cell width-80 text-left hidden-xs hidden-sm",["sortable","num_threads"===n.sorter.column&&"sort"]]),onClick:t[4]||(t[4]=t=>e.$emit("update:sorter","num_threads"))}," THR ",2),Fh,zh,On(wi("div",{class:ce(["table-cell width-80 hidden-xs hidden-sm",["sortable","io_counters"===n.sorter.column&&"sort"]]),onClick:t[5]||(t[5]=t=>e.$emit("update:sorter","io_counters"))}," IOR/s ",2),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:ce(["table-cell width-80 text-left hidden-xs hidden-sm",["sortable","io_counters"===n.sorter.column&&"sort"]]),onClick:t[6]||(t[6]=t=>e.$emit("update:sorter","io_counters"))}," IOW/s ",2),[[Ds,s.ioReadWritePresent]]),wi("div",{class:ce(["table-cell text-left",["sortable","name"===n.sorter.column&&"sort"]]),onClick:t[7]||(t[7]=t=>e.$emit("update:sorter","name"))}," Command ",2)]),(li(!0),pi(ni,null,pr(s.processes,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",{class:ce(["table-cell width-60",s.getCpuPercentAlert(t)])},pe(-1==t.cpu_percent?"?":e.$filters.number(t.cpu_percent,1)),3),wi("div",{class:ce(["table-cell width-60",s.getMemoryPercentAlert(t)])},pe(-1==t.memory_percent?"?":e.$filters.number(t.memory_percent,1)),3),wi("div",$h,pe(e.$filters.bytes(t.memvirt)),1),wi("div",Hh,pe(e.$filters.bytes(t.memres)),1),wi("div",Vh,pe(t.pid),1),wi("div",Gh,pe(t.username),1),"?"!=t.timeplus?(li(),pi("div",Wh,[On(wi("span",{class:"highlight"},pe(t.timeplus.hours)+"h",513),[[Ds,t.timeplus.hours>0]]),Si(" "+pe(e.$filters.leftPad(t.timeplus.minutes,2,"0"))+":"+pe(e.$filters.leftPad(t.timeplus.seconds,2,"0"))+" ",1),On(wi("span",null,"."+pe(e.$filters.leftPad(t.timeplus.milliseconds,2,"0")),513),[[Ds,t.timeplus.hours<=0]])])):Ti("v-if",!0),"?"==t.timeplus?(li(),pi("div",Zh,"?")):Ti("v-if",!0),wi("div",Kh,pe(-1==t.num_threads?"?":t.num_threads),1),wi("div",{class:ce(["table-cell width-60",{nice:t.isNice}])},pe(e.$filters.exclamation(t.nice)),3),wi("div",{class:ce(["table-cell width-60",{status:"R"==t.status}])},pe(t.status),3),On(wi("div",{class:"table-cell width-80 hidden-xs hidden-sm"},pe(e.$filters.bytes(t.io_read)),513),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:"table-cell width-80 text-left hidden-xs hidden-sm"},pe(e.$filters.bytes(t.io_write)),513),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:"table-cell text-left"},pe(t.name),513),[[Ds,s.args.process_short_name]]),On(wi("div",{class:"table-cell text-left"},pe(t.cmdline),513),[[Ds,!s.args.process_short_name]])])))),128))])])],2112)}]])},props:{data:{type:Object}},data:()=>({store:Uo,sorter:void 0}),computed:{args(){return this.store.args||{}},sortProcessesKey(){return this.args.sort_processes_key}},watch:{sortProcessesKey:{immediate:!0,handler(e){e&&!["cpu_percent","memory_percent","username","timemillis","num_threads","io_counters","name"].includes(e)||(this.sorter={column:this.args.sort_processes_key||"cpu_percent",auto:!this.args.sort_processes_key,isReverseColumn:function(e){return!["username","name"].includes(e)},getColumnLabel:function(e){return{cpu_percent:"CPU consumption",memory_percent:"memory consumption",username:"user name",timemillis:"process time",cpu_times:"process time",io_counters:"disk IO",name:"process name",None:"None"}[e]||e}})}}}},Jh=(0,nc.Z)(Xh,[["render",function(e,t,n,r,i,s){const o=cr("glances-plugin-processcount"),a=cr("glances-plugin-amps"),l=cr("glances-plugin-processlist");return s.args.disable_process?(li(),pi("div",wh,"PROCESSES DISABLED (press 'z' to display)")):(li(),pi("div",xh,[xi(o,{sorter:i.sorter,data:n.data},null,8,["sorter","data"]),s.args.disable_amps?Ti("v-if",!0):(li(),pi("div",_h,[wi("div",kh,[xi(a,{data:n.data},null,8,["data"])])])),xi(l,{sorter:i.sorter,data:n.data,"onUpdate:sorter":t[0]||(t[0]=e=>s.args.sort_processes_key=e)},null,8,["sorter","data"])]))}]]),Yh={id:"quicklook",class:"plugin"},eg={class:"cpu-name"},tg={class:"table"},ng={key:0,class:"table-row"},rg=wi("div",{class:"table-cell text-left"},"CPU",-1),ig={class:"table-cell"},sg={class:"progress"},og=["aria-valuenow"],ag={class:"table-cell"},lg={class:"table-cell text-left"},cg={class:"table-cell"},ug={class:"progress"},dg=["aria-valuenow"],fg={class:"table-cell"},pg={class:"table-row"},hg={class:"table-cell text-left"},gg={class:"table-cell"},mg={class:"progress"},bg=["aria-valuenow"],vg={class:"table-cell"};const yg={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},stats(){return this.data.stats.quicklook},view(){return this.data.views.quicklook},cpu(){return this.stats.cpu},cpu_name(){return this.stats.cpu_name},cpu_hz_current(){return this.stats.cpu_hz_current},cpu_hz(){return this.stats.cpu_hz},percpus(){var e=this.stats.percpu.map((({cpu_number:e,total:t})=>({number:e,total:t}))),t=parseInt(this.config.percpu.max_cpu_display);if(this.stats.percpu.length>t){var n=e.sort((function(e,t){return t.total-e.total})),r={number:"x",total:Number((n.slice(t).reduce(((e,{total:t})=>e+t),0)/(this.stats.percpu.length-t)).toFixed(1))};(n=n.slice(0,t)).push(r)}return this.stats.percpu.length<=t?e:n},stats_list_after_cpu(){return this.view.list.filter((e=>!e.includes("cpu")))}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},wg=(0,nc.Z)(yg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Yh,[wi("div",eg,pe(s.cpu_name),1),wi("div",tg,[s.args.percpu?Ti("v-if",!0):(li(),pi("div",ng,[rg,wi("div",ig,[wi("div",sg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("cpu")}`),role:"progressbar","aria-valuenow":s.cpu,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.cpu}%;`)},"   ",14,og)])]),wi("div",ag,pe(s.cpu)+"%",1)])),s.args.percpu?(li(!0),pi(ni,{key:1},pr(s.percpus,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",lg,"CPU"+pe(e.number),1),wi("div",cg,[wi("div",ug,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("cpu")}`),role:"progressbar","aria-valuenow":e.total,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${e.total}%;`)},"   ",14,dg)])]),wi("div",fg,pe(e.total)+"%",1)])))),128)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.stats_list_after_cpu,(e=>(li(),pi("div",pg,[wi("div",hg,pe(e.toUpperCase()),1),wi("div",gg,[wi("div",mg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration(e)}`),role:"progressbar","aria-valuenow":s.stats[e],"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.stats[e]}%;`)},"   ",14,bg)])]),wi("div",vg,pe(s.stats[e])+"%",1)])))),256))])])}]]),xg={class:"plugin",id:"raid"},_g={key:0,class:"table-row"},kg=[wi("div",{class:"table-cell text-left title"},"RAID disks",-1),wi("div",{class:"table-cell"},"Used",-1),wi("div",{class:"table-cell"},"Total",-1)],Sg={class:"table-cell text-left"},Cg={class:"warning"};const Tg={props:{data:{type:Object}},computed:{stats(){return this.data.stats.raid},disks(){const e=Object.entries(this.stats).map((([e,t])=>{const n=Object.entries(t.components).map((([e,t])=>({number:t,name:e})));return{name:e,type:null==t.type?"UNKNOWN":t.type,used:t.used,available:t.available,status:t.status,degraded:t.used0}},methods:{getAlert:e=>e.inactive?"critical":e.degraded?"warning":"ok"}},Ag=(0,nc.Z)(Tg,[["render",function(e,t,n,r,i,s){return li(),pi("section",xg,[s.hasDisks?(li(),pi("div",_g,kg)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.disks,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",Sg,[Si(pe(e.type.toUpperCase())+" "+pe(e.name)+" ",1),On(wi("div",Cg,"└─ Degraded mode",512),[[Ds,e.degraded]]),On(wi("div",null,"   └─ "+pe(e.config),513),[[Ds,e.degraded]]),On(wi("div",{class:"critical"},"└─ Status "+pe(e.status),513),[[Ds,e.inactive]]),e.inactive?(li(!0),pi(ni,{key:0},pr(e.components,((t,n)=>(li(),pi("div",{key:n},"    "+pe(n===e.components.length-1?"└─":"├─")+" disk "+pe(t.number)+": "+pe(t.name),1)))),128)):Ti("v-if",!0)]),On(wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.used),3),[[Ds,"active"==e.status]]),On(wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.available),3),[[Ds,"active"==e.status]])])))),128))])}]]),Eg={id:"smart",class:"plugin"},Og=wi("div",{class:"table-row"},[wi("div",{class:"table-cell text-left title"},"SMART disks"),wi("div",{class:"table-cell"}),wi("div",{class:"table-cell"})],-1),Ig={class:"table-row"},Pg={class:"table-cell text-left text-truncate"},Ng=wi("div",{class:"table-cell"},null,-1),Lg=wi("div",{class:"table-cell"},null,-1),Dg={class:"table-cell text-left"},Mg=wi("div",{class:"table-cell"},null,-1),jg={class:"table-cell text-truncate"};const Rg={props:{data:{type:Object}},computed:{stats(){return this.data.stats.smart},drives(){return(Array.isArray(this.stats)?this.stats:[]).map((e=>{const t=e.DeviceName,n=Object.entries(e).filter((([e])=>"DeviceName"!==e)).sort((([,e],[,t])=>e.namet.name?1:0)).map((([e,t])=>t));return{name:t,details:n}}))}}},qg=(0,nc.Z)(Rg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Eg,[Og,(li(!0),pi(ni,null,pr(s.drives,((e,t)=>(li(),pi(ni,{key:t},[wi("div",Ig,[wi("div",Pg,pe(e.name),1),Ng,Lg]),(li(!0),pi(ni,null,pr(e.details,((e,t)=>(li(),pi("div",{key:t,class:"table-row"},[wi("div",Dg,"  "+pe(e.name),1),Mg,wi("div",jg,[wi("span",null,pe(e.raw),1)])])))),128))],64)))),128))])}]]),Bg={class:"plugin",id:"sensors"},Ug={key:0,class:"table-row"},Fg=[wi("div",{class:"table-cell text-left title"},"SENSORS",-1)],zg={class:"table-cell text-left"},$g=wi("div",{class:"table-cell"},null,-1);const Hg={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.sensors},view(){return this.data.views.sensors},sensors(){return this.stats.map((e=>(this.args.fahrenheit&&"battery"!=e.type&&"fan_speed"!=e.type&&(e.value=parseFloat(1.8*e.value+32).toFixed(1),e.unit="F"),e)))}},methods:{getDecoration(e){if(void 0!==this.view[e].value.decoration)return this.view[e].value.decoration.toLowerCase()}}},Vg=(0,nc.Z)(Hg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Bg,[s.sensors.length>0?(li(),pi("div",Ug,Fg)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.sensors,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",zg,pe(e.label),1),$g,wi("div",{class:ce(["table-cell",s.getDecoration(e.label)])},pe(e.value)+pe(e.unit),3)])))),128))])}]]),Gg={class:"plugin",id:"system"},Wg={key:0,class:"critical"},Zg={class:"title"};const Kg={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{stats(){return this.data.stats.system},hostname(){return this.stats.hostname},humanReadableName(){return this.stats.hr_name},isDisconnected(){return"FAILURE"===this.store.status}}},Qg=(0,nc.Z)(Kg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Gg,[s.isDisconnected?(li(),pi("span",Wg,"Disconnected from")):Ti("v-if",!0),wi("span",Zg,pe(s.hostname),1),wi("span",null,pe(s.humanReadableName),1)])}]]),Xg={class:"plugin",id:"uptime"};const Jg={props:{data:{type:Object}},computed:{value(){return this.data.stats.uptime}}},Yg=(0,nc.Z)(Jg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Xg,[wi("span",null,"Uptime: "+pe(s.value),1)])}]]),em={class:"plugin",id:"wifi"},tm={key:0,class:"table-row"},nm=[wi("div",{class:"table-cell text-left title"},"WIFI",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"dBm",-1)],rm={class:"table-cell text-left"},im=wi("div",{class:"table-cell"},null,-1);const sm={props:{data:{type:Object}},computed:{stats(){return this.data.stats.wifi},view(){return this.data.views.wifi},hotspots(){const e=this.stats.map((e=>{if(""!==e.ssid)return{ssid:e.ssid,quality_level:e.quality_level}})).filter(Boolean);return(0,dc.orderBy)(e,["ssid"])}},methods:{getDecoration(e,t){if(void 0!==this.view[e.ssid][t])return this.view[e.ssid][t].decoration.toLowerCase()}}},om=(0,nc.Z)(sm,[["render",function(e,t,n,r,i,s){return li(),pi("section",em,[s.hotspots.length>0?(li(),pi("div",tm,nm)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.hotspots,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",rm,pe(e.$filters.limitTo(t.ssid,20)),1),im,wi("div",{class:ce(["table-cell",s.getDecoration(t,"quality_level")])},pe(t.quality_level),3)])))),128))])}]]),am=JSON.parse('{"t":["network","ports","wifi","connections","diskio","fs","irq","folders","raid","smart","sensors","now"]}'),lm={components:{GlancesHelp:rc,GlancesPluginAlert:pc,GlancesPluginCloud:bc,GlancesPluginConnections:Uc,GlancesPluginCpu:ju,GlancesPluginDiskio:id,GlancesPluginContainers:Cd,GlancesPluginFolders:Ld,GlancesPluginFs:$d,GlancesPluginGpu:lf,GlancesPluginIp:mf,GlancesPluginIrq:Sf,GlancesPluginLoad:qf,GlancesPluginMem:Jf,GlancesPluginMemMore:hp,GlancesPluginMemswap:Ep,GlancesPluginNetwork:Gp,GlancesPluginNow:Xp,GlancesPluginPercpu:ah,GlancesPluginPorts:yh,GlancesPluginProcess:Jh,GlancesPluginQuicklook:wg,GlancesPluginRaid:Ag,GlancesPluginSensors:Vg,GlancesPluginSmart:qg,GlancesPluginSystem:Qg,GlancesPluginUptime:Yg,GlancesPluginWifi:om},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},data(){return this.store.data||{}},dataLoaded(){return void 0!==this.store.data},hasGpu(){return this.store.data.stats.gpu.length>0},isLinux(){return this.store.data.isLinux},title(){const{data:e}=this,t=e.stats&&e.stats.system&&e.stats.system.hostname||"";return t?`${t} - Glances`:"Glances"},leftMenu(){return void 0!==this.config.outputs.left_menu?this.config.outputs.left_menu.split(","):am.t}},watch:{title(){document&&(document.title=this.title)}},methods:{setupHotKeys(){jo("a",(()=>{this.store.args.sort_processes_key=null})),jo("c",(()=>{this.store.args.sort_processes_key="cpu_percent"})),jo("m",(()=>{this.store.args.sort_processes_key="memory_percent"})),jo("u",(()=>{this.store.args.sort_processes_key="username"})),jo("p",(()=>{this.store.args.sort_processes_key="name"})),jo("i",(()=>{this.store.args.sort_processes_key="io_counters"})),jo("t",(()=>{this.store.args.sort_processes_key="timemillis"})),jo("shift+A",(()=>{this.store.args.disable_amps=!this.store.args.disable_amps})),jo("d",(()=>{this.store.args.disable_diskio=!this.store.args.disable_diskio})),jo("shift+Q",(()=>{this.store.args.enable_irq=!this.store.args.enable_irq})),jo("f",(()=>{this.store.args.disable_fs=!this.store.args.disable_fs})),jo("j",(()=>{this.store.args.programs=!this.store.args.programs})),jo("k",(()=>{this.store.args.disable_connections=!this.store.args.disable_connections})),jo("n",(()=>{this.store.args.disable_network=!this.store.args.disable_network})),jo("s",(()=>{this.store.args.disable_sensors=!this.store.args.disable_sensors})),jo("2",(()=>{this.store.args.disable_left_sidebar=!this.store.args.disable_left_sidebar})),jo("z",(()=>{this.store.args.disable_process=!this.store.args.disable_process})),jo("shift+S",(()=>{this.store.args.process_short_name=!this.store.args.process_short_name})),jo("shift+D",(()=>{this.store.args.disable_containers=!this.store.args.disable_containers})),jo("b",(()=>{this.store.args.byte=!this.store.args.byte})),jo("shift+B",(()=>{this.store.args.diskio_iops=!this.store.args.diskio_iops})),jo("l",(()=>{this.store.args.disable_alert=!this.store.args.disable_alert})),jo("1",(()=>{this.store.args.percpu=!this.store.args.percpu})),jo("h",(()=>{this.store.args.help_tag=!this.store.args.help_tag})),jo("shift+T",(()=>{this.store.args.network_sum=!this.store.args.network_sum})),jo("shift+U",(()=>{this.store.args.network_cumul=!this.store.args.network_cumul})),jo("shift+F",(()=>{this.store.args.fs_free_space=!this.store.args.fs_free_space})),jo("3",(()=>{this.store.args.disable_quicklook=!this.store.args.disable_quicklook})),jo("6",(()=>{this.store.args.meangpu=!this.store.args.meangpu})),jo("shift+G",(()=>{this.store.args.disable_gpu=!this.store.args.disable_gpu})),jo("5",(()=>{this.store.args.disable_quicklook=!this.store.args.disable_quicklook,this.store.args.disable_cpu=!this.store.args.disable_cpu,this.store.args.disable_mem=!this.store.args.disable_mem,this.store.args.disable_memswap=!this.store.args.disable_memswap,this.store.args.disable_load=!this.store.args.disable_load,this.store.args.disable_gpu=!this.store.args.disable_gpu})),jo("shift+I",(()=>{this.store.args.disable_ip=!this.store.args.disable_ip})),jo("shift+P",(()=>{this.store.args.disable_ports=!this.store.args.disable_ports})),jo("shift+W",(()=>{this.store.args.disable_wifi=!this.store.args.disable_wifi}))}},mounted(){const e=window.__GLANCES__||{},t=isFinite(e["refresh-time"])?parseInt(e["refresh-time"],10):void 0;Ho.init(t),this.setupHotKeys()},beforeUnmount(){jo.unbind()}};const cm=((...e)=>{const t=qs().createApp(...e);const{mount:n}=t;return t.mount=e=>{const r=Bs(e);if(!r)return;const i=t._component;L(i)||i.render||i.template||(i.template=r.innerHTML),r.innerHTML="";const s=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t})((0,nc.Z)(lm,[["render",function(e,t,n,r,i,s){const o=cr("glances-help"),a=cr("glances-plugin-system"),l=cr("glances-plugin-ip"),c=cr("glances-plugin-uptime"),u=cr("glances-plugin-cloud"),d=cr("glances-plugin-quicklook"),f=cr("glances-plugin-cpu"),p=cr("glances-plugin-percpu"),h=cr("glances-plugin-gpu"),g=cr("glances-plugin-mem"),m=cr("glances-plugin-mem-more"),b=cr("glances-plugin-memswap"),v=cr("glances-plugin-load"),y=cr("glances-plugin-containers"),w=cr("glances-plugin-process"),x=cr("glances-plugin-alert");return s.dataLoaded?s.args.help_tag?(li(),hi(o,{key:1})):(li(),pi("main",zs,[wi("div",$s,[wi("div",Hs,[wi("div",Vs,[wi("div",Gs,[xi(a,{data:s.data},null,8,["data"])]),s.args.disable_ip?Ti("v-if",!0):(li(),pi("div",Ws,[xi(l,{data:s.data},null,8,["data"])])),wi("div",Zs,[xi(c,{data:s.data},null,8,["data"])])])])]),wi("div",Ks,[wi("div",Qs,[wi("div",Xs,[wi("div",Js,[xi(u,{data:s.data},null,8,["data"])])])]),s.args.enable_separator?(li(),pi("div",Ys)):Ti("v-if",!0),wi("div",eo,[s.args.disable_quicklook?Ti("v-if",!0):(li(),pi("div",to,[xi(d,{data:s.data},null,8,["data"])])),s.args.disable_cpu||s.args.percpu?Ti("v-if",!0):(li(),pi("div",no,[xi(f,{data:s.data},null,8,["data"])])),!s.args.disable_cpu&&s.args.percpu?(li(),pi("div",ro,[xi(p,{data:s.data},null,8,["data"])])):Ti("v-if",!0),!s.args.disable_gpu&&s.hasGpu?(li(),pi("div",io,[xi(h,{data:s.data},null,8,["data"])])):Ti("v-if",!0),s.args.disable_mem?Ti("v-if",!0):(li(),pi("div",so,[xi(g,{data:s.data},null,8,["data"])])),Ti(" NOTE: display if MEM enabled and GPU disabled "),s.args.disable_mem||!s.args.disable_gpu&&s.hasGpu?Ti("v-if",!0):(li(),pi("div",oo,[xi(m,{data:s.data},null,8,["data"])])),s.args.disable_memswap?Ti("v-if",!0):(li(),pi("div",ao,[xi(b,{data:s.data},null,8,["data"])])),s.args.disable_load?Ti("v-if",!0):(li(),pi("div",lo,[xi(v,{data:s.data},null,8,["data"])]))]),s.args.enable_separator?(li(),pi("div",co)):Ti("v-if",!0)]),wi("div",uo,[wi("div",fo,[s.args.disable_left_sidebar?Ti("v-if",!0):(li(),pi("div",po,[wi("div",ho,[Ti(" When they exist on the same node, v-if has a higher priority than v-for.\n That means the v-if condition will not have access to variables from the\n scope of the v-for "),(li(!0),pi(ni,null,pr(s.leftMenu,(e=>{return li(),pi(ni,null,[s.args[`disable_${e}`]?Ti("v-if",!0):(li(),hi((t=`glances-plugin-${e}`,D(t)?dr(lr,t,!1)||t:t||ur),{key:0,id:`plugin-${e}`,class:"plugin table-row-group",data:s.data},null,8,["id","data"]))],64);var t})),256))])])),wi("div",go,[s.args.disable_containers?Ti("v-if",!0):(li(),hi(y,{key:0,data:s.data},null,8,["data"])),xi(w,{data:s.data},null,8,["data"]),s.args.disable_alert?Ti("v-if",!0):(li(),hi(x,{key:1,data:s.data},null,8,["data"]))])])])])):(li(),pi("div",Us,Fs))}]]));cm.config.globalProperties.$filters=e,cm.mount("#app")})()})(); \ No newline at end of file +var mo="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function bo(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function vo(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var wo={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":mo?173:189,"=":mo?61:187,";":mo?59:186,"'":222,"[":219,"]":221,"\\":220},xo={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},_o={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},ko={16:!1,18:!1,17:!1,91:!1},So={},Co=1;Co<20;Co++)wo["f".concat(Co)]=111+Co;var To=[],Ao=!1,Eo="all",Oo=[],Io=function(e){return wo[e.toLowerCase()]||xo[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Po(e){Eo=e||"all"}function No(){return Eo||"all"}var Lo=function(e){var t=e.key,n=e.scope,r=e.method,i=e.splitKey,s=void 0===i?"+":i;yo(t).forEach((function(e){var t=e.split(s),i=t.length,o=t[i-1],a="*"===o?"*":Io(o);if(So[a]){n||(n=No());var l=i>1?vo(xo,t):[];So[a]=So[a].filter((function(e){return!((!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s0,ko)Object.prototype.hasOwnProperty.call(ko,s)&&(!ko[s]&&t.mods.indexOf(+s)>-1||ko[s]&&-1===t.mods.indexOf(+s))&&(i=!1);(0!==t.mods.length||ko[16]||ko[18]||ko[17]||ko[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(To),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Mo(e,t){var n=So["*"],r=e.keyCode||e.which||e.charCode;if(jo.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===To.indexOf(r)&&229!==r&&To.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=_o[t];e[t]&&-1===To.indexOf(n)?To.push(n):!e[t]&&To.indexOf(n)>-1?To.splice(To.indexOf(n),1):"metaKey"===t&&e[t]&&3===To.length&&(e.ctrlKey||e.shiftKey||e.altKey||(To=To.slice(To.indexOf(n))))})),r in ko){for(var i in ko[r]=!0,xo)xo[i]===r&&(jo[i]=!0);if(!n)return}for(var s in ko)Object.prototype.hasOwnProperty.call(ko,s)&&(ko[s]=e[_o[s]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===To.indexOf(17)&&To.push(17),-1===To.indexOf(18)&&To.push(18),ko[17]=!0,ko[18]=!0);var o=No();if(n)for(var a=0;a1&&(i=vo(xo,e)),(e="*"===(e=e[e.length-1])?"*":Io(e))in So||(So[e]=[]),So[e].push({keyup:l,keydown:c,scope:s,mods:i,shortcut:r[a],method:n,key:r[a],splitKey:u,element:o});void 0!==o&&!function(e){return Oo.indexOf(e)>-1}(o)&&window&&(Oo.push(o),bo(o,"keydown",(function(e){Mo(e,o)}),d),Ao||(Ao=!0,bo(window,"focus",(function(){To=[]}),d)),bo(o,"keyup",(function(e){Mo(e,o),function(e){var t=e.keyCode||e.which||e.charCode,n=To.indexOf(t);if(n>=0&&To.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&To.splice(0,To.length),93!==t&&224!==t||(t=91),t in ko)for(var r in ko[t]=!1,xo)xo[r]===t&&(jo[r]=!1)}(e)}),d))}var Ro={getPressedKeyString:function(){return To.map((function(e){return t=e,Object.keys(wo).find((function(e){return wo[e]===t}))||function(e){return Object.keys(xo).find((function(t){return xo[t]===e}))}(e)||String.fromCharCode(e);var t}))},setScope:Po,getScope:No,deleteScope:function(e,t){var n,r;for(var i in e||(e=No()),So)if(Object.prototype.hasOwnProperty.call(So,i))for(n=So[i],r=0;r1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(So).forEach((function(n){So[n].filter((function(n){return n.scope===t&&n.shortcut===e})).forEach((function(e){e&&e.method&&e.method()}))}))},unbind:function(e){if(void 0===e)Object.keys(So).forEach((function(e){return delete So[e]}));else if(Array.isArray(e))e.forEach((function(e){e.key&&Lo(e)}));else if("object"==typeof e)e.key&&Lo(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=this.limits[e][l]){var c=l.lastIndexOf("_");return l.substring(c+1)+s}}return"ok"+s}getAlertLog(e,t,n,r){return this.getAlert(e,t,n,r,!0)}};const Ho=new class{data=void 0;init(e=60){let t;const n=()=>(Uo.status="PENDING",Promise.all([fetch("api/4/all",{method:"GET"}).then((e=>e.json())),fetch("api/4/all/views",{method:"GET"}).then((e=>e.json()))]).then((e=>{const t={stats:e[0],views:e[1],isBsd:"FreeBSD"===e[0].system.os_name,isLinux:"Linux"===e[0].system.os_name,isSunOS:"SunOS"===e[0].system.os_name,isMac:"Darwin"===e[0].system.os_name,isWindows:"Windows"===e[0].system.os_name};this.data=t,Uo.data=t,Uo.status="SUCCESS"})).catch((e=>{console.log(e),Uo.status="FAILURE"})).then((()=>{t&&clearTimeout(t),t=setTimeout(n,1e3*e)})));n(),fetch("api/4/all/limits",{method:"GET"}).then((e=>e.json())).then((e=>{$o.setLimits(e)})),fetch("api/4/args",{method:"GET"}).then((e=>e.json())).then(((e={})=>{Uo.args={...Uo.args,...e}})),fetch("api/4/config",{method:"GET"}).then((e=>e.json())).then(((e={})=>{Uo.config={...Uo.config,...e}}))}getData(){return this.data}};const Vo=new class{constructor(){this.favico=new(zo())({animation:"none"})}badge(e){this.favico.badge(e)}reset(){this.favico.reset()}},Go={key:0},Wo={class:"container-fluid"},Zo={class:"row"},Ko={class:"col-sm-12 col-lg-24"},Qo=wi("div",{class:"row"}," ",-1),Xo={class:"row"},Jo={class:"col-sm-12 col-lg-24"},Yo=wi("div",{class:"row"}," ",-1),ea={class:"divTable",style:{width:"100%"}},ta={class:"divTableBody"},na={class:"divTableRow"},ra={class:"divTableHead"},ia={class:"divTableHead"},sa={class:"divTableHead"},oa={class:"divTableHead"},aa={class:"divTableRow"},la={class:"divTableCell"},ca={class:"divTableCell"},ua={class:"divTableCell"},da={class:"divTableCell"},fa={class:"divTableRow"},pa={class:"divTableCell"},ha={class:"divTableCell"},ga={class:"divTableCell"},ma={class:"divTableCell"},ba={class:"divTableRow"},va={class:"divTableCell"},ya={class:"divTableCell"},wa={class:"divTableCell"},xa={class:"divTableCell"},_a={class:"divTableRow"},ka={class:"divTableCell"},Sa={class:"divTableCell"},Ca={class:"divTableCell"},Ta={class:"divTableCell"},Aa={class:"divTableRow"},Ea={class:"divTableCell"},Oa={class:"divTableCell"},Ia={class:"divTableCell"},Pa={class:"divTableCell"},Na={class:"divTableRow"},La={class:"divTableCell"},Da={class:"divTableCell"},Ma={class:"divTableCell"},ja={class:"divTableCell"},Ra={class:"divTableRow"},qa={class:"divTableCell"},Ba={class:"divTableCell"},Ua={class:"divTableCell"},Fa={class:"divTableCell"},za={class:"divTableRow"},$a=wi("div",{class:"divTableCell"}," ",-1),Ha={class:"divTableCell"},Va={class:"divTableCell"},Ga={class:"divTableCell"},Wa={class:"divTableRow"},Za=wi("div",{class:"divTableCell"}," ",-1),Ka={class:"divTableCell"},Qa={class:"divTableCell"},Xa={class:"divTableCell"},Ja={class:"divTableRow"},Ya=wi("div",{class:"divTableCell"}," ",-1),el={class:"divTableCell"},tl={class:"divTableCell"},nl={class:"divTableCell"},rl={class:"divTableRow"},il=wi("div",{class:"divTableCell"}," ",-1),sl={class:"divTableCell"},ol=wi("div",{class:"divTableCell"}," ",-1),al={class:"divTableCell"},ll={class:"divTableRow"},cl=wi("div",{class:"divTableCell"}," ",-1),ul={class:"divTableCell"},dl=wi("div",{class:"divTableCell"}," ",-1),fl=wi("div",{class:"divTableCell"}," ",-1),pl={class:"divTableRow"},hl=wi("div",{class:"divTableCell"}," ",-1),gl={class:"divTableCell"},ml=wi("div",{class:"divTableCell"}," ",-1),bl=wi("div",{class:"divTableCell"}," ",-1),vl={class:"divTableRow"},yl=wi("div",{class:"divTableCell"}," ",-1),wl={class:"divTableCell"},xl=wi("div",{class:"divTableCell"}," ",-1),_l=wi("div",{class:"divTableCell"}," ",-1),kl={class:"divTableRow"},Sl=wi("div",{class:"divTableCell"}," ",-1),Cl={class:"divTableCell"},Tl=wi("div",{class:"divTableCell"}," ",-1),Al=wi("div",{class:"divTableCell"}," ",-1),El={class:"divTableRow"},Ol=wi("div",{class:"divTableCell"}," ",-1),Il={class:"divTableCell"},Pl=wi("div",{class:"divTableCell"}," ",-1),Nl=wi("div",{class:"divTableCell"}," ",-1),Ll={class:"divTableRow"},Dl=wi("div",{class:"divTableCell"}," ",-1),Ml={class:"divTableCell"},jl=wi("div",{class:"divTableCell"}," ",-1),Rl=wi("div",{class:"divTableCell"}," ",-1),ql={class:"divTableRow"},Bl=wi("div",{class:"divTableCell"}," ",-1),Ul={class:"divTableCell"},Fl=wi("div",{class:"divTableCell"}," ",-1),zl=wi("div",{class:"divTableCell"}," ",-1),$l={class:"divTableRow"},Hl=wi("div",{class:"divTableCell"}," ",-1),Vl={class:"divTableCell"},Gl=wi("div",{class:"divTableCell"}," ",-1),Wl=wi("div",{class:"divTableCell"}," ",-1),Zl={class:"divTableRow"},Kl=wi("div",{class:"divTableCell"}," ",-1),Ql={class:"divTableCell"},Xl=wi("div",{class:"divTableCell"}," ",-1),Jl=wi("div",{class:"divTableCell"}," ",-1),Yl=wi("div",null,[wi("p",null,[Si(" For an exhaustive list of key bindings, "),wi("a",{href:"https://glances.readthedocs.io/en/latest/cmds.html#interactive-commands"},"click here"),Si(". ")])],-1),ec=wi("div",null,[wi("p",null,[Si("Press "),wi("b",null,"h"),Si(" to came back to Glances.")])],-1);const tc={data:()=>({help:void 0}),mounted(){fetch("api/4/help",{method:"GET"}).then((e=>e.json())).then((e=>this.help=e))}};var nc=n(3744);const rc=(0,nc.Z)(tc,[["render",function(e,t,n,r,i,s){return i.help?(li(),pi("div",Go,[wi("div",Wo,[wi("div",Zo,[wi("div",Ko,pe(i.help.version)+" "+pe(i.help.psutil_version),1)]),Qo,wi("div",Xo,[wi("div",Jo,pe(i.help.configuration_file),1)]),Yo]),wi("div",ea,[wi("div",ta,[wi("div",na,[wi("div",ra,pe(i.help.header_sort.replace(":","")),1),wi("div",ia,pe(i.help.header_show_hide.replace(":","")),1),wi("div",sa,pe(i.help.header_toggle.replace(":","")),1),wi("div",oa,pe(i.help.header_miscellaneous.replace(":","")),1)]),wi("div",aa,[wi("div",la,pe(i.help.sort_auto),1),wi("div",ca,pe(i.help.show_hide_application_monitoring),1),wi("div",ua,pe(i.help.toggle_bits_bytes),1),wi("div",da,pe(i.help.misc_erase_process_filter),1)]),wi("div",fa,[wi("div",pa,pe(i.help.sort_cpu),1),wi("div",ha,pe(i.help.show_hide_diskio),1),wi("div",ga,pe(i.help.toggle_count_rate),1),wi("div",ma,pe(i.help.misc_generate_history_graphs),1)]),wi("div",ba,[wi("div",va,pe(i.help.sort_io_rate),1),wi("div",ya,pe(i.help.show_hide_containers),1),wi("div",wa,pe(i.help.toggle_used_free),1),wi("div",xa,pe(i.help.misc_help),1)]),wi("div",_a,[wi("div",ka,pe(i.help.sort_mem),1),wi("div",Sa,pe(i.help.show_hide_top_extended_stats),1),wi("div",Ca,pe(i.help.toggle_bar_sparkline),1),wi("div",Ta,pe(i.help.misc_accumulate_processes_by_program),1)]),wi("div",Aa,[wi("div",Ea,pe(i.help.sort_process_name),1),wi("div",Oa,pe(i.help.show_hide_filesystem),1),wi("div",Ia,pe(i.help.toggle_separate_combined),1),wi("div",Pa,pe(i.help.misc_kill_process)+" - N/A in WebUI ",1)]),wi("div",Na,[wi("div",La,pe(i.help.sort_cpu_times),1),wi("div",Da,pe(i.help.show_hide_gpu),1),wi("div",Ma,pe(i.help.toggle_live_cumulative),1),wi("div",ja,pe(i.help.misc_reset_processes_summary_min_max),1)]),wi("div",Ra,[wi("div",qa,pe(i.help.sort_user),1),wi("div",Ba,pe(i.help.show_hide_ip),1),wi("div",Ua,pe(i.help.toggle_linux_percentage),1),wi("div",Fa,pe(i.help.misc_quit),1)]),wi("div",za,[$a,wi("div",Ha,pe(i.help.show_hide_tcp_connection),1),wi("div",Va,pe(i.help.toggle_cpu_individual_combined),1),wi("div",Ga,pe(i.help.misc_reset_history),1)]),wi("div",Wa,[Za,wi("div",Ka,pe(i.help.show_hide_alert),1),wi("div",Qa,pe(i.help.toggle_gpu_individual_combined),1),wi("div",Xa,pe(i.help.misc_delete_warning_alerts),1)]),wi("div",Ja,[Ya,wi("div",el,pe(i.help.show_hide_network),1),wi("div",tl,pe(i.help.toggle_short_full),1),wi("div",nl,pe(i.help.misc_delete_warning_and_critical_alerts),1)]),wi("div",rl,[il,wi("div",sl,pe(i.help.sort_cpu_times),1),ol,wi("div",al,pe(i.help.misc_edit_process_filter_pattern)+" - N/A in WebUI ",1)]),wi("div",ll,[cl,wi("div",ul,pe(i.help.show_hide_irq),1),dl,fl]),wi("div",pl,[hl,wi("div",gl,pe(i.help.show_hide_raid_plugin),1),ml,bl]),wi("div",vl,[yl,wi("div",wl,pe(i.help.show_hide_sensors),1),xl,_l]),wi("div",kl,[Sl,wi("div",Cl,pe(i.help.show_hide_wifi_module),1),Tl,Al]),wi("div",El,[Ol,wi("div",Il,pe(i.help.show_hide_processes),1),Pl,Nl]),wi("div",Ll,[Dl,wi("div",Ml,pe(i.help.show_hide_left_sidebar),1),jl,Rl]),wi("div",ql,[Bl,wi("div",Ul,pe(i.help.show_hide_quick_look),1),Fl,zl]),wi("div",$l,[Hl,wi("div",Vl,pe(i.help.show_hide_cpu_mem_swap),1),Gl,Wl]),wi("div",Zl,[Kl,wi("div",Ql,pe(i.help.show_hide_all),1),Xl,Jl])])]),Yl,ec])):Ti("v-if",!0)}]]),ic={class:"plugin"},sc={id:"alerts"},oc={key:0,class:"title"},ac={key:1,class:"title"},lc={id:"alert"},cc={class:"table"},uc={class:"table-cell text-left"};var dc=n(6486);const fc={props:{data:{type:Object}},computed:{stats(){return this.data.stats.alert},alerts(){return(this.stats||[]).map((e=>{const t={};var n=(new Date).getTimezoneOffset();if(t.state=e.state,t.type=e.type,t.begin=1e3*e.begin-60*n*1e3,t.end=1e3*e.end-60*n*1e3,t.ongoing=-1==e.end,t.min=e.min,t.avg=e.avg,t.max=e.max,t.top=e.top.join(", "),!t.ongoing){const e=t.end-t.begin,n=parseInt(e/1e3%60),r=parseInt(e/6e4%60),i=parseInt(e/36e5%24);t.duration=(0,dc.padStart)(i,2,"0")+":"+(0,dc.padStart)(r,2,"0")+":"+(0,dc.padStart)(n,2,"0")}return t}))},hasAlerts(){return this.countAlerts>0},countAlerts(){return this.alerts.length},hasOngoingAlerts(){return this.countOngoingAlerts>0},countOngoingAlerts(){return this.alerts.filter((({ongoing:e})=>e)).length}},watch:{countOngoingAlerts(){this.countOngoingAlerts?Vo.badge(this.countOngoingAlerts):Vo.reset()}},methods:{formatDate:e=>new Date(e).toLocaleString()}},pc=(0,nc.Z)(fc,[["render",function(e,t,n,r,i,s){return li(),pi("div",ic,[wi("section",sc,[s.hasAlerts?(li(),pi("span",oc," Warning or critical alerts (last "+pe(s.countAlerts)+" entries) ",1)):(li(),pi("span",ac,"No warning or critical alert detected"))]),wi("section",lc,[wi("div",cc,[(li(!0),pi(ni,null,pr(s.alerts,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",uc,[Si(pe(s.formatDate(t.begin))+" "+pe(t.tz)+" ("+pe(t.ongoing?"ongoing":t.duration)+") - ",1),On(wi("span",null,pe(t.state)+" on ",513),[[Ds,!t.ongoing]]),wi("span",{class:ce(t.state.toLowerCase())},pe(t.type),3),Si(" ("+pe(e.$filters.number(t.max,1))+") "+pe(t.top),1)])])))),128))])])])}]]),hc={key:0,id:"cloud",class:"plugin"},gc={class:"title"};const mc={props:{data:{type:Object}},computed:{stats(){return this.data.stats.cloud},provider(){return void 0!==this.stats.id?`${stats.platform}`:null},instance(){const{stats:e}=this;return void 0!==this.stats.id?`${e.type} instance ${e.name} (${e.region})`:null}}},bc=(0,nc.Z)(mc,[["render",function(e,t,n,r,i,s){return s.instance||s.provider?(li(),pi("section",hc,[wi("span",gc,pe(s.provider),1),Si(" "+pe(s.instance),1)])):Ti("v-if",!0)}]]),vc={class:"plugin",id:"connections"},yc=wi("div",{class:"table-row"},[wi("div",{class:"table-cell text-left title"},"TCP CONNECTIONS"),wi("div",{class:"table-cell"})],-1),wc={class:"table-row"},xc=wi("div",{class:"table-cell text-left"},"Listen",-1),_c=wi("div",{class:"table-cell"},null,-1),kc={class:"table-cell"},Sc={class:"table-row"},Cc=wi("div",{class:"table-cell text-left"},"Initiated",-1),Tc=wi("div",{class:"table-cell"},null,-1),Ac={class:"table-cell"},Ec={class:"table-row"},Oc=wi("div",{class:"table-cell text-left"},"Established",-1),Ic=wi("div",{class:"table-cell"},null,-1),Pc={class:"table-cell"},Nc={class:"table-row"},Lc=wi("div",{class:"table-cell text-left"},"Terminated",-1),Dc=wi("div",{class:"table-cell"},null,-1),Mc={class:"table-cell"},jc={class:"table-row"},Rc=wi("div",{class:"table-cell text-left"},"Tracked",-1),qc=wi("div",{class:"table-cell"},null,-1);const Bc={props:{data:{type:Object}},computed:{stats(){return this.data.stats.connections},view(){return this.data.views.connections},listen(){return this.stats.LISTEN},initiated(){return this.stats.initiated},established(){return this.stats.ESTABLISHED},terminated(){return this.stats.terminated},tracked(){return{count:this.stats.nf_conntrack_count,max:this.stats.nf_conntrack_max}}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Uc=(0,nc.Z)(Bc,[["render",function(e,t,n,r,i,s){return li(),pi("section",vc,[yc,wi("div",wc,[xc,_c,wi("div",kc,pe(s.listen),1)]),wi("div",Sc,[Cc,Tc,wi("div",Ac,pe(s.initiated),1)]),wi("div",Ec,[Oc,Ic,wi("div",Pc,pe(s.established),1)]),wi("div",Nc,[Lc,Dc,wi("div",Mc,pe(s.terminated),1)]),wi("div",jc,[Rc,qc,wi("div",{class:ce(["table-cell",s.getDecoration("nf_conntrack_percent")])},pe(s.tracked.count)+"/"+pe(s.tracked.max),3)])])}]]),Fc={id:"cpu",class:"plugin"},zc={class:"row"},$c={class:"col-sm-24 col-md-12 col-lg-8"},Hc={class:"table"},Vc={class:"table-row"},Gc=wi("div",{class:"table-cell text-left title"},"CPU",-1),Wc={class:"table-row"},Zc=wi("div",{class:"table-cell text-left"},"user:",-1),Kc={class:"table-row"},Qc=wi("div",{class:"table-cell text-left"},"system:",-1),Xc={class:"table-row"},Jc=wi("div",{class:"table-cell text-left"},"iowait:",-1),Yc={class:"table-row"},eu=wi("div",{class:"table-cell text-left"},"dpc:",-1),tu={class:"hidden-xs hidden-sm col-md-12 col-lg-8"},nu={class:"table"},ru={class:"table-row"},iu=wi("div",{class:"table-cell text-left"},"idle:",-1),su={class:"table-cell"},ou={class:"table-row"},au=wi("div",{class:"table-cell text-left"},"irq:",-1),lu={class:"table-cell"},cu={class:"table-row"},uu=wi("div",{class:"table-cell text-left"},"inter:",-1),du={class:"table-cell"},fu={class:"table-row"},pu=wi("div",{class:"table-cell text-left"},"nice:",-1),hu={class:"table-cell"},gu={key:0,class:"table-row"},mu=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),bu={class:"table-row"},vu=wi("div",{class:"table-cell text-left"},"steal:",-1),yu={key:1,class:"table-row"},wu=wi("div",{class:"table-cell text-left"},"syscal:",-1),xu={class:"table-cell"},_u={class:"hidden-xs hidden-sm hidden-md col-lg-8"},ku={class:"table"},Su={key:0,class:"table-row"},Cu=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),Tu={key:1,class:"table-row"},Au=wi("div",{class:"table-cell text-left"},"inter:",-1),Eu={class:"table-cell"},Ou={key:2,class:"table-row"},Iu=wi("div",{class:"table-cell text-left"},"sw_int:",-1),Pu={class:"table-cell"},Nu={key:3,class:"table-row"},Lu=wi("div",{class:"table-cell text-left"},"guest:",-1),Du={class:"table-cell"};const Mu={props:{data:{type:Object}},computed:{stats(){return this.data.stats.cpu},view(){return this.data.views.cpu},isLinux(){return this.data.isLinux},isSunOS(){return this.data.isSunOS},isWindows(){return this.data.isWindows},total(){return this.stats.total},user(){return this.stats.user},system(){return this.stats.system},idle(){return this.stats.idle},nice(){return this.stats.nice},irq(){return this.stats.irq},iowait(){return this.stats.iowait},dpc(){return this.stats.dpc},steal(){return this.stats.steal},guest(){return this.stats.guest},ctx_switches(){const{stats:e}=this;return e.ctx_switches?Math.floor(e.ctx_switches/e.time_since_update):null},interrupts(){const{stats:e}=this;return e.interrupts?Math.floor(e.interrupts/e.time_since_update):null},soft_interrupts(){const{stats:e}=this;return e.soft_interrupts?Math.floor(e.soft_interrupts/e.time_since_update):null},syscalls(){const{stats:e}=this;return e.syscalls?Math.floor(e.syscalls/e.time_since_update):null}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},ju=(0,nc.Z)(Mu,[["render",function(e,t,n,r,i,s){return li(),pi("section",Fc,[wi("div",zc,[wi("div",$c,[wi("div",Hc,[wi("div",Vc,[Gc,wi("div",{class:ce(["table-cell",s.getDecoration("total")])},pe(s.total)+"%",3)]),wi("div",Wc,[Zc,wi("div",{class:ce(["table-cell",s.getDecoration("user")])},pe(s.user)+"%",3)]),wi("div",Kc,[Qc,wi("div",{class:ce(["table-cell",s.getDecoration("system")])},pe(s.system)+"%",3)]),On(wi("div",Xc,[Jc,wi("div",{class:ce(["table-cell",s.getDecoration("iowait")])},pe(s.iowait)+"%",3)],512),[[Ds,null!=s.iowait]]),On(wi("div",Yc,[eu,wi("div",{class:ce(["table-cell",s.getDecoration("dpc")])},pe(s.dpc)+"%",3)],512),[[Ds,null==s.iowait&&null!=s.dpc]])])]),wi("div",tu,[wi("div",nu,[wi("div",ru,[iu,wi("div",su,pe(s.idle)+"%",1)]),On(wi("div",ou,[au,wi("div",lu,pe(s.irq)+"%",1)],512),[[Ds,null!=s.irq]]),Ti(" If no irq, display interrupts "),On(wi("div",cu,[uu,wi("div",du,pe(s.interrupts),1)],512),[[Ds,null==s.irq]]),On(wi("div",fu,[pu,wi("div",hu,pe(s.nice)+"%",1)],512),[[Ds,null!=s.nice]]),Ti(" If no nice, display ctx_switches "),null==s.nice&&null!=s.ctx_switches?(li(),pi("div",gu,[mu,wi("div",{class:ce(["table-cell",s.getDecoration("ctx_switches")])},pe(s.ctx_switches),3)])):Ti("v-if",!0),On(wi("div",bu,[vu,wi("div",{class:ce(["table-cell",s.getDecoration("steal")])},pe(s.steal)+"%",3)],512),[[Ds,null!=s.steal]]),s.isLinux||null==s.syscalls?Ti("v-if",!0):(li(),pi("div",yu,[wu,wi("div",xu,pe(s.syscalls),1)]))])]),wi("div",_u,[wi("div",ku,[Ti(" If not already display instead of nice, then display ctx_switches "),null!=s.nice&&null!=s.ctx_switches?(li(),pi("div",Su,[Cu,wi("div",{class:ce(["table-cell",s.getDecoration("ctx_switches")])},pe(s.ctx_switches),3)])):Ti("v-if",!0),Ti(" If not already display instead of irq, then display interrupts "),null!=s.irq&&null!=s.interrupts?(li(),pi("div",Tu,[Au,wi("div",Eu,pe(s.interrupts),1)])):Ti("v-if",!0),s.isWindows||s.isSunOS||null==s.soft_interrupts?Ti("v-if",!0):(li(),pi("div",Ou,[Iu,wi("div",Pu,pe(s.soft_interrupts),1)])),s.isLinux&&null!=s.guest?(li(),pi("div",Nu,[Lu,wi("div",Du,pe(s.guest)+"%",1)])):Ti("v-if",!0)])])])])}]]),Ru={class:"plugin",id:"diskio"},qu={key:0,class:"table-row"},Bu=wi("div",{class:"table-cell text-left title"},"DISK I/O",-1),Uu={class:"table-cell"},Fu={class:"table-cell"},zu={class:"table-cell"},$u={class:"table-cell"},Hu={class:"table-cell text-left"};var Vu=n(1036),Gu=n.n(Vu);function Wu(e,t){return Zu(e=8*Math.round(e),t)+"b"}function Zu(e,t){if(t=t||!1,isNaN(parseFloat(e))||!isFinite(e)||0==e)return e;const n=["Y","Z","E","P","T","G","M","K"],r={Y:12089258196146292e8,Z:11805916207174113e5,E:0x1000000000000000,P:0x4000000000000,T:1099511627776,G:1073741824,M:1048576,K:1024};for(var i=0;i1){var a=0;return o<10?a=2:o<100&&(a=1),t?a="MK"==s?0:(0,dc.min)([1,a]):"K"==s&&(a=0),parseFloat(o).toFixed(a)+s}}return e.toFixed(0)}function Ku(e){return void 0===e||""===e?"?":e}function Qu(e,t,n){return t=t||0,n=n||" ",String(e).padStart(t,n)}function Xu(e,t){return"function"!=typeof e.slice&&(e=String(e)),e.slice(0,t)}function Ju(e,t,n=!0){return t=t||8,e.length>t?n?e.substring(0,t-1)+"_":"_"+e.substring(e.length-t+1):e}function Yu(e){if(void 0===e)return e;var t=function(e){var t=document.createElement("div");return t.innerText=e,t.innerHTML}(e),n=t.replace(/\n/g,"
");return Gu()(n)}function ed(e,t){return new Intl.NumberFormat(void 0,"number"==typeof t?{maximumFractionDigits:t}:t).format(e)}function td(e){for(var t=0,n=0;n({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.diskio},disks(){const e=this.stats.map((e=>{const t=e.time_since_update;return{name:e.disk_name,bitrate:{txps:Zu(e.read_bytes/t),rxps:Zu(e.write_bytes/t)},count:{txps:Zu(e.read_count/t),rxps:Zu(e.write_count/t)},alias:void 0!==e.alias?e.alias:null}}));return(0,dc.orderBy)(e,["name"])}}},id=(0,nc.Z)(rd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ru,[s.disks.length>0?(li(),pi("div",qu,[Bu,On(wi("div",Uu,"R/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",Fu,"W/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",zu,"IOR/s",512),[[Ds,s.args.diskio_iops]]),On(wi("div",$u,"IOW/s",512),[[Ds,s.args.diskio_iops]])])):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.disks,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Hu,pe(e.$filters.minSize(t.alias?t.alias:t.name,32)),1),On(wi("div",{class:"table-cell"},pe(t.bitrate.txps),513),[[Ds,!s.args.diskio_iops]]),On(wi("div",{class:"table-cell"},pe(t.bitrate.rxps),513),[[Ds,!s.args.diskio_iops]]),On(wi("div",{class:"table-cell"},pe(t.count.txps),513),[[Ds,s.args.diskio_iops]]),On(wi("div",{class:"table-cell"},pe(t.count.rxps),513),[[Ds,s.args.diskio_iops]])])))),128))])}]]),sd={key:0,id:"containers-plugin",class:"plugin"},od=wi("span",{class:"title"},"CONTAINERS",-1),ad={class:"table"},ld={class:"table-row"},cd={class:"table-cell text-left"},ud={class:"table-cell text-left"},dd=wi("div",{class:"table-cell"},"Status",-1),fd=wi("div",{class:"table-cell"},"Uptime",-1),pd=Ci('
/MAX
IOR/s
IOW/s
RX/s
TX/s
Command
',6),hd={class:"table-cell text-left"},gd={class:"table-cell"},md={class:"table-cell"},bd={class:"table-cell"},vd={class:"table-cell text-left"},yd={class:"table-cell"},wd={class:"table-cell"},xd={class:"table-cell"},_d={class:"table-cell"},kd={class:"table-cell text-left"};const Sd={props:{data:{type:Object}},data:()=>({store:Uo,sorter:void 0}),computed:{args(){return this.store.args||{}},sortProcessesKey(){return this.args.sort_processes_key},stats(){return this.data.stats.containers},views(){return this.data.views.containers},containers(){const{sorter:e}=this,t=(this.stats||[]).map((e=>({id:e.id,name:e.name,status:e.status,uptime:e.uptime,cpu_percent:e.cpu.total,memory_usage:null!=e.memory.usage?e.memory.usage:"?",limit:null!=e.memory.limit?e.memory.limit:"?",io_rx:null!=e.io_rx?e.io_rx:"?",io_wx:null!=e.io_wx?e.io_wx:"?",network_rx:null!=e.network_rx?e.network_rx:"?",network_tx:null!=e.network_tx?e.network_tx:"?",command:e.command,image:e.image,engine:e.engine,pod_id:e.pod_id})));return(0,dc.orderBy)(t,[e.column].reduce(((e,t)=>("memory_percent"===t&&(t=["memory_usage"]),e.concat(t))),[]),[e.isReverseColumn(e.column)?"desc":"asc"])},showEngine(){return this.views.show_engine_name},showPod(){return this.views.show_pod_name}},watch:{sortProcessesKey:{immediate:!0,handler(e){e&&!["cpu_percent","memory_percent","name"].includes(e)||(this.sorter={column:this.args.sort_processes_key||"cpu_percent",auto:!this.args.sort_processes_key,isReverseColumn:function(e){return!["name"].includes(e)},getColumnLabel:function(e){return{io_counters:"disk IO",cpu_percent:"CPU consumption",memory_usage:"memory consumption",cpu_times:"uptime",name:"container name",None:"None"}[e]||e}})}}}},Cd=(0,nc.Z)(Sd,[["render",function(e,t,n,r,i,s){return s.containers.length?(li(),pi("section",sd,[od,Si(" "+pe(s.containers.length)+" sorted by "+pe(i.sorter.getColumnLabel(i.sorter.column))+" ",1),wi("div",ad,[wi("div",ld,[On(wi("div",cd,"Engine",512),[[Ds,s.showEngine]]),On(wi("div",ud,"Pod",512),[[Ds,s.showPod]]),wi("div",{class:ce(["table-cell text-left",["sortable","name"===i.sorter.column&&"sort"]]),onClick:t[0]||(t[0]=e=>s.args.sort_processes_key="name")}," Name ",2),dd,fd,wi("div",{class:ce(["table-cell",["sortable","cpu_percent"===i.sorter.column&&"sort"]]),onClick:t[1]||(t[1]=e=>s.args.sort_processes_key="cpu_percent")}," CPU% ",2),wi("div",{class:ce(["table-cell",["sortable","memory_percent"===i.sorter.column&&"sort"]]),onClick:t[2]||(t[2]=e=>s.args.sort_processes_key="memory_percent")}," MEM ",2),pd]),(li(!0),pi(ni,null,pr(s.containers,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[On(wi("div",{class:"table-cell text-left"},pe(t.engine),513),[[Ds,s.showEngine]]),On(wi("div",{class:"table-cell text-left"},pe(t.pod_id||"-"),513),[[Ds,s.showPod]]),wi("div",hd,pe(t.name),1),wi("div",{class:ce(["table-cell","Paused"==t.status?"careful":"ok"])},pe(t.status),3),wi("div",gd,pe(t.uptime),1),wi("div",md,pe(e.$filters.number(t.cpu_percent,1)),1),wi("div",bd,pe(e.$filters.bytes(t.memory_usage)),1),wi("div",vd," /"+pe(e.$filters.bytes(t.limit)),1),wi("div",yd,pe(e.$filters.bytes(t.io_rx)),1),wi("div",wd,pe(e.$filters.bytes(t.io_wx)),1),wi("div",xd,pe(e.$filters.bits(t.network_rx)),1),wi("div",_d,pe(e.$filters.bits(t.network_tx)),1),wi("div",kd,pe(t.command),1)])))),128))])])):Ti("v-if",!0)}]]),Td={class:"plugin",id:"folders"},Ad={key:0,class:"table-row"},Ed=[wi("div",{class:"table-cell text-left title"},"FOLDERS",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"Size",-1)],Od={class:"table-cell text-left"},Id=wi("div",{class:"table-cell"},null,-1),Pd={key:0,class:"visible-lg-inline"};const Nd={props:{data:{type:Object}},computed:{stats(){return this.data.stats.folders},folders(){return this.stats.map((e=>({path:e.path,size:e.size,errno:e.errno,careful:e.careful,warning:e.warning,critical:e.critical})))}},methods:{getDecoration:e=>e.errno>0?"error":null!==e.critical&&e.size>1e6*e.critical?"critical":null!==e.warning&&e.size>1e6*e.warning?"warning":null!==e.careful&&e.size>1e6*e.careful?"careful":"ok"}},Ld=(0,nc.Z)(Nd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Td,[s.folders.length>0?(li(),pi("div",Ad,Ed)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.folders,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Od,pe(t.path),1),Id,wi("div",{class:ce(["table-cell",s.getDecoration(t)])},[t.errno>0?(li(),pi("span",Pd," ? ")):Ti("v-if",!0),Si(" "+pe(e.$filters.bytes(t.size)),1)],2)])))),128))])}]]),Dd={class:"plugin",id:"fs"},Md={class:"table-row"},jd=wi("div",{class:"table-cell text-left title"},"FILE SYS",-1),Rd={class:"table-cell"},qd=wi("div",{class:"table-cell"},"Total",-1),Bd={class:"table-cell text-left"},Ud={key:0,class:"visible-lg-inline"},Fd={class:"table-cell"};const zd={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.fs},view(){return this.data.views.fs},fileSystems(){const e=this.stats.map((e=>({name:e.device_name,mountPoint:e.mnt_point,percent:e.percent,size:e.size,used:e.used,free:e.free,alias:void 0!==e.alias?e.alias:null})));return(0,dc.orderBy)(e,["mnt_point"])}},methods:{getDecoration(e,t){if(null!=this.view[e][t])return this.view[e][t].decoration.toLowerCase()}}},$d=(0,nc.Z)(zd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Dd,[wi("div",Md,[jd,wi("div",Rd,[On(wi("span",null,"Used",512),[[Ds,!s.args.fs_free_space]]),On(wi("span",null,"Free",512),[[Ds,s.args.fs_free_space]])]),qd]),(li(!0),pi(ni,null,pr(s.fileSystems,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Bd,[Si(pe(e.$filters.minSize(t.alias?t.alias:t.mountPoint,26,e.begin=!1))+" ",1),(t.alias?t.alias:t.mountPoint).length+t.name.length<=24?(li(),pi("span",Ud," ("+pe(t.name)+") ",1)):Ti("v-if",!0)]),wi("div",{class:ce(["table-cell",s.getDecoration(t.mountPoint,"used")])},[On(wi("span",null,pe(e.$filters.bytes(t.used)),513),[[Ds,!s.args.fs_free_space]]),On(wi("span",null,pe(e.$filters.bytes(t.free)),513),[[Ds,s.args.fs_free_space]])],2),wi("div",Fd,pe(e.$filters.bytes(t.size)),1)])))),128))])}]]),Hd={id:"gpu",class:"plugin"},Vd={class:"gpu-name title"},Gd={class:"table"},Wd={key:0,class:"table-row"},Zd=wi("div",{class:"table-cell text-left"},"proc:",-1),Kd={key:1,class:"table-cell"},Qd={key:1,class:"table-row"},Xd=wi("div",{class:"table-cell text-left"},"mem:",-1),Jd={key:1,class:"table-cell"},Yd={key:2,class:"table-row"},ef=wi("div",{class:"table-cell text-left"},"temperature:",-1),tf={key:1,class:"table-cell"},nf={class:"table-cell text-left"},rf={key:1},sf={key:3},of={key:5};const af={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.gpu},view(){return this.data.views.gpu},gpus(){return this.stats},name(){let e="GPU";const{stats:t}=this;return 1===t.length?e=t[0].name:t.length&&(e=`${t.length} GPU ${t[0].name}`),e},mean(){const e={proc:null,mem:null,temperature:null},{stats:t}=this;if(!t.length)return e;for(let n of t)e.proc+=n.proc,e.mem+=n.mem,e.temperature+=n.temperature;return e.proc=e.proc/t.length,e.mem=e.mem/t.length,e.temperature=e.temperature/t.length,e}},methods:{getDecoration(e,t){if(void 0!==this.view[e][t])return this.view[e][t].decoration.toLowerCase()},getMeanDecoration(e){return this.getDecoration(0,e)}}},lf=(0,nc.Z)(af,[["render",function(e,t,n,r,i,s){return li(),pi("section",Hd,[wi("div",Vd,pe(s.name),1),wi("div",Gd,[s.args.meangpu||1===s.gpus.length?(li(),pi("div",Wd,[Zd,null!=s.mean.proc?(li(),pi("div",{key:0,class:ce(["table-cell",s.getMeanDecoration("proc")])},pe(e.$filters.number(s.mean.proc,0))+"% ",3)):Ti("v-if",!0),null==s.mean.proc?(li(),pi("div",Kd,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),s.args.meangpu||1===s.gpus.length?(li(),pi("div",Qd,[Xd,null!=s.mean.mem?(li(),pi("div",{key:0,class:ce(["table-cell",s.getMeanDecoration("mem")])},pe(e.$filters.number(s.mean.mem,0))+"% ",3)):Ti("v-if",!0),null==s.mean.mem?(li(),pi("div",Jd,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),s.args.meangpu||1===s.gpus.length?(li(),pi("div",Yd,[ef,null!=s.mean.temperature?(li(),pi("div",{key:0,class:ce(["table-cell",s.getMeanDecoration("temperature")])},pe(e.$filters.number(s.mean.temperature,0))+"° ",3)):Ti("v-if",!0),null==s.mean.temperature?(li(),pi("div",tf,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),!s.args.meangpu&&s.gpus.length>1?(li(!0),pi(ni,{key:3},pr(s.gpus,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",nf,[Si(pe(t.gpu_id)+": ",1),null!=t.proc?(li(),pi("span",{key:0,class:ce(s.getDecoration(t.gpu_id,"proc"))},pe(e.$filters.number(t.proc,0))+"% ",3)):Ti("v-if",!0),null==t.proc?(li(),pi("span",rf,"N/A")):Ti("v-if",!0),Si(" mem: "),null!=t.mem?(li(),pi("span",{key:2,class:ce(s.getDecoration(t.gpu_id,"mem"))},pe(e.$filters.number(t.mem,0))+"% ",3)):Ti("v-if",!0),null==t.mem?(li(),pi("span",sf,"N/A")):Ti("v-if",!0),Si(" temp: "),null!=t.temperature?(li(),pi("span",{key:4,class:ce(s.getDecoration(t.gpu_id,"temperature"))},pe(e.$filters.number(t.temperature,0))+"C ",3)):Ti("v-if",!0),null==t.temperature?(li(),pi("span",of,"N/A")):Ti("v-if",!0)])])))),128)):Ti("v-if",!0)])])}]]),cf={key:0,class:"plugin",id:"ip"},uf={key:0,class:"title"},df={key:1},ff={key:2,class:"title"},pf={key:3},hf={key:4};const gf={props:{data:{type:Object}},computed:{ipStats(){return this.data.stats.ip},address(){return this.ipStats.address},gateway(){return this.ipStats.gateway},maskCdir(){return this.ipStats.mask_cidr},publicAddress(){return this.ipStats.public_address},publicInfo(){return this.ipStats.public_info_human}}},mf=(0,nc.Z)(gf,[["render",function(e,t,n,r,i,s){return s.address?(li(),pi("section",cf,[s.address?(li(),pi("span",uf,"IP")):Ti("v-if",!0),s.address?(li(),pi("span",df,pe(s.address)+"/"+pe(s.maskCdir),1)):Ti("v-if",!0),s.publicAddress?(li(),pi("span",ff,"Pub")):Ti("v-if",!0),s.publicAddress?(li(),pi("span",pf,pe(s.publicAddress),1)):Ti("v-if",!0),s.publicInfo?(li(),pi("span",hf,pe(s.publicInfo),1)):Ti("v-if",!0)])):Ti("v-if",!0)}]]),bf={class:"plugin",id:"irq"},vf={key:0,class:"table-row"},yf=[wi("div",{class:"table-cell text-left title"},"IRQ",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"Rate/s",-1)],wf={class:"table-cell text-left"},xf=wi("div",{class:"table-cell"},null,-1),_f={class:"table-cell"};const kf={props:{data:{type:Object}},computed:{stats(){return this.data.stats.irq},irqs(){return this.stats.map((e=>({irq_line:e.irq_line,irq_rate:e.irq_rate})))}}},Sf=(0,nc.Z)(kf,[["render",function(e,t,n,r,i,s){return li(),pi("section",bf,[s.irqs.length>0?(li(),pi("div",vf,yf)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.irqs,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",wf,pe(e.irq_line),1),xf,wi("div",_f,[wi("span",null,pe(e.irq_rate),1)])])))),128))])}]]),Cf={key:0,id:"load",class:"plugin"},Tf={class:"table"},Af={class:"table-row"},Ef=wi("div",{class:"table-cell text-left title"},"LOAD",-1),Of={class:"table-cell"},If={class:"table-row"},Pf=wi("div",{class:"table-cell text-left"},"1 min:",-1),Nf={class:"table-cell"},Lf={class:"table-row"},Df=wi("div",{class:"table-cell text-left"},"5 min:",-1),Mf={class:"table-row"},jf=wi("div",{class:"table-cell text-left"},"15 min:",-1);const Rf={props:{data:{type:Object}},computed:{stats(){return this.data.stats.load},view(){return this.data.views.load},cpucore(){return this.stats.cpucore},min1(){return this.stats.min1},min5(){return this.stats.min5},min15(){return this.stats.min15}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},qf=(0,nc.Z)(Rf,[["render",function(e,t,n,r,i,s){return null!=s.cpucore?(li(),pi("section",Cf,[wi("div",Tf,[wi("div",Af,[Ef,wi("div",Of,pe(s.cpucore)+"-core",1)]),wi("div",If,[Pf,wi("div",Nf,pe(e.$filters.number(s.min1,2)),1)]),wi("div",Lf,[Df,wi("div",{class:ce(["table-cell",s.getDecoration("min5")])},pe(e.$filters.number(s.min5,2)),3)]),wi("div",Mf,[jf,wi("div",{class:ce(["table-cell",s.getDecoration("min15")])},pe(e.$filters.number(s.min15,2)),3)])])])):Ti("v-if",!0)}]]),Bf={id:"mem",class:"plugin"},Uf={class:"table"},Ff={class:"table-row"},zf=wi("div",{class:"table-cell text-left title"},"MEM",-1),$f={class:"table-row"},Hf=wi("div",{class:"table-cell text-left"},"total:",-1),Vf={class:"table-cell"},Gf={class:"table-row"},Wf=wi("div",{class:"table-cell text-left"},"used:",-1),Zf={class:"table-row"},Kf=wi("div",{class:"table-cell text-left"},"free:",-1),Qf={class:"table-cell"};const Xf={props:{data:{type:Object}},computed:{stats(){return this.data.stats.mem},view(){return this.data.views.mem},percent(){return this.stats.percent},total(){return this.stats.total},used(){return this.stats.used},free(){return this.stats.free}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Jf=(0,nc.Z)(Xf,[["render",function(e,t,n,r,i,s){return li(),pi("section",Bf,[wi("div",Uf,[wi("div",Ff,[zf,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",$f,[Hf,wi("div",Vf,pe(e.$filters.bytes(s.total)),1)]),wi("div",Gf,[Wf,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used,2)),3)]),wi("div",Zf,[Kf,wi("div",Qf,pe(e.$filters.bytes(s.free)),1)])])])}]]),Yf={id:"mem-more",class:"plugin"},ep={class:"table"},tp={class:"table-row"},np=wi("div",{class:"table-cell text-left"},"active:",-1),rp={class:"table-cell"},ip={class:"table-row"},sp=wi("div",{class:"table-cell text-left"},"inactive:",-1),op={class:"table-cell"},ap={class:"table-row"},lp=wi("div",{class:"table-cell text-left"},"buffers:",-1),cp={class:"table-cell"},up={class:"table-row"},dp=wi("div",{class:"table-cell text-left"},"cached:",-1),fp={class:"table-cell"};const pp={props:{data:{type:Object}},computed:{stats(){return this.data.stats.mem},active(){return this.stats.active},inactive(){return this.stats.inactive},buffers(){return this.stats.buffers},cached(){return this.stats.cached}}},hp=(0,nc.Z)(pp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Yf,[wi("div",ep,[On(wi("div",tp,[np,wi("div",rp,pe(e.$filters.bytes(s.active)),1)],512),[[Ds,null!=s.active]]),On(wi("div",ip,[sp,wi("div",op,pe(e.$filters.bytes(s.inactive)),1)],512),[[Ds,null!=s.inactive]]),On(wi("div",ap,[lp,wi("div",cp,pe(e.$filters.bytes(s.buffers)),1)],512),[[Ds,null!=s.buffers]]),On(wi("div",up,[dp,wi("div",fp,pe(e.$filters.bytes(s.cached)),1)],512),[[Ds,null!=s.cached]])])])}]]),gp={id:"memswap",class:"plugin"},mp={class:"table"},bp={class:"table-row"},vp=wi("div",{class:"table-cell text-left title"},"SWAP",-1),yp={class:"table-row"},wp=wi("div",{class:"table-cell text-left"},"total:",-1),xp={class:"table-cell"},_p={class:"table-row"},kp=wi("div",{class:"table-cell text-left"},"used:",-1),Sp={class:"table-row"},Cp=wi("div",{class:"table-cell text-left"},"free:",-1),Tp={class:"table-cell"};const Ap={props:{data:{type:Object}},computed:{stats(){return this.data.stats.memswap},view(){return this.data.views.memswap},percent(){return this.stats.percent},total(){return this.stats.total},used(){return this.stats.used},free(){return this.stats.free}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Ep=(0,nc.Z)(Ap,[["render",function(e,t,n,r,i,s){return li(),pi("section",gp,[wi("div",mp,[wi("div",bp,[vp,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",yp,[wp,wi("div",xp,pe(e.$filters.bytes(s.total)),1)]),wi("div",_p,[kp,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used)),3)]),wi("div",Sp,[Cp,wi("div",Tp,pe(e.$filters.bytes(s.free)),1)])])])}]]),Op={class:"plugin",id:"network"},Ip={class:"table-row"},Pp=wi("div",{class:"table-cell text-left title"},"NETWORK",-1),Np={class:"table-cell"},Lp={class:"table-cell"},Dp={class:"table-cell"},Mp={class:"table-cell"},jp={class:"table-cell"},Rp={class:"table-cell"},qp={class:"table-cell"},Bp={class:"table-cell"},Up={class:"table-cell text-left"},Fp={class:"visible-lg-inline"},zp={class:"hidden-lg"},$p={class:"table-cell"},Hp={class:"table-cell"};const Vp={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.network},networks(){const e=this.stats.map((e=>{const t=void 0!==e.alias?e.alias:null;return{interfaceName:e.interface_name,ifname:t||e.interface_name,bytes_recv_rate_per_sec:e.bytes_recv_rate_per_sec,bytes_sent_rate_per_sec:e.bytes_sent_rate_per_sec,bytes_all_rate_per_sec:e.bytes_all_rate_per_sec,bytes_recv:e.bytes_recv,bytes_sent:e.bytes_sent,bytes_all:e.bytes_all}}));return(0,dc.orderBy)(e,["interfaceName"])}}},Gp=(0,nc.Z)(Vp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Op,[wi("div",Ip,[Pp,On(wi("div",Np,"Rx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Lp,"Tx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Dp,null,512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Mp,"Rx+Tx/s",512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",jp,"Rx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Rp,"Tx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",qp,null,512),[[Ds,s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Bp,"Rx+Tx",512),[[Ds,s.args.network_cumul&&s.args.network_sum]])]),(li(!0),pi(ni,null,pr(s.networks,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Up,[wi("span",Fp,pe(t.ifname),1),wi("span",zp,pe(e.$filters.minSize(t.ifname)),1)]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_recv_rate_per_sec):e.$filters.bits(t.bytes_recv_rate_per_sec)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_sent_rate_per_sec):e.$filters.bits(t.bytes_sent_rate_per_sec)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",$p,null,512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_all_rate_per_sec):e.$filters.bits(t.bytes_all_rate_per_sec)),513),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_recv):e.$filters.bits(t.bytes_recv)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_sent):e.$filters.bits(t.bytes_sent)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Hp,null,512),[[Ds,s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.bytes_all):e.$filters.bits(t.bytes_all)),513),[[Ds,s.args.network_cumul&&s.args.network_sum]])])))),128))])}]]),Wp={id:"now",class:"plugin"},Zp={class:"table-row"},Kp={class:"table-cell text-left"};const Qp={props:{data:{type:Object}},computed:{date_iso(){return this.data.stats.now.iso}},methods:{localDate:e=>new Date(e).toLocaleString()}},Xp=(0,nc.Z)(Qp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Wp,[wi("div",Zp,[wi("div",Kp,pe(s.localDate(s.date_iso)),1)])])}]]),Jp={id:"percpu",class:"plugin"},Yp={class:"table"},eh={class:"table-row"},th={key:0,class:"table-cell text-left title"},nh={key:1,class:"table-cell"},rh=Ci('
user
system
idle
iowait
steal
',5),ih={key:0,class:"table-cell text-left"},sh={key:1,class:"table-cell"};const oh={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},percpuStats(){return this.data.stats.percpu}},methods:{getUserAlert:e=>$o.getAlert("percpu","percpu_user_",e.user),getSystemAlert:e=>$o.getAlert("percpu","percpu_system_",e.system),getIOWaitAlert:e=>$o.getAlert("percpu","percpu_iowait_",e.system)}},ah=(0,nc.Z)(oh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Jp,[wi("div",Yp,[wi("div",eh,[s.args.disable_quicklook?(li(),pi("div",th,"CPU")):Ti("v-if",!0),s.args.disable_quicklook?(li(),pi("div",nh,"total")):Ti("v-if",!0),rh]),(li(!0),pi(ni,null,pr(s.percpuStats,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[s.args.disable_quicklook?(li(),pi("div",ih," CPU"+pe(e.cpu_number),1)):Ti("v-if",!0),s.args.disable_quicklook?(li(),pi("div",sh,pe(e.total)+"% ",1)):Ti("v-if",!0),wi("div",{class:ce(["table-cell",s.getUserAlert(e)])},pe(e.user)+"% ",3),wi("div",{class:ce(["table-cell",s.getSystemAlert(e)])},pe(e.system)+"% ",3),On(wi("div",{class:"table-cell"},pe(e.idle)+"% ",513),[[Ds,null!=e.idle]]),On(wi("div",{class:ce(["table-cell",s.getIOWaitAlert(e)])},pe(e.iowait)+"% ",3),[[Ds,null!=e.iowait]]),On(wi("div",{class:"table-cell"},pe(e.steal)+"% ",513),[[Ds,null!=e.steal]])])))),128))])])}]]),lh={class:"plugin",id:"ports"},ch={class:"table-cell text-left"},uh=wi("div",{class:"table-cell"},null,-1),dh={key:0},fh={key:1},ph={key:2},hh={key:3},gh={key:0},mh={key:1},bh={key:2};const vh={props:{data:{type:Object}},computed:{stats(){return this.data.stats.ports},ports(){return this.stats}},methods:{getPortDecoration:e=>null===e.status?"careful":!1===e.status?"critical":null!==e.rtt_warning&&e.status>e.rtt_warning?"warning":"ok",getWebDecoration:e=>null===e.status?"careful":-1===[200,301,302].indexOf(e.status)?"critical":null!==e.rtt_warning&&e.elapsed>e.rtt_warning?"warning":"ok"}},yh=(0,nc.Z)(vh,[["render",function(e,t,n,r,i,s){return li(),pi("section",lh,[(li(!0),pi(ni,null,pr(s.ports,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",ch,[Ti(" prettier-ignore "),Si(" "+pe(e.$filters.minSize(t.description?t.description:t.host+" "+t.port,20)),1)]),uh,t.host?(li(),pi("div",{key:0,class:ce([s.getPortDecoration(t),"table-cell"])},["null"==t.status?(li(),pi("span",dh,"Scanning")):"false"==t.status?(li(),pi("span",fh,"Timeout")):"true"==t.status?(li(),pi("span",ph,"Open")):(li(),pi("span",hh,pe(e.$filters.number(1e3*t.status,0))+"ms",1))],2)):Ti("v-if",!0),t.url?(li(),pi("div",{key:1,class:ce([s.getWebDecoration(t),"table-cell"])},["null"==t.status?(li(),pi("span",gh,"Scanning")):"Error"==t.status?(li(),pi("span",mh,"Error")):(li(),pi("span",bh,"Code "+pe(t.status),1))],2)):Ti("v-if",!0)])))),128))])}]]),wh={key:0},xh={key:1},_h={key:0,class:"row"},kh={class:"col-lg-18"};const Sh={id:"amps",class:"plugin"},Ch={class:"table"},Th={key:0,class:"table-cell text-left"},Ah=["innerHTML"];const Eh={props:{data:{type:Object}},computed:{stats(){return this.data.stats.amps},processes(){return this.stats.filter((e=>null!==e.result))}},methods:{getNameDecoration(e){const t=e.count,n=e.countmin,r=e.countmax;let i="ok";return i=t>0?(null===n||t>=n)&&(null===r||t<=r)?"ok":"careful":null===n?"ok":"critical",i}}},Oh=(0,nc.Z)(Eh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Sh,[wi("div",Ch,[(li(!0),pi(ni,null,pr(s.processes,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",{class:ce(["table-cell text-left",s.getNameDecoration(t)])},pe(t.name),3),t.regex?(li(),pi("div",Th,pe(t.count),1)):Ti("v-if",!0),wi("div",{class:"table-cell text-left process-result",innerHTML:e.$filters.nl2br(t.result)},null,8,Ah)])))),128))])])}]]),Ih={id:"processcount",class:"plugin"},Ph=wi("span",{class:"title"},"TASKS",-1),Nh={class:"title"};const Lh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.processcount},total(){return this.stats.total||0},running(){return this.stats.running||0},sleeping(){return this.stats.sleeping||0},stopped(){return this.stats.stopped||0},thread(){return this.stats.thread||0}}},Dh=(0,nc.Z)(Lh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ih,[Ph,wi("span",null,pe(s.total)+" ("+pe(s.thread)+" thr),",1),wi("span",null,pe(s.running)+" run,",1),wi("span",null,pe(s.sleeping)+" slp,",1),wi("span",null,pe(s.stopped)+" oth",1),wi("span",null,pe(s.args.programs?"Programs":"Threads"),1),wi("span",Nh,pe(n.sorter.auto?"sorted automatically":"sorted"),1),wi("span",null,"by "+pe(n.sorter.getColumnLabel(n.sorter.column)),1)])}]]),Mh={id:"processlist-plugin",class:"plugin"},jh={class:"table"},Rh={class:"table-row"},qh=wi("div",{class:"table-cell width-80 hidden-xs hidden-sm"},"VIRT",-1),Bh=wi("div",{class:"table-cell width-80 hidden-xs hidden-sm"},"RES",-1),Uh=wi("div",{class:"table-cell width-80"},"PID",-1),Fh=wi("div",{class:"table-cell width-60"},"NI",-1),zh=wi("div",{class:"table-cell width-60"},"S",-1),$h={class:"table-cell width-80"},Hh={class:"table-cell width-80"},Vh={class:"table-cell width-80"},Gh={class:"table-cell width-100 text-left"},Wh={key:0,class:"table-cell width-100 hidden-xs hidden-sm"},Zh={key:1,class:"table-cell width-80 hidden-xs hidden-sm"},Kh={class:"table-cell width-80 text-left hidden-xs hidden-sm"};const Qh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},stats(){return this.data.stats.processlist},processes(){const{sorter:e}=this,t=this.data.stats.isWindows,n=(this.stats||[]).map((e=>(e.memvirt="?",e.memres="?",e.memory_info&&(e.memvirt=e.memory_info.vms,e.memres=e.memory_info.rss),t&&null!==e.username&&(e.username=(0,dc.last)(e.username.split("\\"))),e.timeplus="?",e.timemillis="?",e.cpu_times&&(e.timeplus=nd(e.cpu_times),e.timemillis=td(e.cpu_times)),null===e.num_threads&&(e.num_threads=-1),null===e.cpu_percent&&(e.cpu_percent=-1),null===e.memory_percent&&(e.memory_percent=-1),e.io_read=null,e.io_write=null,e.io_counters&&(e.io_read=(e.io_counters[0]-e.io_counters[2])/e.time_since_update,e.io_write=(e.io_counters[1]-e.io_counters[3])/e.time_since_update),e.isNice=void 0!==e.nice&&(t&&32!=e.nice||!t&&0!=e.nice),Array.isArray(e.cmdline)&&(e.cmdline=e.cmdline.join(" ").replace(/\n/g," ")),null!==e.cmdline&&0!==e.cmdline.length||(e.cmdline=e.name),e)));return(0,dc.orderBy)(n,[e.column].reduce(((e,t)=>("io_counters"===t&&(t=["io_read","io_write"]),e.concat(t))),[]),[e.isReverseColumn(e.column)?"desc":"asc"]).slice(0,this.limit)},ioReadWritePresent(){return(this.stats||[]).some((({io_counters:e})=>e))},limit(){return void 0!==this.config.outputs?this.config.outputs.max_processes_display:void 0}},methods:{getCpuPercentAlert:e=>$o.getAlert("processlist","processlist_cpu_",e.cpu_percent),getMemoryPercentAlert:e=>$o.getAlert("processlist","processlist_mem_",e.cpu_percent)}},Xh={components:{GlancesPluginAmps:Oh,GlancesPluginProcesscount:Dh,GlancesPluginProcesslist:(0,nc.Z)(Qh,[["render",function(e,t,n,r,i,s){return li(),pi(ni,null,[Ti(" prettier-ignore "),wi("section",Mh,[wi("div",jh,[wi("div",Rh,[wi("div",{class:ce(["table-cell width-60",["sortable","cpu_percent"===n.sorter.column&&"sort"]]),onClick:t[0]||(t[0]=t=>e.$emit("update:sorter","cpu_percent"))}," CPU% ",2),wi("div",{class:ce(["table-cell width-60",["sortable","memory_percent"===n.sorter.column&&"sort"]]),onClick:t[1]||(t[1]=t=>e.$emit("update:sorter","memory_percent"))}," MEM% ",2),qh,Bh,Uh,wi("div",{class:ce(["table-cell width-100 text-left",["sortable","username"===n.sorter.column&&"sort"]]),onClick:t[2]||(t[2]=t=>e.$emit("update:sorter","username"))}," USER ",2),wi("div",{class:ce(["table-cell width-100 hidden-xs hidden-sm",["sortable","timemillis"===n.sorter.column&&"sort"]]),onClick:t[3]||(t[3]=t=>e.$emit("update:sorter","timemillis"))}," TIME+ ",2),wi("div",{class:ce(["table-cell width-80 text-left hidden-xs hidden-sm",["sortable","num_threads"===n.sorter.column&&"sort"]]),onClick:t[4]||(t[4]=t=>e.$emit("update:sorter","num_threads"))}," THR ",2),Fh,zh,On(wi("div",{class:ce(["table-cell width-80 hidden-xs hidden-sm",["sortable","io_counters"===n.sorter.column&&"sort"]]),onClick:t[5]||(t[5]=t=>e.$emit("update:sorter","io_counters"))}," IOR/s ",2),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:ce(["table-cell width-80 text-left hidden-xs hidden-sm",["sortable","io_counters"===n.sorter.column&&"sort"]]),onClick:t[6]||(t[6]=t=>e.$emit("update:sorter","io_counters"))}," IOW/s ",2),[[Ds,s.ioReadWritePresent]]),wi("div",{class:ce(["table-cell text-left",["sortable","name"===n.sorter.column&&"sort"]]),onClick:t[7]||(t[7]=t=>e.$emit("update:sorter","name"))}," Command ",2)]),(li(!0),pi(ni,null,pr(s.processes,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",{class:ce(["table-cell width-60",s.getCpuPercentAlert(t)])},pe(-1==t.cpu_percent?"?":e.$filters.number(t.cpu_percent,1)),3),wi("div",{class:ce(["table-cell width-60",s.getMemoryPercentAlert(t)])},pe(-1==t.memory_percent?"?":e.$filters.number(t.memory_percent,1)),3),wi("div",$h,pe(e.$filters.bytes(t.memvirt)),1),wi("div",Hh,pe(e.$filters.bytes(t.memres)),1),wi("div",Vh,pe(t.pid),1),wi("div",Gh,pe(t.username),1),"?"!=t.timeplus?(li(),pi("div",Wh,[On(wi("span",{class:"highlight"},pe(t.timeplus.hours)+"h",513),[[Ds,t.timeplus.hours>0]]),Si(" "+pe(e.$filters.leftPad(t.timeplus.minutes,2,"0"))+":"+pe(e.$filters.leftPad(t.timeplus.seconds,2,"0"))+" ",1),On(wi("span",null,"."+pe(e.$filters.leftPad(t.timeplus.milliseconds,2,"0")),513),[[Ds,t.timeplus.hours<=0]])])):Ti("v-if",!0),"?"==t.timeplus?(li(),pi("div",Zh,"?")):Ti("v-if",!0),wi("div",Kh,pe(-1==t.num_threads?"?":t.num_threads),1),wi("div",{class:ce(["table-cell width-60",{nice:t.isNice}])},pe(e.$filters.exclamation(t.nice)),3),wi("div",{class:ce(["table-cell width-60",{status:"R"==t.status}])},pe(t.status),3),On(wi("div",{class:"table-cell width-80 hidden-xs hidden-sm"},pe(e.$filters.bytes(t.io_read)),513),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:"table-cell width-80 text-left hidden-xs hidden-sm"},pe(e.$filters.bytes(t.io_write)),513),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:"table-cell text-left"},pe(t.name),513),[[Ds,s.args.process_short_name]]),On(wi("div",{class:"table-cell text-left"},pe(t.cmdline),513),[[Ds,!s.args.process_short_name]])])))),128))])])],2112)}]])},props:{data:{type:Object}},data:()=>({store:Uo,sorter:void 0}),computed:{args(){return this.store.args||{}},sortProcessesKey(){return this.args.sort_processes_key}},watch:{sortProcessesKey:{immediate:!0,handler(e){e&&!["cpu_percent","memory_percent","username","timemillis","num_threads","io_counters","name"].includes(e)||(this.sorter={column:this.args.sort_processes_key||"cpu_percent",auto:!this.args.sort_processes_key,isReverseColumn:function(e){return!["username","name"].includes(e)},getColumnLabel:function(e){return{cpu_percent:"CPU consumption",memory_percent:"memory consumption",username:"user name",timemillis:"process time",cpu_times:"process time",io_counters:"disk IO",name:"process name",None:"None"}[e]||e}})}}}},Jh=(0,nc.Z)(Xh,[["render",function(e,t,n,r,i,s){const o=cr("glances-plugin-processcount"),a=cr("glances-plugin-amps"),l=cr("glances-plugin-processlist");return s.args.disable_process?(li(),pi("div",wh,"PROCESSES DISABLED (press 'z' to display)")):(li(),pi("div",xh,[xi(o,{sorter:i.sorter,data:n.data},null,8,["sorter","data"]),s.args.disable_amps?Ti("v-if",!0):(li(),pi("div",_h,[wi("div",kh,[xi(a,{data:n.data},null,8,["data"])])])),xi(l,{sorter:i.sorter,data:n.data,"onUpdate:sorter":t[0]||(t[0]=e=>s.args.sort_processes_key=e)},null,8,["sorter","data"])]))}]]),Yh={id:"quicklook",class:"plugin"},eg={class:"cpu-name"},tg={class:"table"},ng={key:0,class:"table-row"},rg=wi("div",{class:"table-cell text-left"},"CPU",-1),ig={class:"table-cell"},sg={class:"progress"},og=["aria-valuenow"],ag={class:"table-cell"},lg={class:"table-cell text-left"},cg={class:"table-cell"},ug={class:"progress"},dg=["aria-valuenow"],fg={class:"table-cell"},pg={class:"table-row"},hg={class:"table-cell text-left"},gg={class:"table-cell"},mg={class:"progress"},bg=["aria-valuenow"],vg={class:"table-cell"};const yg={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},stats(){return this.data.stats.quicklook},view(){return this.data.views.quicklook},cpu(){return this.stats.cpu},cpu_name(){return this.stats.cpu_name},cpu_hz_current(){return this.stats.cpu_hz_current},cpu_hz(){return this.stats.cpu_hz},percpus(){var e=this.stats.percpu.map((({cpu_number:e,total:t})=>({number:e,total:t}))),t=parseInt(this.config.percpu.max_cpu_display);if(this.stats.percpu.length>t){var n=e.sort((function(e,t){return t.total-e.total})),r={number:"x",total:Number((n.slice(t).reduce(((e,{total:t})=>e+t),0)/(this.stats.percpu.length-t)).toFixed(1))};(n=n.slice(0,t)).push(r)}return this.stats.percpu.length<=t?e:n},stats_list_after_cpu(){return this.view.list.filter((e=>!e.includes("cpu")))}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},wg=(0,nc.Z)(yg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Yh,[wi("div",eg,pe(s.cpu_name),1),wi("div",tg,[s.args.percpu?Ti("v-if",!0):(li(),pi("div",ng,[rg,wi("div",ig,[wi("div",sg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("cpu")}`),role:"progressbar","aria-valuenow":s.cpu,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.cpu}%;`)},"   ",14,og)])]),wi("div",ag,pe(s.cpu)+"%",1)])),s.args.percpu?(li(!0),pi(ni,{key:1},pr(s.percpus,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",lg,"CPU"+pe(e.number),1),wi("div",cg,[wi("div",ug,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("cpu")}`),role:"progressbar","aria-valuenow":e.total,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${e.total}%;`)},"   ",14,dg)])]),wi("div",fg,pe(e.total)+"%",1)])))),128)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.stats_list_after_cpu,(e=>(li(),pi("div",pg,[wi("div",hg,pe(e.toUpperCase()),1),wi("div",gg,[wi("div",mg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration(e)}`),role:"progressbar","aria-valuenow":s.stats[e],"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.stats[e]}%;`)},"   ",14,bg)])]),wi("div",vg,pe(s.stats[e])+"%",1)])))),256))])])}]]),xg={class:"plugin",id:"raid"},_g={key:0,class:"table-row"},kg=[wi("div",{class:"table-cell text-left title"},"RAID disks",-1),wi("div",{class:"table-cell"},"Used",-1),wi("div",{class:"table-cell"},"Total",-1)],Sg={class:"table-cell text-left"},Cg={class:"warning"};const Tg={props:{data:{type:Object}},computed:{stats(){return this.data.stats.raid},disks(){const e=Object.entries(this.stats).map((([e,t])=>{const n=Object.entries(t.components).map((([e,t])=>({number:t,name:e})));return{name:e,type:null==t.type?"UNKNOWN":t.type,used:t.used,available:t.available,status:t.status,degraded:t.used0}},methods:{getAlert:e=>e.inactive?"critical":e.degraded?"warning":"ok"}},Ag=(0,nc.Z)(Tg,[["render",function(e,t,n,r,i,s){return li(),pi("section",xg,[s.hasDisks?(li(),pi("div",_g,kg)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.disks,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",Sg,[Si(pe(e.type.toUpperCase())+" "+pe(e.name)+" ",1),On(wi("div",Cg,"└─ Degraded mode",512),[[Ds,e.degraded]]),On(wi("div",null,"   └─ "+pe(e.config),513),[[Ds,e.degraded]]),On(wi("div",{class:"critical"},"└─ Status "+pe(e.status),513),[[Ds,e.inactive]]),e.inactive?(li(!0),pi(ni,{key:0},pr(e.components,((t,n)=>(li(),pi("div",{key:n},"    "+pe(n===e.components.length-1?"└─":"├─")+" disk "+pe(t.number)+": "+pe(t.name),1)))),128)):Ti("v-if",!0)]),On(wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.used),3),[[Ds,"active"==e.status]]),On(wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.available),3),[[Ds,"active"==e.status]])])))),128))])}]]),Eg={id:"smart",class:"plugin"},Og=wi("div",{class:"table-row"},[wi("div",{class:"table-cell text-left title"},"SMART disks"),wi("div",{class:"table-cell"}),wi("div",{class:"table-cell"})],-1),Ig={class:"table-row"},Pg={class:"table-cell text-left text-truncate"},Ng=wi("div",{class:"table-cell"},null,-1),Lg=wi("div",{class:"table-cell"},null,-1),Dg={class:"table-cell text-left"},Mg=wi("div",{class:"table-cell"},null,-1),jg={class:"table-cell text-truncate"};const Rg={props:{data:{type:Object}},computed:{stats(){return this.data.stats.smart},drives(){return(Array.isArray(this.stats)?this.stats:[]).map((e=>{const t=e.DeviceName,n=Object.entries(e).filter((([e])=>"DeviceName"!==e)).sort((([,e],[,t])=>e.namet.name?1:0)).map((([e,t])=>t));return{name:t,details:n}}))}}},qg=(0,nc.Z)(Rg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Eg,[Og,(li(!0),pi(ni,null,pr(s.drives,((e,t)=>(li(),pi(ni,{key:t},[wi("div",Ig,[wi("div",Pg,pe(e.name),1),Ng,Lg]),(li(!0),pi(ni,null,pr(e.details,((e,t)=>(li(),pi("div",{key:t,class:"table-row"},[wi("div",Dg,"  "+pe(e.name),1),Mg,wi("div",jg,[wi("span",null,pe(e.raw),1)])])))),128))],64)))),128))])}]]),Bg={class:"plugin",id:"sensors"},Ug={key:0,class:"table-row"},Fg=[wi("div",{class:"table-cell text-left title"},"SENSORS",-1)],zg={class:"table-cell text-left"},$g=wi("div",{class:"table-cell"},null,-1);const Hg={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.sensors},view(){return this.data.views.sensors},sensors(){return this.stats.map((e=>(this.args.fahrenheit&&"battery"!=e.type&&"fan_speed"!=e.type&&(e.value=parseFloat(1.8*e.value+32).toFixed(1),e.unit="F"),e)))}},methods:{getDecoration(e){if(void 0!==this.view[e].value.decoration)return this.view[e].value.decoration.toLowerCase()}}},Vg=(0,nc.Z)(Hg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Bg,[s.sensors.length>0?(li(),pi("div",Ug,Fg)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.sensors,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",zg,pe(e.label),1),$g,wi("div",{class:ce(["table-cell",s.getDecoration(e.label)])},pe(e.value)+pe(e.unit),3)])))),128))])}]]),Gg={class:"plugin",id:"system"},Wg={key:0,class:"critical"},Zg={class:"title"};const Kg={props:{data:{type:Object}},data:()=>({store:Uo}),computed:{stats(){return this.data.stats.system},hostname(){return this.stats.hostname},humanReadableName(){return this.stats.hr_name},isDisconnected(){return"FAILURE"===this.store.status}}},Qg=(0,nc.Z)(Kg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Gg,[s.isDisconnected?(li(),pi("span",Wg,"Disconnected from")):Ti("v-if",!0),wi("span",Zg,pe(s.hostname),1),wi("span",null,pe(s.humanReadableName),1)])}]]),Xg={class:"plugin",id:"uptime"};const Jg={props:{data:{type:Object}},computed:{value(){return this.data.stats.uptime}}},Yg=(0,nc.Z)(Jg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Xg,[wi("span",null,"Uptime: "+pe(s.value),1)])}]]),em={class:"plugin",id:"wifi"},tm={key:0,class:"table-row"},nm=[wi("div",{class:"table-cell text-left title"},"WIFI",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"dBm",-1)],rm={class:"table-cell text-left"},im=wi("div",{class:"table-cell"},null,-1);const sm={props:{data:{type:Object}},computed:{stats(){return this.data.stats.wifi},view(){return this.data.views.wifi},hotspots(){const e=this.stats.map((e=>{if(""!==e.ssid)return{ssid:e.ssid,quality_level:e.quality_level}})).filter(Boolean);return(0,dc.orderBy)(e,["ssid"])}},methods:{getDecoration(e,t){if(void 0!==this.view[e.ssid][t])return this.view[e.ssid][t].decoration.toLowerCase()}}},om=(0,nc.Z)(sm,[["render",function(e,t,n,r,i,s){return li(),pi("section",em,[s.hotspots.length>0?(li(),pi("div",tm,nm)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.hotspots,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",rm,pe(e.$filters.limitTo(t.ssid,20)),1),im,wi("div",{class:ce(["table-cell",s.getDecoration(t,"quality_level")])},pe(t.quality_level),3)])))),128))])}]]),am=JSON.parse('{"t":["network","ports","wifi","connections","diskio","fs","irq","folders","raid","smart","sensors","now"]}'),lm={components:{GlancesHelp:rc,GlancesPluginAlert:pc,GlancesPluginCloud:bc,GlancesPluginConnections:Uc,GlancesPluginCpu:ju,GlancesPluginDiskio:id,GlancesPluginContainers:Cd,GlancesPluginFolders:Ld,GlancesPluginFs:$d,GlancesPluginGpu:lf,GlancesPluginIp:mf,GlancesPluginIrq:Sf,GlancesPluginLoad:qf,GlancesPluginMem:Jf,GlancesPluginMemMore:hp,GlancesPluginMemswap:Ep,GlancesPluginNetwork:Gp,GlancesPluginNow:Xp,GlancesPluginPercpu:ah,GlancesPluginPorts:yh,GlancesPluginProcess:Jh,GlancesPluginQuicklook:wg,GlancesPluginRaid:Ag,GlancesPluginSensors:Vg,GlancesPluginSmart:qg,GlancesPluginSystem:Qg,GlancesPluginUptime:Yg,GlancesPluginWifi:om},data:()=>({store:Uo}),computed:{args(){return this.store.args||{}},config(){return this.store.config||{}},data(){return this.store.data||{}},dataLoaded(){return void 0!==this.store.data},hasGpu(){return this.store.data.stats.gpu.length>0},isLinux(){return this.store.data.isLinux},title(){const{data:e}=this,t=e.stats&&e.stats.system&&e.stats.system.hostname||"";return t?`${t} - Glances`:"Glances"},leftMenu(){return void 0!==this.config.outputs.left_menu?this.config.outputs.left_menu.split(","):am.t}},watch:{title(){document&&(document.title=this.title)}},methods:{setupHotKeys(){jo("a",(()=>{this.store.args.sort_processes_key=null})),jo("c",(()=>{this.store.args.sort_processes_key="cpu_percent"})),jo("m",(()=>{this.store.args.sort_processes_key="memory_percent"})),jo("u",(()=>{this.store.args.sort_processes_key="username"})),jo("p",(()=>{this.store.args.sort_processes_key="name"})),jo("i",(()=>{this.store.args.sort_processes_key="io_counters"})),jo("t",(()=>{this.store.args.sort_processes_key="timemillis"})),jo("shift+A",(()=>{this.store.args.disable_amps=!this.store.args.disable_amps})),jo("d",(()=>{this.store.args.disable_diskio=!this.store.args.disable_diskio})),jo("shift+Q",(()=>{this.store.args.enable_irq=!this.store.args.enable_irq})),jo("f",(()=>{this.store.args.disable_fs=!this.store.args.disable_fs})),jo("j",(()=>{this.store.args.programs=!this.store.args.programs})),jo("k",(()=>{this.store.args.disable_connections=!this.store.args.disable_connections})),jo("n",(()=>{this.store.args.disable_network=!this.store.args.disable_network})),jo("s",(()=>{this.store.args.disable_sensors=!this.store.args.disable_sensors})),jo("2",(()=>{this.store.args.disable_left_sidebar=!this.store.args.disable_left_sidebar})),jo("z",(()=>{this.store.args.disable_process=!this.store.args.disable_process})),jo("shift+S",(()=>{this.store.args.process_short_name=!this.store.args.process_short_name})),jo("shift+D",(()=>{this.store.args.disable_containers=!this.store.args.disable_containers})),jo("b",(()=>{this.store.args.byte=!this.store.args.byte})),jo("shift+B",(()=>{this.store.args.diskio_iops=!this.store.args.diskio_iops})),jo("l",(()=>{this.store.args.disable_alert=!this.store.args.disable_alert})),jo("1",(()=>{this.store.args.percpu=!this.store.args.percpu})),jo("h",(()=>{this.store.args.help_tag=!this.store.args.help_tag})),jo("shift+T",(()=>{this.store.args.network_sum=!this.store.args.network_sum})),jo("shift+U",(()=>{this.store.args.network_cumul=!this.store.args.network_cumul})),jo("shift+F",(()=>{this.store.args.fs_free_space=!this.store.args.fs_free_space})),jo("3",(()=>{this.store.args.disable_quicklook=!this.store.args.disable_quicklook})),jo("6",(()=>{this.store.args.meangpu=!this.store.args.meangpu})),jo("shift+G",(()=>{this.store.args.disable_gpu=!this.store.args.disable_gpu})),jo("5",(()=>{this.store.args.disable_quicklook=!this.store.args.disable_quicklook,this.store.args.disable_cpu=!this.store.args.disable_cpu,this.store.args.disable_mem=!this.store.args.disable_mem,this.store.args.disable_memswap=!this.store.args.disable_memswap,this.store.args.disable_load=!this.store.args.disable_load,this.store.args.disable_gpu=!this.store.args.disable_gpu})),jo("shift+I",(()=>{this.store.args.disable_ip=!this.store.args.disable_ip})),jo("shift+P",(()=>{this.store.args.disable_ports=!this.store.args.disable_ports})),jo("shift+W",(()=>{this.store.args.disable_wifi=!this.store.args.disable_wifi}))}},mounted(){const e=window.__GLANCES__||{},t=isFinite(e["refresh-time"])?parseInt(e["refresh-time"],10):void 0;Ho.init(t),this.setupHotKeys()},beforeUnmount(){jo.unbind()}};const cm=((...e)=>{const t=qs().createApp(...e);const{mount:n}=t;return t.mount=e=>{const r=Bs(e);if(!r)return;const i=t._component;L(i)||i.render||i.template||(i.template=r.innerHTML),r.innerHTML="";const s=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t})((0,nc.Z)(lm,[["render",function(e,t,n,r,i,s){const o=cr("glances-help"),a=cr("glances-plugin-system"),l=cr("glances-plugin-ip"),c=cr("glances-plugin-uptime"),u=cr("glances-plugin-cloud"),d=cr("glances-plugin-quicklook"),f=cr("glances-plugin-cpu"),p=cr("glances-plugin-percpu"),h=cr("glances-plugin-gpu"),g=cr("glances-plugin-mem"),m=cr("glances-plugin-mem-more"),b=cr("glances-plugin-memswap"),v=cr("glances-plugin-load"),y=cr("glances-plugin-containers"),w=cr("glances-plugin-process"),x=cr("glances-plugin-alert");return s.dataLoaded?s.args.help_tag?(li(),hi(o,{key:1})):(li(),pi("main",zs,[wi("div",$s,[wi("div",Hs,[wi("div",Vs,[wi("div",Gs,[xi(a,{data:s.data},null,8,["data"])]),s.args.disable_ip?Ti("v-if",!0):(li(),pi("div",Ws,[xi(l,{data:s.data},null,8,["data"])])),wi("div",Zs,[xi(c,{data:s.data},null,8,["data"])])])])]),wi("div",Ks,[wi("div",Qs,[wi("div",Xs,[wi("div",Js,[xi(u,{data:s.data},null,8,["data"])])])]),s.args.enable_separator?(li(),pi("div",Ys)):Ti("v-if",!0),wi("div",eo,[s.args.disable_quicklook?Ti("v-if",!0):(li(),pi("div",to,[xi(d,{data:s.data},null,8,["data"])])),s.args.disable_cpu||s.args.percpu?Ti("v-if",!0):(li(),pi("div",no,[xi(f,{data:s.data},null,8,["data"])])),!s.args.disable_cpu&&s.args.percpu?(li(),pi("div",ro,[xi(p,{data:s.data},null,8,["data"])])):Ti("v-if",!0),!s.args.disable_gpu&&s.hasGpu?(li(),pi("div",io,[xi(h,{data:s.data},null,8,["data"])])):Ti("v-if",!0),s.args.disable_mem?Ti("v-if",!0):(li(),pi("div",so,[xi(g,{data:s.data},null,8,["data"])])),Ti(" NOTE: display if MEM enabled and GPU disabled "),s.args.disable_mem||!s.args.disable_gpu&&s.hasGpu?Ti("v-if",!0):(li(),pi("div",oo,[xi(m,{data:s.data},null,8,["data"])])),s.args.disable_memswap?Ti("v-if",!0):(li(),pi("div",ao,[xi(b,{data:s.data},null,8,["data"])])),s.args.disable_load?Ti("v-if",!0):(li(),pi("div",lo,[xi(v,{data:s.data},null,8,["data"])]))]),s.args.enable_separator?(li(),pi("div",co)):Ti("v-if",!0)]),wi("div",uo,[wi("div",fo,[s.args.disable_left_sidebar?Ti("v-if",!0):(li(),pi("div",po,[wi("div",ho,[Ti(" When they exist on the same node, v-if has a higher priority than v-for.\n That means the v-if condition will not have access to variables from the\n scope of the v-for "),(li(!0),pi(ni,null,pr(s.leftMenu,(e=>{return li(),pi(ni,null,[s.args[`disable_${e}`]?Ti("v-if",!0):(li(),hi((t=`glances-plugin-${e}`,D(t)?dr(lr,t,!1)||t:t||ur),{key:0,id:`plugin-${e}`,class:"plugin table-row-group",data:s.data},null,8,["id","data"]))],64);var t})),256))])])),wi("div",go,[s.args.disable_containers?Ti("v-if",!0):(li(),hi(y,{key:0,data:s.data},null,8,["data"])),xi(w,{data:s.data},null,8,["data"]),s.args.disable_alert?Ti("v-if",!0):(li(),hi(x,{key:1,data:s.data},null,8,["data"]))])])])])):(li(),pi("div",Us,Fs))}]]));cm.config.globalProperties.$filters=e,cm.mount("#app")})()})(); \ No newline at end of file From 3aa6be73619b16da4560ead62204de1d5a274fa6 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 30 Apr 2024 16:04:36 +0200 Subject: [PATCH 2/7] Remove Windows unitary test because Gitgub CI action is broken --- .github/workflows/test.yml | 49 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 030730f8..b19bad50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,33 +47,38 @@ jobs: run: | python ./unitest.py - test-windows: + # Error appear with h11, not related to Glances + # Should be tested if correction is done + # Installed c:\hostedtoolcache\windows\python\3.9.13\x64\lib\site-packages\exceptiongroup-1.2.1-py3.9.egg + # error: h11 0.14.0 is installed but h11<0.13,>=0.11 is required by {'httpcore'} + # Error: Process completed with exit code 1. + # test-windows: - # https://github.com/actions/runner-images?tab=readme-ov-file#available-images - runs-on: windows-latest - strategy: - matrix: - # Python version "3.12" introduce this issue: - # https://github.com/nicolargo/glances/actions/runs/6439648370/job/17487567454 - python-version: ["3.8", "3.9", "3.10", "3.11"] - steps: + # # https://github.com/actions/runner-images?tab=readme-ov-file#available-images + # runs-on: windows-latest + # strategy: + # matrix: + # # Python version "3.12" introduce this issue: + # # https://github.com/nicolargo/glances/actions/runs/6439648370/job/17487567454 + # python-version: ["3.8", "3.9", "3.10", "3.11"] + # steps: - - uses: actions/checkout@v4 + # - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + # - name: Set up Python ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if (Test-Path -PathType Leaf "requirements.txt") { python -m pip install -r requirements.txt } - python setup.py install + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # if (Test-Path -PathType Leaf "requirements.txt") { python -m pip install -r requirements.txt } + # python setup.py install - - name: Unitary tests - run: | - python ./unitest.py + # - name: Unitary tests + # run: | + # python ./unitest.py test-macos: From e2e2264a4d270a203686822ad7643b13d0b1b2e5 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 30 Apr 2024 17:02:34 +0200 Subject: [PATCH 3/7] Set sensor refresh time at Glances refresh * 3 --- conf/glances.conf | 7 ++++--- docker-compose/glances.conf | 7 ++++--- glances/plugins/sensors/__init__.py | 8 ++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/conf/glances.conf b/conf/glances.conf index 10f48a6d..a7ed6374 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -239,7 +239,7 @@ public_template={continent_name}/{country_name}/{city_name} [connections] # Display additional information about TCP connections -# This plugin is disabled by default +# This plugin is disabled by default because it consumes lots of CPU disable=True # nf_conntrack thresholds in % nf_conntrack_percent_careful=70 @@ -333,8 +333,9 @@ port=7634 [sensors] # Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html disable=False -# By default refresh every refresh time * 2 -#refresh=6 +# Set the refresh multiplicator for the sensors +# By default refresh every Glances refresh * 3 (increase to reduce CPU consumption) +#refresh=3 # Hide some sensors (comma separated list of regexp) hide=unknown.* # Show only the following sensors (comma separated list of regexp) diff --git a/docker-compose/glances.conf b/docker-compose/glances.conf index 74362ea9..225700fa 100755 --- a/docker-compose/glances.conf +++ b/docker-compose/glances.conf @@ -239,7 +239,7 @@ public_template={continent_name}/{country_name}/{city_name} [connections] # Display additional information about TCP connections -# This plugin is disabled by default +# This plugin is disabled by default because it consumes lots of CPU disable=True # nf_conntrack thresholds in % nf_conntrack_percent_careful=70 @@ -333,8 +333,9 @@ port=7634 [sensors] # Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html disable=False -# By default refresh every refresh time * 2 -#refresh=6 +# Set the refresh multiplicator for the sensors +# By default refresh every Glances refresh * 3 (increase to reduce CPU consumption) +#refresh=3 # Hide some sensors (comma separated list of regexp) hide=unknown.* # Show only the following sensors (comma separated list of regexp) diff --git a/glances/plugins/sensors/__init__.py b/glances/plugins/sensors/__init__.py index adeda67f..35e04678 100644 --- a/glances/plugins/sensors/__init__.py +++ b/glances/plugins/sensors/__init__.py @@ -26,6 +26,11 @@ SENSOR_TEMP_UNIT = 'C' SENSOR_FAN_TYPE = 'fan_speed' SENSOR_FAN_UNIT = 'R' +# Define the default refresh multiplicator +# Default value is 3 * Glances refresh time +# Can be overwritten by the refresh option in the sensors section of the glances.conf file +DEFAULT_REFRESH = 3 + # Fields description # description: human readable description # short_name: shortname to use un UI @@ -96,9 +101,8 @@ class PluginModel(GlancesPluginModel): self.display_curse = True # Not necessary to refresh every refresh time - # By default set to refresh * 2 if self.get_refresh() == args.time: - self.set_refresh(self.get_refresh() * 2) + self.set_refresh(self.get_refresh() * DEFAULT_REFRESH) def get_key(self): """Return the key of the list.""" From fdd819c450913de14f6621a9d77bfa154c7734a6 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 30 Apr 2024 17:15:09 +0200 Subject: [PATCH 4/7] Remove Pytz from dep, because it is not used anymore --- README.rst | 1 - requirements.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/README.rst b/README.rst index 059fd379..3a751964 100644 --- a/README.rst +++ b/README.rst @@ -87,7 +87,6 @@ Requirements - ``defusedxml`` (in order to monkey patch xmlrpc) - ``packaging`` (for the version comparison) - ``ujson`` (an optimized alternative to the standard json module) -- ``pytz`` (for the timezone support) - ``pydantic`` (for the data validation support) *Note for Python 2 users* diff --git a/requirements.txt b/requirements.txt index af41c966..abb29186 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,4 @@ psutil>=5.6.7 defusedxml packaging ujson>=5.4.0 -pytz pydantic From 6264f2abea00d97b7d6eb4749e182071de9a3d53 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Wed, 1 May 2024 13:42:58 +0200 Subject: [PATCH 5/7] Switch to forks of pysnmp as it is unmaintained #2741 --- README.rst | 2 +- glances/plugins/help/__init__.py | 50 ++++++++++++++++--------- glances/plugins/mem/__init__.py | 8 +--- glances/plugins/now/__init__.py | 4 +- glances/plugins/percpu/__init__.py | 5 ++- glances/plugins/plugin/model.py | 10 +++-- glances/plugins/processlist/__init__.py | 2 +- glances/plugins/quicklook/__init__.py | 2 +- glances/plugins/sensors/__init__.py | 2 +- glances/plugins/smart/__init__.py | 2 +- glances/plugins/system/__init__.py | 2 +- glances/snmp.py | 7 +--- optional-requirements.txt | 2 +- 13 files changed, 56 insertions(+), 42 deletions(-) diff --git a/README.rst b/README.rst index 3a751964..617ba122 100644 --- a/README.rst +++ b/README.rst @@ -121,7 +121,7 @@ Optional dependencies: - ``pygal`` (for the graph export module) - ``pymdstat`` (for RAID support) [Linux-only] - ``pymongo`` (for the MongoDB export module) -- ``pysnmp`` (for SNMP support) +- ``pysnmp-lextudio`` (for SNMP support) - ``pySMART.smartx`` (for HDD Smart support) [Linux-only] - ``pyzmq`` (for the ZeroMQ export module) - ``requests`` (for the Ports, Cloud plugins and RESTful export module) diff --git a/glances/plugins/help/__init__.py b/glances/plugins/help/__init__.py index 607d682f..0fe571fa 100644 --- a/glances/plugins/help/__init__.py +++ b/glances/plugins/help/__init__.py @@ -106,30 +106,46 @@ class PluginModel(GlancesPluginModel): ('toggle_linux_percentage', msg_col.format('0', 'Load, Linux/percentage')), ('toggle_cpu_individual_combined', msg_col.format('1', 'CPU, individual/combined')), ('toggle_gpu_individual_combined', msg_col.format('6', 'GPU, individual/combined')), - ('toggle_short_full', - msg_col.format('S', - 'Process names, short/full') if self.args.webserver else msg_col.format('/', 'Process names, short/full')), + ( + 'toggle_short_full', + ( + msg_col.format('S', 'Process names, short/full') + if self.args and self.args.webserver + else msg_col.format('/', 'Process names, short/full') + ), + ), ('header_miscellaneous', msg_header.format('MISCELLANEOUS:')), - ('misc_erase_process_filter', - '' if self.args.webserver else msg_col.format('E', 'Erase process filter')), - ('misc_generate_history_graphs', - '' if self.args.webserver else msg_col.format('g', 'Generate history graphs')), + ( + 'misc_erase_process_filter', + '' if self.args and self.args.webserver else msg_col.format('E', 'Erase process filter'), + ), + ( + 'misc_generate_history_graphs', + '' if self.args and self.args.webserver else msg_col.format('g', 'Generate history graphs'), + ), ('misc_help', msg_col.format('h', 'HELP')), - ('misc_accumulate_processes_by_program', - '' if self.args.webserver else msg_col.format('j', 'Display threads or programs')), + ( + 'misc_accumulate_processes_by_program', + '' if self.args and self.args.webserver else msg_col.format('j', 'Display threads or programs'), + ), ('misc_increase_nice_process', msg_col.format('+', 'Increase nice process')), ('misc_decrease_nice_process', msg_col.format('-', 'Decrease nice process (need admin rights)')), - ('misc_kill_process', - '' if self.args.webserver else msg_col.format('k', 'Kill process')), - ('misc_reset_processes_summary_min_max', - '' if self.args.webserver else msg_col.format('M', 'Reset processes summary min/max')), - ('misc_quit', - '' if self.args.webserver else msg_col.format('q', 'QUIT (or Esc or Ctrl-C)')), + ('misc_kill_process', '' if self.args and self.args.webserver else msg_col.format('k', 'Kill process')), + ( + 'misc_reset_processes_summary_min_max', + '' if self.args and self.args.webserver else msg_col.format('M', 'Reset processes summary min/max'), + ), + ( + 'misc_quit', + '' if self.args and self.args.webserver else msg_col.format('q', 'QUIT (or Esc or Ctrl-C)'), + ), ('misc_reset_history', msg_col.format('r', 'Reset history')), ('misc_delete_warning_alerts', msg_col.format('w', 'Delete warning alerts')), ('misc_delete_warning_and_critical_alerts', msg_col.format('x', 'Delete warning & critical alerts')), - ('misc_edit_process_filter_pattern', - '' if self.args.webserver else ' ENTER: Edit process filter pattern'), + ( + 'misc_edit_process_filter_pattern', + '' if self.args and self.args.webserver else ' ENTER: Edit process filter pattern', + ), ] ) diff --git a/glances/plugins/mem/__init__.py b/glances/plugins/mem/__init__.py index b44181b1..5921b131 100644 --- a/glances/plugins/mem/__init__.py +++ b/glances/plugins/mem/__init__.py @@ -204,12 +204,8 @@ class PluginModel(GlancesPluginModel): self.reset() return self.stats - for key in iterkeys(stats): - if stats[key] != '': - stats[key] = float(stats[key]) * 1024 - - # Use the 'free'/htop calculation - stats['free'] = stats['free'] - stats['total'] + (stats['buffers'] + stats['cached']) + for k in stats: + stats[k] = int(stats[k]) * 1024 # used=total-free stats['used'] = stats['total'] - stats['free'] diff --git a/glances/plugins/now/__init__.py b/glances/plugins/now/__init__.py index 3f997b71..dd88b954 100644 --- a/glances/plugins/now/__init__.py +++ b/glances/plugins/now/__init__.py @@ -53,9 +53,9 @@ class PluginModel(GlancesPluginModel): # Set the message position self.align = 'bottom' - if args.strftime_format: + if args and args.strftime_format: self.strftime = args.strftime_format - elif config is not None: + elif config: if 'global' in config.as_dict(): self.strftime = config.as_dict()['global']['strftime_format'] diff --git a/glances/plugins/percpu/__init__.py b/glances/plugins/percpu/__init__.py index d16ffb45..aa1204e4 100644 --- a/glances/plugins/percpu/__init__.py +++ b/glances/plugins/percpu/__init__.py @@ -108,7 +108,10 @@ class PluginModel(GlancesPluginModel): self.display_curse = True # Manage the maximum number of CPU to display (related to enhancement request #2734) - self.max_cpu_display = config.get_int_value('percpu', 'max_cpu_display', 4) + if config: + self.max_cpu_display = config.get_int_value('percpu', 'max_cpu_display', 4) + else: + self.max_cpu_display = 4 def get_key(self): """Return the key of the list.""" diff --git a/glances/plugins/plugin/model.py b/glances/plugins/plugin/model.py index 5a65d9a0..e711fb3f 100644 --- a/glances/plugins/plugin/model.py +++ b/glances/plugins/plugin/model.py @@ -350,8 +350,10 @@ class GlancesPluginModel(object): ret = {} if bulk: # Bulk request - snmp_result = snmp_client.getbulk_by_oid(0, 10, itervalues(*snmp_oid)) - + snmp_result = snmp_client.getbulk_by_oid(0, + 10, + *list(itervalues(snmp_oid))) + logger.info(snmp_result) if len(snmp_oid) == 1: # Bulk command for only one OID # Note: key is the item indexed but the OID result @@ -379,7 +381,7 @@ class GlancesPluginModel(object): index += 1 else: # Simple get request - snmp_result = snmp_client.get_by_oid(itervalues(*snmp_oid)) + snmp_result = snmp_client.get_by_oid(*list(itervalues(snmp_oid))) # Build the internal dict with the SNMP result for key in iterkeys(snmp_oid): @@ -623,7 +625,7 @@ class GlancesPluginModel(object): """Return the plugin refresh time""" ret = self.get_limits(item='refresh') if ret is None: - ret = self.args.time + ret = self.args.time if hasattr(self.args, 'time') else 2 return ret def get_refresh_time(self): diff --git a/glances/plugins/processlist/__init__.py b/glances/plugins/processlist/__init__.py index ae4b0dcd..e29d2225 100644 --- a/glances/plugins/processlist/__init__.py +++ b/glances/plugins/processlist/__init__.py @@ -194,7 +194,7 @@ class PluginModel(GlancesPluginModel): config.as_dict()['processlist']['export'])) # The default sort key could also be overwrite by command line (see #1903) - if args.sort_processes_key is not None: + if args and args.sort_processes_key is not None: glances_processes.set_sort_key(args.sort_processes_key, False) # Note: 'glances_processes' is already init in the processes.py script diff --git a/glances/plugins/quicklook/__init__.py b/glances/plugins/quicklook/__init__.py index 6cf4ea25..48dd474b 100644 --- a/glances/plugins/quicklook/__init__.py +++ b/glances/plugins/quicklook/__init__.py @@ -92,7 +92,7 @@ class PluginModel(GlancesPluginModel): self.display_curse = True # Manage the maximum number of CPU to display (related to enhancement request #2734) - self.max_cpu_display = config.get_int_value('percpu', 'max_cpu_display', 4) + self.max_cpu_display = config.get_int_value('percpu', 'max_cpu_display', 4) if config else 4 # Define the stats list self.stats_list = self.get_conf_value('list', default=self.DEFAULT_STATS_LIST) diff --git a/glances/plugins/sensors/__init__.py b/glances/plugins/sensors/__init__.py index 35e04678..1eec639c 100644 --- a/glances/plugins/sensors/__init__.py +++ b/glances/plugins/sensors/__init__.py @@ -101,7 +101,7 @@ class PluginModel(GlancesPluginModel): self.display_curse = True # Not necessary to refresh every refresh time - if self.get_refresh() == args.time: + if args and self.get_refresh() == args.time: self.set_refresh(self.get_refresh() * DEFAULT_REFRESH) def get_key(self): diff --git a/glances/plugins/smart/__init__.py b/glances/plugins/smart/__init__.py index 644efa04..f2e33d32 100644 --- a/glances/plugins/smart/__init__.py +++ b/glances/plugins/smart/__init__.py @@ -125,7 +125,7 @@ class PluginModel(GlancesPluginModel): def __init__(self, args=None, config=None, stats_init_value=[]): """Init the plugin.""" # check if user is admin - if not is_admin(): + if not is_admin() and args: disable(args, "smart") logger.debug("Current user is not admin, HDD SMART plugin disabled.") diff --git a/glances/plugins/system/__init__.py b/glances/plugins/system/__init__.py index 8e0e65fe..419d803e 100644 --- a/glances/plugins/system/__init__.py +++ b/glances/plugins/system/__init__.py @@ -132,7 +132,7 @@ class PluginModel(GlancesPluginModel): self.set_refresh(60) # Get the default message (if defined) - self.system_info_msg = config.get_value('system', 'system_info_msg') + self.system_info_msg = config.get_value('system', 'system_info_msg') if config else None @GlancesPluginModel._check_decorator @GlancesPluginModel._log_result_decorator diff --git a/glances/snmp.py b/glances/snmp.py index 368efd19..fb6a6d93 100644 --- a/glances/snmp.py +++ b/glances/snmp.py @@ -41,12 +41,9 @@ class GlancesSNMPClient(object): ret = {} for name, val in varBinds: if str(val) == '': - ret[name.prettyPrint()] = '' + ret[str(name)] = '' else: - ret[name.prettyPrint()] = val.prettyPrint() - # In Python 3, prettyPrint() return 'b'linux'' instead of 'linux' - if ret[name.prettyPrint()].startswith('b\''): - ret[name.prettyPrint()] = ret[name.prettyPrint()][2:-1] + ret[str(name)] = val.prettyPrint() return ret def __get_result__(self, errorIndication, errorStatus, errorIndex, varBinds): diff --git a/optional-requirements.txt b/optional-requirements.txt index 6a92e6f8..37d5dd79 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -27,7 +27,7 @@ pygal pymdstat pymongo; python_version >= "3.7" nvidia-ml-py; python_version >= "3.5" -pysnmp +pysnmp-lextudio; python_version >= "3.7" pySMART.smartx python-dateutil pyzmq From 21b49c7db20cddd66e171da50404a2764efc7648 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Wed, 1 May 2024 15:51:38 +0200 Subject: [PATCH 6/7] Remove autoinstall script from documentation --- README.rst | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/README.rst b/README.rst index 617ba122..97778e0c 100644 --- a/README.rst +++ b/README.rst @@ -135,26 +135,27 @@ Installation There are several methods to test/install Glances on your system. Choose your weapon! -PyPI: The standard way ----------------------- +PyPI: Pip, the standard way +--------------------------- Glances is on ``PyPI``. By using PyPI, you will be using the latest stable version. -To install Glances, simply use ``pip``: +To install Glances, simply use the ``pip`` command line. + +Warning: on modern Linux operating systems, you may have an externally-managed-environment +error message when you try to use ``pip``. In this case, go to the the PipX section bellow. .. code-block:: console pip install --user glances *Note*: Python headers are required to install `psutil`_, a Glances -dependency. For example, on Debian/Ubuntu **the simplest** is ``apt install python3-psutil`` or alternatively need to install first +dependency. For example, on Debian/Ubuntu **the simplest** is +``apt install python3-psutil`` or alternatively need to install first the *python-dev* package and gcc (*python-devel* on Fedora/CentOS/RHEL). For Windows, just install psutil from the binary installation file. -*Note 2 (for the Wifi plugin)*: If you want to use the Wifi plugin, you need -to install the *wireless-tools* package on your system. - By default, Glances is installed without the Web interface dependencies. To install it, use the following command: @@ -181,24 +182,18 @@ If you want to test the develop version (could be instable), enter: pip install --user -i https://test.pypi.org/simple/ Glances -Glances Auto Install script: the easy way ------------------------------------------ +PyPI: PipX, the alternative way +------------------------------- -To install both dependencies and the latest Glances production ready version -(aka *master* branch), just enter the following command line: +Install PipX on your system (apt install pipx on Ubuntu). + +Install Glances (with all features): .. code-block:: console - curl -L https://bit.ly/glances | /bin/bash + pipx install 'glances[all]' -or - -.. code-block:: console - - wget -O- https://bit.ly/glances | /bin/bash - -*Note*: This is only supported on some GNU/Linux distributions and Mac OS X. -If you want to support other distributions, please contribute to `glancesautoinstall`_. +The glances script will be installed in the ~/.local/bin folder. Docker: the cloudy way ---------------------- @@ -256,8 +251,8 @@ Run the container in *Web server mode*: For a full list of options, see the Glances `Docker`_ documentation page. -GNU/Linux ---------- +GNU/Linux package +----------------- `Glances` is available on many Linux distributions, so you should be able to install it using your favorite package manager. Be aware that From e0f7498b7e85fd215a1d55f1b126cccd44ef5809 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Wed, 1 May 2024 18:05:00 +0200 Subject: [PATCH 7/7] Add refresh to curses global loop --- glances/outputs/glances_curses.py | 6 ++++++ glances/standalone.py | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index d95e63aa..e7e032f5 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -1130,6 +1130,10 @@ class _GlancesCurses(object): update the terminal.""" self.term_window.erase() + def refresh(self): + """Refresh the windows""" + self.term_window.refresh() + def flush(self, stats, cs_status=None): """Erase and update the screen. @@ -1139,8 +1143,10 @@ class _GlancesCurses(object): "Connected": Client is connected to the server "Disconnected": Client is disconnected from the server """ + # See https://stackoverflow.com/a/43486979/1919431 self.erase() self.display(stats, cs_status=cs_status) + self.refresh() def update(self, stats, duration=3, cs_status=None, return_to_browser=False): """Update the screen. diff --git a/glances/standalone.py b/glances/standalone.py index 68700c8c..c28afe5e 100644 --- a/glances/standalone.py +++ b/glances/standalone.py @@ -148,15 +148,16 @@ class GlancesStandalone(object): logger.debug('Stats updated duration: {} seconds'.format(counter.get())) # Patch for issue1326 to avoid < 0 refresh - adapted_refresh = self.refresh_time - counter.get() - adapted_refresh = adapted_refresh if adapted_refresh > 0 else 0 + adapted_refresh = (self.refresh_time - counter.get()) if (self.refresh_time - counter.get()) > 0 else 0 # Display stats # and wait refresh_time - counter if not self.quiet: # The update function return True if an exit key 'q' or 'ESC' # has been pressed. + counter_display = Counter() ret = not self.screen.update(self.stats, duration=adapted_refresh) + logger.debug('Stats display duration: {} seconds'.format(counter_display.get() - adapted_refresh)) else: # Nothing is displayed # Break should be done via a signal (CTRL-C)