mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-03 08:36:18 +00:00
Update AppImage
This commit is contained in:
@@ -201,7 +201,6 @@ export function ProxmoxDashboard() {
|
||||
<Server className="h-4 w-4 text-muted-foreground" />
|
||||
<div className="text-sm">
|
||||
<div className="font-medium text-foreground">{systemStatus.serverName}</div>
|
||||
<div className="text-xs text-muted-foreground">{systemStatus.nodeId}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -19,6 +19,9 @@ interface SystemData {
|
||||
node_id: string
|
||||
timestamp: string
|
||||
cpu_cores?: number
|
||||
proxmox_version?: string
|
||||
kernel_version?: string
|
||||
available_updates?: number
|
||||
}
|
||||
|
||||
interface VMData {
|
||||
@@ -376,10 +379,11 @@ export function SystemOverview() {
|
||||
<Area
|
||||
type="monotone"
|
||||
dataKey="value"
|
||||
stroke="#60a5fa"
|
||||
fill="#60a5fa"
|
||||
fillOpacity={0.3}
|
||||
stroke="#3b82f6"
|
||||
fill="#3b82f6"
|
||||
fillOpacity={0.4}
|
||||
name="CPU %"
|
||||
strokeWidth={2}
|
||||
/>
|
||||
</AreaChart>
|
||||
</ResponsiveContainer>
|
||||
@@ -419,19 +423,21 @@ export function SystemOverview() {
|
||||
type="monotone"
|
||||
dataKey="used"
|
||||
stackId="1"
|
||||
stroke="#60a5fa"
|
||||
fill="#60a5fa"
|
||||
stroke="#3b82f6"
|
||||
fill="#3b82f6"
|
||||
fillOpacity={0.6}
|
||||
name="Used Memory (GB)"
|
||||
strokeWidth={2}
|
||||
/>
|
||||
<Area
|
||||
type="monotone"
|
||||
dataKey="available"
|
||||
stackId="1"
|
||||
stroke="#34d399"
|
||||
fill="#34d399"
|
||||
stroke="#10b981"
|
||||
fill="#10b981"
|
||||
fillOpacity={0.6}
|
||||
name="Available Memory (GB)"
|
||||
strokeWidth={2}
|
||||
/>
|
||||
</AreaChart>
|
||||
</ResponsiveContainer>
|
||||
@@ -458,18 +464,22 @@ export function SystemOverview() {
|
||||
<span className="text-muted-foreground">Uptime:</span>
|
||||
<span className="text-foreground">{systemData.uptime}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Last Update:</span>
|
||||
<span className="text-foreground">{new Date(systemData.timestamp).toLocaleTimeString()}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Proxmox Version:</span>
|
||||
<span className="text-foreground">8.x</span>
|
||||
<span className="text-foreground">{systemData.proxmox_version || "N/A"}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Kernel:</span>
|
||||
<span className="text-foreground font-mono text-sm">Linux</span>
|
||||
<span className="text-foreground font-mono text-sm">{systemData.kernel_version || "Linux"}</span>
|
||||
</div>
|
||||
{systemData.available_updates !== undefined && systemData.available_updates > 0 && (
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Available Updates:</span>
|
||||
<Badge variant="outline" className="bg-yellow-500/10 text-yellow-500 border-yellow-500/20">
|
||||
{systemData.available_updates} packages
|
||||
</Badge>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
@@ -263,6 +263,37 @@ def get_system_info():
|
||||
hostname = socket.gethostname()
|
||||
node_id = f"pve-{hostname}"
|
||||
|
||||
proxmox_version = None
|
||||
try:
|
||||
result = subprocess.run(['pveversion'], capture_output=True, text=True, timeout=5)
|
||||
if result.returncode == 0:
|
||||
# Parse output like "pve-manager/9.0.6/..."
|
||||
version_line = result.stdout.strip().split('\n')[0]
|
||||
if '/' in version_line:
|
||||
proxmox_version = version_line.split('/')[1]
|
||||
except Exception as e:
|
||||
print(f"Note: pveversion not available: {e}")
|
||||
|
||||
kernel_version = None
|
||||
try:
|
||||
result = subprocess.run(['uname', '-r'], capture_output=True, text=True, timeout=5)
|
||||
if result.returncode == 0:
|
||||
kernel_version = result.stdout.strip()
|
||||
except Exception as e:
|
||||
print(f"Note: uname not available: {e}")
|
||||
|
||||
cpu_cores = psutil.cpu_count(logical=False) # Physical cores only
|
||||
|
||||
available_updates = 0
|
||||
try:
|
||||
result = subprocess.run(['apt', 'list', '--upgradable'], capture_output=True, text=True, timeout=10)
|
||||
if result.returncode == 0:
|
||||
# Count lines minus header
|
||||
lines = result.stdout.strip().split('\n')
|
||||
available_updates = max(0, len(lines) - 1)
|
||||
except Exception as e:
|
||||
print(f"Note: apt list not available: {e}")
|
||||
|
||||
# Try to get Proxmox node info if available
|
||||
try:
|
||||
result = subprocess.run(['pvesh', 'get', '/nodes', '--output-format', 'json'],
|
||||
@@ -275,7 +306,7 @@ def get_system_info():
|
||||
print(f"Note: pvesh not available or failed: {e}")
|
||||
pass # Use default if pvesh not available
|
||||
|
||||
return {
|
||||
response = {
|
||||
'cpu_usage': round(cpu_percent, 1),
|
||||
'memory_usage': round(memory.percent, 1),
|
||||
'memory_total': round(memory.total / (1024**3), 1), # GB
|
||||
@@ -285,8 +316,18 @@ def get_system_info():
|
||||
'load_average': list(load_avg),
|
||||
'hostname': hostname,
|
||||
'node_id': node_id,
|
||||
'timestamp': datetime.now().isoformat()
|
||||
'timestamp': datetime.now().isoformat(),
|
||||
'cpu_cores': cpu_cores
|
||||
}
|
||||
|
||||
if proxmox_version:
|
||||
response['proxmox_version'] = proxmox_version
|
||||
if kernel_version:
|
||||
response['kernel_version'] = kernel_version
|
||||
if available_updates > 0:
|
||||
response['available_updates'] = available_updates
|
||||
|
||||
return response
|
||||
except Exception as e:
|
||||
print(f"Critical error getting system info: {e}")
|
||||
return {
|
||||
|
Reference in New Issue
Block a user