diff options
author | nicolargo <nicolas@nicolargo.com> | 2023-07-25 16:04:55 +0200 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2023-07-25 16:04:55 +0200 |
commit | bd96e303589f8fbc6ac1f418c4f78b4061a75ee9 (patch) | |
tree | c9f7d6fd9eb83077875249ef27b922eb918841e3 | |
parent | 1def83cb8a6bb8100c97a71b13ef24e9c7140d9a (diff) | |
parent | b28263855bc3deb086d7ee0c55782405f00ee723 (diff) |
Merge branch 'feature/wifihotspot' into develop
-rw-r--r-- | conf/glances.conf | 4 | ||||
-rw-r--r-- | docs/_static/wifi.png | bin | 8692 -> 23135 bytes | |||
-rw-r--r-- | docs/_static/wifi2.png | bin | 0 -> 3522 bytes | |||
-rw-r--r-- | docs/aoa/wifi.rst | 18 | ||||
-rw-r--r-- | docs/api.rst | 294 | ||||
-rw-r--r-- | docs/man/glances.1 | 2 | ||||
-rw-r--r-- | glances/outputs/static/js/components/plugin-wifi.vue | 4 | ||||
-rw-r--r-- | glances/outputs/static/public/glances.js | 2 | ||||
-rw-r--r-- | glances/plugins/ports/model.py | 5 | ||||
-rw-r--r-- | glances/plugins/wifi/model.py | 127 |
10 files changed, 258 insertions, 198 deletions
diff --git a/conf/glances.conf b/conf/glances.conf index c8eacf3d..0fdf4651 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -205,10 +205,6 @@ nf_conntrack_percent_critical=90 [wifi] 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) -#show=docker.* # Define SIGNAL thresholds in db (lower is better...) # Based on: http://serverfault.com/questions/501025/industry-standard-for-minimum-wifi-signal-strength careful=-65 diff --git a/docs/_static/wifi.png b/docs/_static/wifi.png Binary files differindex 328c556e..954e9076 100644 --- a/docs/_static/wifi.png +++ b/docs/_static/wifi.png diff --git a/docs/_static/wifi2.png b/docs/_static/wifi2.png Binary files differnew file mode 100644 index 00000000..f2089761 --- /dev/null +++ b/docs/_static/wifi2.png diff --git a/docs/aoa/wifi.rst b/docs/aoa/wifi.rst index d8a38e16..81452bcd 100644 --- a/docs/aoa/wifi.rst +++ b/docs/aoa/wifi.rst @@ -3,14 +3,16 @@ Wi-Fi ===== -*Availability: Linux* +*Availability: Linux only* + +If ``nmcli`` is available on the system, Glances displays the hotspot name, +the security type and the Wi-Fi signal quality: .. image:: ../_static/wifi.png -Glances displays the Wi-Fi signal quality. +or, as a backup, the file ``/proc/net/wireless`` is used to display the signal quality: -.. note:: - Stats are grabbed from the ``/proc/net/wireless`` file (so Linux only). +.. image:: ../_static/wifi2.png In the configuration file, you can define signal quality thresholds: @@ -18,16 +20,12 @@ In the configuration file, you can define signal quality thresholds: - ``"Good"`` quality between -85 and -60dBm - ``"Excellent"`` between -60 and -40dBm -It's also possible to disable the scan on a specific interface from the -configuration file (``[wifi]`` section). For example, if you want to -hide the loopback interface (lo) and all the virtual docker interfaces: +Thresholds for the signal quality can be defined in the configuration file: .. code-block:: ini [wifi] - hide=lo,docker.* - #show=wlp2s0 - # Define SIGNAL thresholds in dBm (lower is better...) + disable=False careful=-65 warning=-75 critical=-85 diff --git a/docs/api.rst b/docs/api.rst index 2206ac63..04d51eb5 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 - [[1690221756.0, + [[1690293736.0, -1, "WARNING", "MEM", - 73.52308859142421, - 73.52308859142421, - 73.52308859142421, - 73.52308859142421, + 77.54053433873582, + 77.54053433873582, + 77.54053433873582, + 77.54053433873582, 1, [], "", @@ -111,7 +111,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.16022157669067383}, + "timer": 0.23587393760681152}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -120,7 +120,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.1601276397705078}] + "timer": 0.2357802391052246}] 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.16022157669067383}]} + "timer": 0.23587393760681152}]} GET connections --------------- @@ -164,11 +164,11 @@ Get plugin stats:: "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", "Image": ["portainer/portainer-ce:2.9.3"], "Status": "running", - "Uptime": "2 weeks", + "Uptime": "an hour", "cpu": {"total": 0.0}, "cpu_percent": 0.0, "engine": "docker", - "io": {"cumulative_ior": 5931008, "cumulative_iow": 6717440}, + "io": {"cumulative_ior": 29429760, "cumulative_iow": 2326528}, "io_r": None, "io_w": None, "key": "name", @@ -176,10 +176,10 @@ Get plugin stats:: "limit": 7836184576, "max_usage": None, "rss": None, - "usage": 15683584}, - "memory_usage": 15683584, + "usage": 21876736}, + "memory_usage": 21876736, "name": "portainer", - "network": {"cumulative_rx": 3537709, "cumulative_tx": 0}, + "network": {"cumulative_rx": 401604, "cumulative_tx": 0}, "network_rx": None, "network_tx": None}, {"Command": ["top"], @@ -188,15 +188,15 @@ Get plugin stats:: "Image": "["docker.io/library/ubuntu:latest"]", "Status": "running", "Uptime": "2 months", - "cpu": {"total": 6.527343974782009e-06}, - "cpu_percent": 6.527343974782009e-06, + "cpu": {"total": 6.7650116939635326e-06}, + "cpu_percent": 6.7650116939635326e-06, "engine": "podman", "io": {"ior": 0.0, "iow": 0.0, "time_since_update": 1}, "io_r": 0.0, "io_w": 0.0, "key": "name", - "memory": {"limit": 7836184576.0, "usage": 1081344.0}, - "memory_usage": 1081344.0, + "memory": {"limit": 7836184576.0, "usage": 1093632.0}, + "memory_usage": 1093632.0, "name": "frosty_bouman", "network": {"rx": 0.0, "time_since_update": 1, "tx": 0.0}, "network_rx": 0.0, @@ -209,8 +209,8 @@ Get plugin stats:: "Image": "["k8s.gcr.io/pause:3.5"]", "Status": "running", "Uptime": "2 months", - "cpu": {"total": 3.162306945021642e-10}, - "cpu_percent": 3.162306945021642e-10, + "cpu": {"total": 3.177554220933258e-10}, + "cpu_percent": 3.177554220933258e-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": 73.6, + "idle": 70.8, "interrupts": 0, "iowait": 0.0, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, - "softirq": 0.0, + "softirq": 0.7, "steal": 0.0, "syscalls": 0, - "system": 3.8, + "system": 4.4, "time_since_update": 1, - "total": 26.4, - "user": 22.6} + "total": 29.2, + "user": 24.1} Fields descriptions: @@ -290,7 +290,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 26.4} + {"total": 29.2} 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": 26173812736, + "free": 25133506560, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 88.7, + "percent": 89.1, "size": 243334156288, - "used": 204772888576}, + "used": 205813194752}, {"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": 26173812736, + "free": 25133506560, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 88.7, + "percent": 89.1, "size": 243334156288, - "used": 204772888576}]} + "used": 205813194752}]} GET ip ------ @@ -375,17 +375,17 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.0.32", - "gateway": "192.168.0.254", + {"address": "192.168.1.14", + "gateway": "192.168.1.1", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "91.166.228.228", + "public_address": "92.151.148.66", "public_info_human": ""} Get a specific field:: # curl http://localhost:61208/api/3/ip/gateway - {"gateway": "192.168.0.254"} + {"gateway": "192.168.1.1"} GET load -------- @@ -393,7 +393,10 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, "min1": 1.04296875, "min15": 1.11474609375, "min5": 0.9052734375} + {"cpucore": 4, + "min1": 1.18505859375, + "min15": 1.17724609375, + "min5": 1.23779296875} Fields descriptions: @@ -405,7 +408,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 1.04296875} + {"min1": 1.18505859375} GET mem ------- @@ -413,16 +416,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2751746048, - "available": 2074779648, - "buffers": 127934464, - "cached": 2468466688, - "free": 2074779648, - "inactive": 3784257536, - "percent": 73.5, - "shared": 544108544, + {"active": 3179450368, + "available": 1759965184, + "buffers": 139554816, + "cached": 2369826816, + "free": 1759965184, + "inactive": 3354943488, + "percent": 77.5, + "shared": 580452352, "total": 7836184576, - "used": 5761404928} + "used": 6076219392} Fields descriptions: @@ -449,13 +452,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 5769068544, - "percent": 28.6, - "sin": 30049615872, - "sout": 43714748416, + {"free": 5171486720, + "percent": 36.0, + "sin": 30833557504, + "sout": 44998725632, "time_since_update": 1, "total": 8082419712, - "used": 2313351168} + "used": 2910932992} Fields descriptions: @@ -479,29 +482,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 1243428214, - "cumulative_rx": 621714107, - "cumulative_tx": 621714107, - "cx": 0, + "cumulative_cx": 1271814348, + "cumulative_rx": 635907174, + "cumulative_tx": 635907174, + "cx": 1070, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 0, + "rx": 535, "speed": 0, "time_since_update": 1, - "tx": 0}, + "tx": 535}, {"alias": None, - "cumulative_cx": 42045848970, - "cumulative_rx": 40404482049, - "cumulative_tx": 1641366921, - "cx": 451, + "cumulative_cx": 43280474609, + "cumulative_rx": 41602144558, + "cumulative_tx": 1678330051, + "cx": 4727, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 211, + "rx": 663, "speed": 0, "time_since_update": 1, - "tx": 240}] + "tx": 4064}] Fields descriptions: @@ -524,25 +527,25 @@ Get a specific field:: "wlp2s0", "docker0", "br_grafana", - "veth868647c", "mpqemubr0", + "veth0868fe1", "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": 1243428214, - "cumulative_rx": 621714107, - "cumulative_tx": 621714107, - "cx": 0, + "cumulative_cx": 1271814348, + "cumulative_rx": 635907174, + "cumulative_tx": 635907174, + "cx": 1070, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 0, + "rx": 535, "speed": 0, "time_since_update": 1, - "tx": 0}]} + "tx": 535}]} GET now ------- @@ -550,7 +553,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2023-07-24 20:02:36 CEST" + "2023-07-25 16:02:16 CEST" GET percpu ---------- @@ -561,29 +564,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 4.0, + "idle": 30.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 3.0, - "total": 96.0, - "user": 18.0}, + "system": 2.0, + "total": 70.0, + "user": 4.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 23.0, + "idle": 30.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 1.0, - "total": 77.0, - "user": 2.0}] + "system": 0.0, + "total": 70.0, + "user": 4.0}] Get a specific field:: @@ -597,30 +600,30 @@ Get plugin stats:: # curl http://localhost:61208/api/3/ports [{"description": "DefaultGateway", - "host": "192.168.0.254", + "host": "192.168.1.1", "indice": "port_0", "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.003764, + "status": 0.005154, "timeout": 3}] Get a specific field:: # curl http://localhost:61208/api/3/ports/host - {"host": ["192.168.0.254"]} + {"host": ["192.168.1.1"]} Get a specific item when field matches the given value:: - # 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}]} + # 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.005154, + "timeout": 3}]} GET processcount ---------------- @@ -628,12 +631,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 1, "sleeping": 317, "thread": 1548, "total": 386} + {"pid_max": 0, "running": 1, "sleeping": 323, "thread": 1643, "total": 391} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 386} + {"total": 391} GET psutilversion ----------------- @@ -649,69 +652,69 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/3/quicklook - {"cpu": 26.4, + {"cpu": 29.2, "cpu_hz": 3000000000.0, - "cpu_hz_current": 2704714500.0, + "cpu_hz_current": 2649443250.0, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", - "mem": 73.5, + "mem": 77.5, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 4.0, + "idle": 30.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 3.0, - "total": 96.0, - "user": 18.0}, + "system": 2.0, + "total": 70.0, + "user": 4.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 23.0, + "idle": 30.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 1.0, - "total": 77.0, - "user": 2.0}, + "system": 0.0, + "total": 70.0, + "user": 4.0}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 25.0, - "iowait": 1.0, + "idle": 14.0, + "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 75.0, - "user": 1.0}, + "system": 3.0, + "total": 86.0, + "user": 17.0}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 25.0, + "idle": 24.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, - "softirq": 0.0, + "softirq": 1.0, "steal": 0.0, - "system": 1.0, - "total": 75.0, - "user": 2.0}], - "swap": 28.6} + "system": 2.0, + "total": 76.0, + "user": 9.0}], + "swap": 36.0} Get a specific field:: # curl http://localhost:61208/api/3/quicklook/cpu - {"cpu": 26.4} + {"cpu": 29.2} GET sensors ----------- @@ -782,33 +785,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/3/uptime - "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"}]} + "78 days, 3:00:11" GET all stats ------------- @@ -824,33 +801,33 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/3/cpu/history - {"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]]} + {"system": [["2023-07-25T16:02:16.701846", 4.4], + ["2023-07-25T16:02:18.501052", 4.4], + ["2023-07-25T16:02:19.527073", 3.0]], + "user": [["2023-07-25T16:02:16.701836", 24.1], + ["2023-07-25T16:02:18.501045", 24.1], + ["2023-07-25T16:02:19.527068", 16.6]]} Limit history to last 2 values:: # curl http://localhost:61208/api/3/cpu/history/2 - {"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]]} + {"system": [["2023-07-25T16:02:18.501052", 4.4], + ["2023-07-25T16:02:19.527073", 3.0]], + "user": [["2023-07-25T16:02:18.501045", 24.1], + ["2023-07-25T16:02:19.527068", 16.6]]} History for a specific field:: # curl http://localhost:61208/api/3/cpu/system/history - {"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]]} + {"system": [["2023-07-25T16:02:16.701846", 4.4], + ["2023-07-25T16:02:18.501052", 4.4], + ["2023-07-25T16:02:19.527073", 3.0]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/3/cpu/system/history - {"system": [["2023-07-24T20:02:37.801975", 3.8], - ["2023-07-24T20:02:38.828873", 1.3]]} + {"system": [["2023-07-25T16:02:18.501052", 4.4], + ["2023-07-25T16:02:19.527073", 3.0]]} GET limits (used for thresholds) -------------------------------- @@ -1036,7 +1013,6 @@ All limits/thresholds:: "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 6fbbdfd7..6e90746c 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 24, 2023" "4.0.0_beta01" "Glances" +.TH "GLANCES" "1" "Jul 25, 2023" "4.0.0_beta01" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS diff --git a/glances/outputs/static/js/components/plugin-wifi.vue b/glances/outputs/static/js/components/plugin-wifi.vue index 5fc31f8c..9fa0aa52 100644 --- a/glances/outputs/static/js/components/plugin-wifi.vue +++ b/glances/outputs/static/js/components/plugin-wifi.vue @@ -8,6 +8,9 @@ <div class="table-row" v-for="(hotspot, hotspotId) in hotspots" :key="hotspotId"> <div class="table-cell text-left"> {{ $filters.limitTo(hotspot.ssid, 20) }} + <span> + {{ hotspot.security }} + </span> </div> <div class="table-cell"></div> <div class="table-cell" :class="getDecoration(hotspot, 'signal')"> @@ -42,6 +45,7 @@ export default { return { ssid: hotspotData['ssid'], signal: hotspotData['signal'], + security: hotspotData['security'] }; }) .filter(Boolean); diff --git a/glances/outputs/static/public/glances.js b/glances/outputs/static/public/glances.js index f2db21d7..578068ed 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)} |