Update AppImage

This commit is contained in:
MacRimi
2025-10-21 20:12:00 +02:00
parent 1e128348e5
commit 8ee8edcd36
2 changed files with 6 additions and 59 deletions

View File

@@ -179,70 +179,22 @@ const getModalProgressColor = (percent: number): string => {
} }
const getOSIcon = (osInfo: VMDetails["os_info"] | undefined, vmType: string): React.ReactNode => { const getOSIcon = (osInfo: VMDetails["os_info"] | undefined, vmType: string): React.ReactNode => {
// Only show logo for LXCs, VMs show nothing
if (vmType !== "lxc") { if (vmType !== "lxc") {
return null return null
} }
const osId = osInfo?.id?.toLowerCase() const osId = osInfo?.id?.toLowerCase()
// Try to use SVG icons for common distributions
switch (osId) { switch (osId) {
case "debian": case "debian":
return ( return <img src="/icons/debian.svg" alt="Debian" className="h-16 w-16" />
<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>'
}}
/>
)
case "ubuntu": case "ubuntu":
return ( return <img src="/icons/ubuntu.svg" alt="Ubuntu" className="h-16 w-16" />
<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>'
}}
/>
)
case "alpine": case "alpine":
return ( return <img src="/icons/alpine.svg" alt="Alpine" className="h-16 w-16" />
<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>'
}}
/>
)
case "arch": case "arch":
return ( return <img src="/icons/arch.svg" alt="Arch" className="h-16 w-16" />
<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>'
}}
/>
)
default: default:
// Generic LXC container icon
return <Container className="h-16 w-16 text-cyan-500" /> return <Container className="h-16 w-16 text-cyan-500" />
} }
} }

View File

@@ -4834,7 +4834,6 @@ def api_vm_details(vmid):
os_info = {} os_info = {}
if vm_type == 'lxc' and resource.get('status') == 'running': if vm_type == 'lxc' and resource.get('status') == 'running':
try: try:
print(f"[v0] Reading /etc/os-release for LXC {vmid}...")
os_release_result = subprocess.run( os_release_result = subprocess.run(
['pct', 'exec', str(vmid), '--', 'cat', '/etc/os-release'], ['pct', 'exec', str(vmid), '--', 'cat', '/etc/os-release'],
capture_output=True, text=True, timeout=5) 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("'") os_info['name'] = line.split('=', 1)[1].strip('"').strip("'")
elif line.startswith('PRETTY_NAME='): elif line.startswith('PRETTY_NAME='):
os_info['pretty_name'] = line.split('=', 1)[1].strip('"').strip("'") 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: except Exception as e:
print(f"[v0] Error reading OS info for LXC {vmid}: {e}") pass # Silently handle errors
response_data = { response_data = {
**resource, **resource,
@@ -4883,7 +4878,7 @@ def api_vm_logs(vmid):
"""Download real logs for a specific VM/LXC (not task history)""" """Download real logs for a specific VM/LXC (not task history)"""
try: try:
# Get VM type and node # 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) capture_output=True, text=True, timeout=10)
if result.returncode == 0: if result.returncode == 0: