Skip to content

Commit 0225992

Browse files
fixed memory bar bug
1 parent 14b20a6 commit 0225992

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/static/js/color_bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ document.addEventListener('DOMContentLoaded', function () {
2424
// if max_attr is defined, use that to define the limits
2525
if (max_value) {
2626
const max = parseInt(card.getAttribute(max_attr), 10);
27-
27+
console.log("dataAttr: ", dataAttr, "max: ", max);
2828
if (isNaN(max)) {
2929
// console.warn(`Invalid max value for ${max_value}`);
3030
return;

src/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _get_system_info():
437437
"""
438438
boot_time = get_cached_value('boot_time', lambda: datetime.datetime.fromtimestamp(psutil.boot_time()))
439439
uptime_dict = get_cached_value('uptime', lambda: format_uptime(datetime.datetime.now() - boot_time))
440-
440+
memory_available = get_cached_value("memory_available", get_memory_available)
441441
# Gathering fresh system information
442442
battery_info = psutil.sensors_battery()
443443
memory_info = psutil.virtual_memory()
@@ -451,6 +451,7 @@ def _get_system_info():
451451
info = {
452452
'cpu_percent': cpu_usage_percent(),
453453
'memory_percent': round(memory_info.percent, 2),
454+
'memory_available': memory_available,
454455
'disk_percent': round(disk_info.percent, 2),
455456
'network_sent': network_sent,
456457
'battery_percent': round(battery_info.percent, 1) if battery_info else 0,

0 commit comments

Comments
 (0)