system info fixes (#212)
This commit is contained in:
@ -1033,17 +1033,18 @@ def get_system_info():
|
|||||||
disk_used = round(psutil.disk_usage('/').used / 1024**3, 1)
|
disk_used = round(psutil.disk_usage('/').used / 1024**3, 1)
|
||||||
disk_free = round(psutil.disk_usage('/').free / 1024**3, 1)
|
disk_free = round(psutil.disk_usage('/').free / 1024**3, 1)
|
||||||
disk_used_percentage = round(psutil.disk_usage('/').percent, 1)
|
disk_used_percentage = round(psutil.disk_usage('/').percent, 1)
|
||||||
memory_total = round(psutil.virtual_memory().total / 1024**3, 1)
|
# memory_total = round(psutil.virtual_memory().total / 1024**3, 1)
|
||||||
memory_perc = round(psutil.virtual_memory().percent, 1)
|
# memory_perc = round(psutil.virtual_memory().percent, 1)
|
||||||
cpu_time_user = round(psutil.cpu_times().user,1)
|
# cpu_time_user = round(psutil.cpu_times().user,1)
|
||||||
cpu_time_system = round(psutil.cpu_times().system,1)
|
# cpu_time_system = round(psutil.cpu_times().system,1)
|
||||||
cpu_time_idle = round(psutil.cpu_times().idle,1)
|
# cpu_time_idle = round(psutil.cpu_times().idle,1)
|
||||||
network_sent = round(psutil.net_io_counters().bytes_sent / 1024**3, 6)
|
# network_sent = round(psutil.net_io_counters().bytes_sent / 1024**3, 6)
|
||||||
network_recv = round(psutil.net_io_counters().bytes_recv / 1024**3, 6)
|
# network_recv = round(psutil.net_io_counters().bytes_recv / 1024**3, 6)
|
||||||
return {"disk_space": {"total": disk_total, "used": disk_used, "free" : disk_free, "used_percentage" : disk_used_percentage},
|
return {"disk_space": {"total": disk_total, "used": disk_used, "free" : disk_free, "used_percentage" : disk_used_percentage},
|
||||||
"memory": {"total": memory_total, "used_percentage": memory_perc},
|
# "memory": {"total": memory_total, "used_percentage": memory_perc},
|
||||||
"cpu_time" : {"user": cpu_time_user, "system": cpu_time_system, "idle": cpu_time_idle},
|
# "cpu_time" : {"user": cpu_time_user, "system": cpu_time_system, "idle": cpu_time_idle},
|
||||||
"network": {"sent": network_sent, "received": network_recv}}
|
# "network": {"sent": network_sent, "received": network_recv}
|
||||||
|
}
|
||||||
|
|
||||||
# Thread function to insert data from the queue into the database
|
# Thread function to insert data from the queue into the database
|
||||||
def insert_queue2db():
|
def insert_queue2db():
|
||||||
|
|||||||
@ -136,18 +136,20 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="main" class="mainConteiner flex-container content">
|
<div id="main" class="mainConteiner flex-container content">
|
||||||
<div id="system-info" class="flex-items">
|
<div id="system-info" class="flex-items">
|
||||||
<label data-bs-toggle="collapse" data-bs-target="#disk-gauge-container" aria-expanded="true">
|
<label data-bs-toggle="collapse" data-bs-target="#system-info-inner" aria-expanded="true">
|
||||||
<h4>System Info </h4>
|
<h4>System Info </h4>
|
||||||
</label>
|
</label>
|
||||||
<div id="system-info-output"> </div>
|
<div id="system-info-inner" class="collapse">
|
||||||
<div id="graphical-output">
|
<div id="system-info-output"></div>
|
||||||
<div id="disk-gauge-container">
|
<div id="graphical-output">
|
||||||
<span id="title"> Disk Space: </span>
|
<div id="disk-gauge-container">
|
||||||
<span id="free-space">Free: -- GB</span> |
|
<span id="title"> Disk Space: </span>
|
||||||
<span id="total-space">Total: -- GB</span> |
|
<span id="free-space">Free: -- GB</span> |
|
||||||
<span id="used-percent">Used: -- %</span>
|
<span id="total-space">Total: -- GB</span> |
|
||||||
<div id="disk-gauge">
|
<span id="used-percent">Used: -- %</span>
|
||||||
<div id="disk-gauge-bar"></div>
|
<div id="disk-gauge">
|
||||||
|
<div id="disk-gauge-bar"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user