diff options
-rw-r--r-- | conf/glances.conf | 2 | ||||
-rw-r--r-- | docs/aoa/wifi.rst | 8 | ||||
-rw-r--r-- | docs/api.rst | 286 | ||||
-rw-r--r-- | docs/man/glances.1 | 2 | ||||
-rw-r--r-- | glances/globals.py | 5 | ||||
-rw-r--r-- | glances/outputs/static/js/components/plugin-wifi.vue | 5 | ||||
-rw-r--r-- | glances/outputs/static/public/glances.js | 2 | ||||
-rw-r--r-- | glances/plugins/wifi/model.py | 100 |
8 files changed, 211 insertions, 199 deletions
diff --git a/conf/glances.conf b/conf/glances.conf index 63ab731f..c8eacf3d 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -204,7 +204,7 @@ nf_conntrack_percent_warning=80 nf_conntrack_percent_critical=90 [wifi] -disable=True +disable=False # Define the list of hidden wireless network interfaces (comma-separated regexp) hide=lo,docker.* # Define the list of wireless network interfaces to be show (comma-separated) diff --git a/docs/aoa/wifi.rst b/docs/aoa/wifi.rst index eb23c037..d8a38e16 100644 --- a/docs/aoa/wifi.rst +++ b/docs/aoa/wifi.rst @@ -3,18 +3,14 @@ Wi-Fi ===== -* WARNING: The Wifi Python lib (https://pypi.python.org/pypi/wifi) is note -compatible with Python 3. So the plugin is disable in Glances 4.0 or higher* - *Availability: Linux* .. image:: ../_static/wifi.png -Glances displays the Wi-Fi hotspot names and signal quality. If Glances -is ran as root, then all the available hotspots are displayed. +Glances displays the Wi-Fi signal quality. .. note:: - You need to install the ``wireless-tools`` package on your system. + Stats are grabbed from the ``/proc/net/wireless`` file (so Linux only). In the configuration file, you can define signal quality thresholds: diff --git a/docs/api.rst b/docs/api.rst index 04bc809d..2206ac63 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -84,14 +84,14 @@ GET alert Get plugin stats:: # curl http://localhost:61208/api/3/alert - [[1689404452.0, + [[1690221756.0, -1, "WARNING", "MEM", - 77.25691549611605, - 77.25691549611605, - 77.25691549611605, - 77.25691549611605, + 73.52308859142421, + 73.52308859142421, + 73.52308859142421, + 73.52308859142421, 1, [], "", @@ -111,7 +111,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.26898837089538574}, + "timer": 0.16022157669067383}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -120,7 +120,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.268878698348999}] + "timer": 0.1601276397705078}] Get a specific field:: @@ -138,7 +138,7 @@ Get a specific item when field matches the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.26898837089538574}]} + "timer": 0.16022157669067383}]} GET connections --------------- @@ -164,11 +164,11 @@ Get plugin stats:: "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", "Image": ["portainer/portainer-ce:2.9.3"], "Status": "running", - "Uptime": "6 days", + "Uptime": "2 weeks", "cpu": {"total": 0.0}, "cpu_percent": 0.0, "engine": "docker", - "io": {"cumulative_ior": 5718016, "cumulative_iow": 6606848}, + "io": {"cumulative_ior": 5931008, "cumulative_iow": 6717440}, "io_r": None, "io_w": None, "key": "name", @@ -176,10 +176,10 @@ Get plugin stats:: "limit": 7836184576, "max_usage": None, "rss": None, - "usage": 13799424}, - "memory_usage": 13799424, + "usage": 15683584}, + "memory_usage": 15683584, "name": "portainer", - "network": {"cumulative_rx": 2373195, "cumulative_tx": 0}, + "network": {"cumulative_rx": 3537709, "cumulative_tx": 0}, "network_rx": None, "network_tx": None}, {"Command": ["top"], @@ -188,8 +188,8 @@ Get plugin stats:: "Image": "["docker.io/library/ubuntu:latest"]", "Status": "running", "Uptime": "2 months", - "cpu": {"total": 6.265692018448844e-06}, - "cpu_percent": 6.265692018448844e-06, + "cpu": {"total": 6.527343974782009e-06}, + "cpu_percent": 6.527343974782009e-06, "engine": "podman", "io": {"ior": 0.0, "iow": 0.0, "time_since_update": 1}, "io_r": 0.0, @@ -209,8 +209,8 @@ Get plugin stats:: "Image": "["k8s.gcr.io/pause:3.5"]", "Status": "running", "Uptime": "2 months", - "cpu": {"total": 3.138384055481648e-10}, - "cpu_percent": 3.138384055481648e-10, + "cpu": {"total": 3.162306945021642e-10}, + "cpu_percent": 3.162306945021642e-10, "engine": "podman", "io": {"ior": 0.0, "iow": 0.0, "time_since_update": 1}, "io_r": 0.0, @@ -255,19 +255,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 72.0, + "idle": 73.6, "interrupts": 0, - "iowait": 0.7, + "iowait": 0.0, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 6.0, + "system": 3.8, "time_since_update": 1, - "total": 27.3, - "user": 21.3} + "total": 26.4, + "user": 22.6} Fields descriptions: @@ -290,7 +290,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 27.3} + {"total": 26.4} GET diskio ---------- @@ -336,13 +336,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 25724469248, + "free": 26173812736, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 88.9, + "percent": 88.7, "size": 243334156288, - "used": 205222232064}, + "used": 204772888576}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -361,13 +361,13 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 25724469248, + "free": 26173812736, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 88.9, + "percent": 88.7, "size": 243334156288, - "used": 205222232064}]} + "used": 204772888576}]} GET ip ------ @@ -375,17 +375,17 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.1.14", - "gateway": "192.168.1.1", + {"address": "192.168.0.32", + "gateway": "192.168.0.254", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "92.151.148.66", + "public_address": "91.166.228.228", "public_info_human": ""} Get a specific field:: # curl http://localhost:61208/api/3/ip/gateway - {"gateway": "192.168.1.1"} + {"gateway": "192.168.0.254"} GET load -------- @@ -393,7 +393,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, "min1": 1.45703125, "min15": 1.44189453125, "min5": 1.5908203125} + {"cpucore": 4, "min1": 1.04296875, "min15": 1.11474609375, "min5": 0.9052734375} Fields descriptions: @@ -405,7 +405,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 1.45703125} + {"min1": 1.04296875} GET mem ------- @@ -413,16 +413,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2771607552, - "available": 1782190080, - "buffers": 301641728, - "cached": 2176180224, - "free": 1782190080, - "inactive": 3422621696, - "percent": 77.3, - "shared": 645427200, + {"active": 2751746048, + "available": 2074779648, + "buffers": 127934464, + "cached": 2468466688, + "free": 2074779648, + "inactive": 3784257536, + "percent": 73.5, + "shared": 544108544, "total": 7836184576, - "used": 6053994496} + "used": 5761404928} Fields descriptions: @@ -449,13 +449,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 5611012096, - "percent": 30.6, - "sin": 29654863872, - "sout": 42837680128, + {"free": 5769068544, + "percent": 28.6, + "sin": 30049615872, + "sout": 43714748416, "time_since_update": 1, "total": 8082419712, - "used": 2471407616} + "used": 2313351168} Fields descriptions: @@ -479,29 +479,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 1205877830, - "cumulative_rx": 602938915, - "cumulative_tx": 602938915, - "cx": 576, + "cumulative_cx": 1243428214, + "cumulative_rx": 621714107, + "cumulative_tx": 621714107, + "cx": 0, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 288, + "rx": 0, "speed": 0, "time_since_update": 1, - "tx": 288}, + "tx": 0}, {"alias": None, - "cumulative_cx": 41374141828, - "cumulative_rx": 39785221263, - "cumulative_tx": 1588920565, - "cx": 224, + "cumulative_cx": 42045848970, + "cumulative_rx": 40404482049, + "cumulative_tx": 1641366921, + "cx": 451, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 98, + "rx": 211, "speed": 0, "time_since_update": 1, - "tx": 126}] + "tx": 240}] Fields descriptions: @@ -524,25 +524,25 @@ Get a specific field:: "wlp2s0", "docker0", "br_grafana", - "mpqemubr0", "veth868647c", + "mpqemubr0", "vboxnet0"]} Get a specific item when field matches the given value:: # curl http://localhost:61208/api/3/network/interface_name/lo {"lo": [{"alias": None, - "cumulative_cx": 1205877830, - "cumulative_rx": 602938915, - "cumulative_tx": 602938915, - "cx": 576, + "cumulative_cx": 1243428214, + "cumulative_rx": 621714107, + "cumulative_tx": 621714107, + "cx": 0, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 288, + "rx": 0, "speed": 0, "time_since_update": 1, - "tx": 288}]} + "tx": 0}]} GET now ------- @@ -550,7 +550,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2023-07-15 09:00:52 CEST" + "2023-07-24 20:02:36 CEST" GET percpu ---------- @@ -561,7 +561,7 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 30.0, + "idle": 4.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -569,21 +569,21 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 3.0, - "total": 70.0, - "user": 5.0}, + "total": 96.0, + "user": 18.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 33.0, + "idle": 23.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 2.0, - "total": 67.0, - "user": 4.0}] + "system": 1.0, + "total": 77.0, + "user": 2.0}] Get a specific field:: @@ -597,30 +597,30 @@ Get plugin stats:: # curl http://localhost:61208/api/3/ports [{"description": "DefaultGateway", - "host": "192.168.1.1", + "host": "192.168.0.254", "indice": "port_0", "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.007983, + "status": 0.003764, "timeout": 3}] Get a specific field:: # curl http://localhost:61208/api/3/ports/host - {"host": ["192.168.1.1"]} + {"host": ["192.168.0.254"]} Get a specific item when field matches the given value:: - # curl http://localhost:61208/api/3/ports/host/192.168.1.1 - {"192.168.1.1": [{"description": "DefaultGateway", - "host": "192.168.1.1", - "indice": "port_0", - "port": 0, - "refresh": 30, - "rtt_warning": None, - "status": 0.007983, - "timeout": 3}]} + # curl http://localhost:61208/api/3/ports/host/192.168.0.254 + {"192.168.0.254": [{"description": "DefaultGateway", + "host": "192.168.0.254", + "indice": "port_0", + "port": 0, + "refresh": 30, + "rtt_warning": None, + "status": 0.003764, + "timeout": 3}]} GET processcount ---------------- @@ -628,12 +628,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 2, "sleeping": 321, "thread": 1653, "total": 392} + {"pid_max": 0, "running": 1, "sleeping": 317, "thread": 1548, "total": 386} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 392} + {"total": 386} GET psutilversion ----------------- @@ -649,15 +649,15 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {"cpu": 27.3, + {"cpu": 26.4, "cpu_hz": 3000000000.0, - "cpu_hz_current": 2419778250.0000005, + "cpu_hz_current": 2704714500.0, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", - "mem": 77.3, + "mem": 73.5, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 30.0, + "idle": 4.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -665,53 +665,53 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 3.0, - "total": 70.0, - "user": 5.0}, + "total": 96.0, + "user": 18.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 33.0, + "idle": 23.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 2.0, - "total": 67.0, - "user": 4.0}, + "system": 1.0, + "total": 77.0, + "user": 2.0}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 33.0, - "iowait": 0.0, + "idle": 25.0, + "iowait": 1.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 1.0, - "total": 67.0, + "system": 0.0, + "total": 75.0, "user": 1.0}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 12.0, + "idle": 25.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 3.0, - "total": 88.0, - "user": 22.0}], - "swap": 30.6} + "system": 1.0, + "total": 75.0, + "user": 2.0}], + "swap": 28.6} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {"cpu": 27.3} + {"cpu": 26.4} GET sensors ----------- @@ -782,7 +782,33 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - "67 days, 19:58:49" + "77 days, 7:00:32" + +GET wifi +-------- + +Get plugin stats:: + + # curl http://localhost:61208/api/3/wifi + [{"key": "ssid", + "noise": -256.0, + "quality": 54.0, + "signal": -56.0, + "ssid": "wlp2s0"}] + +Get a specific field:: + + # curl http://localhost:61208/api/3/wifi/ssid + {"ssid": ["wlp2s0"]} + +Get a specific item when field matches the given value:: + + # curl http://localhost:61208/api/3/wifi/ssid/wlp2s0 + {"wlp2s0": [{"key": "ssid", + "noise": -256.0, + "quality": 54.0, + "signal": -56.0, + "ssid": "wlp2s0"}]} GET all stats ------------- @@ -798,33 +824,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {"system": [["2023-07-15T09:00:52.711609", 6.0], - ["2023-07-15T09:00:54.510067", 6.0], - ["2023-07-15T09:00:55.535819", 3.4]], - "user": [["2023-07-15T09:00:52.711595", 21.3], - ["2023-07-15T09:00:54.510061", 21.3], - ["2023-07-15T09:00:55.535813", 13.8]]} + {"system": [["2023-07-24T20:02:36.054025", 3.8], + ["2023-07-24T20:02:37.801975", 3.8], + ["2023-07-24T20:02:38.828873", 1.3]], + "user": [["2023-07-24T20:02:36.054019", 22.6], + ["2023-07-24T20:02:37.801964", 22.6], + ["2023-07-24T20:02:38.828867", 15.0]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {"system": [["2023-07-15T09:00:54.510067", 6.0], - ["2023-07-15T09:00:55.535819", 3.4]], - "user": [["2023-07-15T09:00:54.510061", 21.3], - ["2023-07-15T09:00:55.535813", 13.8]]} + {"system": [["2023-07-24T20:02:37.801975", 3.8], + ["2023-07-24T20:02:38.828873", 1.3]], + "user": [["2023-07-24T20:02:37.801964", 22.6], + ["2023-07-24T20:02:38.828867", 15.0]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2023-07-15T09:00:52.711609", 6.0], - ["2023-07-15T09:00:54.510067", 6.0], - ["2023-07-15T09:00:55.535819", 3.4]]} + {"system": [["2023-07-24T20:02:36.054025", 3.8], + ["2023-07-24T20:02:37.801975", 3.8], + ["2023-07-24T20:02:38.828873", 1.3]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2023-07-15T09:00:54.510067", 6.0], - ["2023-07-15T09:00:55.535819", 3.4]]} + {"system": [["2023-07-24T20:02:37.801975", 3.8], + ["2023-07-24T20:02:38.828873", 1.3]]} GET limits (used for thresholds) -------------------------------- @@ -1005,7 +1031,13 @@ All limits/thresholds:: "system": {"history_size": 1200.0, "system_disable": ["False"], "system_refresh": 60}, - "uptime": {"history_size": 1200.0}} + "uptime": {"history_size": 1200.0}, + "wifi": {"history_size": 1200.0, + "wifi_careful": -65.0, + "wifi_critical": -85.0, + "wifi_disable": ["False"], + "wifi_hide": ["lo", "docker.*"], + "wifi_warning": -75.0}} Limits/thresholds for the cpu plugin:: diff --git a/docs/man/glances.1 b/docs/man/glances.1 index 35484133..6fbbdfd7 100644 --- a/docs/man/glances.1 +++ b/docs/man/glances.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "GLANCES" "1" "Jul 15, 2023" "4.0.0_beta01" "Glances" +.TH "GLANCES" "1" "Jul 24, 2023" "4.0.0_beta01" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS diff --git a/glances/globals.py b/glances/globals.py index 4b3e15b0..c539c9b5 100644 --- a/glances/globals.py +++ b/glances/globals.py @@ -367,3 +367,8 @@ def string_value_to_float(s): except ValueError: return None return value * convert_dict[unit] + + +def file_exists(filename): + """Return True if the file exists and is readable.""" + return os.path.isfile(filename) and os.access(filename, os.R_OK) diff --git a/glances/outputs/static/js/components/plugin-wifi.vue b/glances/outputs/static/js/components/plugin-wifi.vue index b4d43343..5fc31f8c 100644 --- a/glances/outputs/static/js/components/plugin-wifi.vue +++ b/glances/outputs/static/js/components/plugin-wifi.vue @@ -8,9 +8,6 @@ <div class="table-row" v-for="(hotspot, hotspotId) in hotspots" :key="hotspotId"> <div class="table-cell text-left"> {{ $filters.limitTo(hotspot.ssid, 20) }} - <span v-if="hotspot.encrypted"> - {{ hotspot.encryption_type }} - </span> </div> <div class="table-cell"></div> <div class="table-cell" :class="getDecoration(hotspot, 'signal')"> @@ -44,9 +41,7 @@ export default { } return { ssid: hotspotData['ssid'], - encrypted: hotspotData['encrypted'], signal: hotspotData['signal'], - encryption_type: hotspotData['encryption_type'] }; }) .filter(Boolean); diff --git a/glances/outputs/static/public/glances.js b/glances/outputs/static/public/glances.js index 68e03ec2..f2db21d7 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 ho="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function go(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function mo(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function bo(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var vo={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,"-":ho?173:189,"=":ho?61:187,";":ho?59:186,"'":222,"[":219,"]":221,"\\":220},yo={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},wo={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},xo={16:!1,18:!1,17:!1,91:!1},_o={},ko=1;ko<20;ko++)vo["f".concat(ko)]=111+ko;var So=[],Co=!1,To="all",Ao=[],Eo=function(e){return vo[e.toLowerCase()]||yo[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Oo(e){To=e||"all"}function Io(){return To||"all"}var Po=function(e){var t=e.key,n=e.scope,r=e.method,i=e.splitKey,s=void 0===i?"+":i;bo(t).forEach((function(e){var t=e.split(s),i=t.length,o=t[i-1],a="*"===o?"*":Eo(o);if(_o[a]){n||(n=Io());var l=i>1?mo(yo,t):[];_o[a]=_o[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;s<n.length;s++)-1===r.indexOf(n[s])&&(i=!1);return i}(e.mods,l))}))}}))};function No(e,t,n,r){var i;if(t.element===r&&(t.scope===n||"all"===t.scope)){for(var s in i=t.mods.length>0,xo)Object.prototype.hasOwnProperty.call(xo,s)&&(!xo[s]&&t.mods.indexOf(+s)>-1||xo[s]&&-1===t.mods.indexOf(+s))&&(i=!1);(0!==t.mods.length||xo[16]||xo[18]||xo[17]||xo[91])&&!i&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(So),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Lo(e,t){var n=_o["*"],r=e.keyCode||e.which||e.charCode;if(Do.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===So.indexOf(r)&&229!==r&&So.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=wo[t];e[t]&&-1===So.indexOf(n)?So.push(n):!e[t]&&So.indexOf(n)>-1?So.splice(So.indexOf(n),1):"metaKey"===t&&e[t]&&3===So.length&&(e.ctrlKey||e.shiftKey||e.altKey||(So=So.slice(So.indexOf(n))))})),r in xo){for(var i in xo[r]=!0,yo)yo[i]===r&&(Do[i]=!0);if(!n)return}for(var s in xo)Object.prototype.hasOwnProperty.call(xo,s)&&(xo[s]=e[wo[s]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===So.indexOf(17)&&So.push(17),-1===So.indexOf(18)&&So.push(18),xo[17]=!0,xo[18]=!0);var o=Io();if(n)for(var a=0;a<n.length;a++)n[a].scope===o&&("keydown"===e.type&&n[a].keydown||"keyup"===e.type&&n[a].keyup)&&No(e,n[a],o,t);if(r in _o)for(var l=0;l<_o[r].length;l++)if(("keydown"===e.type&&_o[r][l].keydown||"keyup"===e.type&&_o[r][l].keyup)&&_o[r][l].key){for(var c=_o[r][l],u=c.splitKey,d=c.key.split(u),f=[],p=0;p<d.length;p++)f.push(Eo(d[p]));f.sort().join("")===So.sort().join("")&&No(e,c,o,t)}}}function Do(e,t,n){So=[];var r=bo(e),i=[],s="all",o=document,a=0,l=!1,c=!0,u="+",d=!1;for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(s=t.scope),t.element&&(o=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(c=t.keydown),void 0!==t.capture&&(d=t.capture),"string"==typeof t.splitKey&&(u=t.splitKey)),"string"==typeof t&&(s=t);a<r.length;a++)i=[],(e=r[a].split(u)).length>1&&(i=mo(yo,e)),(e="*"===(e=e[e.length-1])?"*":Eo(e))in _o||(_o[e]=[]),_o[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 Ao.indexOf(e)>-1}(o)&&window&&(Ao.push(o),go(o,"keydown",(function(e){Lo(e,o)}),d),Co||(Co=!0,go(window,"focus",(function(){So=[]}),d)),go(o,"keyup",(function(e){Lo(e,o),function(e){var t=e.keyCode||e.which||e.charCode,n=So.indexOf(t);if(n>=0&&So.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&So.splice(0,So.length),93!==t&&224!==t||(t=91),t in xo)for(var r in xo[t]=!1,yo)yo[r]===t&&(Do[r]=!1)}(e)}),d))}var Mo={getPressedKeyString:function(){return So.map((function(e){return t=e,Object.keys(vo).find((function(e){return vo[e]===t}))||function(e){return Object.keys(yo).find((function(t){return yo[t]===e}))}(e)||String.fromCharCode(e);var t}))},setScope:Oo,getScope:Io,deleteScope:function(e,t){var n,r;for(var i in e||(e=Io()),_o)if(Object.prototype.hasOwnProperty.call(_o,i))for(n=_o[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;Io()===e&&Oo(t||"all")},getPressedKeyCodes:function(){return So.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=Eo(e)),-1!==So.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(r=!1),r},trigger:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(_o).forEach((function(n){_o[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(_o).forEach((function(e){return delete _o[e]}));else if(Array.isArray(e))e.forEach((function(e){e.key&&Po(e)}));else if("object"==typeof e)e.key&&Po(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],s=n[1];"function"==typeof i&&(s=i,i=""),Po({key:e,scope:i,method:s,splitKey:"+"})}},keyMap:vo,modifier:yo,modifierMap:wo};for(var jo in Mo)Object.prototype.hasOwnProperty.call(Mo,jo)&&(Do[jo]=Mo[jo]);if("undefined"!=typeof window){var Ro=window.hotkeys;Do.noConflict=function(e){return e&&window.hotkeys===Do&&(window.hotkeys=Ro),Do},window.hotkeys=Do}const qo=kt({args:void 0,config:void 0,data:void 0,status:"IDLE"});var Bo=n(9049),Uo=n.n(Bo);const Fo=new class{limits={};limitSuffix=["critical","careful","warning"];setLimits(e){this.limits=e}getAlert(e,t,n,r,i){var s=(i=i||!1)?"_log":"",o=100*(n=n||0)/(r=r||100);if(null!=this.limits[e])for(var a=0;a<this.limitSuffix.length;a++){var l=t+this.limitSuffix[a];if(o>=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 zo=new class{data=void 0;init(e=60){let t;const n=()=>(qo.status="PENDING",Promise.all([fetch("api/3/all",{method:"GET"}).then((e=>e.json())),fetch("api/3/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,qo.data=t,qo.status="SUCCESS"})).catch((e=>{console.log(e),qo.status="FAILURE"})).then((()=>{t&&clearTimeout(t),t=setTimeout(n,1e3*e)})));n(),fetch("api/3/all/limits",{method:"GET"}).then((e=>e.json())).then((e=>{Fo.setLimits(e)})),fetch("api/3/args",{method:"GET"}).then((e=>e.json())).then(((e={})=>{qo.args={...qo.args,...e}})),fetch("api/3/config",{method:"GET"}).then((e=>e.json())).then(((e={})=>{qo.config={...qo.config,...e}}))}getData(){return this.data}};const $o=new class{constructor(){this.favico=new(Uo())({animation:"none"})}badge(e){this.favico.badge(e)}reset(){this.favico.reset()}},Ho={key:0},Vo={class:"container-fluid"},Go={class:"row"},Wo={class:"col-sm-12 col-lg-24"},Zo=wi("div",{class:"row"}," ",-1),Ko={class:"row"},Qo={class:"col-sm-12 col-lg-24"},Xo=wi("div",{class:"row"}," ",-1),Jo={class:"divTable",style:{width:"100%"}},Yo={class:"divTableBody"},ea={class:"divTableRow"},ta={class:"divTableHead"},na={class:"divTableHead"},ra={class:"divTableHead"},ia={class:"divTableHead"},sa={class:"divTableRow"},oa={class:"divTableCell"},aa={class:"divTableCell"},la={class:"divTableCell"},ca={class:"divTableCell"},ua={class:"divTableRow"},da={class:"divTableCell"},fa={class:"divTableCell"},pa={class:"divTableCell"},ha={class:"divTableCell"},ga={class:"divTableRow"},ma={class:"divTableCell"},ba={class:"divTableCell"},va={class:"divTableCell"},ya={class:"divTableCell"},wa={class:"divTableRow"},xa={class:"divTableCell"},_a={class:"divTableCell"},ka={class:"divTableCell"},Sa={class:"divTableCell"},Ca={class:"divTableRow"},Ta={class:"divTableCell"},Aa={class:"divTableCell"},Ea={class:"divTableCell"},Oa={class:"divTableCell"},Ia={class:"divTableRow"},Pa={class:"divTableCell"},Na={class:"divTableCell"},La={class:"divTableCell"},Da={class:"divTableCell"},Ma={class:"divTableRow"},ja={class:"divTableCell"},Ra={class:"divTableCell"},qa={class:"divTableCell"},Ba={class:"divTableCell"},Ua={class:"divTableRow"},Fa=wi("div",{class:"divTableCell"}," ",-1),za={class:"divTableCell"},$a={class:"divTableCell"},Ha={class:"divTableCell"},Va={class:"divTableRow"},Ga=wi("div",{class:"divTableCell"}," ",-1),Wa={class:"divTableCell"},Za={class:"divTableCell"},Ka={class:"divTableCell"},Qa={class:"divTableRow"},Xa=wi("div",{class:"divTableCell"}," ",-1),Ja={class:"divTableCell"},Ya={class:"divTableCell"},el={class:"divTableCell"},tl={class:"divTableRow"},nl=wi("div",{class:"divTableCell"}," ",-1),rl={class:"divTableCell"},il=wi("div",{class:"divTableCell"}," ",-1),sl={class:"divTableCell"},ol={class:"divTableRow"},al=wi("div",{class:"divTableCell"}," ",-1),ll={class:"divTableCell"},cl=wi("div",{class:"divTableCell"}," ",-1),ul=wi("div",{class:"divTableCell"}," ",-1),dl={class:"divTableRow"},fl=wi("div",{class:"divTableCell"}," ",-1),pl={class:"divTableCell"},hl=wi("div",{class:"divTableCell"}," ",-1),gl=wi("div",{class:"divTableCell"}," ",-1),ml={class:"divTableRow"},bl=wi("div",{class:"divTableCell"}," ",-1),vl={class:"divTableCell"},yl=wi("div",{class:"divTableCell"}," ",-1),wl=wi("div",{class:"divTableCell"}," ",-1),xl={class:"divTableRow"},_l=wi("div",{class:"divTableCell"}," ",-1),kl={class:"divTableCell"},Sl=wi("div",{class:"divTableCell"}," ",-1),Cl=wi("div",{class:"divTableCell"}," ",-1),Tl={class:"divTableRow"},Al=wi("div",{class:"divTableCell"}," ",-1),El={class:"divTableCell"},Ol=wi("div",{class:"divTableCell"}," ",-1),Il=wi("div",{class:"divTableCell"}," ",-1),Pl={class:"divTableRow"},Nl=wi("div",{class:"divTableCell"}," ",-1),Ll={class:"divTableCell"},Dl=wi("div",{class:"divTableCell"}," ",-1),Ml=wi("div",{class:"divTableCell"}," ",-1),jl={class:"divTableRow"},Rl=wi("div",{class:"divTableCell"}," ",-1),ql={class:"divTableCell"},Bl=wi("div",{class:"divTableCell"}," ",-1),Ul=wi("div",{class:"divTableCell"}," ",-1),Fl={class:"divTableRow"},zl=wi("div",{class:"divTableCell"}," ",-1),$l={class:"divTableCell"},Hl=wi("div",{class:"divTableCell"}," ",-1),Vl=wi("div",{class:"divTableCell"}," ",-1),Gl={class:"divTableRow"},Wl=wi("div",{class:"divTableCell"}," ",-1),Zl={class:"divTableCell"},Kl=wi("div",{class:"divTableCell"}," ",-1),Ql=wi("div",{class:"divTableCell"}," ",-1),Xl=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),Jl=wi("div",null,[wi("p",null,[Si("Press "),wi("b",null,"h"),Si(" to came back to Glances.")])],-1);const Yl={data:()=>({help:void 0}),mounted(){fetch("api/3/help",{method:"GET"}).then((e=>e.json())).then((e=>this.help=e))}};var ec=n(3744);const tc=(0,ec.Z)(Yl,[["render",function(e,t,n,r,i,s){return i.help?(li(),pi("div",Ho,[wi("div",Vo,[wi("div",Go,[wi("div",Wo,pe(i.help.version)+" "+pe(i.help.psutil_version),1)]),Zo,wi("div",Ko,[wi("div",Qo,pe(i.help.configuration_file),1)]),Xo]),wi("div",Jo,[wi("div",Yo,[wi("div",ea,[wi("div",ta,pe(i.help.header_sort.replace(":","")),1),wi("div",na,pe(i.help.header_show_hide.replace(":","")),1),wi("div",ra,pe(i.help.header_toggle.replace(":","")),1),wi("div",ia,pe(i.help.header_miscellaneous.replace(":","")),1)]),wi("div",sa,[wi("div",oa,pe(i.help.sort_auto),1),wi("div",aa,pe(i.help.show_hide_application_monitoring),1),wi("div",la,pe(i.help.toggle_bits_bytes),1),wi("div",ca,pe(i.help.misc_erase_process_filter),1)]),wi("div",ua,[wi("div",da,pe(i.help.sort_cpu),1),wi("div",fa,pe(i.help.show_hide_diskio),1),wi("div",pa,pe(i.help.toggle_count_rate),1),wi("div",ha,pe(i.help.misc_generate_history_graphs),1)]),wi("div",ga,[wi("div",ma,pe(i.help.sort_io_rate),1),wi("div",ba,pe(i.help.show_hide_containers),1),wi("div",va,pe(i.help.toggle_used_free),1),wi("div",ya,pe(i.help.misc_help),1)]),wi("div",wa,[wi("div",xa,pe(i.help.sort_mem),1),wi("div",_a,pe(i.help.show_hide_top_extended_stats),1),wi("div",ka,pe(i.help.toggle_bar_sparkline),1),wi("div",Sa,pe(i.help.misc_accumulate_processes_by_program),1)]),wi("div",Ca,[wi("div",Ta,pe(i.help.sort_process_name),1),wi("div",Aa,pe(i.help.show_hide_filesystem),1),wi("div",Ea,pe(i.help.toggle_separate_combined),1),wi("div",Oa,pe(i.help.misc_kill_process)+" - N/A in WebUI ",1)]),wi("div",Ia,[wi("div",Pa,pe(i.help.sort_cpu_times),1),wi("div",Na,pe(i.help.show_hide_gpu),1),wi("div",La,pe(i.help.toggle_live_cumulative),1),wi("div",Da,pe(i.help.misc_reset_processes_summary_min_max),1)]),wi("div",Ma,[wi("div",ja,pe(i.help.sort_user),1),wi("div",Ra,pe(i.help.show_hide_ip),1),wi("div",qa,pe(i.help.toggle_linux_percentage),1),wi("div",Ba,pe(i.help.misc_quit),1)]),wi("div",Ua,[Fa,wi("div",za,pe(i.help.show_hide_tcp_connection),1),wi("div",$a,pe(i.help.toggle_cpu_individual_combined),1),wi("div",Ha,pe(i.help.misc_reset_hist |