Show CPU brand in UI instead of arch. Resolves #110.

This commit is contained in:
Brett Williams
2025-02-28 19:54:58 -06:00
parent 562cb23da3
commit 7827f73530
3 changed files with 6 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import tempfile
import time import time
from datetime import datetime from datetime import datetime
import cpuinfo
import psutil import psutil
import yaml import yaml
from flask import Flask, request, send_file, after_this_request, Response, redirect, url_for from flask import Flask, request, send_file, after_this_request, Response, redirect, url_for
@@ -230,6 +231,7 @@ def status():
"system_os": current_system_os(), "system_os": current_system_os(),
"system_os_version": current_system_os_version(), "system_os_version": current_system_os_version(),
"system_cpu": current_system_cpu(), "system_cpu": current_system_cpu(),
"system_cpu_brand": cpuinfo.get_cpu_info()['brand_raw'],
"cpu_percent": psutil.cpu_percent(percpu=False), "cpu_percent": psutil.cpu_percent(percpu=False),
"cpu_percent_per_cpu": psutil.cpu_percent(percpu=True), "cpu_percent_per_cpu": psutil.cpu_percent(percpu=True),
"cpu_count": psutil.cpu_count(logical=False), "cpu_count": psutil.cpu_count(logical=False),

View File

@@ -7,6 +7,8 @@ import sys
import threading import threading
from collections import deque from collections import deque
import cpuinfo
from api.api_server import API_VERSION from api.api_server import API_VERSION
from src.api.api_server import start_server from src.api.api_server import start_server
from src.api.preview_manager import PreviewManager from src.api.preview_manager import PreviewManager
@@ -110,6 +112,7 @@ def run(server_only=False) -> int:
# start zeroconf server # start zeroconf server
ZeroconfServer.configure(f"_{APP_NAME.lower()}._tcp.local.", local_hostname, Config.port_number) ZeroconfServer.configure(f"_{APP_NAME.lower()}._tcp.local.", local_hostname, Config.port_number)
ZeroconfServer.properties = {'system_cpu': current_system_cpu(), ZeroconfServer.properties = {'system_cpu': current_system_cpu(),
'system_cpu_brand': cpuinfo.get_cpu_info()['brand_raw'],
'system_cpu_cores': multiprocessing.cpu_count(), 'system_cpu_cores': multiprocessing.cpu_count(),
'system_os': current_system_os(), 'system_os': current_system_os(),
'system_os_version': current_system_os_version(), 'system_os_version': current_system_os_version(),

View File

@@ -244,7 +244,7 @@ class MainWindow(QMainWindow):
# Use the get method with defaults to avoid KeyError # Use the get method with defaults to avoid KeyError
os_info = f"OS: {server_info.get('system_os', 'Unknown')} {server_info.get('system_os_version', '')}" os_info = f"OS: {server_info.get('system_os', 'Unknown')} {server_info.get('system_os_version', '')}"
cpu_info = f"CPU: {server_info.get('system_cpu', 'Unknown')} - {server_info.get('system_cpu_cores', 'Unknown')} cores" cpu_info = f"CPU: {server_info.get('system_cpu_brand', 'Unknown')} ({server_info.get('system_cpu_cores', 'Unknown')} cores)"
self.server_info_os.setText(os_info.strip()) self.server_info_os.setText(os_info.strip())
self.server_info_cpu.setText(cpu_info) self.server_info_cpu.setText(cpu_info)