diff --git a/NEWS.rst b/NEWS.rst index 944adf05..cc0c8394 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -12,12 +12,17 @@ Under development: https://github.com/nicolargo/glances/issues?q=is%3Aopen+is%3A * The Glances API version 3 is replaced by the version 4. So Restfull API URL is now /api/4/ #2610 * Alias definition change in the configuration file #1735 + Glances version 3.x and lower: + sda1_alias=InternalDisk sdb1_alias=ExternalDisk + Glances version 4.x and higher: + alias=sda1:InternalDisk,sdb1:ExternalDisk - * Alias can now be used to redefine FS name #1735 + + * Alert data model change from a list of list to a list of dict #2633 =============== Version 3.4.0.3 diff --git a/docs/api.rst b/docs/api.rst index 7229c1f1..97ffc495 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -109,18 +109,54 @@ GET alert Get plugin stats:: # curl http://localhost:61208/api/4/alert - [[1703267698.0, - -1, - "WARNING", - "MEM", - 77.65786849069791, - 77.65786849069791, - 77.65786849069791, - 77.65786849069791, - 1, - [], - "", - "memory_percent"]] + [{"avg": 71.7690328288976, + "begin": 1703324631.0, + "count": 1, + "desc": "", + "end": -1, + "max": 71.7690328288976, + "min": 71.7690328288976, + "sort": "memory_percent", + "state": "WARNING", + "sum": 71.7690328288976, + "top": [], + "type": "MEM"}] + +Fields descriptions: + +* **begin**: Begin timestamp of the event (unit is *timestamp*) +* **end**: End timestamp of the event (or -1 if ongoing) (unit is *timestamp*) +* **state**: State of the event (WARNING|CRITICAL) (unit is *string*) +* **type**: Type of the event (CPU|LOAD|MEM) (unit is *string*) +* **max**: Maximum value during the event period (unit is *float*) +* **avg**: Average value during the event period (unit is *float*) +* **min**: Minimum value during the event period (unit is *float*) +* **sum**: Sum of the values during the event period (unit is *float*) +* **count**: Number of values during the event period (unit is *int*) +* **top**: Top 3 processes name during the event period (unit is *list*) +* **desc**: Description of the event (unit is *string*) +* **sort**: Sort key of the top processes (unit is *string*) + +Get a specific field:: + + # curl http://localhost:61208/api/4/alert/begin + {"begin": [1703324631.0]} + +Get a specific item when field matches the given value:: + + # curl http://localhost:61208/api/4/alert/begin/1703324631.0 + {"1703324631.0": [{"avg": 71.7690328288976, + "begin": 1703324631.0, + "count": 1, + "desc": "", + "end": -1, + "max": 71.7690328288976, + "min": 71.7690328288976, + "sort": "memory_percent", + "state": "WARNING", + "sum": 71.7690328288976, + "top": [], + "type": "MEM"}]} GET amps -------- @@ -136,7 +172,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.3074169158935547}, + "timer": 0.3228726387023926}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -145,7 +181,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.30725765228271484}] + "timer": 0.3227043151855469}] Fields descriptions: @@ -173,7 +209,7 @@ Get a specific item when field matches the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.3074169158935547}]} + "timer": 0.3228726387023926}]} GET connections --------------- @@ -207,8 +243,8 @@ Get plugin stats:: # curl http://localhost:61208/api/4/containers [{"command": "top", - "cpu": {"total": 1.2265872243101236e-06}, - "cpu_percent": 1.2265872243101236e-06, + "cpu": {"total": 1.2822740648554537e-06}, + "cpu_percent": 1.2822740648554537e-06, "created": "2023-12-09T10:45:34.339489876+01:00", "engine": "podman", "id": "481d6ffb7eef284d062628cf350bdd9ce0a803db8a2a505d75565ed24322b714", @@ -217,8 +253,8 @@ Get plugin stats:: "io_rx": 0.0, "io_wx": 0.0, "key": "name", - "memory": {"limit": 7823585280.0, "usage": 1388544.0}, - "memory_usage": 1388544.0, + "memory": {"limit": 7823585280.0, "usage": 1376256.0}, + "memory_usage": 1376256.0, "name": "sad_darwin", "network": {"rx": 0.0, "time_since_update": 1, "tx": 0.0}, "network_rx": 0.0, @@ -228,8 +264,8 @@ Get plugin stats:: "status": "running", "uptime": "1 weeks"}, {"command": "", - "cpu": {"total": 3.3083466569066167e-10}, - "cpu_percent": 3.3083466569066167e-10, + "cpu": {"total": 3.319390733197021e-10}, + "cpu_percent": 3.319390733197021e-10, "created": "2022-10-22T14:23:03.120912374+02:00", "engine": "podman", "id": "9491515251edcd5bb5dc17205d7ee573c0be96fe0b08b0a12a7e2cea874565ea", @@ -238,8 +274,8 @@ Get plugin stats:: "io_rx": 0.0, "io_wx": 0.0, "key": "name", - "memory": {"limit": 7823585280.0, "usage": 327680.0}, - "memory_usage": 327680.0, + "memory": {"limit": 7823585280.0, "usage": 319488.0}, + "memory_usage": 319488.0, "name": "8d0f1c783def-infra", "network": {"rx": 0.0, "time_since_update": 1, "tx": 0.0}, "network_rx": 0.0, @@ -277,8 +313,8 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/containers/name/sad_darwin {"sad_darwin": [{"command": "top", - "cpu": {"total": 1.2265872243101236e-06}, - "cpu_percent": 1.2265872243101236e-06, + "cpu": {"total": 1.2822740648554537e-06}, + "cpu_percent": 1.2822740648554537e-06, "created": "2023-12-09T10:45:34.339489876+01:00", "engine": "podman", "id": "481d6ffb7eef284d062628cf350bdd9ce0a803db8a2a505d75565ed24322b714", @@ -287,8 +323,8 @@ Get a specific item when field matches the given value:: "io_rx": 0.0, "io_wx": 0.0, "key": "name", - "memory": {"limit": 7823585280.0, "usage": 1388544.0}, - "memory_usage": 1388544.0, + "memory": {"limit": 7823585280.0, "usage": 1376256.0}, + "memory_usage": 1376256.0, "name": "sad_darwin", "network": {"rx": 0.0, "time_since_update": 1, "tx": 0.0}, "network_rx": 0.0, @@ -326,19 +362,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 73.0, + "idle": 64.1, "interrupts": 0, - "iowait": 0.0, + "iowait": 0.5, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 2.2, + "system": 12.6, "time_since_update": 1, - "total": 27.0, - "user": 24.9} + "total": 35.4, + "user": 22.7} Fields descriptions: @@ -361,7 +397,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/cpu/total - {"total": 27.0} + {"total": 35.4} GET diskio ---------- @@ -418,13 +454,13 @@ Get plugin stats:: # curl http://localhost:61208/api/4/fs [{"alias": "Root", "device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 25931997184, + "free": 25977536512, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "percent": 88.8, "size": 243334156288, - "used": 205014704128}, + "used": 204969164800}, {"device_name": "zsfpool", "free": 31195136, "fs_type": "zfs", @@ -454,13 +490,13 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/fs/mnt_point// {"/": [{"alias": "Root", "device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 25931997184, + "free": 25977536512, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", "percent": 88.8, "size": 243334156288, - "used": 205014704128}]} + "used": 204969164800}]} GET ip ------ @@ -495,10 +531,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/4/load - {"cpucore": 4, - "min1": 1.02978515625, - "min15": 1.37255859375, - "min5": 1.27783203125} + {"cpucore": 4, "min1": 1.8193359375, "min15": 1.66552734375, "min5": 1.58203125} Fields descriptions: @@ -510,7 +543,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/load/min1 - {"min1": 1.02978515625} + {"min1": 1.8193359375} GET mem ------- @@ -518,16 +551,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/4/mem - {"active": 3293724672, - "available": 1747955712, - "buffers": 105394176, - "cached": 1907453952, - "free": 1747955712, - "inactive": 2607702016, - "percent": 77.7, - "shared": 546648064, + {"active": 3406278656, + "available": 2208673792, + "buffers": 109953024, + "cached": 1813655552, + "free": 2208673792, + "inactive": 2144509952, + "percent": 71.8, + "shared": 509751296, "total": 7823585280, - "used": 6075629568} + "used": 5614911488} Fields descriptions: @@ -554,13 +587,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/4/memswap - {"free": 4666490880, - "percent": 42.3, - "sin": 8551440384, - "sout": 14097289216, + {"free": 4540248064, + "percent": 43.8, + "sin": 8918196224, + "sout": 14552772608, "time_since_update": 1, "total": 8082419712, - "used": 3415928832} + "used": 3542171648} Fields descriptions: @@ -584,9 +617,9 @@ Get plugin stats:: # curl http://localhost:61208/api/4/network [{"alias": None, - "cumulative_cx": 1917091264, - "cumulative_rx": 958545632, - "cumulative_tx": 958545632, + "cumulative_cx": 1949107280, + "cumulative_rx": 974553640, + "cumulative_tx": 974553640, "cx": 0, "interface_name": "lo", "is_up": True, @@ -596,14 +629,14 @@ Get plugin stats:: "time_since_update": 1, "tx": 0}, {"alias": "WIFI", - "cumulative_cx": 6804843378, - "cumulative_rx": 6353991859, - "cumulative_tx": 450851519, - "cx": 1056, + "cumulative_cx": 6848799089, + "cumulative_rx": 6385848903, + "cumulative_tx": 462950186, + "cx": 224, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 930, + "rx": 98, "speed": 0, "time_since_update": 1, "tx": 126}] @@ -637,9 +670,9 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/network/interface_name/lo {"lo": [{"alias": None, - "cumulative_cx": 1917091264, - "cumulative_rx": 958545632, - "cumulative_tx": 958545632, + "cumulative_cx": 1949107280, + "cumulative_rx": 974553640, + "cumulative_tx": 974553640, "cx": 0, "interface_name": "lo", "is_up": True, @@ -655,7 +688,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/4/now - "2023-12-22 18:54:58 CET" + "2023-12-23 10:43:51 CET" GET percpu ---------- @@ -666,29 +699,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 31.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": 2.0, - "total": 69.0, - "user": 15.0}, + "system": 3.0, + "total": 75.0, + "user": 21.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 35.0, - "iowait": 0.0, + "idle": 33.0, + "iowait": 1.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 1.0, - "total": 65.0, - "user": 9.0}] + "system": 3.0, + "total": 67.0, + "user": 11.0}] Fields descriptions: @@ -722,7 +755,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.007214, + "status": 0.007002, "timeout": 3}] Fields descriptions: @@ -750,7 +783,7 @@ Get a specific item when field matches the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.007214, + "status": 0.007002, "timeout": 3}]} GET processcount @@ -759,7 +792,7 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/4/processcount - {"pid_max": 0, "running": 2, "sleeping": 312, "thread": 1495, "total": 379} + {"pid_max": 0, "running": 1, "sleeping": 313, "thread": 1486, "total": 390} Fields descriptions: @@ -772,7 +805,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/processcount/total - {"total": 379} + {"total": 390} GET psutilversion ----------------- @@ -788,54 +821,54 @@ GET quicklook Get plugin stats:: # curl http://localhost:61208/api/4/quicklook - {"cpu": 27.0, + {"cpu": 35.4, "cpu_hz": 2025000000.0, - "cpu_hz_current": 2047157750.0, + "cpu_hz_current": 1785102250.0, "cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz", - "mem": 77.7, + "mem": 71.8, "percpu": [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 31.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": 2.0, - "total": 69.0, - "user": 15.0}, + "system": 3.0, + "total": 75.0, + "user": 21.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 35.0, - "iowait": 0.0, + "idle": 33.0, + "iowait": 1.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 1.0, - "total": 65.0, - "user": 9.0}, + "system": 3.0, + "total": 67.0, + "user": 11.0}, {"cpu_number": 2, "guest": 0.0, "guest_nice": 0.0, - "idle": 43.0, + "idle": 21.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 0.0, - "total": 57.0, - "user": 2.0}, + "system": 18.0, + "total": 79.0, + "user": 10.0}, {"cpu_number": 3, "guest": 0.0, "guest_nice": 0.0, - "idle": 27.0, + "idle": 47.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", @@ -843,9 +876,9 @@ Get plugin stats:: "softirq": 0.0, "steal": 0.0, "system": 1.0, - "total": 73.0, - "user": 19.0}], - "swap": 42.3} + "total": 53.0, + "user": 2.0}], + "swap": 43.8} Fields descriptions: @@ -859,7 +892,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/quicklook/cpu - {"cpu": 27.0} + {"cpu": 35.4} GET sensors ----------- @@ -948,7 +981,7 @@ GET uptime Get plugin stats:: # curl http://localhost:61208/api/4/uptime - "27 days, 9:57:04" + "28 days, 1:45:56" GET version ----------- @@ -972,28 +1005,33 @@ GET top n items of a specific plugin Get top 2 processes of the processlist plugin:: # curl http://localhost:61208/api/4/processlist/top/2 - [{"cmdline": ["/snap/firefox/3206/usr/lib/firefox/firefox"], + [{"cmdline": ["/usr/share/code/code", + "--ms-enable-electron-run-as-node", + "/home/nicolargo/.vscode/extensions/ms-python.vscode-pylance-2023.12.1/dist/server.bundle.js", + "--cancellationReceive=file:810abd06604ca203178b3fa9390087012fbf550dba", + "--node-ipc", + "--clientProcessId=391253"], "cpu_percent": 0.0, - "cpu_times": {"children_system": 1408.84, - "children_user": 10148.43, + "cpu_times": {"children_system": 0.41, + "children_user": 4.19, "iowait": 0.0, - "system": 3365.72, - "user": 11764.01}, + "system": 256.43, + "user": 4368.89}, "gids": {"effective": 1000, "real": 1000, "saved": 1000}, - "io_counters": [9456750592, 13008068608, 0, 0, 0], + "io_counters": [355196928, 1896448, 0, 0, 0], "key": "pid", - "memory_info": {"data": 1410756608, + "memory_info": {"data": 886296576, "dirty": 0, "lib": 0, - "rss": 517181440, - "shared": 109961216, - "text": 643072, - "vms": 13905248256}, - "memory_percent": 6.610542628353635, - "name": "firefox", + "rss": 500559872, + "shared": 20254720, + "text": 120565760, + "vms": 1207768694784}, + "memory_percent": 6.398088013172395, + "name": "code", "nice": 0, - "num_threads": 138, - "pid": 7195, + "num_threads": 13, + "pid": 391817, "status": "S", "time_since_update": 1, "username": "nicolargo"}, @@ -1024,19 +1062,19 @@ Get top 2 processes of the processlist plugin:: "cpu_times": {"children_system": 0.0, "children_user": 0.0, "iowait": 0.0, - "system": 390.29, - "user": 4351.56}, + "system": 399.65, + "user": 4442.83}, "gids": {"effective": 1000, "real": 1000, "saved": 1000}, - "io_counters": [517786624, 0, 0, 0, 0], + "io_counters": [580611072, 0, 0, 0, 0], "key": "pid", - "memory_info": {"data": 1422823424, + "memory_info": {"data": 1419350016, "dirty": 0, "lib": 0, - "rss": 497307648, - "shared": 54018048, + "rss": 482299904, + "shared": 50790400, "text": 643072, - "vms": 4070424576}, - "memory_percent": 6.356518529571138, + "vms": 4056260608}, + "memory_percent": 6.164691592650474, "name": "WebExtensions", "nice": 0, "num_threads": 20, @@ -1071,34 +1109,34 @@ GET stats history History of a plugin:: # curl http://localhost:61208/api/4/cpu/history - {"system": [["2023-12-22T18:55:00.816728", 3.5], - ["2023-12-22T18:55:01.837000", 3.5], - ["2023-12-22T18:55:03.276090", 6.7]], - "user": [["2023-12-22T18:55:00.816716", 39.2], - ["2023-12-22T18:55:01.836985", 39.2], - ["2023-12-22T18:55:03.276079", 30.4]]} + {"system": [["2023-12-23T10:43:53.365630", 12.6], + ["2023-12-23T10:43:54.388206", 2.3], + ["2023-12-23T10:43:55.606404", 2.3]], + "user": [["2023-12-23T10:43:53.365616", 22.7], + ["2023-12-23T10:43:54.388189", 12.7], + ["2023-12-23T10:43:55.606390", 12.7]]} Limit history to last 2 values:: # curl http://localhost:61208/api/4/cpu/history/2 - {"system": [["2023-12-22T18:55:01.837000", 3.5], - ["2023-12-22T18:55:03.276090", 6.7]], - "user": [["2023-12-22T18:55:01.836985", 39.2], - ["2023-12-22T18:55:03.276079", 30.4]]} + {"system": [["2023-12-23T10:43:54.388206", 2.3], + ["2023-12-23T10:43:55.606404", 2.3]], + "user": [["2023-12-23T10:43:54.388189", 12.7], + ["2023-12-23T10:43:55.606390", 12.7]]} History for a specific field:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2023-12-22T18:54:58.788338", 2.2], - ["2023-12-22T18:55:00.816728", 3.5], - ["2023-12-22T18:55:01.837000", 3.5], - ["2023-12-22T18:55:03.276090", 6.7]]} + {"system": [["2023-12-23T10:43:51.624123", 12.6], + ["2023-12-23T10:43:53.365630", 12.6], + ["2023-12-23T10:43:54.388206", 2.3], + ["2023-12-23T10:43:55.606404", 2.3]]} Limit history for a specific field to last 2 values:: # curl http://localhost:61208/api/4/cpu/system/history - {"system": [["2023-12-22T18:55:01.837000", 3.5], - ["2023-12-22T18:55:03.276090", 6.7]]} + {"system": [["2023-12-23T10:43:54.388206", 2.3], + ["2023-12-23T10:43:55.606404", 2.3]]} GET limits (used for thresholds) -------------------------------- diff --git a/docs/man/glances.1 b/docs/man/glances.1 index 81f1f014..520ac3b4 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" "Dec 22, 2023" "4.0.0_beta01" "Glances" +.TH "GLANCES" "1" "Dec 23, 2023" "4.0.0_beta01" "Glances" .SH NAME glances \- An eye on your system .SH SYNOPSIS diff --git a/glances/events.py b/glances/events.py index 2dbc5100..46938433 100644 --- a/glances/events.py +++ b/glances/events.py @@ -25,14 +25,20 @@ class GlancesEvents(object): event_value = value Item (or event) is defined by: - ["begin", - "end", - "WARNING|CRITICAL", - "CPU|LOAD|MEM", - MAX, AVG, MIN, SUM, COUNT, - [top3 process list], - "Processes description", - "top sort key"] + { + "begin": "begin", + "end": "end", + "state": "WARNING|CRITICAL", + "type": "CPU|LOAD|MEM", + "max": MAX, + "avg": AVG, + "min": MIN, + "sum": SUM, + "count": COUNT, + "top": [top 3 process name], + "desc": "Processes description", + "sort": "top sort key" + } """ def __init__(self, max_events=10): @@ -60,11 +66,11 @@ class GlancesEvents(object): An event exist if: * end is < 0 - * event_type is matching + * type is matching Return -1 if the item is not found. """ for i in range(self.len()): - if self.events_list[i][1] < 0 and self.events_list[i][3] == event_type: + if self.events_list[i]['end'] < 0 and self.events_list[i]['type'] == event_type: return i return -1 @@ -124,20 +130,20 @@ class GlancesEvents(object): # Create the new log item # Time is stored in Epoch format # Epoch -> DMYHMS = datetime.fromtimestamp(epoch) - item = [ - time.mktime(datetime.now().timetuple()), # START DATE - -1, # END DATE - event_state, # STATE: WARNING|CRITICAL - event_type, # TYPE: CPU, LOAD, MEM... - event_value, # MAX - event_value, # AVG - event_value, # MIN - event_value, # SUM - 1, # COUNT - [], # TOP 3 PROCESS LIST - proc_desc, # MONITORED PROCESSES DESC - glances_processes.sort_key, - ] # TOP PROCESS SORT KEY + item = { + "begin": time.mktime(datetime.now().timetuple()), + "end": -1, + "state": event_state, + "type": event_type, + "max": event_value, + "avg": event_value, + "min": event_value, + "sum": event_value, + "count": 1, + "top": [], + "desc": proc_desc, + "sort": glances_processes.sort_key, + } # Add the item to the list self.events_list.insert(0, item) @@ -145,7 +151,6 @@ class GlancesEvents(object): # Limit the list to 'max_events' items if self.len() > self.max_events: self.events_list.pop() - return True else: return False @@ -158,9 +163,9 @@ class GlancesEvents(object): # Set the end of the events end_time = time.mktime(datetime.now().timetuple()) - if end_time - self.events_list[event_index][0] > peak_time: + if end_time - self.events_list[event_index]['begin'] > peak_time: # If event is > peak_time seconds - self.events_list[event_index][1] = end_time + self.events_list[event_index]['end'] = end_time else: # If event <= peak_time seconds, ignore self.events_list.remove(self.events_list[event_index]) @@ -170,25 +175,25 @@ class GlancesEvents(object): # State if event_state == "CRITICAL": - self.events_list[event_index][2] = event_state + self.events_list[event_index]['state'] = event_state # Min value - self.events_list[event_index][6] = min(self.events_list[event_index][6], event_value) + self.events_list[event_index]['min'] = min(self.events_list[event_index]['min'], event_value) # Max value - self.events_list[event_index][4] = max(self.events_list[event_index][4], event_value) + self.events_list[event_index]['max'] = max(self.events_list[event_index]['max'], event_value) # Average value - self.events_list[event_index][7] += event_value - self.events_list[event_index][8] += 1 - self.events_list[event_index][5] = self.events_list[event_index][7] / self.events_list[event_index][8] + self.events_list[event_index]['sum'] += event_value + self.events_list[event_index]['count'] += 1 + self.events_list[event_index]['avg'] = self.events_list[event_index]['sum'] / self.events_list[event_index]['count'] # TOP PROCESS LIST (only for CRITICAL ALERT) if event_state == "CRITICAL": events_sort_key = self.get_event_sort_key(event_type) # Sort the current process list to retrieve the TOP 3 processes - self.events_list[event_index][9] = sort_stats(proc_list, events_sort_key)[0:3] - self.events_list[event_index][11] = events_sort_key + self.events_list[event_index]['top'] = [p['name'] for p in sort_stats(proc_list, events_sort_key)[0:3]] + self.events_list[event_index]['sort'] = events_sort_key # MONITORED PROCESSES DESC - self.events_list[event_index][10] = proc_desc + self.events_list[event_index]['desc'] = proc_desc return True @@ -202,7 +207,7 @@ class GlancesEvents(object): clean_events_list = [] while self.len() > 0: item = self.events_list.pop() - if item[1] < 0 or (not critical and item[2].startswith("CRITICAL")): + if item['end'] < 0 or (not critical and item['state'].startswith("CRITICAL")): clean_events_list.insert(0, item) # The list is now the clean one self.events_list = clean_events_list diff --git a/glances/outputs/static/js/components/plugin-alert.vue b/glances/outputs/static/js/components/plugin-alert.vue index 4a9393af..5eb7cabf 100644 --- a/glances/outputs/static/js/components/plugin-alert.vue +++ b/glances/outputs/static/js/components/plugin-alert.vue @@ -13,11 +13,12 @@ {{ formatDate(alert.begin) }} {{ alert.tz }} ({{ alert.ongoing ? 'ongoing' : alert.duration }}) - - {{ alert.level }} on - - {{ alert.name }} + {{ alert.state }} on + + {{ alert.type }} ({{ $filters.number(alert.max, 1) }}) + {{ alert.top }} @@ -43,14 +44,15 @@ export default { return (this.stats || []).map((alertalertStats) => { const alert = {}; var tzoffset = new Date().getTimezoneOffset(); - alert.name = alertalertStats[3]; - alert.level = alertalertStats[2]; - alert.begin = alertalertStats[0] * 1000 - tzoffset * 60 * 1000; - alert.end = alertalertStats[1] * 1000 - tzoffset * 60 * 1000; - alert.ongoing = alertalertStats[1] == -1; - alert.min = alertalertStats[6]; - alert.mean = alertalertStats[5]; - alert.max = alertalertStats[4]; + alert.state = alertalertStats.state; + alert.type = alertalertStats.type; + alert.begin = alertalertStats.begin * 1000 - tzoffset * 60 * 1000; + alert.end = alertalertStats.end * 1000 - tzoffset * 60 * 1000; + alert.ongoing = alertalertStats.end == -1; + alert.min = alertalertStats.min; + alert.avg = alertalertStats.avg; + alert.max = alertalertStats.max; + alert.top = alertalertStats.top.join(', '); if (!alert.ongoing) { const duration = alert.end - alert.begin; diff --git a/glances/outputs/static/public/glances.js b/glances/outputs/static/public/glances.js index 2b8a40ab..d8e0bef3 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=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;s0,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;a1&&(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;r1&&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=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/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,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/4/all/limits",{method:"GET"}).then((e=>e.json())).then((e=>{Fo.setLimits(e)})),fetch("api/4/args",{method:"GET"}).then((e=>e.json())).then(((e={})=>{qo.args={...qo.args,...e}})),fetch("api/4/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/4/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_history),1)]),wi("div",Va,[Ga,wi("div",Wa,pe(i.help.show_hide_alert),1),wi("div",Za,pe(i.help.toggle_gpu_individual_combined),1),wi("div",Ka,pe(i.help.misc_delete_warning_alerts),1)]),wi("div",Qa,[Xa,wi("div",Ja,pe(i.help.show_hide_network),1),wi("div",Ya,pe(i.help.toggle_short_full),1),wi("div",el,pe(i.help.misc_delete_warning_and_critical_alerts),1)]),wi("div",tl,[nl,wi("div",rl,pe(i.help.sort_cpu_times),1),il,wi("div",sl,pe(i.help.misc_edit_process_filter_pattern)+" - N/A in WebUI ",1)]),wi("div",ol,[al,wi("div",ll,pe(i.help.show_hide_irq),1),cl,ul]),wi("div",dl,[fl,wi("div",pl,pe(i.help.show_hide_raid_plugin),1),hl,gl]),wi("div",ml,[bl,wi("div",vl,pe(i.help.show_hide_sensors),1),yl,wl]),wi("div",xl,[_l,wi("div",kl,pe(i.help.show_hide_wifi_module),1),Sl,Cl]),wi("div",Tl,[Al,wi("div",El,pe(i.help.show_hide_processes),1),Ol,Il]),wi("div",Pl,[Nl,wi("div",Ll,pe(i.help.show_hide_left_sidebar),1),Dl,Ml]),wi("div",jl,[Rl,wi("div",ql,pe(i.help.show_hide_quick_look),1),Bl,Ul]),wi("div",Fl,[zl,wi("div",$l,pe(i.help.show_hide_cpu_mem_swap),1),Hl,Vl]),wi("div",Gl,[Wl,wi("div",Zl,pe(i.help.show_hide_all),1),Kl,Ql])])]),Xl,Jl])):Ti("v-if",!0)}]]),nc={class:"plugin"},rc={id:"alerts"},ic={key:0,class:"title"},sc={key:1,class:"title"},oc={id:"alert"},ac={class:"table"},lc={class:"table-cell text-left"};var cc=n(6486);const uc={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.name=e[3],t.level=e[2],t.begin=1e3*e[0]-60*n*1e3,t.end=1e3*e[1]-60*n*1e3,t.ongoing=-1==e[1],t.min=e[6],t.mean=e[5],t.max=e[4],!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,cc.padStart)(i,2,"0")+":"+(0,cc.padStart)(r,2,"0")+":"+(0,cc.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?$o.badge(this.countOngoingAlerts):$o.reset()}},methods:{formatDate:e=>new Date(e).toISOString().slice(0,19).replace(/[^\d-:]/," ")}},dc=(0,ec.Z)(uc,[["render",function(e,t,n,r,i,s){return li(),pi("div",nc,[wi("section",rc,[s.hasAlerts?(li(),pi("span",ic," Warning or critical alerts (last "+pe(s.countAlerts)+" entries) ",1)):(li(),pi("span",sc,"No warning or critical alert detected"))]),wi("section",oc,[wi("div",ac,[(li(!0),pi(ni,null,pr(s.alerts,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",lc,[Si(pe(s.formatDate(t.begin))+" "+pe(t.tz)+" ("+pe(t.ongoing?"ongoing":t.duration)+") - ",1),On(wi("span",null,pe(t.level)+" on ",513),[[Ds,!t.ongoing]]),wi("span",{class:ce(t.level.toLowerCase())},pe(t.name),3),Si(" ("+pe(e.$filters.number(t.max,1))+") ",1)])])))),128))])])])}]]),fc={key:0,id:"cloud",class:"plugin"},pc={class:"title"};const hc={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}}},gc=(0,ec.Z)(hc,[["render",function(e,t,n,r,i,s){return s.instance||s.provider?(li(),pi("section",fc,[wi("span",pc,pe(s.provider),1),Si(" "+pe(s.instance),1)])):Ti("v-if",!0)}]]),mc={class:"plugin",id:"connections"},bc=wi("div",{class:"table-row"},[wi("div",{class:"table-cell text-left title"},"TCP CONNECTIONS"),wi("div",{class:"table-cell"})],-1),vc={class:"table-row"},yc=wi("div",{class:"table-cell text-left"},"Listen",-1),wc=wi("div",{class:"table-cell"},null,-1),xc={class:"table-cell"},_c={class:"table-row"},kc=wi("div",{class:"table-cell text-left"},"Initiated",-1),Sc=wi("div",{class:"table-cell"},null,-1),Cc={class:"table-cell"},Tc={class:"table-row"},Ac=wi("div",{class:"table-cell text-left"},"Established",-1),Ec=wi("div",{class:"table-cell"},null,-1),Oc={class:"table-cell"},Ic={class:"table-row"},Pc=wi("div",{class:"table-cell text-left"},"Terminated",-1),Nc=wi("div",{class:"table-cell"},null,-1),Lc={class:"table-cell"},Dc={class:"table-row"},Mc=wi("div",{class:"table-cell text-left"},"Tracked",-1),jc=wi("div",{class:"table-cell"},null,-1);const Rc={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()}}},qc=(0,ec.Z)(Rc,[["render",function(e,t,n,r,i,s){return li(),pi("section",mc,[bc,wi("div",vc,[yc,wc,wi("div",xc,pe(s.listen),1)]),wi("div",_c,[kc,Sc,wi("div",Cc,pe(s.initiated),1)]),wi("div",Tc,[Ac,Ec,wi("div",Oc,pe(s.established),1)]),wi("div",Ic,[Pc,Nc,wi("div",Lc,pe(s.terminated),1)]),wi("div",Dc,[Mc,jc,wi("div",{class:ce(["table-cell",s.getDecoration("nf_conntrack_percent")])},pe(s.tracked.count)+"/"+pe(s.tracked.max),3)])])}]]),Bc={id:"cpu",class:"plugin"},Uc={class:"row"},Fc={class:"col-sm-24 col-md-12 col-lg-8"},zc={class:"table"},$c={class:"table-row"},Hc=wi("div",{class:"table-cell text-left title"},"CPU",-1),Vc={class:"table-row"},Gc=wi("div",{class:"table-cell text-left"},"user:",-1),Wc={class:"table-row"},Zc=wi("div",{class:"table-cell text-left"},"system:",-1),Kc={class:"table-row"},Qc=wi("div",{class:"table-cell text-left"},"iowait:",-1),Xc={class:"table-row"},Jc=wi("div",{class:"table-cell text-left"},"dpc:",-1),Yc={class:"hidden-xs hidden-sm col-md-12 col-lg-8"},eu={class:"table"},tu={class:"table-row"},nu=wi("div",{class:"table-cell text-left"},"idle:",-1),ru={class:"table-cell"},iu={class:"table-row"},su=wi("div",{class:"table-cell text-left"},"irq:",-1),ou={class:"table-cell"},au={class:"table-row"},lu=wi("div",{class:"table-cell text-left"},"inter:",-1),cu={class:"table-cell"},uu={class:"table-row"},du=wi("div",{class:"table-cell text-left"},"nice:",-1),fu={class:"table-cell"},pu={key:0,class:"table-row"},hu=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),gu={class:"table-row"},mu=wi("div",{class:"table-cell text-left"},"steal:",-1),bu={key:1,class:"table-row"},vu=wi("div",{class:"table-cell text-left"},"syscal:",-1),yu={class:"table-cell"},wu={class:"hidden-xs hidden-sm hidden-md col-lg-8"},xu={class:"table"},_u={key:0,class:"table-row"},ku=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),Su={key:1,class:"table-row"},Cu=wi("div",{class:"table-cell text-left"},"inter:",-1),Tu={class:"table-cell"},Au={key:2,class:"table-row"},Eu=wi("div",{class:"table-cell text-left"},"sw_int:",-1),Ou={class:"table-cell"};const Iu={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},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()}}},Pu=(0,ec.Z)(Iu,[["render",function(e,t,n,r,i,s){return li(),pi("section",Bc,[wi("div",Uc,[wi("div",Fc,[wi("div",zc,[wi("div",$c,[Hc,wi("div",{class:ce(["table-cell",s.getDecoration("total")])},pe(s.total)+"%",3)]),wi("div",Vc,[Gc,wi("div",{class:ce(["table-cell",s.getDecoration("user")])},pe(s.user)+"%",3)]),wi("div",Wc,[Zc,wi("div",{class:ce(["table-cell",s.getDecoration("system")])},pe(s.system)+"%",3)]),On(wi("div",Kc,[Qc,wi("div",{class:ce(["table-cell",s.getDecoration("iowait")])},pe(s.iowait)+"%",3)],512),[[Ds,null!=s.iowait]]),On(wi("div",Xc,[Jc,wi("div",{class:ce(["table-cell",s.getDecoration("dpc")])},pe(s.dpc)+"%",3)],512),[[Ds,null==s.iowait&&null!=s.dpc]])])]),wi("div",Yc,[wi("div",eu,[wi("div",tu,[nu,wi("div",ru,pe(s.idle)+"%",1)]),On(wi("div",iu,[su,wi("div",ou,pe(s.irq)+"%",1)],512),[[Ds,null!=s.irq]]),Ti(" If no irq, display interrupts "),On(wi("div",au,[lu,wi("div",cu,pe(s.interrupts),1)],512),[[Ds,null==s.irq]]),On(wi("div",uu,[du,wi("div",fu,pe(s.nice)+"%",1)],512),[[Ds,null!=s.nice]]),Ti(" If no nice, display ctx_switches "),null==s.nice&&s.ctx_switches?(li(),pi("div",pu,[hu,wi("div",{class:ce(["table-cell",s.getDecoration("ctx_switches")])},pe(s.ctx_switches),3)])):Ti("v-if",!0),On(wi("div",gu,[mu,wi("div",{class:ce(["table-cell",s.getDecoration("steal")])},pe(s.steal)+"%",3)],512),[[Ds,null!=s.steal]]),!s.isLinux&&s.syscalls?(li(),pi("div",bu,[vu,wi("div",yu,pe(s.syscalls),1)])):Ti("v-if",!0)])]),wi("div",wu,[wi("div",xu,[Ti(" If not already display instead of nice, then display ctx_switches "),null!=s.nice&&s.ctx_switches?(li(),pi("div",_u,[ku,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&&s.interrupts?(li(),pi("div",Su,[Cu,wi("div",Tu,pe(s.interrupts),1)])):Ti("v-if",!0),s.isWindows||s.isSunOS||!s.soft_interrupts?Ti("v-if",!0):(li(),pi("div",Au,[Eu,wi("div",Ou,pe(s.soft_interrupts),1)]))])])])])}]]),Nu={class:"plugin",id:"diskio"},Lu={key:0,class:"table-row"},Du=wi("div",{class:"table-cell text-left title"},"DISK I/O",-1),Mu={class:"table-cell"},ju={class:"table-cell"},Ru={class:"table-cell"},qu={class:"table-cell"},Bu={class:"table-cell text-left"};var Uu=n(1036),Fu=n.n(Uu);function zu(e,t){return $u(e=8*Math.round(e),t)+"b"}function $u(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,cc.min)([1,a]):"K"==s&&(a=0),parseFloat(o).toFixed(a)+s}}return e.toFixed(0)}function Hu(e){return void 0===e||""===e?"?":e}function Vu(e,t,n){return t=t||0,n=n||" ",String(e).padStart(t,n)}function Gu(e,t){return"function"!=typeof e.slice&&(e=String(e)),e.slice(0,t)}function Wu(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 Zu(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 Fu()(n)}function Ku(e,t){return new Intl.NumberFormat(void 0,"number"==typeof t?{maximumFractionDigits:t}:t).format(e)}function Qu(e){for(var t=0,n=0;n({store:qo}),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:$u(e.read_bytes/t),rxps:$u(e.write_bytes/t)},count:{txps:$u(e.read_count/t),rxps:$u(e.write_count/t)},alias:void 0!==e.alias?e.alias:null}}));return(0,cc.orderBy)(e,["name"])}}},Yu=(0,ec.Z)(Ju,[["render",function(e,t,n,r,i,s){return li(),pi("section",Nu,[s.disks.length>0?(li(),pi("div",Lu,[Du,On(wi("div",Mu,"R/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",ju,"W/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",Ru,"IOR/s",512),[[Ds,s.args.diskio_iops]]),On(wi("div",qu,"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",Bu,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))])}]]),ed={key:0,id:"containers-plugin",class:"plugin"},td=wi("span",{class:"title"},"CONTAINERS",-1),nd={class:"table"},rd={class:"table-row"},id=wi("div",{class:"table-cell text-left"},"Engine",-1),sd=wi("div",{class:"table-cell text-left"},"Pod",-1),od=wi("div",{class:"table-cell"},"Status",-1),ad=wi("div",{class:"table-cell"},"Uptime",-1),ld=Ci('
/MAX
IOR/s
IOW/s
RX/s
TX/s
Command
',6),cd={class:"table-cell text-left"},ud={class:"table-cell text-left"},dd={class:"table-cell text-left"},fd={class:"table-cell"},pd={class:"table-cell"},hd={class:"table-cell"},gd={class:"table-cell"},md={class:"table-cell"},bd={class:"table-cell"},vd={class:"table-cell"},yd={class:"table-cell"},wd={class:"table-cell text-left"};const xd={props:{data:{type:Object}},data:()=>({store:qo,sorter:void 0}),computed:{args(){return this.store.args||{}},sortProcessesKey(){return this.args.sort_processes_key},stats(){return this.data.stats.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,cc.orderBy)(t,[e.column].reduce(((e,t)=>("memory_percent"===t&&(t=["memory_usage"]),e.concat(t))),[]),[e.isReverseColumn(e.column)?"desc":"asc"])}},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}})}}}},_d=(0,ec.Z)(xd,[["render",function(e,t,n,r,i,s){return s.containers.length?(li(),pi("section",ed,[td,Si(" "+pe(s.containers.length)+" sorted by "+pe(i.sorter.getColumnLabel(i.sorter.column))+" ",1),wi("div",nd,[wi("div",rd,[id,sd,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),od,ad,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),ld]),(li(!0),pi(ni,null,pr(s.containers,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",cd,pe(t.engine),1),wi("div",ud,pe(t.pod_id||"-"),1),wi("div",dd,pe(t.name),1),wi("div",{class:ce(["table-cell","Paused"==t.status?"careful":"ok"])},pe(t.status),3),wi("div",fd,pe(t.uptime),1),wi("div",pd,pe(e.$filters.number(t.cpu_percent,1)),1),wi("div",hd,pe(e.$filters.bytes(t.memory_usage)),1),wi("div",gd,pe(e.$filters.bytes(t.limit)),1),wi("div",md,pe(e.$filters.bytes(t.io_rx)),1),wi("div",bd,pe(e.$filters.bytes(t.io_wx)),1),wi("div",vd,pe(e.$filters.bits(t.network_rx)),1),wi("div",yd,pe(e.$filters.bits(t.network_tx)),1),wi("div",wd,pe(t.command),1)])))),128))])])):Ti("v-if",!0)}]]),kd={class:"plugin",id:"folders"},Sd={key:0,class:"table-row"},Cd=[wi("div",{class:"table-cell text-left title"},"FOLDERS",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"Size",-1)],Td={class:"table-cell text-left"},Ad=wi("div",{class:"table-cell"},null,-1),Ed={key:0,class:"visible-lg-inline"};const Od={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"}},Id=(0,ec.Z)(Od,[["render",function(e,t,n,r,i,s){return li(),pi("section",kd,[s.folders.length>0?(li(),pi("div",Sd,Cd)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.folders,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Td,pe(t.path),1),Ad,wi("div",{class:ce(["table-cell",s.getDecoration(t)])},[t.errno>0?(li(),pi("span",Ed," ? ")):Ti("v-if",!0),Si(" "+pe(e.$filters.bytes(t.size)),1)],2)])))),128))])}]]),Pd={class:"plugin",id:"fs"},Nd={class:"table-row"},Ld=wi("div",{class:"table-cell text-left title"},"FILE SYS",-1),Dd={class:"table-cell"},Md=wi("div",{class:"table-cell"},"Total",-1),jd={class:"table-cell text-left"},Rd={key:0,class:"visible-lg-inline"},qd={class:"table-cell"};const Bd={props:{data:{type:Object}},data:()=>({store:qo}),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,cc.orderBy)(e,["mnt_point"])}},methods:{getDecoration(e,t){if(null!=this.view[e][t])return this.view[e][t].decoration.toLowerCase()}}},Ud=(0,ec.Z)(Bd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Pd,[wi("div",Nd,[Ld,wi("div",Dd,[On(wi("span",null,"Used",512),[[Ds,!s.args.fs_free_space]]),On(wi("span",null,"Free",512),[[Ds,s.args.fs_free_space]])]),Md]),(li(!0),pi(ni,null,pr(s.fileSystems,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",jd,[Si(pe(e.$filters.minSize(t.alias?t.alias:t.mountPoint,36,e.begin=!1))+" ",1),(t.alias?t.alias:t.mountPoint).length+t.name.length<=34?(li(),pi("span",Rd," ("+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",qd,pe(e.$filters.bytes(t.size)),1)])))),128))])}]]),Fd={id:"gpu",class:"plugin"},zd={class:"gpu-name title"},$d={class:"table"},Hd={key:0,class:"table-row"},Vd=wi("div",{class:"table-cell text-left"},"proc:",-1),Gd={key:1,class:"table-cell"},Wd={key:1,class:"table-row"},Zd=wi("div",{class:"table-cell text-left"},"mem:",-1),Kd={key:1,class:"table-cell"},Qd={key:2,class:"table-row"},Xd=wi("div",{class:"table-cell text-left"},"temperature:",-1),Jd={key:1,class:"table-cell"},Yd={class:"table-cell text-left"},ef={key:1},tf={key:3},nf={key:5};const rf={props:{data:{type:Object}},data:()=>({store:qo}),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)}}},sf=(0,ec.Z)(rf,[["render",function(e,t,n,r,i,s){return li(),pi("section",Fd,[wi("div",zd,pe(s.name),1),wi("div",$d,[s.args.meangpu||1===s.gpus.length?(li(),pi("div",Hd,[Vd,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",Gd,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),s.args.meangpu||1===s.gpus.length?(li(),pi("div",Wd,[Zd,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",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.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",Jd,"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",Yd,[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",ef,"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",tf,"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",nf,"N/A")):Ti("v-if",!0)])])))),128)):Ti("v-if",!0)])])}]]),of={key:0,class:"plugin",id:"ip"},af={key:0,class:"title"},lf={key:1},cf={key:2,class:"title"},uf={key:3},df={key:4};const ff={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}}},pf=(0,ec.Z)(ff,[["render",function(e,t,n,r,i,s){return null!=s.address?(li(),pi("section",of,[null!=s.address?(li(),pi("span",af,"IP")):Ti("v-if",!0),null!=s.address?(li(),pi("span",lf,pe(s.address)+"/"+pe(s.maskCdir),1)):Ti("v-if",!0),null!=s.publicAddress?(li(),pi("span",cf,"Pub")):Ti("v-if",!0),null!=s.publicAddress?(li(),pi("span",uf,pe(s.publicAddress),1)):Ti("v-if",!0),null!=s.publicInfo?(li(),pi("span",df,pe(s.publicInfo),1)):Ti("v-if",!0)])):Ti("v-if",!0)}]]),hf={class:"plugin",id:"irq"},gf={key:0,class:"table-row"},mf=[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)],bf={class:"table-cell text-left"},vf=wi("div",{class:"table-cell"},null,-1),yf={class:"table-cell"};const wf={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})))}}},xf=(0,ec.Z)(wf,[["render",function(e,t,n,r,i,s){return li(),pi("section",hf,[s.irqs.length>0?(li(),pi("div",gf,mf)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.irqs,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",bf,pe(e.irq_line),1),vf,wi("div",yf,[wi("span",null,pe(e.irq_rate),1)])])))),128))])}]]),_f={key:0,id:"load",class:"plugin"},kf={class:"table"},Sf={class:"table-row"},Cf=wi("div",{class:"table-cell text-left title"},"LOAD",-1),Tf={class:"table-cell"},Af={class:"table-row"},Ef=wi("div",{class:"table-cell text-left"},"1 min:",-1),Of={class:"table-cell"},If={class:"table-row"},Pf=wi("div",{class:"table-cell text-left"},"5 min:",-1),Nf={class:"table-row"},Lf=wi("div",{class:"table-cell text-left"},"15 min:",-1);const Df={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()}}},Mf=(0,ec.Z)(Df,[["render",function(e,t,n,r,i,s){return null!=s.cpucore?(li(),pi("section",_f,[wi("div",kf,[wi("div",Sf,[Cf,wi("div",Tf,pe(s.cpucore)+"-core",1)]),wi("div",Af,[Ef,wi("div",Of,pe(e.$filters.number(s.min1,2)),1)]),wi("div",If,[Pf,wi("div",{class:ce(["table-cell",s.getDecoration("min5")])},pe(e.$filters.number(s.min5,2)),3)]),wi("div",Nf,[Lf,wi("div",{class:ce(["table-cell",s.getDecoration("min15")])},pe(e.$filters.number(s.min15,2)),3)])])])):Ti("v-if",!0)}]]),jf={id:"mem",class:"plugin"},Rf={class:"table"},qf={class:"table-row"},Bf=wi("div",{class:"table-cell text-left title"},"MEM",-1),Uf={class:"table-row"},Ff=wi("div",{class:"table-cell text-left"},"total:",-1),zf={class:"table-cell"},$f={class:"table-row"},Hf=wi("div",{class:"table-cell text-left"},"used:",-1),Vf={class:"table-row"},Gf=wi("div",{class:"table-cell text-left"},"free:",-1),Wf={class:"table-cell"};const Zf={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()}}},Kf=(0,ec.Z)(Zf,[["render",function(e,t,n,r,i,s){return li(),pi("section",jf,[wi("div",Rf,[wi("div",qf,[Bf,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",Uf,[Ff,wi("div",zf,pe(e.$filters.bytes(s.total)),1)]),wi("div",$f,[Hf,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used,2)),3)]),wi("div",Vf,[Gf,wi("div",Wf,pe(e.$filters.bytes(s.free)),1)])])])}]]),Qf={id:"mem-more",class:"plugin"},Xf={class:"table"},Jf={class:"table-row"},Yf=wi("div",{class:"table-cell text-left"},"active:",-1),ep={class:"table-cell"},tp={class:"table-row"},np=wi("div",{class:"table-cell text-left"},"inactive:",-1),rp={class:"table-cell"},ip={class:"table-row"},sp=wi("div",{class:"table-cell text-left"},"buffers:",-1),op={class:"table-cell"},ap={class:"table-row"},lp=wi("div",{class:"table-cell text-left"},"cached:",-1),cp={class:"table-cell"};const up={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}}},dp=(0,ec.Z)(up,[["render",function(e,t,n,r,i,s){return li(),pi("section",Qf,[wi("div",Xf,[On(wi("div",Jf,[Yf,wi("div",ep,pe(e.$filters.bytes(s.active)),1)],512),[[Ds,null!=s.active]]),On(wi("div",tp,[np,wi("div",rp,pe(e.$filters.bytes(s.inactive)),1)],512),[[Ds,null!=s.inactive]]),On(wi("div",ip,[sp,wi("div",op,pe(e.$filters.bytes(s.buffers)),1)],512),[[Ds,null!=s.buffers]]),On(wi("div",ap,[lp,wi("div",cp,pe(e.$filters.bytes(s.cached)),1)],512),[[Ds,null!=s.cached]])])])}]]),fp={id:"memswap",class:"plugin"},pp={class:"table"},hp={class:"table-row"},gp=wi("div",{class:"table-cell text-left title"},"SWAP",-1),mp={class:"table-row"},bp=wi("div",{class:"table-cell text-left"},"total:",-1),vp={class:"table-cell"},yp={class:"table-row"},wp=wi("div",{class:"table-cell text-left"},"used:",-1),xp={class:"table-row"},_p=wi("div",{class:"table-cell text-left"},"free:",-1),kp={class:"table-cell"};const Sp={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()}}},Cp=(0,ec.Z)(Sp,[["render",function(e,t,n,r,i,s){return li(),pi("section",fp,[wi("div",pp,[wi("div",hp,[gp,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",mp,[bp,wi("div",vp,pe(e.$filters.bytes(s.total)),1)]),wi("div",yp,[wp,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used)),3)]),wi("div",xp,[_p,wi("div",kp,pe(e.$filters.bytes(s.free)),1)])])])}]]),Tp={class:"plugin",id:"network"},Ap={class:"table-row"},Ep=wi("div",{class:"table-cell text-left title"},"NETWORK",-1),Op={class:"table-cell"},Ip={class:"table-cell"},Pp={class:"table-cell"},Np={class:"table-cell"},Lp={class:"table-cell"},Dp={class:"table-cell"},Mp={class:"table-cell"},jp={class:"table-cell"},Rp={class:"table-cell text-left"},qp={class:"visible-lg-inline"},Bp={class:"hidden-lg"},Up={class:"table-cell"},Fp={class:"table-cell"};const zp={props:{data:{type:Object}},data:()=>({store:qo}),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,rx:e.rx,tx:e.tx,cx:e.cx,time_since_update:e.time_since_update,cumulativeRx:e.cumulative_rx,cumulativeTx:e.cumulative_tx,cumulativeCx:e.cumulative_cx}}));return(0,cc.orderBy)(e,["interfaceName"])}}},$p=(0,ec.Z)(zp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Tp,[wi("div",Ap,[Ep,On(wi("div",Op,"Rx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Ip,"Tx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Pp,null,512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Np,"Rx+Tx/s",512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Lp,"Rx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Dp,"Tx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Mp,null,512),[[Ds,s.args.network_cumul&&s.args.network_sum]]),On(wi("div",jp,"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",Rp,[wi("span",qp,pe(t.ifname),1),wi("span",Bp,pe(e.$filters.minSize(t.ifname)),1)]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.rx/t.time_since_update):e.$filters.bits(t.rx/t.time_since_update)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.tx/t.time_since_update):e.$filters.bits(t.tx/t.time_since_update)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Up,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.cx/t.time_since_update):e.$filters.bits(t.cx/t.time_since_update)),513),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.cumulativeRx):e.$filters.bits(t.cumulativeRx)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.cumulativeTx):e.$filters.bits(t.cumulativeTx)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Fp,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.cumulativeCx):e.$filters.bits(t.cumulativeCx)),513),[[Ds,s.args.network_cumul&&s.args.network_sum]])])))),128))])}]]),Hp={id:"now",class:"plugin"},Vp={class:"table-row"},Gp={class:"table-cell text-left"};const Wp={props:{data:{type:Object}},computed:{value(){return this.data.stats.now}}},Zp=(0,ec.Z)(Wp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Hp,[wi("div",Vp,[wi("div",Gp,pe(s.value),1)])])}]]),Kp={id:"percpu",class:"plugin"},Qp={class:"table-row"},Xp={class:"table-cell text-left title"},Jp={key:0},Yp={class:"table-row"},eh=wi("div",{class:"table-cell text-left"},"user:",-1),th={class:"table-row"},nh=wi("div",{class:"table-cell text-left"},"system:",-1),rh={class:"table-row"},ih=wi("div",{class:"table-cell text-left"},"idle:",-1),sh={key:0,class:"table-row"},oh=wi("div",{class:"table-cell text-left"},"iowait:",-1),ah={key:1,class:"table-row"},lh=wi("div",{class:"table-cell text-left"},"steal:",-1);const ch={props:{data:{type:Object}},computed:{percpuStats(){return this.data.stats.percpu},cpusChunks(){const e=this.percpuStats.map((e=>({number:e.cpu_number,total:e.total,user:e.user,system:e.system,idle:e.idle,iowait:e.iowait,steal:e.steal})));return(0,cc.chunk)(e,4)}},methods:{getUserAlert:e=>Fo.getAlert("percpu","percpu_user_",e.user),getSystemAlert:e=>Fo.getAlert("percpu","percpu_system_",e.system)}},uh=(0,ec.Z)(ch,[["render",function(e,t,n,r,i,s){return li(),pi("section",Kp,[(li(!0),pi(ni,null,pr(s.cpusChunks,((e,t)=>(li(),pi("div",{class:"table",key:t},[wi("div",Qp,[wi("div",Xp,[0===t?(li(),pi("span",Jp,"PER CPU")):Ti("v-if",!0)]),(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:"table-cell",key:t},pe(e.total)+"% ",1)))),128))]),wi("div",Yp,[eh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getUserAlert(e)]),key:t},pe(e.user)+"% ",3)))),128))]),wi("div",th,[nh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getSystemAlert(e)]),key:t},pe(e.system)+"% ",3)))),128))]),wi("div",rh,[ih,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:"table-cell",key:t},pe(e.idle)+"% ",1)))),128))]),e[0].iowait?(li(),pi("div",sh,[oh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getSystemAlert(e)]),key:t},pe(e.iowait)+"% ",3)))),128))])):Ti("v-if",!0),e[0].steal?(li(),pi("div",ah,[lh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getSystemAlert(e)]),key:t},pe(e.steal)+"% ",3)))),128))])):Ti("v-if",!0)])))),128))])}]]),dh={class:"plugin",id:"ports"},fh={class:"table-cell text-left"},ph=wi("div",{class:"table-cell"},null,-1),hh={key:0},gh={key:1},mh={key:2},bh={key:3},vh={key:0},yh={key:1},wh={key:2};const xh={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"}},_h=(0,ec.Z)(xh,[["render",function(e,t,n,r,i,s){return li(),pi("section",dh,[(li(!0),pi(ni,null,pr(s.ports,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",fh,[Ti(" prettier-ignore "),Si(" "+pe(e.$filters.minSize(t.description?t.description:t.host+" "+t.port,20)),1)]),ph,t.host?(li(),pi("div",{key:0,class:ce([s.getPortDecoration(t),"table-cell"])},["null"==t.status?(li(),pi("span",hh,"Scanning")):"false"==t.status?(li(),pi("span",gh,"Timeout")):"true"==t.status?(li(),pi("span",mh,"Open")):(li(),pi("span",bh,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",vh,"Scanning")):"Error"==t.status?(li(),pi("span",yh,"Error")):(li(),pi("span",wh,"Code "+pe(t.status),1))],2)):Ti("v-if",!0)])))),128))])}]]),kh={key:0},Sh={key:1},Ch={key:0,class:"row"},Th={class:"col-lg-18"};const Ah={id:"amps",class:"plugin"},Eh={class:"table"},Oh={key:0,class:"table-cell text-left"},Ih=["innerHTML"];const Ph={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}}},Nh=(0,ec.Z)(Ph,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ah,[wi("div",Eh,[(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",Oh,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,Ih)])))),128))])])}]]),Lh={id:"processcount",class:"plugin"},Dh=wi("span",{class:"title"},"TASKS",-1),Mh={class:"title"};const jh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:qo}),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}}},Rh=(0,ec.Z)(jh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Lh,[Dh,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",Mh,pe(n.sorter.auto?"sorted automatically":"sorted"),1),wi("span",null,"by "+pe(n.sorter.getColumnLabel(n.sorter.column)),1)])}]]),qh={id:"processlist-plugin",class:"plugin"},Bh={class:"table"},Uh={class:"table-row"},Fh=wi("div",{class:"table-cell width-75 hidden-xs hidden-sm"},"VIRT",-1),zh=wi("div",{class:"table-cell width-75 hidden-xs hidden-sm"},"RES",-1),$h=wi("div",{class:"table-cell width-75"},"PID",-1),Hh=wi("div",{class:"table-cell width-50"},"NI",-1),Vh=wi("div",{class:"table-cell width-50"},"S",-1),Gh={class:"table-cell width-75"},Wh={class:"table-cell width-75"},Zh={class:"table-cell width-75"},Kh={class:"table-cell width-100 text-left"},Qh={key:0,class:"table-cell width-100 hidden-xs hidden-sm"},Xh={key:1,class:"table-cell width-75 hidden-xs hidden-sm"},Jh={class:"table-cell width-75 text-left hidden-xs hidden-sm"};const Yh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:qo}),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),e.timeplus="?",e.timemillis="?",e.cpu_times&&(e.timeplus=Xu(e.cpu_times),e.timemillis=Qu(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&&(e.cmdline=e.name),t&&null!==e.username&&(e.username=(0,cc.last)(e.username.split("\\"))),e)));return(0,cc.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=>Fo.getAlert("processlist","processlist_cpu_",e.cpu_percent),getMemoryPercentAlert:e=>Fo.getAlert("processlist","processlist_mem_",e.cpu_percent)}},eg={components:{GlancesPluginAmps:Nh,GlancesPluginProcesscount:Rh,GlancesPluginProcesslist:(0,ec.Z)(Yh,[["render",function(e,t,n,r,i,s){return li(),pi(ni,null,[Ti(" prettier-ignore "),wi("section",qh,[wi("div",Bh,[wi("div",Uh,[wi("div",{class:ce(["table-cell width-50",["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-50",["sortable","memory_percent"===n.sorter.column&&"sort"]]),onClick:t[1]||(t[1]=t=>e.$emit("update:sorter","memory_percent"))}," MEM% ",2),Fh,zh,$h,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-75 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),Hh,Vh,On(wi("div",{class:ce(["table-cell width-75 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-75 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-50",s.getCpuPercentAlert(t)])},pe(-1==t.cpu_percent?"?":e.$filters.number(t.cpu_percent,1)),3),wi("div",{class:ce(["table-cell width-50",s.getMemoryPercentAlert(t)])},pe(-1==t.memory_percent?"?":e.$filters.number(t.memory_percent,1)),3),wi("div",Gh,pe(e.$filters.bytes(t.memvirt)),1),wi("div",Wh,pe(e.$filters.bytes(t.memres)),1),wi("div",Zh,pe(t.pid),1),wi("div",Kh,pe(t.username),1),"?"!=t.timeplus?(li(),pi("div",Qh,[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",Xh,"?")):Ti("v-if",!0),wi("div",Jh,pe(-1==t.num_threads?"?":t.num_threads),1),wi("div",{class:ce(["table-cell width-50",{nice:t.isNice}])},pe(e.$filters.exclamation(t.nice)),3),wi("div",{class:ce(["table-cell width-50",{status:"R"==t.status}])},pe(t.status),3),On(wi("div",{class:"table-cell width-75 hidden-xs hidden-sm"},pe(e.$filters.bytes(t.io_read)),513),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:"table-cell width-75 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:qo,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}})}}}},tg=(0,ec.Z)(eg,[["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",kh,"PROCESSES DISABLED (press 'z' to display)")):(li(),pi("div",Sh,[xi(o,{sorter:i.sorter,data:n.data},null,8,["sorter","data"]),s.args.disable_amps?Ti("v-if",!0):(li(),pi("div",Ch,[wi("div",Th,[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"])]))}]]),ng={id:"quicklook",class:"plugin"},rg={class:"cpu-name"},ig={class:"table"},sg={key:0,class:"table-row"},og=wi("div",{class:"table-cell text-left"},"CPU",-1),ag={class:"table-cell"},lg={class:"progress"},cg=["aria-valuenow"],ug={class:"table-cell"},dg={class:"table-cell text-left"},fg={class:"table-cell"},pg={class:"progress"},hg=["aria-valuenow"],gg={class:"table-cell"},mg={class:"table-row"},bg=wi("div",{class:"table-cell text-left"},"MEM",-1),vg={class:"table-cell"},yg={class:"progress"},wg=["aria-valuenow"],xg={class:"table-cell"},_g={class:"table-row"},kg=wi("div",{class:"table-cell text-left"},"SWAP",-1),Sg={class:"table-cell"},Cg={class:"progress"},Tg=["aria-valuenow"],Ag={class:"table-cell"};const Eg={props:{data:{type:Object}},data:()=>({store:qo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.quicklook},view(){return this.data.views.quicklook},mem(){return this.stats.mem},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},swap(){return this.stats.swap},percpus(){return this.stats.percpu.map((({cpu_number:e,total:t})=>({number:e,total:t})))}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Og=(0,ec.Z)(Eg,[["render",function(e,t,n,r,i,s){return li(),pi("section",ng,[wi("div",rg,pe(s.cpu_name),1),wi("div",ig,[s.args.percpu?Ti("v-if",!0):(li(),pi("div",sg,[og,wi("div",ag,[wi("div",lg,[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,cg)])]),wi("div",ug,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",dg,"CPU"+pe(e.number),1),wi("div",fg,[wi("div",pg,[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,hg)])]),wi("div",gg,pe(e.total)+"%",1)])))),128)):Ti("v-if",!0),wi("div",mg,[bg,wi("div",vg,[wi("div",yg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("mem")}`),role:"progressbar","aria-valuenow":s.mem,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.mem}%;`)},"   ",14,wg)])]),wi("div",xg,pe(s.mem)+"%",1)]),wi("div",_g,[kg,wi("div",Sg,[wi("div",Cg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("swap")}`),role:"progressbar","aria-valuenow":s.swap,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.swap}%;`)},"   ",14,Tg)])]),wi("div",Ag,pe(s.swap)+"%",1)])])])}]]),Ig={class:"plugin",id:"raid"},Pg={key:0,class:"table-row"},Ng=[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)],Lg={class:"table-cell text-left"},Dg={class:"warning"};const Mg={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"}},jg=(0,ec.Z)(Mg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ig,[s.hasDisks?(li(),pi("div",Pg,Ng)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.disks,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",Lg,[Si(pe(e.type.toUppercase())+" "+pe(e.name)+" ",1),On(wi("div",Dg,"└─ 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,!e.inactive]]),On(wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.available),3),[[Ds,!e.inactive]])])))),128))])}]]),Rg={id:"smart",class:"plugin"},qg=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),Bg={class:"table-row"},Ug={class:"table-cell text-left text-truncate"},Fg=wi("div",{class:"table-cell"},null,-1),zg=wi("div",{class:"table-cell"},null,-1),$g={class:"table-cell text-left"},Hg=wi("div",{class:"table-cell"},null,-1),Vg={class:"table-cell text-truncate"};const Gg={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}}))}}},Wg=(0,ec.Z)(Gg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Rg,[qg,(li(!0),pi(ni,null,pr(s.drives,((e,t)=>(li(),pi(ni,{key:t},[wi("div",Bg,[wi("div",Ug,pe(e.name),1),Fg,zg]),(li(!0),pi(ni,null,pr(e.details,((e,t)=>(li(),pi("div",{key:t,class:"table-row"},[wi("div",$g,"  "+pe(e.name),1),Hg,wi("div",Vg,[wi("span",null,pe(e.raw),1)])])))),128))],64)))),128))])}]]),Zg={class:"plugin",id:"sensors"},Kg={key:0,class:"table-row"},Qg=[wi("div",{class:"table-cell text-left title"},"SENSORS",-1)],Xg={class:"table-cell text-left"},Jg={class:"table-cell"};const Yg={props:{data:{type:Object}},data:()=>({store:qo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.sensors},sensors(){return this.stats.filter((e=>!(Array.isArray(e.value)&&0===e.value.length||0===e.value))).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:{getAlert(e){const t="battery"==e.type?100-e.value:e.value;return Fo.getAlert("sensors","sensors_"+e.type+"_",t)}}},em=(0,ec.Z)(Yg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Zg,[s.sensors.length>0?(li(),pi("div",Kg,Qg)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.sensors,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",Xg,pe(e.label),1),wi("div",Jg,pe(e.unit),1),wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.value),3)])))),128))])}]]),tm={class:"plugin",id:"system"},nm={key:0,class:"critical"},rm={class:"title"},im={key:1,class:"hidden-xs hidden-sm"},sm={key:2,class:"hidden-xs hidden-sm"};const om={props:{data:{type:Object}},data:()=>({store:qo}),computed:{stats(){return this.data.stats.system},isLinux(){return this.data.isLinux},hostname(){return this.stats.hostname},platform(){return this.stats.platform},os(){return{name:this.stats.os_name,version:this.stats.os_version}},humanReadableName(){return this.stats.hr_name},isDisconnected(){return"FAILURE"===this.store.status}}},am=(0,ec.Z)(om,[["render",function(e,t,n,r,i,s){return li(),pi("section",tm,[s.isDisconnected?(li(),pi("span",nm,"Disconnected from")):Ti("v-if",!0),wi("span",rm,pe(s.hostname),1),s.isLinux?(li(),pi("span",im," ("+pe(s.humanReadableName)+" / "+pe(s.os.name)+" "+pe(s.os.version)+") ",1)):Ti("v-if",!0),s.isLinux?Ti("v-if",!0):(li(),pi("span",sm," ("+pe(s.os.name)+" "+pe(s.os.version)+" "+pe(s.platform)+") ",1))])}]]),lm={class:"plugin",id:"uptime"};const cm={props:{data:{type:Object}},computed:{value(){return this.data.stats.uptime}}},um=(0,ec.Z)(cm,[["render",function(e,t,n,r,i,s){return li(),pi("section",lm,[wi("span",null,"Uptime: "+pe(s.value),1)])}]]),dm={class:"plugin",id:"wifi"},fm={key:0,class:"table-row"},pm=[wi("div",{class:"table-cell text-left title"},"WIFI",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"dBm",-1)],hm={class:"table-cell text-left"},gm=wi("div",{class:"table-cell"},null,-1);const mm={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,signal:e.signal,security:e.security}})).filter(Boolean);return(0,cc.orderBy)(e,["ssid"])}},methods:{getDecoration(e,t){if(void 0!==this.view[e.ssid][t])return this.view[e.ssid][t].decoration.toLowerCase()}}},bm={components:{GlancesHelp:tc,GlancesPluginAlert:dc,GlancesPluginCloud:gc,GlancesPluginConnections:qc,GlancesPluginCpu:Pu,GlancesPluginDiskio:Yu,GlancesPluginContainers:_d,GlancesPluginFolders:Id,GlancesPluginFs:Ud,GlancesPluginGpu:sf,GlancesPluginIp:pf,GlancesPluginIrq:xf,GlancesPluginLoad:Mf,GlancesPluginMem:Kf,GlancesPluginMemMore:dp,GlancesPluginMemswap:Cp,GlancesPluginNetwork:$p,GlancesPluginNow:Zp,GlancesPluginPercpu:uh,GlancesPluginPorts:_h,GlancesPluginProcess:tg,GlancesPluginQuicklook:Og,GlancesPluginRaid:jg,GlancesPluginSensors:em,GlancesPluginSmart:Wg,GlancesPluginSystem:am,GlancesPluginUptime:um,GlancesPluginWifi:(0,ec.Z)(mm,[["render",function(e,t,n,r,i,s){return li(),pi("section",dm,[s.hotspots.length>0?(li(),pi("div",fm,pm)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.hotspots,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",hm,[Si(pe(e.$filters.limitTo(t.ssid,20))+" ",1),wi("span",null,pe(t.security),1)]),gm,wi("div",{class:ce(["table-cell",s.getDecoration(t,"signal")])},pe(t.signal),3)])))),128))])}]])},data:()=>({store:qo}),computed:{args(){return this.store.args||{}},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"}},watch:{title(){document&&(document.title=this.title)}},methods:{setupHotKeys(){Do("a",(()=>{this.store.args.sort_processes_key=null})),Do("c",(()=>{this.store.args.sort_processes_key="cpu_percent"})),Do("m",(()=>{this.store.args.sort_processes_key="memory_percent"})),Do("u",(()=>{this.store.args.sort_processes_key="username"})),Do("p",(()=>{this.store.args.sort_processes_key="name"})),Do("i",(()=>{this.store.args.sort_processes_key="io_counters"})),Do("t",(()=>{this.store.args.sort_processes_key="timemillis"})),Do("shift+A",(()=>{this.store.args.disable_amps=!this.store.args.disable_amps})),Do("d",(()=>{this.store.args.disable_diskio=!this.store.args.disable_diskio})),Do("shift+Q",(()=>{this.store.args.enable_irq=!this.store.args.enable_irq})),Do("f",(()=>{this.store.args.disable_fs=!this.store.args.disable_fs})),Do("j",(()=>{this.store.args.programs=!this.store.args.programs})),Do("k",(()=>{this.store.args.disable_connections=!this.store.args.disable_connections})),Do("n",(()=>{this.store.args.disable_network=!this.store.args.disable_network})),Do("s",(()=>{this.store.args.disable_sensors=!this.store.args.disable_sensors})),Do("2",(()=>{this.store.args.disable_left_sidebar=!this.store.args.disable_left_sidebar})),Do("z",(()=>{this.store.args.disable_process=!this.store.args.disable_process})),Do("/",(()=>{this.store.args.process_short_name=!this.store.args.process_short_name})),Do("shift+D",(()=>{this.store.args.disable_containers=!this.store.args.disable_containers})),Do("b",(()=>{this.store.args.byte=!this.store.args.byte})),Do("shift+B",(()=>{this.store.args.diskio_iops=!this.store.args.diskio_iops})),Do("l",(()=>{this.store.args.disable_alert=!this.store.args.disable_alert})),Do("1",(()=>{this.store.args.percpu=!this.store.args.percpu})),Do("h",(()=>{this.store.args.help_tag=!this.store.args.help_tag})),Do("shift+T",(()=>{this.store.args.network_sum=!this.store.args.network_sum})),Do("shift+U",(()=>{this.store.args.network_cumul=!this.store.args.network_cumul})),Do("shift+F",(()=>{this.store.args.fs_free_space=!this.store.args.fs_free_space})),Do("3",(()=>{this.store.args.disable_quicklook=!this.store.args.disable_quicklook})),Do("6",(()=>{this.store.args.meangpu=!this.store.args.meangpu})),Do("shift+G",(()=>{this.store.args.disable_gpu=!this.store.args.disable_gpu})),Do("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})),Do("shift+I",(()=>{this.store.args.disable_ip=!this.store.args.disable_ip})),Do("shift+P",(()=>{this.store.args.disable_ports=!this.store.args.disable_ports})),Do("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;zo.init(t),this.setupHotKeys()},beforeUnmount(){Do.unbind()}};const vm=((...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,ec.Z)(bm,[["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-network"),w=cr("glances-plugin-wifi"),x=cr("glances-plugin-connections"),_=cr("glances-plugin-ports"),k=cr("glances-plugin-diskio"),S=cr("glances-plugin-fs"),C=cr("glances-plugin-irq"),T=cr("glances-plugin-smart"),A=cr("glances-plugin-folders"),E=cr("glances-plugin-raid"),O=cr("glances-plugin-sensors"),I=cr("glances-plugin-now"),P=cr("glances-plugin-containers"),N=cr("glances-plugin-process"),L=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"])])])]),wi("div",Ys,[s.args.disable_quicklook?Ti("v-if",!0):(li(),pi("div",eo,[xi(d,{data:s.data},null,8,["data"])])),s.args.disable_cpu||s.args.percpu?Ti("v-if",!0):(li(),pi("div",to,[xi(f,{data:s.data},null,8,["data"])])),!s.args.disable_cpu&&s.args.percpu?(li(),pi("div",no,[xi(p,{data:s.data},null,8,["data"])])):Ti("v-if",!0),!s.args.disable_gpu&&s.hasGpu?(li(),pi("div",ro,[xi(h,{data:s.data},null,8,["data"])])):Ti("v-if",!0),s.args.disable_mem?Ti("v-if",!0):(li(),pi("div",io,[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",so,[xi(m,{data:s.data},null,8,["data"])])),s.args.disable_memswap?Ti("v-if",!0):(li(),pi("div",oo,[xi(b,{data:s.data},null,8,["data"])])),s.args.disable_load?Ti("v-if",!0):(li(),pi("div",ao,[xi(v,{data:s.data},null,8,["data"])]))])]),wi("div",lo,[wi("div",co,[s.args.disable_left_sidebar?Ti("v-if",!0):(li(),pi("div",uo,[wi("div",fo,[s.args.disable_network?Ti("v-if",!0):(li(),hi(y,{key:0,id:"plugin-network",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_wifi?Ti("v-if",!0):(li(),hi(w,{key:1,id:"plugin-wifi",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.isLinux&&!s.args.disable_connections?(li(),hi(x,{key:2,id:"plugin-connections",class:"plugin table-row-group",data:s.data},null,8,["data"])):Ti("v-if",!0),s.args.disable_ports?Ti("v-if",!0):(li(),hi(_,{key:3,id:"plugin-ports",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_diskio?Ti("v-if",!0):(li(),hi(k,{key:4,id:"plugin-diskio",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_fs?Ti("v-if",!0):(li(),hi(S,{key:5,id:"plugin-fs",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_irq?Ti("v-if",!0):(li(),hi(C,{key:6,id:"plugin-irq",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_smart?Ti("v-if",!0):(li(),hi(T,{key:7,id:"plugin-smart",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_folders?Ti("v-if",!0):(li(),hi(A,{key:8,id:"plugin-folders",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.raid?Ti("v-if",!0):(li(),hi(E,{key:9,id:"plugin-raid",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_sensors?Ti("v-if",!0):(li(),hi(O,{key:10,id:"plugin-sensors",class:"plugin table-row-group",data:s.data},null,8,["data"])),xi(I,{id:"plugin-now",class:"plugin table-row-group",data:s.data},null,8,["data"])])])),wi("div",po,[s.args.disable_containers?Ti("v-if",!0):(li(),hi(P,{key:0,data:s.data},null,8,["data"])),xi(N,{data:s.data},null,8,["data"]),s.args.disable_alert?Ti("v-if",!0):(li(),hi(L,{key:1,data:s.data},null,8,["data"]))])])])])):(li(),pi("div",Us,Fs))}]]));vm.config.globalProperties.$filters=e,vm.mount("#app")})()})(); \ No newline at end of file +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=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;s0,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;a1&&(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;r1&&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=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/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,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/4/all/limits",{method:"GET"}).then((e=>e.json())).then((e=>{Fo.setLimits(e)})),fetch("api/4/args",{method:"GET"}).then((e=>e.json())).then(((e={})=>{qo.args={...qo.args,...e}})),fetch("api/4/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/4/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_history),1)]),wi("div",Va,[Ga,wi("div",Wa,pe(i.help.show_hide_alert),1),wi("div",Za,pe(i.help.toggle_gpu_individual_combined),1),wi("div",Ka,pe(i.help.misc_delete_warning_alerts),1)]),wi("div",Qa,[Xa,wi("div",Ja,pe(i.help.show_hide_network),1),wi("div",Ya,pe(i.help.toggle_short_full),1),wi("div",el,pe(i.help.misc_delete_warning_and_critical_alerts),1)]),wi("div",tl,[nl,wi("div",rl,pe(i.help.sort_cpu_times),1),il,wi("div",sl,pe(i.help.misc_edit_process_filter_pattern)+" - N/A in WebUI ",1)]),wi("div",ol,[al,wi("div",ll,pe(i.help.show_hide_irq),1),cl,ul]),wi("div",dl,[fl,wi("div",pl,pe(i.help.show_hide_raid_plugin),1),hl,gl]),wi("div",ml,[bl,wi("div",vl,pe(i.help.show_hide_sensors),1),yl,wl]),wi("div",xl,[_l,wi("div",kl,pe(i.help.show_hide_wifi_module),1),Sl,Cl]),wi("div",Tl,[Al,wi("div",El,pe(i.help.show_hide_processes),1),Ol,Il]),wi("div",Pl,[Nl,wi("div",Ll,pe(i.help.show_hide_left_sidebar),1),Dl,Ml]),wi("div",jl,[Rl,wi("div",ql,pe(i.help.show_hide_quick_look),1),Bl,Ul]),wi("div",Fl,[zl,wi("div",$l,pe(i.help.show_hide_cpu_mem_swap),1),Hl,Vl]),wi("div",Gl,[Wl,wi("div",Zl,pe(i.help.show_hide_all),1),Kl,Ql])])]),Xl,Jl])):Ti("v-if",!0)}]]),nc={class:"plugin"},rc={id:"alerts"},ic={key:0,class:"title"},sc={key:1,class:"title"},oc={id:"alert"},ac={class:"table"},lc={class:"table-cell text-left"};var cc=n(6486);const uc={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,cc.padStart)(i,2,"0")+":"+(0,cc.padStart)(r,2,"0")+":"+(0,cc.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?$o.badge(this.countOngoingAlerts):$o.reset()}},methods:{formatDate:e=>new Date(e).toISOString().slice(0,19).replace(/[^\d-:]/," ")}},dc=(0,ec.Z)(uc,[["render",function(e,t,n,r,i,s){return li(),pi("div",nc,[wi("section",rc,[s.hasAlerts?(li(),pi("span",ic," Warning or critical alerts (last "+pe(s.countAlerts)+" entries) ",1)):(li(),pi("span",sc,"No warning or critical alert detected"))]),wi("section",oc,[wi("div",ac,[(li(!0),pi(ni,null,pr(s.alerts,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",lc,[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))])])])}]]),fc={key:0,id:"cloud",class:"plugin"},pc={class:"title"};const hc={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}}},gc=(0,ec.Z)(hc,[["render",function(e,t,n,r,i,s){return s.instance||s.provider?(li(),pi("section",fc,[wi("span",pc,pe(s.provider),1),Si(" "+pe(s.instance),1)])):Ti("v-if",!0)}]]),mc={class:"plugin",id:"connections"},bc=wi("div",{class:"table-row"},[wi("div",{class:"table-cell text-left title"},"TCP CONNECTIONS"),wi("div",{class:"table-cell"})],-1),vc={class:"table-row"},yc=wi("div",{class:"table-cell text-left"},"Listen",-1),wc=wi("div",{class:"table-cell"},null,-1),xc={class:"table-cell"},_c={class:"table-row"},kc=wi("div",{class:"table-cell text-left"},"Initiated",-1),Sc=wi("div",{class:"table-cell"},null,-1),Cc={class:"table-cell"},Tc={class:"table-row"},Ac=wi("div",{class:"table-cell text-left"},"Established",-1),Ec=wi("div",{class:"table-cell"},null,-1),Oc={class:"table-cell"},Ic={class:"table-row"},Pc=wi("div",{class:"table-cell text-left"},"Terminated",-1),Nc=wi("div",{class:"table-cell"},null,-1),Lc={class:"table-cell"},Dc={class:"table-row"},Mc=wi("div",{class:"table-cell text-left"},"Tracked",-1),jc=wi("div",{class:"table-cell"},null,-1);const Rc={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()}}},qc=(0,ec.Z)(Rc,[["render",function(e,t,n,r,i,s){return li(),pi("section",mc,[bc,wi("div",vc,[yc,wc,wi("div",xc,pe(s.listen),1)]),wi("div",_c,[kc,Sc,wi("div",Cc,pe(s.initiated),1)]),wi("div",Tc,[Ac,Ec,wi("div",Oc,pe(s.established),1)]),wi("div",Ic,[Pc,Nc,wi("div",Lc,pe(s.terminated),1)]),wi("div",Dc,[Mc,jc,wi("div",{class:ce(["table-cell",s.getDecoration("nf_conntrack_percent")])},pe(s.tracked.count)+"/"+pe(s.tracked.max),3)])])}]]),Bc={id:"cpu",class:"plugin"},Uc={class:"row"},Fc={class:"col-sm-24 col-md-12 col-lg-8"},zc={class:"table"},$c={class:"table-row"},Hc=wi("div",{class:"table-cell text-left title"},"CPU",-1),Vc={class:"table-row"},Gc=wi("div",{class:"table-cell text-left"},"user:",-1),Wc={class:"table-row"},Zc=wi("div",{class:"table-cell text-left"},"system:",-1),Kc={class:"table-row"},Qc=wi("div",{class:"table-cell text-left"},"iowait:",-1),Xc={class:"table-row"},Jc=wi("div",{class:"table-cell text-left"},"dpc:",-1),Yc={class:"hidden-xs hidden-sm col-md-12 col-lg-8"},eu={class:"table"},tu={class:"table-row"},nu=wi("div",{class:"table-cell text-left"},"idle:",-1),ru={class:"table-cell"},iu={class:"table-row"},su=wi("div",{class:"table-cell text-left"},"irq:",-1),ou={class:"table-cell"},au={class:"table-row"},lu=wi("div",{class:"table-cell text-left"},"inter:",-1),cu={class:"table-cell"},uu={class:"table-row"},du=wi("div",{class:"table-cell text-left"},"nice:",-1),fu={class:"table-cell"},pu={key:0,class:"table-row"},hu=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),gu={class:"table-row"},mu=wi("div",{class:"table-cell text-left"},"steal:",-1),bu={key:1,class:"table-row"},vu=wi("div",{class:"table-cell text-left"},"syscal:",-1),yu={class:"table-cell"},wu={class:"hidden-xs hidden-sm hidden-md col-lg-8"},xu={class:"table"},_u={key:0,class:"table-row"},ku=wi("div",{class:"table-cell text-left"},"ctx_sw:",-1),Su={key:1,class:"table-row"},Cu=wi("div",{class:"table-cell text-left"},"inter:",-1),Tu={class:"table-cell"},Au={key:2,class:"table-row"},Eu=wi("div",{class:"table-cell text-left"},"sw_int:",-1),Ou={class:"table-cell"};const Iu={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},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()}}},Pu=(0,ec.Z)(Iu,[["render",function(e,t,n,r,i,s){return li(),pi("section",Bc,[wi("div",Uc,[wi("div",Fc,[wi("div",zc,[wi("div",$c,[Hc,wi("div",{class:ce(["table-cell",s.getDecoration("total")])},pe(s.total)+"%",3)]),wi("div",Vc,[Gc,wi("div",{class:ce(["table-cell",s.getDecoration("user")])},pe(s.user)+"%",3)]),wi("div",Wc,[Zc,wi("div",{class:ce(["table-cell",s.getDecoration("system")])},pe(s.system)+"%",3)]),On(wi("div",Kc,[Qc,wi("div",{class:ce(["table-cell",s.getDecoration("iowait")])},pe(s.iowait)+"%",3)],512),[[Ds,null!=s.iowait]]),On(wi("div",Xc,[Jc,wi("div",{class:ce(["table-cell",s.getDecoration("dpc")])},pe(s.dpc)+"%",3)],512),[[Ds,null==s.iowait&&null!=s.dpc]])])]),wi("div",Yc,[wi("div",eu,[wi("div",tu,[nu,wi("div",ru,pe(s.idle)+"%",1)]),On(wi("div",iu,[su,wi("div",ou,pe(s.irq)+"%",1)],512),[[Ds,null!=s.irq]]),Ti(" If no irq, display interrupts "),On(wi("div",au,[lu,wi("div",cu,pe(s.interrupts),1)],512),[[Ds,null==s.irq]]),On(wi("div",uu,[du,wi("div",fu,pe(s.nice)+"%",1)],512),[[Ds,null!=s.nice]]),Ti(" If no nice, display ctx_switches "),null==s.nice&&s.ctx_switches?(li(),pi("div",pu,[hu,wi("div",{class:ce(["table-cell",s.getDecoration("ctx_switches")])},pe(s.ctx_switches),3)])):Ti("v-if",!0),On(wi("div",gu,[mu,wi("div",{class:ce(["table-cell",s.getDecoration("steal")])},pe(s.steal)+"%",3)],512),[[Ds,null!=s.steal]]),!s.isLinux&&s.syscalls?(li(),pi("div",bu,[vu,wi("div",yu,pe(s.syscalls),1)])):Ti("v-if",!0)])]),wi("div",wu,[wi("div",xu,[Ti(" If not already display instead of nice, then display ctx_switches "),null!=s.nice&&s.ctx_switches?(li(),pi("div",_u,[ku,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&&s.interrupts?(li(),pi("div",Su,[Cu,wi("div",Tu,pe(s.interrupts),1)])):Ti("v-if",!0),s.isWindows||s.isSunOS||!s.soft_interrupts?Ti("v-if",!0):(li(),pi("div",Au,[Eu,wi("div",Ou,pe(s.soft_interrupts),1)]))])])])])}]]),Nu={class:"plugin",id:"diskio"},Lu={key:0,class:"table-row"},Du=wi("div",{class:"table-cell text-left title"},"DISK I/O",-1),Mu={class:"table-cell"},ju={class:"table-cell"},Ru={class:"table-cell"},qu={class:"table-cell"},Bu={class:"table-cell text-left"};var Uu=n(1036),Fu=n.n(Uu);function zu(e,t){return $u(e=8*Math.round(e),t)+"b"}function $u(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,cc.min)([1,a]):"K"==s&&(a=0),parseFloat(o).toFixed(a)+s}}return e.toFixed(0)}function Hu(e){return void 0===e||""===e?"?":e}function Vu(e,t,n){return t=t||0,n=n||" ",String(e).padStart(t,n)}function Gu(e,t){return"function"!=typeof e.slice&&(e=String(e)),e.slice(0,t)}function Wu(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 Zu(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 Fu()(n)}function Ku(e,t){return new Intl.NumberFormat(void 0,"number"==typeof t?{maximumFractionDigits:t}:t).format(e)}function Qu(e){for(var t=0,n=0;n({store:qo}),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:$u(e.read_bytes/t),rxps:$u(e.write_bytes/t)},count:{txps:$u(e.read_count/t),rxps:$u(e.write_count/t)},alias:void 0!==e.alias?e.alias:null}}));return(0,cc.orderBy)(e,["name"])}}},Yu=(0,ec.Z)(Ju,[["render",function(e,t,n,r,i,s){return li(),pi("section",Nu,[s.disks.length>0?(li(),pi("div",Lu,[Du,On(wi("div",Mu,"R/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",ju,"W/s",512),[[Ds,!s.args.diskio_iops]]),On(wi("div",Ru,"IOR/s",512),[[Ds,s.args.diskio_iops]]),On(wi("div",qu,"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",Bu,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))])}]]),ed={key:0,id:"containers-plugin",class:"plugin"},td=wi("span",{class:"title"},"CONTAINERS",-1),nd={class:"table"},rd={class:"table-row"},id=wi("div",{class:"table-cell text-left"},"Engine",-1),sd=wi("div",{class:"table-cell text-left"},"Pod",-1),od=wi("div",{class:"table-cell"},"Status",-1),ad=wi("div",{class:"table-cell"},"Uptime",-1),ld=Ci('
/MAX
IOR/s
IOW/s
RX/s
TX/s
Command
',6),cd={class:"table-cell text-left"},ud={class:"table-cell text-left"},dd={class:"table-cell text-left"},fd={class:"table-cell"},pd={class:"table-cell"},hd={class:"table-cell"},gd={class:"table-cell"},md={class:"table-cell"},bd={class:"table-cell"},vd={class:"table-cell"},yd={class:"table-cell"},wd={class:"table-cell text-left"};const xd={props:{data:{type:Object}},data:()=>({store:qo,sorter:void 0}),computed:{args(){return this.store.args||{}},sortProcessesKey(){return this.args.sort_processes_key},stats(){return this.data.stats.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,cc.orderBy)(t,[e.column].reduce(((e,t)=>("memory_percent"===t&&(t=["memory_usage"]),e.concat(t))),[]),[e.isReverseColumn(e.column)?"desc":"asc"])}},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}})}}}},_d=(0,ec.Z)(xd,[["render",function(e,t,n,r,i,s){return s.containers.length?(li(),pi("section",ed,[td,Si(" "+pe(s.containers.length)+" sorted by "+pe(i.sorter.getColumnLabel(i.sorter.column))+" ",1),wi("div",nd,[wi("div",rd,[id,sd,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),od,ad,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),ld]),(li(!0),pi(ni,null,pr(s.containers,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",cd,pe(t.engine),1),wi("div",ud,pe(t.pod_id||"-"),1),wi("div",dd,pe(t.name),1),wi("div",{class:ce(["table-cell","Paused"==t.status?"careful":"ok"])},pe(t.status),3),wi("div",fd,pe(t.uptime),1),wi("div",pd,pe(e.$filters.number(t.cpu_percent,1)),1),wi("div",hd,pe(e.$filters.bytes(t.memory_usage)),1),wi("div",gd,pe(e.$filters.bytes(t.limit)),1),wi("div",md,pe(e.$filters.bytes(t.io_rx)),1),wi("div",bd,pe(e.$filters.bytes(t.io_wx)),1),wi("div",vd,pe(e.$filters.bits(t.network_rx)),1),wi("div",yd,pe(e.$filters.bits(t.network_tx)),1),wi("div",wd,pe(t.command),1)])))),128))])])):Ti("v-if",!0)}]]),kd={class:"plugin",id:"folders"},Sd={key:0,class:"table-row"},Cd=[wi("div",{class:"table-cell text-left title"},"FOLDERS",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"Size",-1)],Td={class:"table-cell text-left"},Ad=wi("div",{class:"table-cell"},null,-1),Ed={key:0,class:"visible-lg-inline"};const Od={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"}},Id=(0,ec.Z)(Od,[["render",function(e,t,n,r,i,s){return li(),pi("section",kd,[s.folders.length>0?(li(),pi("div",Sd,Cd)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.folders,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",Td,pe(t.path),1),Ad,wi("div",{class:ce(["table-cell",s.getDecoration(t)])},[t.errno>0?(li(),pi("span",Ed," ? ")):Ti("v-if",!0),Si(" "+pe(e.$filters.bytes(t.size)),1)],2)])))),128))])}]]),Pd={class:"plugin",id:"fs"},Nd={class:"table-row"},Ld=wi("div",{class:"table-cell text-left title"},"FILE SYS",-1),Dd={class:"table-cell"},Md=wi("div",{class:"table-cell"},"Total",-1),jd={class:"table-cell text-left"},Rd={key:0,class:"visible-lg-inline"},qd={class:"table-cell"};const Bd={props:{data:{type:Object}},data:()=>({store:qo}),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,cc.orderBy)(e,["mnt_point"])}},methods:{getDecoration(e,t){if(null!=this.view[e][t])return this.view[e][t].decoration.toLowerCase()}}},Ud=(0,ec.Z)(Bd,[["render",function(e,t,n,r,i,s){return li(),pi("section",Pd,[wi("div",Nd,[Ld,wi("div",Dd,[On(wi("span",null,"Used",512),[[Ds,!s.args.fs_free_space]]),On(wi("span",null,"Free",512),[[Ds,s.args.fs_free_space]])]),Md]),(li(!0),pi(ni,null,pr(s.fileSystems,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",jd,[Si(pe(e.$filters.minSize(t.alias?t.alias:t.mountPoint,36,e.begin=!1))+" ",1),(t.alias?t.alias:t.mountPoint).length+t.name.length<=34?(li(),pi("span",Rd," ("+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",qd,pe(e.$filters.bytes(t.size)),1)])))),128))])}]]),Fd={id:"gpu",class:"plugin"},zd={class:"gpu-name title"},$d={class:"table"},Hd={key:0,class:"table-row"},Vd=wi("div",{class:"table-cell text-left"},"proc:",-1),Gd={key:1,class:"table-cell"},Wd={key:1,class:"table-row"},Zd=wi("div",{class:"table-cell text-left"},"mem:",-1),Kd={key:1,class:"table-cell"},Qd={key:2,class:"table-row"},Xd=wi("div",{class:"table-cell text-left"},"temperature:",-1),Jd={key:1,class:"table-cell"},Yd={class:"table-cell text-left"},ef={key:1},tf={key:3},nf={key:5};const rf={props:{data:{type:Object}},data:()=>({store:qo}),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)}}},sf=(0,ec.Z)(rf,[["render",function(e,t,n,r,i,s){return li(),pi("section",Fd,[wi("div",zd,pe(s.name),1),wi("div",$d,[s.args.meangpu||1===s.gpus.length?(li(),pi("div",Hd,[Vd,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",Gd,"N/A")):Ti("v-if",!0)])):Ti("v-if",!0),s.args.meangpu||1===s.gpus.length?(li(),pi("div",Wd,[Zd,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",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.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",Jd,"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",Yd,[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",ef,"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",tf,"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",nf,"N/A")):Ti("v-if",!0)])])))),128)):Ti("v-if",!0)])])}]]),of={key:0,class:"plugin",id:"ip"},af={key:0,class:"title"},lf={key:1},cf={key:2,class:"title"},uf={key:3},df={key:4};const ff={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}}},pf=(0,ec.Z)(ff,[["render",function(e,t,n,r,i,s){return null!=s.address?(li(),pi("section",of,[null!=s.address?(li(),pi("span",af,"IP")):Ti("v-if",!0),null!=s.address?(li(),pi("span",lf,pe(s.address)+"/"+pe(s.maskCdir),1)):Ti("v-if",!0),null!=s.publicAddress?(li(),pi("span",cf,"Pub")):Ti("v-if",!0),null!=s.publicAddress?(li(),pi("span",uf,pe(s.publicAddress),1)):Ti("v-if",!0),null!=s.publicInfo?(li(),pi("span",df,pe(s.publicInfo),1)):Ti("v-if",!0)])):Ti("v-if",!0)}]]),hf={class:"plugin",id:"irq"},gf={key:0,class:"table-row"},mf=[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)],bf={class:"table-cell text-left"},vf=wi("div",{class:"table-cell"},null,-1),yf={class:"table-cell"};const wf={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})))}}},xf=(0,ec.Z)(wf,[["render",function(e,t,n,r,i,s){return li(),pi("section",hf,[s.irqs.length>0?(li(),pi("div",gf,mf)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.irqs,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",bf,pe(e.irq_line),1),vf,wi("div",yf,[wi("span",null,pe(e.irq_rate),1)])])))),128))])}]]),_f={key:0,id:"load",class:"plugin"},kf={class:"table"},Sf={class:"table-row"},Cf=wi("div",{class:"table-cell text-left title"},"LOAD",-1),Tf={class:"table-cell"},Af={class:"table-row"},Ef=wi("div",{class:"table-cell text-left"},"1 min:",-1),Of={class:"table-cell"},If={class:"table-row"},Pf=wi("div",{class:"table-cell text-left"},"5 min:",-1),Nf={class:"table-row"},Lf=wi("div",{class:"table-cell text-left"},"15 min:",-1);const Df={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()}}},Mf=(0,ec.Z)(Df,[["render",function(e,t,n,r,i,s){return null!=s.cpucore?(li(),pi("section",_f,[wi("div",kf,[wi("div",Sf,[Cf,wi("div",Tf,pe(s.cpucore)+"-core",1)]),wi("div",Af,[Ef,wi("div",Of,pe(e.$filters.number(s.min1,2)),1)]),wi("div",If,[Pf,wi("div",{class:ce(["table-cell",s.getDecoration("min5")])},pe(e.$filters.number(s.min5,2)),3)]),wi("div",Nf,[Lf,wi("div",{class:ce(["table-cell",s.getDecoration("min15")])},pe(e.$filters.number(s.min15,2)),3)])])])):Ti("v-if",!0)}]]),jf={id:"mem",class:"plugin"},Rf={class:"table"},qf={class:"table-row"},Bf=wi("div",{class:"table-cell text-left title"},"MEM",-1),Uf={class:"table-row"},Ff=wi("div",{class:"table-cell text-left"},"total:",-1),zf={class:"table-cell"},$f={class:"table-row"},Hf=wi("div",{class:"table-cell text-left"},"used:",-1),Vf={class:"table-row"},Gf=wi("div",{class:"table-cell text-left"},"free:",-1),Wf={class:"table-cell"};const Zf={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()}}},Kf=(0,ec.Z)(Zf,[["render",function(e,t,n,r,i,s){return li(),pi("section",jf,[wi("div",Rf,[wi("div",qf,[Bf,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",Uf,[Ff,wi("div",zf,pe(e.$filters.bytes(s.total)),1)]),wi("div",$f,[Hf,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used,2)),3)]),wi("div",Vf,[Gf,wi("div",Wf,pe(e.$filters.bytes(s.free)),1)])])])}]]),Qf={id:"mem-more",class:"plugin"},Xf={class:"table"},Jf={class:"table-row"},Yf=wi("div",{class:"table-cell text-left"},"active:",-1),ep={class:"table-cell"},tp={class:"table-row"},np=wi("div",{class:"table-cell text-left"},"inactive:",-1),rp={class:"table-cell"},ip={class:"table-row"},sp=wi("div",{class:"table-cell text-left"},"buffers:",-1),op={class:"table-cell"},ap={class:"table-row"},lp=wi("div",{class:"table-cell text-left"},"cached:",-1),cp={class:"table-cell"};const up={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}}},dp=(0,ec.Z)(up,[["render",function(e,t,n,r,i,s){return li(),pi("section",Qf,[wi("div",Xf,[On(wi("div",Jf,[Yf,wi("div",ep,pe(e.$filters.bytes(s.active)),1)],512),[[Ds,null!=s.active]]),On(wi("div",tp,[np,wi("div",rp,pe(e.$filters.bytes(s.inactive)),1)],512),[[Ds,null!=s.inactive]]),On(wi("div",ip,[sp,wi("div",op,pe(e.$filters.bytes(s.buffers)),1)],512),[[Ds,null!=s.buffers]]),On(wi("div",ap,[lp,wi("div",cp,pe(e.$filters.bytes(s.cached)),1)],512),[[Ds,null!=s.cached]])])])}]]),fp={id:"memswap",class:"plugin"},pp={class:"table"},hp={class:"table-row"},gp=wi("div",{class:"table-cell text-left title"},"SWAP",-1),mp={class:"table-row"},bp=wi("div",{class:"table-cell text-left"},"total:",-1),vp={class:"table-cell"},yp={class:"table-row"},wp=wi("div",{class:"table-cell text-left"},"used:",-1),xp={class:"table-row"},_p=wi("div",{class:"table-cell text-left"},"free:",-1),kp={class:"table-cell"};const Sp={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()}}},Cp=(0,ec.Z)(Sp,[["render",function(e,t,n,r,i,s){return li(),pi("section",fp,[wi("div",pp,[wi("div",hp,[gp,wi("div",{class:ce(["table-cell",s.getDecoration("percent")])},pe(s.percent)+"%",3)]),wi("div",mp,[bp,wi("div",vp,pe(e.$filters.bytes(s.total)),1)]),wi("div",yp,[wp,wi("div",{class:ce(["table-cell",s.getDecoration("used")])},pe(e.$filters.bytes(s.used)),3)]),wi("div",xp,[_p,wi("div",kp,pe(e.$filters.bytes(s.free)),1)])])])}]]),Tp={class:"plugin",id:"network"},Ap={class:"table-row"},Ep=wi("div",{class:"table-cell text-left title"},"NETWORK",-1),Op={class:"table-cell"},Ip={class:"table-cell"},Pp={class:"table-cell"},Np={class:"table-cell"},Lp={class:"table-cell"},Dp={class:"table-cell"},Mp={class:"table-cell"},jp={class:"table-cell"},Rp={class:"table-cell text-left"},qp={class:"visible-lg-inline"},Bp={class:"hidden-lg"},Up={class:"table-cell"},Fp={class:"table-cell"};const zp={props:{data:{type:Object}},data:()=>({store:qo}),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,rx:e.rx,tx:e.tx,cx:e.cx,time_since_update:e.time_since_update,cumulativeRx:e.cumulative_rx,cumulativeTx:e.cumulative_tx,cumulativeCx:e.cumulative_cx}}));return(0,cc.orderBy)(e,["interfaceName"])}}},$p=(0,ec.Z)(zp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Tp,[wi("div",Ap,[Ep,On(wi("div",Op,"Rx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Ip,"Tx/s",512),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Pp,null,512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Np,"Rx+Tx/s",512),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",Lp,"Rx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Dp,"Tx",512),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Mp,null,512),[[Ds,s.args.network_cumul&&s.args.network_sum]]),On(wi("div",jp,"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",Rp,[wi("span",qp,pe(t.ifname),1),wi("span",Bp,pe(e.$filters.minSize(t.ifname)),1)]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.rx/t.time_since_update):e.$filters.bits(t.rx/t.time_since_update)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.tx/t.time_since_update):e.$filters.bits(t.tx/t.time_since_update)),513),[[Ds,!s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Up,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.cx/t.time_since_update):e.$filters.bits(t.cx/t.time_since_update)),513),[[Ds,!s.args.network_cumul&&s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.cumulativeRx):e.$filters.bits(t.cumulativeRx)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",{class:"table-cell"},pe(s.args.byte?e.$filters.bytes(t.cumulativeTx):e.$filters.bits(t.cumulativeTx)),513),[[Ds,s.args.network_cumul&&!s.args.network_sum]]),On(wi("div",Fp,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.cumulativeCx):e.$filters.bits(t.cumulativeCx)),513),[[Ds,s.args.network_cumul&&s.args.network_sum]])])))),128))])}]]),Hp={id:"now",class:"plugin"},Vp={class:"table-row"},Gp={class:"table-cell text-left"};const Wp={props:{data:{type:Object}},computed:{value(){return this.data.stats.now}}},Zp=(0,ec.Z)(Wp,[["render",function(e,t,n,r,i,s){return li(),pi("section",Hp,[wi("div",Vp,[wi("div",Gp,pe(s.value),1)])])}]]),Kp={id:"percpu",class:"plugin"},Qp={class:"table-row"},Xp={class:"table-cell text-left title"},Jp={key:0},Yp={class:"table-row"},eh=wi("div",{class:"table-cell text-left"},"user:",-1),th={class:"table-row"},nh=wi("div",{class:"table-cell text-left"},"system:",-1),rh={class:"table-row"},ih=wi("div",{class:"table-cell text-left"},"idle:",-1),sh={key:0,class:"table-row"},oh=wi("div",{class:"table-cell text-left"},"iowait:",-1),ah={key:1,class:"table-row"},lh=wi("div",{class:"table-cell text-left"},"steal:",-1);const ch={props:{data:{type:Object}},computed:{percpuStats(){return this.data.stats.percpu},cpusChunks(){const e=this.percpuStats.map((e=>({number:e.cpu_number,total:e.total,user:e.user,system:e.system,idle:e.idle,iowait:e.iowait,steal:e.steal})));return(0,cc.chunk)(e,4)}},methods:{getUserAlert:e=>Fo.getAlert("percpu","percpu_user_",e.user),getSystemAlert:e=>Fo.getAlert("percpu","percpu_system_",e.system)}},uh=(0,ec.Z)(ch,[["render",function(e,t,n,r,i,s){return li(),pi("section",Kp,[(li(!0),pi(ni,null,pr(s.cpusChunks,((e,t)=>(li(),pi("div",{class:"table",key:t},[wi("div",Qp,[wi("div",Xp,[0===t?(li(),pi("span",Jp,"PER CPU")):Ti("v-if",!0)]),(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:"table-cell",key:t},pe(e.total)+"% ",1)))),128))]),wi("div",Yp,[eh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getUserAlert(e)]),key:t},pe(e.user)+"% ",3)))),128))]),wi("div",th,[nh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getSystemAlert(e)]),key:t},pe(e.system)+"% ",3)))),128))]),wi("div",rh,[ih,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:"table-cell",key:t},pe(e.idle)+"% ",1)))),128))]),e[0].iowait?(li(),pi("div",sh,[oh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getSystemAlert(e)]),key:t},pe(e.iowait)+"% ",3)))),128))])):Ti("v-if",!0),e[0].steal?(li(),pi("div",ah,[lh,(li(!0),pi(ni,null,pr(e,((e,t)=>(li(),pi("div",{class:ce(["table-cell",s.getSystemAlert(e)]),key:t},pe(e.steal)+"% ",3)))),128))])):Ti("v-if",!0)])))),128))])}]]),dh={class:"plugin",id:"ports"},fh={class:"table-cell text-left"},ph=wi("div",{class:"table-cell"},null,-1),hh={key:0},gh={key:1},mh={key:2},bh={key:3},vh={key:0},yh={key:1},wh={key:2};const xh={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"}},_h=(0,ec.Z)(xh,[["render",function(e,t,n,r,i,s){return li(),pi("section",dh,[(li(!0),pi(ni,null,pr(s.ports,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",fh,[Ti(" prettier-ignore "),Si(" "+pe(e.$filters.minSize(t.description?t.description:t.host+" "+t.port,20)),1)]),ph,t.host?(li(),pi("div",{key:0,class:ce([s.getPortDecoration(t),"table-cell"])},["null"==t.status?(li(),pi("span",hh,"Scanning")):"false"==t.status?(li(),pi("span",gh,"Timeout")):"true"==t.status?(li(),pi("span",mh,"Open")):(li(),pi("span",bh,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",vh,"Scanning")):"Error"==t.status?(li(),pi("span",yh,"Error")):(li(),pi("span",wh,"Code "+pe(t.status),1))],2)):Ti("v-if",!0)])))),128))])}]]),kh={key:0},Sh={key:1},Ch={key:0,class:"row"},Th={class:"col-lg-18"};const Ah={id:"amps",class:"plugin"},Eh={class:"table"},Oh={key:0,class:"table-cell text-left"},Ih=["innerHTML"];const Ph={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}}},Nh=(0,ec.Z)(Ph,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ah,[wi("div",Eh,[(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",Oh,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,Ih)])))),128))])])}]]),Lh={id:"processcount",class:"plugin"},Dh=wi("span",{class:"title"},"TASKS",-1),Mh={class:"title"};const jh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:qo}),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}}},Rh=(0,ec.Z)(jh,[["render",function(e,t,n,r,i,s){return li(),pi("section",Lh,[Dh,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",Mh,pe(n.sorter.auto?"sorted automatically":"sorted"),1),wi("span",null,"by "+pe(n.sorter.getColumnLabel(n.sorter.column)),1)])}]]),qh={id:"processlist-plugin",class:"plugin"},Bh={class:"table"},Uh={class:"table-row"},Fh=wi("div",{class:"table-cell width-75 hidden-xs hidden-sm"},"VIRT",-1),zh=wi("div",{class:"table-cell width-75 hidden-xs hidden-sm"},"RES",-1),$h=wi("div",{class:"table-cell width-75"},"PID",-1),Hh=wi("div",{class:"table-cell width-50"},"NI",-1),Vh=wi("div",{class:"table-cell width-50"},"S",-1),Gh={class:"table-cell width-75"},Wh={class:"table-cell width-75"},Zh={class:"table-cell width-75"},Kh={class:"table-cell width-100 text-left"},Qh={key:0,class:"table-cell width-100 hidden-xs hidden-sm"},Xh={key:1,class:"table-cell width-75 hidden-xs hidden-sm"},Jh={class:"table-cell width-75 text-left hidden-xs hidden-sm"};const Yh={props:{data:{type:Object},sorter:{type:Object}},data:()=>({store:qo}),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),e.timeplus="?",e.timemillis="?",e.cpu_times&&(e.timeplus=Xu(e.cpu_times),e.timemillis=Qu(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&&(e.cmdline=e.name),t&&null!==e.username&&(e.username=(0,cc.last)(e.username.split("\\"))),e)));return(0,cc.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=>Fo.getAlert("processlist","processlist_cpu_",e.cpu_percent),getMemoryPercentAlert:e=>Fo.getAlert("processlist","processlist_mem_",e.cpu_percent)}},eg={components:{GlancesPluginAmps:Nh,GlancesPluginProcesscount:Rh,GlancesPluginProcesslist:(0,ec.Z)(Yh,[["render",function(e,t,n,r,i,s){return li(),pi(ni,null,[Ti(" prettier-ignore "),wi("section",qh,[wi("div",Bh,[wi("div",Uh,[wi("div",{class:ce(["table-cell width-50",["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-50",["sortable","memory_percent"===n.sorter.column&&"sort"]]),onClick:t[1]||(t[1]=t=>e.$emit("update:sorter","memory_percent"))}," MEM% ",2),Fh,zh,$h,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-75 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),Hh,Vh,On(wi("div",{class:ce(["table-cell width-75 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-75 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-50",s.getCpuPercentAlert(t)])},pe(-1==t.cpu_percent?"?":e.$filters.number(t.cpu_percent,1)),3),wi("div",{class:ce(["table-cell width-50",s.getMemoryPercentAlert(t)])},pe(-1==t.memory_percent?"?":e.$filters.number(t.memory_percent,1)),3),wi("div",Gh,pe(e.$filters.bytes(t.memvirt)),1),wi("div",Wh,pe(e.$filters.bytes(t.memres)),1),wi("div",Zh,pe(t.pid),1),wi("div",Kh,pe(t.username),1),"?"!=t.timeplus?(li(),pi("div",Qh,[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",Xh,"?")):Ti("v-if",!0),wi("div",Jh,pe(-1==t.num_threads?"?":t.num_threads),1),wi("div",{class:ce(["table-cell width-50",{nice:t.isNice}])},pe(e.$filters.exclamation(t.nice)),3),wi("div",{class:ce(["table-cell width-50",{status:"R"==t.status}])},pe(t.status),3),On(wi("div",{class:"table-cell width-75 hidden-xs hidden-sm"},pe(e.$filters.bytes(t.io_read)),513),[[Ds,s.ioReadWritePresent]]),On(wi("div",{class:"table-cell width-75 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:qo,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}})}}}},tg=(0,ec.Z)(eg,[["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",kh,"PROCESSES DISABLED (press 'z' to display)")):(li(),pi("div",Sh,[xi(o,{sorter:i.sorter,data:n.data},null,8,["sorter","data"]),s.args.disable_amps?Ti("v-if",!0):(li(),pi("div",Ch,[wi("div",Th,[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"])]))}]]),ng={id:"quicklook",class:"plugin"},rg={class:"cpu-name"},ig={class:"table"},sg={key:0,class:"table-row"},og=wi("div",{class:"table-cell text-left"},"CPU",-1),ag={class:"table-cell"},lg={class:"progress"},cg=["aria-valuenow"],ug={class:"table-cell"},dg={class:"table-cell text-left"},fg={class:"table-cell"},pg={class:"progress"},hg=["aria-valuenow"],gg={class:"table-cell"},mg={class:"table-row"},bg=wi("div",{class:"table-cell text-left"},"MEM",-1),vg={class:"table-cell"},yg={class:"progress"},wg=["aria-valuenow"],xg={class:"table-cell"},_g={class:"table-row"},kg=wi("div",{class:"table-cell text-left"},"SWAP",-1),Sg={class:"table-cell"},Cg={class:"progress"},Tg=["aria-valuenow"],Ag={class:"table-cell"};const Eg={props:{data:{type:Object}},data:()=>({store:qo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.quicklook},view(){return this.data.views.quicklook},mem(){return this.stats.mem},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},swap(){return this.stats.swap},percpus(){return this.stats.percpu.map((({cpu_number:e,total:t})=>({number:e,total:t})))}},methods:{getDecoration(e){if(void 0!==this.view[e])return this.view[e].decoration.toLowerCase()}}},Og=(0,ec.Z)(Eg,[["render",function(e,t,n,r,i,s){return li(),pi("section",ng,[wi("div",rg,pe(s.cpu_name),1),wi("div",ig,[s.args.percpu?Ti("v-if",!0):(li(),pi("div",sg,[og,wi("div",ag,[wi("div",lg,[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,cg)])]),wi("div",ug,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",dg,"CPU"+pe(e.number),1),wi("div",fg,[wi("div",pg,[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,hg)])]),wi("div",gg,pe(e.total)+"%",1)])))),128)):Ti("v-if",!0),wi("div",mg,[bg,wi("div",vg,[wi("div",yg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("mem")}`),role:"progressbar","aria-valuenow":s.mem,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.mem}%;`)},"   ",14,wg)])]),wi("div",xg,pe(s.mem)+"%",1)]),wi("div",_g,[kg,wi("div",Sg,[wi("div",Cg,[wi("div",{class:ce(`progress-bar progress-bar-${s.getDecoration("swap")}`),role:"progressbar","aria-valuenow":s.swap,"aria-valuemin":"0","aria-valuemax":"100",style:ie(`width: ${s.swap}%;`)},"   ",14,Tg)])]),wi("div",Ag,pe(s.swap)+"%",1)])])])}]]),Ig={class:"plugin",id:"raid"},Pg={key:0,class:"table-row"},Ng=[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)],Lg={class:"table-cell text-left"},Dg={class:"warning"};const Mg={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"}},jg=(0,ec.Z)(Mg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Ig,[s.hasDisks?(li(),pi("div",Pg,Ng)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.disks,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",Lg,[Si(pe(e.type.toUppercase())+" "+pe(e.name)+" ",1),On(wi("div",Dg,"└─ 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,!e.inactive]]),On(wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.available),3),[[Ds,!e.inactive]])])))),128))])}]]),Rg={id:"smart",class:"plugin"},qg=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),Bg={class:"table-row"},Ug={class:"table-cell text-left text-truncate"},Fg=wi("div",{class:"table-cell"},null,-1),zg=wi("div",{class:"table-cell"},null,-1),$g={class:"table-cell text-left"},Hg=wi("div",{class:"table-cell"},null,-1),Vg={class:"table-cell text-truncate"};const Gg={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}}))}}},Wg=(0,ec.Z)(Gg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Rg,[qg,(li(!0),pi(ni,null,pr(s.drives,((e,t)=>(li(),pi(ni,{key:t},[wi("div",Bg,[wi("div",Ug,pe(e.name),1),Fg,zg]),(li(!0),pi(ni,null,pr(e.details,((e,t)=>(li(),pi("div",{key:t,class:"table-row"},[wi("div",$g,"  "+pe(e.name),1),Hg,wi("div",Vg,[wi("span",null,pe(e.raw),1)])])))),128))],64)))),128))])}]]),Zg={class:"plugin",id:"sensors"},Kg={key:0,class:"table-row"},Qg=[wi("div",{class:"table-cell text-left title"},"SENSORS",-1)],Xg={class:"table-cell text-left"},Jg={class:"table-cell"};const Yg={props:{data:{type:Object}},data:()=>({store:qo}),computed:{args(){return this.store.args||{}},stats(){return this.data.stats.sensors},sensors(){return this.stats.filter((e=>!(Array.isArray(e.value)&&0===e.value.length||0===e.value))).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:{getAlert(e){const t="battery"==e.type?100-e.value:e.value;return Fo.getAlert("sensors","sensors_"+e.type+"_",t)}}},em=(0,ec.Z)(Yg,[["render",function(e,t,n,r,i,s){return li(),pi("section",Zg,[s.sensors.length>0?(li(),pi("div",Kg,Qg)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.sensors,((e,t)=>(li(),pi("div",{class:"table-row",key:t},[wi("div",Xg,pe(e.label),1),wi("div",Jg,pe(e.unit),1),wi("div",{class:ce(["table-cell",s.getAlert(e)])},pe(e.value),3)])))),128))])}]]),tm={class:"plugin",id:"system"},nm={key:0,class:"critical"},rm={class:"title"},im={key:1,class:"hidden-xs hidden-sm"},sm={key:2,class:"hidden-xs hidden-sm"};const om={props:{data:{type:Object}},data:()=>({store:qo}),computed:{stats(){return this.data.stats.system},isLinux(){return this.data.isLinux},hostname(){return this.stats.hostname},platform(){return this.stats.platform},os(){return{name:this.stats.os_name,version:this.stats.os_version}},humanReadableName(){return this.stats.hr_name},isDisconnected(){return"FAILURE"===this.store.status}}},am=(0,ec.Z)(om,[["render",function(e,t,n,r,i,s){return li(),pi("section",tm,[s.isDisconnected?(li(),pi("span",nm,"Disconnected from")):Ti("v-if",!0),wi("span",rm,pe(s.hostname),1),s.isLinux?(li(),pi("span",im," ("+pe(s.humanReadableName)+" / "+pe(s.os.name)+" "+pe(s.os.version)+") ",1)):Ti("v-if",!0),s.isLinux?Ti("v-if",!0):(li(),pi("span",sm," ("+pe(s.os.name)+" "+pe(s.os.version)+" "+pe(s.platform)+") ",1))])}]]),lm={class:"plugin",id:"uptime"};const cm={props:{data:{type:Object}},computed:{value(){return this.data.stats.uptime}}},um=(0,ec.Z)(cm,[["render",function(e,t,n,r,i,s){return li(),pi("section",lm,[wi("span",null,"Uptime: "+pe(s.value),1)])}]]),dm={class:"plugin",id:"wifi"},fm={key:0,class:"table-row"},pm=[wi("div",{class:"table-cell text-left title"},"WIFI",-1),wi("div",{class:"table-cell"},null,-1),wi("div",{class:"table-cell"},"dBm",-1)],hm={class:"table-cell text-left"},gm=wi("div",{class:"table-cell"},null,-1);const mm={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,signal:e.signal,security:e.security}})).filter(Boolean);return(0,cc.orderBy)(e,["ssid"])}},methods:{getDecoration(e,t){if(void 0!==this.view[e.ssid][t])return this.view[e.ssid][t].decoration.toLowerCase()}}},bm={components:{GlancesHelp:tc,GlancesPluginAlert:dc,GlancesPluginCloud:gc,GlancesPluginConnections:qc,GlancesPluginCpu:Pu,GlancesPluginDiskio:Yu,GlancesPluginContainers:_d,GlancesPluginFolders:Id,GlancesPluginFs:Ud,GlancesPluginGpu:sf,GlancesPluginIp:pf,GlancesPluginIrq:xf,GlancesPluginLoad:Mf,GlancesPluginMem:Kf,GlancesPluginMemMore:dp,GlancesPluginMemswap:Cp,GlancesPluginNetwork:$p,GlancesPluginNow:Zp,GlancesPluginPercpu:uh,GlancesPluginPorts:_h,GlancesPluginProcess:tg,GlancesPluginQuicklook:Og,GlancesPluginRaid:jg,GlancesPluginSensors:em,GlancesPluginSmart:Wg,GlancesPluginSystem:am,GlancesPluginUptime:um,GlancesPluginWifi:(0,ec.Z)(mm,[["render",function(e,t,n,r,i,s){return li(),pi("section",dm,[s.hotspots.length>0?(li(),pi("div",fm,pm)):Ti("v-if",!0),(li(!0),pi(ni,null,pr(s.hotspots,((t,n)=>(li(),pi("div",{class:"table-row",key:n},[wi("div",hm,[Si(pe(e.$filters.limitTo(t.ssid,20))+" ",1),wi("span",null,pe(t.security),1)]),gm,wi("div",{class:ce(["table-cell",s.getDecoration(t,"signal")])},pe(t.signal),3)])))),128))])}]])},data:()=>({store:qo}),computed:{args(){return this.store.args||{}},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"}},watch:{title(){document&&(document.title=this.title)}},methods:{setupHotKeys(){Do("a",(()=>{this.store.args.sort_processes_key=null})),Do("c",(()=>{this.store.args.sort_processes_key="cpu_percent"})),Do("m",(()=>{this.store.args.sort_processes_key="memory_percent"})),Do("u",(()=>{this.store.args.sort_processes_key="username"})),Do("p",(()=>{this.store.args.sort_processes_key="name"})),Do("i",(()=>{this.store.args.sort_processes_key="io_counters"})),Do("t",(()=>{this.store.args.sort_processes_key="timemillis"})),Do("shift+A",(()=>{this.store.args.disable_amps=!this.store.args.disable_amps})),Do("d",(()=>{this.store.args.disable_diskio=!this.store.args.disable_diskio})),Do("shift+Q",(()=>{this.store.args.enable_irq=!this.store.args.enable_irq})),Do("f",(()=>{this.store.args.disable_fs=!this.store.args.disable_fs})),Do("j",(()=>{this.store.args.programs=!this.store.args.programs})),Do("k",(()=>{this.store.args.disable_connections=!this.store.args.disable_connections})),Do("n",(()=>{this.store.args.disable_network=!this.store.args.disable_network})),Do("s",(()=>{this.store.args.disable_sensors=!this.store.args.disable_sensors})),Do("2",(()=>{this.store.args.disable_left_sidebar=!this.store.args.disable_left_sidebar})),Do("z",(()=>{this.store.args.disable_process=!this.store.args.disable_process})),Do("/",(()=>{this.store.args.process_short_name=!this.store.args.process_short_name})),Do("shift+D",(()=>{this.store.args.disable_containers=!this.store.args.disable_containers})),Do("b",(()=>{this.store.args.byte=!this.store.args.byte})),Do("shift+B",(()=>{this.store.args.diskio_iops=!this.store.args.diskio_iops})),Do("l",(()=>{this.store.args.disable_alert=!this.store.args.disable_alert})),Do("1",(()=>{this.store.args.percpu=!this.store.args.percpu})),Do("h",(()=>{this.store.args.help_tag=!this.store.args.help_tag})),Do("shift+T",(()=>{this.store.args.network_sum=!this.store.args.network_sum})),Do("shift+U",(()=>{this.store.args.network_cumul=!this.store.args.network_cumul})),Do("shift+F",(()=>{this.store.args.fs_free_space=!this.store.args.fs_free_space})),Do("3",(()=>{this.store.args.disable_quicklook=!this.store.args.disable_quicklook})),Do("6",(()=>{this.store.args.meangpu=!this.store.args.meangpu})),Do("shift+G",(()=>{this.store.args.disable_gpu=!this.store.args.disable_gpu})),Do("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})),Do("shift+I",(()=>{this.store.args.disable_ip=!this.store.args.disable_ip})),Do("shift+P",(()=>{this.store.args.disable_ports=!this.store.args.disable_ports})),Do("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;zo.init(t),this.setupHotKeys()},beforeUnmount(){Do.unbind()}};const vm=((...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,ec.Z)(bm,[["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-network"),w=cr("glances-plugin-wifi"),x=cr("glances-plugin-connections"),_=cr("glances-plugin-ports"),k=cr("glances-plugin-diskio"),S=cr("glances-plugin-fs"),C=cr("glances-plugin-irq"),T=cr("glances-plugin-smart"),A=cr("glances-plugin-folders"),E=cr("glances-plugin-raid"),O=cr("glances-plugin-sensors"),I=cr("glances-plugin-now"),P=cr("glances-plugin-containers"),N=cr("glances-plugin-process"),L=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"])])])]),wi("div",Ys,[s.args.disable_quicklook?Ti("v-if",!0):(li(),pi("div",eo,[xi(d,{data:s.data},null,8,["data"])])),s.args.disable_cpu||s.args.percpu?Ti("v-if",!0):(li(),pi("div",to,[xi(f,{data:s.data},null,8,["data"])])),!s.args.disable_cpu&&s.args.percpu?(li(),pi("div",no,[xi(p,{data:s.data},null,8,["data"])])):Ti("v-if",!0),!s.args.disable_gpu&&s.hasGpu?(li(),pi("div",ro,[xi(h,{data:s.data},null,8,["data"])])):Ti("v-if",!0),s.args.disable_mem?Ti("v-if",!0):(li(),pi("div",io,[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",so,[xi(m,{data:s.data},null,8,["data"])])),s.args.disable_memswap?Ti("v-if",!0):(li(),pi("div",oo,[xi(b,{data:s.data},null,8,["data"])])),s.args.disable_load?Ti("v-if",!0):(li(),pi("div",ao,[xi(v,{data:s.data},null,8,["data"])]))])]),wi("div",lo,[wi("div",co,[s.args.disable_left_sidebar?Ti("v-if",!0):(li(),pi("div",uo,[wi("div",fo,[s.args.disable_network?Ti("v-if",!0):(li(),hi(y,{key:0,id:"plugin-network",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_wifi?Ti("v-if",!0):(li(),hi(w,{key:1,id:"plugin-wifi",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.isLinux&&!s.args.disable_connections?(li(),hi(x,{key:2,id:"plugin-connections",class:"plugin table-row-group",data:s.data},null,8,["data"])):Ti("v-if",!0),s.args.disable_ports?Ti("v-if",!0):(li(),hi(_,{key:3,id:"plugin-ports",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_diskio?Ti("v-if",!0):(li(),hi(k,{key:4,id:"plugin-diskio",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_fs?Ti("v-if",!0):(li(),hi(S,{key:5,id:"plugin-fs",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_irq?Ti("v-if",!0):(li(),hi(C,{key:6,id:"plugin-irq",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_smart?Ti("v-if",!0):(li(),hi(T,{key:7,id:"plugin-smart",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_folders?Ti("v-if",!0):(li(),hi(A,{key:8,id:"plugin-folders",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.raid?Ti("v-if",!0):(li(),hi(E,{key:9,id:"plugin-raid",class:"plugin table-row-group",data:s.data},null,8,["data"])),s.args.disable_sensors?Ti("v-if",!0):(li(),hi(O,{key:10,id:"plugin-sensors",class:"plugin table-row-group",data:s.data},null,8,["data"])),xi(I,{id:"plugin-now",class:"plugin table-row-group",data:s.data},null,8,["data"])])])),wi("div",po,[s.args.disable_containers?Ti("v-if",!0):(li(),hi(P,{key:0,data:s.data},null,8,["data"])),xi(N,{data:s.data},null,8,["data"]),s.args.disable_alert?Ti("v-if",!0):(li(),hi(L,{key:1,data:s.data},null,8,["data"]))])])])])):(li(),pi("div",Us,Fs))}]]));vm.config.globalProperties.$filters=e,vm.mount("#app")})()})(); \ No newline at end of file diff --git a/glances/plugins/alert/__init__.py b/glances/plugins/alert/__init__.py index 0d3908a9..4d241ce4 100644 --- a/glances/plugins/alert/__init__.py +++ b/glances/plugins/alert/__init__.py @@ -19,6 +19,77 @@ from glances.thresholds import glances_thresholds # from glances.logger import logger from glances.plugins.plugin.model import GlancesPluginModel +# { +# "begin": "begin", +# "end": "end", +# "state": "WARNING|CRITICAL", +# "type": "CPU|LOAD|MEM", +# "max": MAX, +# "avg": AVG, +# "min": MIN, +# "sum": SUM, +# "count": COUNT, +# "top": [top3 process list], +# "desc": "Processes description", +# "sort": "top sort key" +# } +# Fields description +# description: human readable description +# short_name: shortname to use un UI +# unit: unit type +# rate: is it a rate ? If yes, // by time_since_update when displayed, +# min_symbol: Auto unit should be used if value > than 1 'X' (K, M, G)... +fields_description = { + 'begin': { + 'description': 'Begin timestamp of the event', + 'unit': 'timestamp', + }, + 'end': { + 'description': 'End timestamp of the event (or -1 if ongoing)', + 'unit': 'timestamp', + }, + 'state': { + 'description': 'State of the event (WARNING|CRITICAL)', + 'unit': 'string', + }, + 'type': { + 'description': 'Type of the event (CPU|LOAD|MEM)', + 'unit': 'string', + }, + 'max': { + 'description': 'Maximum value during the event period', + 'unit': 'float', + }, + 'avg': { + 'description': 'Average value during the event period', + 'unit': 'float', + }, + 'min': { + 'description': 'Minimum value during the event period', + 'unit': 'float', + }, + 'sum': { + 'description': 'Sum of the values during the event period', + 'unit': 'float', + }, + 'count': { + 'description': 'Number of values during the event period', + 'unit': 'int', + }, + 'top': { + 'description': 'Top 3 processes name during the event period', + 'unit': 'list', + }, + 'desc': { + 'description': 'Description of the event', + 'unit': 'string', + }, + 'sort': { + 'description': 'Sort key of the top processes', + 'unit': 'string', + }, +} + # Static decision tree for the global alert message # - msg: Message to be displayed (result of the decision tree) # - thresholds: a list of stats to take into account @@ -172,7 +243,11 @@ class PluginModel(GlancesPluginModel): def __init__(self, args=None, config=None): """Init the plugin.""" - super(PluginModel, self).__init__(args=args, config=config, stats_init_value=[]) + super(PluginModel, self).__init__( + args=args, config=config, + stats_init_value=[], + fields_description=fields_description + ) # We want to display the stat in the curse interface self.display_curse = True @@ -210,32 +285,35 @@ class PluginModel(GlancesPluginModel): # New line ret.append(self.curse_new_line()) # Start - msg = str(datetime.fromtimestamp(alert[0], tz=pytz.timezone(tzname[0] if tzname[0] else 'UTC'))) + msg = str(datetime.fromtimestamp(alert['begin'], + tz=pytz.timezone(tzname[0] if tzname[0] else 'UTC'))) ret.append(self.curse_add_line(msg)) # Duration - if alert[1] > 0: + if alert['end'] > 0: # If finished display duration - msg = ' ({})'.format(datetime.fromtimestamp(alert[1]) - datetime.fromtimestamp(alert[0])) + msg = ' ({})'.format(datetime.fromtimestamp(alert['end']) - datetime.fromtimestamp(alert['begin'])) else: msg = ' (ongoing)' ret.append(self.curse_add_line(msg)) ret.append(self.curse_add_line(" - ")) # Infos - if alert[1] > 0: + if alert['end'] > 0: # If finished do not display status - msg = '{} on {}'.format(alert[2], alert[3]) + msg = '{} on {}'.format(alert['state'], alert['type']) ret.append(self.curse_add_line(msg)) else: - msg = str(alert[3]) - ret.append(self.curse_add_line(msg, decoration=alert[2])) + msg = str(alert['type']) + ret.append(self.curse_add_line(msg, decoration=alert['state'])) # Min / Mean / Max - if self.approx_equal(alert[6], alert[4], tolerance=0.1): - msg = ' ({:.1f})'.format(alert[5]) + if self.approx_equal(alert['min'], alert['max'], tolerance=0.1): + msg = ' ({:.1f})'.format(alert['avg']) else: - msg = ' (Min:{:.1f} Mean:{:.1f} Max:{:.1f})'.format(alert[6], alert[5], alert[4]) + msg = ' (Min:{:.1f} Mean:{:.1f} Max:{:.1f})'.format(alert['min'], + alert['avg'], + alert['max']) ret.append(self.curse_add_line(msg)) # Top processes - top_process = ', '.join([p['name'] for p in alert[9]]) + top_process = ', '.join(alert['top']) if top_process != '': msg = ': {}'.format(top_process) ret.append(self.curse_add_line(msg)) diff --git a/glances/plugins/plugin/model.py b/glances/plugins/plugin/model.py index 66442594..cba16dac 100644 --- a/glances/plugins/plugin/model.py +++ b/glances/plugins/plugin/model.py @@ -415,12 +415,13 @@ class GlancesPluginModel(object): def get_raw_stats_value(self, item, value): """Return the stats object for a specific item=value. - Stats should be a list of dict (processlist, network...) + Return None if the item=value does not exist + Return None if the item is not a list of dict """ if not isinstance(self.stats, list): return None else: - if not isinstance(value, int) and value.isdigit(): + if (not isinstance(value, int) and not isinstance(value, float)) and value.isdigit(): value = int(value) try: return {value: [i for i in self.stats if i[item] == value]} diff --git a/unitest-restful.py b/unitest-restful.py index 8eb3e19b..08f7c27f 100755 --- a/unitest-restful.py +++ b/unitest-restful.py @@ -104,8 +104,10 @@ class TestGlances(unittest.TestCase): self.assertIsInstance(req.json(), text_type) elif p in ('fs', 'percpu', 'sensors', 'alert', 'processlist', 'diskio', 'hddtemp', 'batpercent', 'network', 'folders', 'amps', 'ports', - 'irq', 'wifi', 'gpu'): + 'irq', 'wifi', 'gpu', 'containers'): self.assertIsInstance(req.json(), list) + if len(req.json()) > 0: + self.assertIsInstance(req.json()[0], dict) else: self.assertIsInstance(req.json(), dict)