mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-10 20:06:18 +00:00
Update AppImage
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
Cpu,
|
||||
MemoryStick,
|
||||
Cpu as Gpu,
|
||||
Info,
|
||||
} from "lucide-react"
|
||||
import useSWR from "swr"
|
||||
import { useState } from "react"
|
||||
@@ -249,7 +248,7 @@ export default function Hardware() {
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
{hardwareData.gpus.map((gpu, index) => (
|
||||
<div
|
||||
key={index}
|
||||
@@ -267,9 +266,30 @@ export default function Hardware() {
|
||||
<span className="font-medium">{gpu.type}</span>
|
||||
</div>
|
||||
|
||||
{gpu.driver_version && (
|
||||
{gpu.slot && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-muted-foreground">PCI Slot</span>
|
||||
<span className="font-mono text-xs">{gpu.slot}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{gpu.pci_driver && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-muted-foreground">Driver</span>
|
||||
<span className="font-mono text-xs text-green-500">{gpu.pci_driver}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{gpu.pci_kernel_module && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-muted-foreground">Kernel Module</span>
|
||||
<span className="font-mono text-xs">{gpu.pci_kernel_module}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{gpu.driver_version && (
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-muted-foreground">Driver Version</span>
|
||||
<span className="font-mono text-xs">{gpu.driver_version}</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -320,11 +340,6 @@ export default function Hardware() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="mt-3 flex items-center gap-1 text-xs text-muted-foreground">
|
||||
<Info className="h-3 w-3" />
|
||||
<span>Click for detailed information</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -357,6 +372,24 @@ export default function Hardware() {
|
||||
<span className="text-sm text-muted-foreground">PCI Slot</span>
|
||||
<span className="font-mono text-sm">{selectedGPU.slot}</span>
|
||||
</div>
|
||||
{selectedGPU.pci_class && (
|
||||
<div className="flex justify-between border-b border-border/50 pb-2">
|
||||
<span className="text-sm text-muted-foreground">Class</span>
|
||||
<span className="font-mono text-sm">{selectedGPU.pci_class}</span>
|
||||
</div>
|
||||
)}
|
||||
{selectedGPU.pci_driver && (
|
||||
<div className="flex justify-between border-b border-border/50 pb-2">
|
||||
<span className="text-sm text-muted-foreground">Driver</span>
|
||||
<span className="font-mono text-sm text-green-500">{selectedGPU.pci_driver}</span>
|
||||
</div>
|
||||
)}
|
||||
{selectedGPU.pci_kernel_module && (
|
||||
<div className="flex justify-between border-b border-border/50 pb-2">
|
||||
<span className="text-sm text-muted-foreground">Kernel Module</span>
|
||||
<span className="font-mono text-sm">{selectedGPU.pci_kernel_module}</span>
|
||||
</div>
|
||||
)}
|
||||
{selectedGPU.driver_version && (
|
||||
<div className="flex justify-between border-b border-border/50 pb-2">
|
||||
<span className="text-sm text-muted-foreground">Driver Version</span>
|
||||
|
@@ -807,7 +807,7 @@ def get_smart_data(disk_name):
|
||||
print(f"[v0] Extracted partial data from text output, continuing to next attempt...")
|
||||
else:
|
||||
print(f"[v0] No usable output (return code {result.returncode}), trying next command...")
|
||||
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
print(f"[v0] Command timeout for attempt {cmd_index + 1}, trying next...")
|
||||
continue
|
||||
@@ -1665,6 +1665,22 @@ def get_detailed_gpu_info(gpu):
|
||||
|
||||
return detailed_info
|
||||
|
||||
def get_pci_device_info(pci_slot):
|
||||
"""Get detailed PCI device information for a given slot"""
|
||||
pci_info = {}
|
||||
try:
|
||||
# Use lspci -vmm for detailed information
|
||||
result = subprocess.run(['lspci', '-vmm', '-s', pci_slot], capture_output=True, text=True, timeout=5)
|
||||
if result.returncode == 0:
|
||||
for line in result.stdout.split('\n'):
|
||||
line = line.strip()
|
||||
if ':' in line:
|
||||
key, value = line.split(':', 1)
|
||||
pci_info[key.strip().lower().replace(' ', '_')] = value.strip()
|
||||
except Exception as e:
|
||||
print(f"[v0] Error getting PCI device info for {pci_slot}: {e}")
|
||||
return pci_info
|
||||
|
||||
def get_gpu_info():
|
||||
"""Get GPU information from lspci and enrich with temperature/fan data from sensors"""
|
||||
gpus = []
|
||||
@@ -1696,6 +1712,12 @@ def get_gpu_info():
|
||||
'type': 'Discrete' if vendor in ['NVIDIA', 'AMD'] else 'Integrated'
|
||||
}
|
||||
|
||||
pci_info = get_pci_device_info(slot)
|
||||
if pci_info:
|
||||
gpu['pci_class'] = pci_info.get('class', '')
|
||||
gpu['pci_driver'] = pci_info.get('driver', '')
|
||||
gpu['pci_kernel_module'] = pci_info.get('kernel_module', '')
|
||||
|
||||
detailed_info = get_detailed_gpu_info(gpu)
|
||||
gpu.update(detailed_info)
|
||||
|
||||
@@ -2639,3 +2661,4 @@ if __name__ == '__main__':
|
||||
print("API endpoints available at: /api/system, /api/storage, /api/network, /api/vms, /api/logs, /api/health, /api/hardware")
|
||||
|
||||
app.run(host='0.0.0.0', port=8008, debug=False)
|
||||
, debug=False)
|
||||
|
@@ -89,6 +89,9 @@ export interface GPU {
|
||||
name: string
|
||||
vendor: string
|
||||
type: string
|
||||
pci_class?: string
|
||||
pci_driver?: string
|
||||
pci_kernel_module?: string
|
||||
driver_version?: string
|
||||
memory_total?: string
|
||||
memory_used?: string
|
||||
|
Reference in New Issue
Block a user