mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 08:48:13 +00:00
Show CPU brand in UI instead of arch. Resolves #110.
This commit is contained in:
@@ -11,6 +11,7 @@ import tempfile
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
import cpuinfo
|
||||
import psutil
|
||||
import yaml
|
||||
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_version": current_system_os_version(),
|
||||
"system_cpu": current_system_cpu(),
|
||||
"system_cpu_brand": cpuinfo.get_cpu_info()['brand_raw'],
|
||||
"cpu_percent": psutil.cpu_percent(percpu=False),
|
||||
"cpu_percent_per_cpu": psutil.cpu_percent(percpu=True),
|
||||
"cpu_count": psutil.cpu_count(logical=False),
|
||||
|
||||
@@ -7,6 +7,8 @@ import sys
|
||||
import threading
|
||||
from collections import deque
|
||||
|
||||
import cpuinfo
|
||||
|
||||
from api.api_server import API_VERSION
|
||||
from src.api.api_server import start_server
|
||||
from src.api.preview_manager import PreviewManager
|
||||
@@ -110,6 +112,7 @@ def run(server_only=False) -> int:
|
||||
# start zeroconf server
|
||||
ZeroconfServer.configure(f"_{APP_NAME.lower()}._tcp.local.", local_hostname, Config.port_number)
|
||||
ZeroconfServer.properties = {'system_cpu': current_system_cpu(),
|
||||
'system_cpu_brand': cpuinfo.get_cpu_info()['brand_raw'],
|
||||
'system_cpu_cores': multiprocessing.cpu_count(),
|
||||
'system_os': current_system_os(),
|
||||
'system_os_version': current_system_os_version(),
|
||||
|
||||
@@ -244,7 +244,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
# 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', '')}"
|
||||
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_cpu.setText(cpu_info)
|
||||
|
||||
Reference in New Issue
Block a user