Revert a miss

This commit is contained in:
nicolargo 2022-11-03 15:33:03 +01:00
parent cd520655ef
commit 894e046adc
21 changed files with 207 additions and 174 deletions

View File

@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install pip install build tools
run: >-
@ -100,43 +100,43 @@ jobs:
tag: ${{ fromJson(needs.create_Docker_builds.outputs.tags) }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Retrieve Repository Docker metadata
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v2.5.0
uses: crazy-max/ghaction-docker-meta@v4.1.1
with:
images: ${{ env.DEFAULT_DOCKER_IMAGE }}
labels: |
org.opencontainers.image.url=https://nicolargo.github.io/glances/
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}-${{ matrix.tag.tag }}
restore-keys: ${{ runner.os }}-buildx-${{ env.NODE_ENV }}-${{ matrix.os }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
if: ${{ env.PUSH_BRANCH == 'true' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: ${{ env.PUSH_BRANCH == 'true' }}
tags: "${{ env.DEFAULT_DOCKER_IMAGE }}:${{ matrix.os != 'alpine' && format('{0}-', matrix.os) || '' }}${{ matrix.tag.tag }}"

View File

@ -39,7 +39,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

View File

@ -101,6 +101,9 @@ webui: venv-dev-upgrade ## Build the Web UI
webui-audit: venv-dev-upgrade ## Audit the Web UI
cd glances/outputs/static/ && npm audit
webui-audit-fix: venv-dev-upgrade ## Fix audit the Web UI
cd glances/outputs/static/ && npm audit fix && npm ci && npm run build
# ===================================================================
# Packaging
# ===================================================================

View File

@ -57,6 +57,18 @@ Glances is written in Python and uses libraries to grab information from
your system. It is based on an open architecture where developers can
add new plugins or exports modules.
Project sponsorship
===================
You can help me to achieve my goals of improving this open-source project
or just say "thank you" by:
- sponsor me using one-time or monthly tier Github sponsors_ page
- send me some pieces of bitcoin: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X
- buy me a gift on my wishlist_ page
Any and all contributions are greatly appreciated.
Requirements
============
@ -437,15 +449,6 @@ There is also a chat dedicated to the Glances developers:
.. image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/nicolargo/glances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
Donation
========
If you like this open-source project, you can become a sponsor.
See the Github sponsors_ page (one-time or monthly tier available).
Or send me some bitcoins: 185KN9FCix3svJYp7JQM7hRMfSKyeaJR4X
Author
======
@ -468,5 +471,6 @@ Glances is distributed under the LGPL version 3 license. See ``COPYING`` for mor
.. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F
.. _package: https://repology.org/metapackage/glances/packages
.. _sponsors: https://github.com/sponsors/nicolargo
.. _wishlist: https://www.amazon.fr/hz/wishlist/ls/BWAAQKWFR3FI?ref_=wl_share
.. _issue2021: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157
.. _issue2021comment: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157

View File

@ -74,7 +74,7 @@ Get plugin stats::
"refresh": 3.0,
"regex": True,
"result": None,
"timer": 0.8577334880828857},
"timer": 0.82912278175354},
{"count": 0,
"countmax": 20.0,
"countmin": None,
@ -83,7 +83,7 @@ Get plugin stats::
"refresh": 3.0,
"regex": True,
"result": None,
"timer": 0.8575551509857178}]
"timer": 0.8289539813995361}]
Get a specific field::
@ -101,7 +101,7 @@ Get a specific item when field matchs the given value::
"refresh": 3.0,
"regex": True,
"result": None,
"timer": 0.8577334880828857}]}
"timer": 0.82912278175354}]}
GET core
--------
@ -131,19 +131,19 @@ Get plugin stats::
"ctx_switches": 0,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 56.6,
"idle": 60.1,
"interrupts": 0,
"iowait": 0.2,
"iowait": 0.0,
"irq": 0.0,
"nice": 0.0,
"soft_interrupts": 0,
"softirq": 0.0,
"softirq": 0.2,
"steal": 0.0,
"syscalls": 0,
"system": 6.9,
"system": 5.3,
"time_since_update": 1,
"total": 44.6,
"user": 36.3}
"total": 40.6,
"user": 34.4}
Fields descriptions:
@ -166,7 +166,7 @@ Fields descriptions:
Get a specific field::
# curl http://localhost:61208/api/3/cpu/total
{"total": 44.6}
{"total": 40.6}
GET diskio
----------
@ -232,13 +232,13 @@ Get plugin stats::
# curl http://localhost:61208/api/3/fs
[{"device_name": "/dev/mapper/ubuntu--gnome--vg-root",
"free": 64636698624,
"free": 64636235776,
"fs_type": "ext4",
"key": "mnt_point",
"mnt_point": "/",
"percent": 72.0,
"size": 243334156288,
"used": 166310002688},
"used": 166310465536},
{"device_name": "zsfpool",
"free": 41811968,
"fs_type": "zfs",
@ -257,13 +257,13 @@ Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/fs/mnt_point//
{"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root",
"free": 64636698624,
"free": 64636235776,
"fs_type": "ext4",
"key": "mnt_point",
"mnt_point": "/",
"percent": 72.0,
"size": 243334156288,
"used": 166310002688}]}
"used": 166310465536}]}
GET ip
------
@ -289,7 +289,7 @@ GET load
Get plugin stats::
# curl http://localhost:61208/api/3/load
{"cpucore": 4, "min1": 2.04541015625, "min15": 1.93603515625, "min5": 2.21875}
{"cpucore": 4, "min1": 1.79931640625, "min15": 1.958984375, "min5": 2.16015625}
Fields descriptions:
@ -301,7 +301,7 @@ Fields descriptions:
Get a specific field::
# curl http://localhost:61208/api/3/load/min1
{"min1": 2.04541015625}
{"min1": 1.79931640625}
GET mem
-------
@ -309,16 +309,16 @@ GET mem
Get plugin stats::
# curl http://localhost:61208/api/3/mem
{"active": 2864410624,
"available": 2522054656,
"buffers": 289193984,
"cached": 3059560448,
"free": 2522054656,
"inactive": 3469127680,
"percent": 67.8,
"shared": 689233920,
{"active": 2861182976,
"available": 2539823104,
"buffers": 288755712,
"cached": 3050266624,
"free": 2539823104,
"inactive": 3463237632,
"percent": 67.6,
"shared": 680669184,
"total": 7836188672,
"used": 5314134016}
"used": 5296365568}
Fields descriptions:
@ -345,13 +345,13 @@ GET memswap
Get plugin stats::
# curl http://localhost:61208/api/3/memswap
{"free": 4256505856,
{"free": 4256415744,
"percent": 47.3,
"sin": 2737213440,
"sout": 8771731456,
"sin": 2738352128,
"sout": 8773423104,
"time_since_update": 1,
"total": 8082419712,
"used": 3825913856}
"used": 3826003968}
Fields descriptions:
@ -375,29 +375,29 @@ Get plugin stats::
# curl http://localhost:61208/api/3/network
[{"alias": None,
"cumulative_cx": 449461276,
"cumulative_rx": 224730638,
"cumulative_tx": 224730638,
"cx": 6686,
"cumulative_cx": 449777162,
"cumulative_rx": 224888581,
"cumulative_tx": 224888581,
"cx": 5508,
"interface_name": "lo",
"is_up": True,
"key": "interface_name",
"rx": 3343,
"rx": 2754,
"speed": 0,
"time_since_update": 1,
"tx": 3343},
"tx": 2754},
{"alias": None,
"cumulative_cx": 10025928817,
"cumulative_rx": 9388587487,
"cumulative_tx": 637341330,
"cx": 27382,
"cumulative_cx": 10026810126,
"cumulative_rx": 9389174147,
"cumulative_tx": 637635979,
"cx": 25944,
"interface_name": "wlp2s0",
"is_up": True,
"key": "interface_name",
"rx": 20981,
"rx": 19839,
"speed": 0,
"time_since_update": 1,
"tx": 6401}]
"tx": 6105}]
Fields descriptions:
@ -427,17 +427,17 @@ Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/network/interface_name/lo
{"lo": [{"alias": None,
"cumulative_cx": 449461276,
"cumulative_rx": 224730638,
"cumulative_tx": 224730638,
"cx": 6686,
"cumulative_cx": 449777162,
"cumulative_rx": 224888581,
"cumulative_tx": 224888581,
"cx": 5508,
"interface_name": "lo",
"is_up": True,
"key": "interface_name",
"rx": 3343,
"rx": 2754,
"speed": 0,
"time_since_update": 1,
"tx": 3343}]}
"tx": 2754}]}
GET now
-------
@ -445,7 +445,7 @@ GET now
Get plugin stats::
# curl http://localhost:61208/api/3/now
"2022-11-03 15:28:12 CET"
"2022-11-03 15:30:23 CET"
GET percpu
----------
@ -456,29 +456,29 @@ Get plugin stats::
[{"cpu_number": 0,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 37.0,
"idle": 59.2,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.5,
"total": 63.0,
"user": 56.5},
"system": 4.9,
"total": 40.8,
"user": 35.9},
{"cpu_number": 1,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 64.5,
"idle": 82.0,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.5,
"total": 35.5,
"user": 29.0}]
"system": 5.0,
"total": 18.0,
"user": 13.0}]
Get a specific field::
@ -497,7 +497,7 @@ Get plugin stats::
"port": 0,
"refresh": 30,
"rtt_warning": None,
"status": 0.00666,
"status": 0.005885,
"timeout": 3}]
Get a specific field::
@ -514,7 +514,7 @@ Get a specific item when field matchs the given value::
"port": 0,
"refresh": 30,
"rtt_warning": None,
"status": 0.00666,
"status": 0.005885,
"timeout": 3}]}
GET processcount
@ -523,12 +523,12 @@ GET processcount
Get plugin stats::
# curl http://localhost:61208/api/3/processcount
{"pid_max": 0, "running": 1, "sleeping": 326, "thread": 1659, "total": 391}
{"pid_max": 0, "running": 1, "sleeping": 326, "thread": 1654, "total": 389}
Get a specific field::
# curl http://localhost:61208/api/3/processcount/total
{"total": 391}
{"total": 389}
GET processlist
---------------
@ -538,15 +538,15 @@ Get plugin stats::
# curl http://localhost:61208/api/3/processlist
[{"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"],
"cpu_percent": 0.0,
"cpu_times": pcputimes(user=8263.22, system=2791.59, children_user=7778.17, children_system=1384.45, iowait=0.0),
"cpu_times": pcputimes(user=8265.26, system=2792.3, children_user=7778.43, children_system=1384.62, iowait=0.0),
"gids": pgids(real=1000, effective=1000, saved=1000),
"io_counters": [4759993344, 9646694400, 0, 0, 0],
"io_counters": [4759993344, 9648111616, 0, 0, 0],
"key": "pid",
"memory_info": pmem(rss=457252864, vms=13290209280, shared=124047360, text=634880, lib=0, data=1298206720, dirty=0),
"memory_percent": 5.835143628353924,
"memory_info": pmem(rss=462217216, vms=13290643456, shared=124010496, text=634880, lib=0, data=1298190336, dirty=0),
"memory_percent": 5.898495242356513,
"name": "firefox",
"nice": 0,
"num_threads": 151,
"num_threads": 150,
"pid": 252940,
"status": "S",
"time_since_update": 1,
@ -571,12 +571,12 @@ Get plugin stats::
"true",
"tab"],
"cpu_percent": 0.0,
"cpu_times": pcputimes(user=1478.27, system=286.18, children_user=0.0, children_system=0.0, iowait=0.0),
"cpu_times": pcputimes(user=1479.73, system=286.38, children_user=0.0, children_system=0.0, iowait=0.0),
"gids": pgids(real=1000, effective=1000, saved=1000),
"io_counters": [201466880, 0, 0, 0, 0],
"key": "pid",
"memory_info": pmem(rss=449581056, vms=3538014208, shared=79355904, text=634880, lib=0, data=936325120, dirty=0),
"memory_percent": 5.737241340377977,
"memory_info": pmem(rss=448593920, vms=3538014208, shared=79355904, text=634880, lib=0, data=936325120, dirty=0),
"memory_percent": 5.724644196009476,
"name": "WebExtensions",
"nice": 0,
"num_threads": 20,
@ -592,8 +592,8 @@ Get a specific field::
253132,
3549,
590528,
253182,
590488,
253182,
479037,
479255,
604831,
@ -604,11 +604,11 @@ Get a specific field::
253147,
51440,
478972,
605269,
601048,
479089,
605726,
601048,
605889,
606596,
606103,
450641,
602074,
@ -618,7 +618,7 @@ Get a specific field::
482393,
590512,
3499,
606244,
606696,
603305,
546430,
4055,
@ -635,8 +635,8 @@ Get a specific field::
253654,
557500,
521757,
16698,
479015,
16698,
450239,
521726,
255947,
@ -649,11 +649,11 @@ Get a specific field::
3364,
521696,
4977,
450957,
3744,
1369,
3743,
17566,
450957,
17373,
4062,
17754,
@ -677,8 +677,8 @@ Get a specific field::
603476,
3528,
107499,
492260,
4087,
492260,
3663,
544139,
1945,
@ -775,8 +775,8 @@ Get a specific field::
450933,
1470,
2920,
606201,
3953,
606671,
17516,
2406,
181215,
@ -789,8 +789,8 @@ Get a specific field::
181225,
1353,
478979,
606695,
181228,
606243,
2208,
3733,
4187,
@ -964,9 +964,6 @@ Get a specific field::
557455,
599164,
599474,
600213,
600792,
600828,
600991,
600996,
601072,
@ -978,28 +975,29 @@ Get a specific field::
605094,
605572,
605573,
605888]}
605888,
606456]}
Get a specific item when field matchs the given value::
# curl http://localhost:61208/api/3/processlist/pid/252940
{"252940": [{"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"],
"cpu_percent": 0.0,
"cpu_times": [8263.22, 2791.59, 7778.17, 1384.45, 0.0],
"cpu_times": [8265.26, 2792.3, 7778.43, 1384.62, 0.0],
"gids": [1000, 1000, 1000],
"io_counters": [4759993344, 9646694400, 0, 0, 0],
"io_counters": [4759993344, 9648111616, 0, 0, 0],
"key": "pid",
"memory_info": [457252864,
13290209280,
124047360,
"memory_info": [462217216,
13290643456,
124010496,
634880,
0,
1298206720,
1298190336,
0],
"memory_percent": 5.835143628353924,
"memory_percent": 5.898495242356513,
"name": "firefox",
"nice": 0,
"num_threads": 151,
"num_threads": 150,
"pid": 252940,
"status": "S",
"time_since_update": 1,
@ -1019,69 +1017,69 @@ GET quicklook
Get plugin stats::
# curl http://localhost:61208/api/3/quicklook
{"cpu": 44.6,
{"cpu": 40.6,
"cpu_hz": 1700000000.0,
"cpu_hz_current": 1472035750.0,
"cpu_hz_current": 1248027000.0,
"cpu_name": "Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz",
"mem": 67.8,
"mem": 67.6,
"percpu": [{"cpu_number": 0,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 37.0,
"idle": 59.2,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.5,
"total": 63.0,
"user": 56.5},
"system": 4.9,
"total": 40.8,
"user": 35.9},
{"cpu_number": 1,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 64.5,
"idle": 82.0,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.5,
"total": 35.5,
"user": 29.0},
"system": 5.0,
"total": 18.0,
"user": 13.0},
{"cpu_number": 2,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 74.0,
"idle": 64.0,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 6.7,
"total": 26.0,
"user": 19.2},
"system": 5.0,
"total": 36.0,
"user": 31.0},
{"cpu_number": 3,
"guest": 0.0,
"guest_nice": 0.0,
"idle": 47.6,
"idle": 34.3,
"iowait": 0.0,
"irq": 0.0,
"key": "cpu_number",
"nice": 0.0,
"softirq": 0.0,
"steal": 0.0,
"system": 2.9,
"total": 52.4,
"user": 49.5}],
"system": 1.0,
"total": 65.7,
"user": 64.7}],
"swap": 47.3}
Get a specific field::
# curl http://localhost:61208/api/3/quicklook/cpu
{"cpu": 44.6}
{"cpu": 40.6}
GET sensors
-----------
@ -1152,7 +1150,7 @@ GET uptime
Get plugin stats::
# curl http://localhost:61208/api/3/uptime
{"seconds": 1662393}
{"seconds": 1662524}
GET all stats
-------------
@ -1168,33 +1166,33 @@ GET stats history
History of a plugin::
# curl http://localhost:61208/api/3/cpu/history
{"system": [["2022-11-03T15:28:13.350934", 6.9],
["2022-11-03T15:28:14.423145", 6.9],
["2022-11-03T15:28:15.646191", 4.0]],
"user": [["2022-11-03T15:28:13.350910", 36.3],
["2022-11-03T15:28:14.423138", 36.3],
["2022-11-03T15:28:15.646180", 11.4]]}
{"system": [["2022-11-03T15:30:24.540635", 5.3],
["2022-11-03T15:30:25.618359", 5.3],
["2022-11-03T15:30:26.877869", 4.3]],
"user": [["2022-11-03T15:30:24.540625", 34.4],
["2022-11-03T15:30:25.618348", 34.4],
["2022-11-03T15:30:26.877858", 13.3]]}
Limit history to last 2 values::
# curl http://localhost:61208/api/3/cpu/history/2
{"system": [["2022-11-03T15:28:14.423145", 6.9],
["2022-11-03T15:28:15.646191", 4.0]],
"user": [["2022-11-03T15:28:14.423138", 36.3],
["2022-11-03T15:28:15.646180", 11.4]]}
{"system": [["2022-11-03T15:30:25.618359", 5.3],
["2022-11-03T15:30:26.877869", 4.3]],
"user": [["2022-11-03T15:30:25.618348", 34.4],
["2022-11-03T15:30:26.877858", 13.3]]}
History for a specific field::
# curl http://localhost:61208/api/3/cpu/system/history
{"system": [["2022-11-03T15:28:13.350934", 6.9],
["2022-11-03T15:28:14.423145", 6.9],
["2022-11-03T15:28:15.646191", 4.0]]}
{"system": [["2022-11-03T15:30:24.540635", 5.3],
["2022-11-03T15:30:25.618359", 5.3],
["2022-11-03T15:30:26.877869", 4.3]]}
Limit history for a specific field to last 2 values::
# curl http://localhost:61208/api/3/cpu/system/history
{"system": [["2022-11-03T15:28:14.423145", 6.9],
["2022-11-03T15:28:15.646191", 4.0]]}
{"system": [["2022-11-03T15:30:25.618359", 5.3],
["2022-11-03T15:30:26.877869", 4.3]]}
GET limits (used for thresholds)
--------------------------------

