mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update AppImage
This commit is contained in:
@@ -179,70 +179,22 @@ const getModalProgressColor = (percent: number): string => {
|
||||
}
|
||||
|
||||
const getOSIcon = (osInfo: VMDetails["os_info"] | undefined, vmType: string): React.ReactNode => {
|
||||
// Only show logo for LXCs, VMs show nothing
|
||||
if (vmType !== "lxc") {
|
||||
return null
|
||||
}
|
||||
|
||||
const osId = osInfo?.id?.toLowerCase()
|
||||
|
||||
// Try to use SVG icons for common distributions
|
||||
switch (osId) {
|
||||
case "debian":
|
||||
return (
|
||||
<img
|
||||
src="/icons/debian.svg"
|
||||
alt="Debian"
|
||||
className="h-16 w-16"
|
||||
onError={(e) => {
|
||||
// fallback to Container icon if SVG doesn't exist
|
||||
e.currentTarget.style.display = "none"
|
||||
e.currentTarget.parentElement!.innerHTML =
|
||||
'<div class="flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" class="text-cyan-500"><path d="M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"/><path d="M10 21.9V14L2.1 9.1"/><path d="m10 14 11.9-6.9"/><path d="M14 19.8v-8.1"/><path d="M18 17.5V9.4"/></svg></div>'
|
||||
}}
|
||||
/>
|
||||
)
|
||||
return <img src="/icons/debian.svg" alt="Debian" className="h-16 w-16" />
|
||||
case "ubuntu":
|
||||
return (
|
||||
<img
|
||||
src="/icons/ubuntu.svg"
|
||||
alt="Ubuntu"
|
||||
className="h-16 w-16"
|
||||
onError={(e) => {
|
||||
e.currentTarget.style.display = "none"
|
||||
e.currentTarget.parentElement!.innerHTML =
|
||||
'<div class="flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" class="text-orange-500"><path d="M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"/><path d="M10 21.9V14L2.1 9.1"/><path d="m10 14 11.9-6.9"/><path d="M14 19.8v-8.1"/><path d="M18 17.5V9.4"/></svg></div>'
|
||||
}}
|
||||
/>
|
||||
)
|
||||
return <img src="/icons/ubuntu.svg" alt="Ubuntu" className="h-16 w-16" />
|
||||
case "alpine":
|
||||
return (
|
||||
<img
|
||||
src="/icons/alpine.svg"
|
||||
alt="Alpine"
|
||||
className="h-16 w-16"
|
||||
onError={(e) => {
|
||||
e.currentTarget.style.display = "none"
|
||||
e.currentTarget.parentElement!.innerHTML =
|
||||
'<div class="flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" class="text-blue-400"><path d="M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"/><path d="M10 21.9V14L2.1 9.1"/><path d="m10 14 11.9-6.9"/><path d="M14 19.8v-8.1"/><path d="M18 17.5V9.4"/></svg></div>'
|
||||
}}
|
||||
/>
|
||||
)
|
||||
return <img src="/icons/alpine.svg" alt="Alpine" className="h-16 w-16" />
|
||||
case "arch":
|
||||
return (
|
||||
<img
|
||||
src="/icons/arch.svg"
|
||||
alt="Arch"
|
||||
className="h-16 w-16"
|
||||
onError={(e) => {
|
||||
e.currentTarget.style.display = "none"
|
||||
e.currentTarget.parentElement!.innerHTML =
|
||||
'<div class="flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" class="text-blue-500"><path d="M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"/><path d="M10 21.9V14L2.1 9.1"/><path d="m10 14 11.9-6.9"/><path d="M14 19.8v-8.1"/><path d="M18 17.5V9.4"/></svg></div>'
|
||||
}}
|
||||
/>
|
||||
)
|
||||
return <img src="/icons/arch.svg" alt="Arch" className="h-16 w-16" />
|
||||
default:
|
||||
// Generic LXC container icon
|
||||
return <Container className="h-16 w-16 text-cyan-500" />
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4834,7 +4834,6 @@ def api_vm_details(vmid):
|
||||
os_info = {}
|
||||
if vm_type == 'lxc' and resource.get('status') == 'running':
|
||||
try:
|
||||
print(f"[v0] Reading /etc/os-release for LXC {vmid}...")
|
||||
os_release_result = subprocess.run(
|
||||
['pct', 'exec', str(vmid), '--', 'cat', '/etc/os-release'],
|
||||
capture_output=True, text=True, timeout=5)
|
||||
@@ -4851,12 +4850,8 @@ def api_vm_details(vmid):
|
||||
os_info['name'] = line.split('=', 1)[1].strip('"').strip("'")
|
||||
elif line.startswith('PRETTY_NAME='):
|
||||
os_info['pretty_name'] = line.split('=', 1)[1].strip('"').strip("'")
|
||||
|
||||
print(f"[v0] OS Info for LXC {vmid}: {os_info}")
|
||||
else:
|
||||
print(f"[v0] Failed to read /etc/os-release for LXC {vmid}: {os_release_result.stderr}")
|
||||
except Exception as e:
|
||||
print(f"[v0] Error reading OS info for LXC {vmid}: {e}")
|
||||
pass # Silently handle errors
|
||||
|
||||
response_data = {
|
||||
**resource,
|
||||
@@ -4883,7 +4878,7 @@ def api_vm_logs(vmid):
|
||||
"""Download real logs for a specific VM/LXC (not task history)"""
|
||||
try:
|
||||
# Get VM type and node
|
||||
result = subprocess.run(['pvesh', 'get', f'/cluster/resources', '--type', 'vm', '--output-format', 'json'],
|
||||
result = subprocess.run(['pvesh', 'get', '/cluster/resources', '--type', 'vm', '--output-format', 'json'],
|
||||
capture_output=True, text=True, timeout=10)
|
||||
|
||||
if result.returncode == 0:
|
||||
|
||||
Reference in New Issue
Block a user