mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-16 17:16:25 +00:00
Update AppImage
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
|||||||
Cpu,
|
Cpu,
|
||||||
MemoryStick,
|
MemoryStick,
|
||||||
Cpu as Gpu,
|
Cpu as Gpu,
|
||||||
Info,
|
|
||||||
} from "lucide-react"
|
} from "lucide-react"
|
||||||
import useSWR from "swr"
|
import useSWR from "swr"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
@@ -249,7 +248,7 @@ export default function Hardware() {
|
|||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-4 md:grid-cols-2">
|
<div className="grid gap-4 sm:grid-cols-2">
|
||||||
{hardwareData.gpus.map((gpu, index) => (
|
{hardwareData.gpus.map((gpu, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
@@ -267,9 +266,30 @@ export default function Hardware() {
|
|||||||
<span className="font-medium">{gpu.type}</span>
|
<span className="font-medium">{gpu.type}</span>
|
||||||
</div>
|
</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">
|
<div className="flex justify-between text-sm">
|
||||||
<span className="text-muted-foreground">Driver</span>
|
<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>
|
<span className="font-mono text-xs">{gpu.driver_version}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -320,11 +340,6 @@ export default function Hardware() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</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>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -357,6 +372,24 @@ export default function Hardware() {
|
|||||||
<span className="text-sm text-muted-foreground">PCI Slot</span>
|
<span className="text-sm text-muted-foreground">PCI Slot</span>
|
||||||
<span className="font-mono text-sm">{selectedGPU.slot}</span>
|
<span className="font-mono text-sm">{selectedGPU.slot}</span>
|
||||||
</div>
|
</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 && (
|
{selectedGPU.driver_version && (
|
||||||
<div className="flex justify-between border-b border-border/50 pb-2">
|
<div className="flex justify-between border-b border-border/50 pb-2">
|
||||||
<span className="text-sm text-muted-foreground">Driver Version</span>
|
<span className="text-sm text-muted-foreground">Driver Version</span>
|
||||||
|
|||||||
@@ -1665,6 +1665,22 @@ def get_detailed_gpu_info(gpu):
|
|||||||
|
|
||||||
return detailed_info
|
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():
|
def get_gpu_info():
|
||||||
"""Get GPU information from lspci and enrich with temperature/fan data from sensors"""
|
"""Get GPU information from lspci and enrich with temperature/fan data from sensors"""
|
||||||
gpus = []
|
gpus = []
|
||||||
@@ -1696,6 +1712,12 @@ def get_gpu_info():
|
|||||||
'type': 'Discrete' if vendor in ['NVIDIA', 'AMD'] else 'Integrated'
|
'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)
|
detailed_info = get_detailed_gpu_info(gpu)
|
||||||
gpu.update(detailed_info)
|
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")
|
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)
|
app.run(host='0.0.0.0', port=8008, debug=False)
|
||||||
|
, debug=False)
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ export interface GPU {
|
|||||||
name: string
|
name: string
|
||||||
vendor: string
|
vendor: string
|
||||||
type: string
|
type: string
|
||||||
|
pci_class?: string
|
||||||
|
pci_driver?: string
|
||||||
|
pci_kernel_module?: string
|
||||||
driver_version?: string
|
driver_version?: string
|
||||||
memory_total?: string
|
memory_total?: string
|
||||||
memory_used?: string
|
memory_used?: string
|
||||||
|
|||||||
Reference in New Issue
Block a user