View File

@ -24,8 +24,10 @@ from datetime import datetime
# Insert Glances' path into the system.
sys.path.insert(0, os.path.abspath('..'))
# WARNING: Do not move this import before the sys.path.insert() call.
from glances import __version__
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.

View File

@ -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" "Nov 03, 2022" "3.3.0.4" "Glances"
.TH "GLANCES" "1" "Nov 03, 2022" "3.3.1_beta1" "Glances"
.SH NAME
glances \- An eye on your system
.SH SYNOPSIS

View File

@ -19,7 +19,7 @@ import sys
# Global name
# Version should start and end with a numerical char
# See https://packaging.python.org/specifications/core-metadata/#version
__version__ = '3.3.0.4'
__version__ = '3.3.1_beta1'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPLv3'

View File

@ -186,6 +186,9 @@ class GlancesAutoDiscoverClient(object):
# Issue #528 (no network interface available)
pass
# Ensure zeroconf_bind_address is an IP address not an host
zeroconf_bind_address = socket.gethostbyname(zeroconf_bind_address)
# Check IP v4/v6
address_family = socket.getaddrinfo(zeroconf_bind_address, args.port)[0][0]

View File

@ -127,8 +127,7 @@ class GlancesBottle(object):
if username == self.args.username:
from glances.password import GlancesPassword
pwd = GlancesPassword(username=username,
config=self.config)
pwd = GlancesPassword(username=username, config=self.config)
return pwd.check_password(self.args.password, pwd.sha256_hash(password))
else:
return False

View File

@ -5,12 +5,15 @@
<span>{{ running }} run,</span>
<span>{{ sleeping }} slp,</span>
<span>{{ stopped }} oth</span>
<span>{{ args.programs ? 'Programs' : 'Threads' }}</span>
<span class="title">{{ sorter.auto ? 'sorted automatically' : 'sorted' }}</span>
<span>by {{ sorter.getColumnLabel(sorter.column) }}</span>
</section>
</template>
<script>
import { store } from '../store.js';
export default {
props: {
data: {
@ -20,7 +23,15 @@ export default {
type: Object
}
},
data() {
return {
store
};
},
computed: {
args() {
return this.store.args || {};
},
stats() {
return this.data.stats['processcount'];
},

View File

@ -4,6 +4,7 @@
"requires": true,
"packages": {
"": {
"name": "static",
"dependencies": {
"bootstrap": "^3.4.1",
"favico.js": "^0.3.10",
@ -4899,9 +4900,9 @@
"dev": true
},
"node_modules/minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
"integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
"dev": true,
"dependencies": {
"brace-expansion": "^1.1.7"
@ -12158,9 +12159,9 @@
"dev": true
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
"integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"

File diff suppressed because one or more lines are too long

View File

@ -41,9 +41,7 @@ class GlancesPassword(object):
if self.config is None:
return user_config_dir()
else:
return self.config.get_value('passwords',
'local_password_path',
default=user_config_dir())
return self.config.get_value('passwords', 'local_password_path', default=user_config_dir())
def sha256_hash(self, plain_password):
"""Return the SHA-256 of the given password."""

View File

@ -14,7 +14,6 @@ Just a stupid plugin to display the help screen.
"""
import sys
from glances.compat import iteritems
from collections import OrderedDict
from glances import __version__, psutil_version
from glances.plugins.glances_plugin import GlancesPlugin
from itertools import chain
@ -63,7 +62,7 @@ class Plugin(GlancesPlugin):
self.view_data.update(
[
## First column
# First column
#
('header_sort', msg_header.format('SORT PROCESSES:')),
('sort_auto', msg_col.format('a', 'Automatically')),
@ -91,7 +90,7 @@ class Plugin(GlancesPlugin):
('show_hide_wifi_module', msg_col.format('W', 'Wifi')),
('show_hide_processes', msg_col.format('z', 'Processes')),
('show_hide_left_sidebar', msg_col.format('2', 'Left sidebar')),
## Second column
# Second column
#
('show_hide_quick_look', msg_col.format('3', 'Quick Look')),
('show_hide_cpu_mem_swap', msg_col.format('4', 'CPU, MEM, and SWAP')),
@ -146,7 +145,7 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_new_line())
## key-shortcuts
# key-shortcuts
#
# Collect all values after the 1st key-msg
# in a list of curse-lines.

View File

@ -67,7 +67,7 @@ class GlancesXMLRPCHandler(SimpleXMLRPCRequestHandler, object):
if username in self.server.user_dict:
from glances.password import GlancesPassword
pwd = GlancesPassword()
pwd = GlancesPassword(username=username, config=self.config)
return pwd.check_password(self.server.user_dict[username], password)
else:
return False
@ -93,10 +93,11 @@ class GlancesXMLRPCServer(SimpleXMLRPCServer, object):
finished = False
def __init__(self, bind_address, bind_port=61209, requestHandler=GlancesXMLRPCHandler):
def __init__(self, bind_address, bind_port=61209, requestHandler=GlancesXMLRPCHandler, config=None):
self.bind_address = bind_address
self.bind_port = bind_port
self.config = config
try:
self.address_family = socket.getaddrinfo(bind_address, bind_port)[0][0]
except socket.error as e:
@ -191,7 +192,7 @@ class GlancesServer(object):
# Init the XML RPC server
try:
self.server = GlancesXMLRPCServer(args.bind_address, args.port, requestHandler)
self.server = GlancesXMLRPCServer(args.bind_address, args.port, requestHandler, config=config)
except Exception as e:
logger.critical("Cannot start Glances server: {}".format(e))
sys.exit(2)
@ -211,6 +212,7 @@ class GlancesServer(object):
if not self.args.disable_autodiscover:
# Note: The Zeroconf service name will be based on the hostname
# Correct issue: Zeroconf problem with zeroconf service name #889
logger.info('Autodiscover is enabled with service name {}'.format(socket.gethostname().split('.', 1)[0]))
self.autodiscover_client = GlancesAutoDiscoverClient(socket.gethostname().split('.', 1)[0], args)
else:
logger.info("Glances autodiscover announce is disabled")

View File

@ -11,8 +11,8 @@ docker>=2.0.0
elasticsearch
graphitesender
hddtemp
influxdb>=1.0.0
influxdb-client; python_version >= "3.6"
influxdb>=1.0.0 # For InfluxDB < 1.8
influxdb-client; python_version >= "3.7" # For InfluxDB >= 1.8
kafka-python
netifaces
py3nvml; python_version >= "3.0"
@ -32,5 +32,5 @@ six
sparklines
statsd
wifi
zeroconf==0.19.1; python_version < "3.0"
zeroconf; python_version >= "3.0"
zeroconf==0.19.1; python_version < "3.7"
zeroconf; python_version >= "3.7"

View File

@ -13,7 +13,7 @@ confinement: strict
apps:
glances:
command: glances-launch $SNAP/bin/glances
command: bin/glances-launch $SNAP/bin/glances
plugs:
- network
- system-observe
@ -63,6 +63,7 @@ parts:
cp -r $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/bottle-dist
organize:
bottle-dist: bottle/dist
docker:
plugin: python
source: https://github.com/docker/docker-py.git
@ -73,11 +74,13 @@ parts:
cp -r $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/docker-dist
organize:
bottle-dist: docker/dist
launchers:
source: snap/local/launchers
plugin: dump
organize:
'*': bin/
selective-checkout:
plugin: nil
build-packages:

View File

@ -15,6 +15,7 @@ import subprocess
import time
import numbers
import unittest
import os
from glances import __version__
from glances.compat import text_type
@ -54,7 +55,11 @@ class TestGlances(unittest.TestCase):
global pid
print('INFO: [TEST_000] Start the Glances Web Server')
cmdline = "python -m glances -B localhost -w -p %s" % SERVER_PORT
if os.path.isfile("./venv/bin/python"):
cmdline = "./venv/bin/python"
else:
cmdline = "python"
cmdline += " -m glances -B localhost -w -p %s" % SERVER_PORT
print("Run the Glances Web Server on port %s" % SERVER_PORT)
args = shlex.split(cmdline)
pid = subprocess.Popen(args)

View File

@ -15,6 +15,7 @@ import shlex
import subprocess
import time
import unittest
import os
from glances import __version__
from glances.compat import ServerProxy
@ -43,7 +44,11 @@ class TestGlances(unittest.TestCase):
global pid
print('INFO: [TEST_000] Start the Glances Web Server')
cmdline = "python -m glances -B localhost -s -p %s" % SERVER_PORT
if os.path.isfile("./venv/bin/python"):
cmdline = "./venv/bin/python"
else:
cmdline = "python"
cmdline += " -m glances -B localhost -s -p %s" % SERVER_PORT
print("Run the Glances Server on port %s" % SERVER_PORT)
args = shlex.split(cmdline)
pid = subprocess.Popen(args)