From e07e6657a5cc2dd1fc8f5d2426cd2cd75cc7844c Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 5 Dec 2025 12:51:47 +0000 Subject: [PATCH] refactor: Use text labels for OS column instead of icons Simplified OS display to plain "Windows" and "Linux" text labels. Previous icon attempts were rejected as too complex or unclear. Text labels are cleaner and more universally recognizable. --- .../src/components/Dashboard/GuestRow.tsx | 130 +++--------------- 1 file changed, 18 insertions(+), 112 deletions(-) diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx index 44e17b48d..8c6017d39 100644 --- a/frontend-modern/src/components/Dashboard/GuestRow.tsx +++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx @@ -205,39 +205,27 @@ function NetworkInfoCell(props: { ipAddresses: string[]; networkInterfaces: Netw ); } -// OS detection helper - returns icon type and color based on OS name -type OSType = 'windows' | 'ubuntu' | 'debian' | 'alpine' | 'centos' | 'fedora' | 'arch' | 'nixos' | 'opensuse' | 'gentoo' | 'linux' | 'freebsd' | 'unknown'; +// OS detection helper - simplified to just Linux vs Windows +type OSType = 'windows' | 'linux' | 'unknown'; function detectOSType(osName: string): OSType { const lower = osName.toLowerCase(); if (lower.includes('windows')) return 'windows'; - if (lower.includes('ubuntu')) return 'ubuntu'; - if (lower.includes('debian') || lower.includes('devuan')) return 'debian'; - if (lower.includes('alpine')) return 'alpine'; - if (lower.includes('centos') || lower.includes('rocky') || lower.includes('alma') || lower.includes('rhel') || lower.includes('red hat')) return 'centos'; - if (lower.includes('fedora')) return 'fedora'; - if (lower.includes('arch')) return 'arch'; - if (lower.includes('nixos')) return 'nixos'; - if (lower.includes('opensuse') || lower.includes('suse')) return 'opensuse'; - if (lower.includes('gentoo')) return 'gentoo'; - if (lower.includes('freebsd') || lower.includes('openbsd') || lower.includes('netbsd')) return 'freebsd'; - if (lower.includes('linux') || lower.includes('gnu')) return 'linux'; + // All Linux distros, BSDs, and Unix-likes -> linux + if (lower.includes('linux') || lower.includes('debian') || lower.includes('ubuntu') || + lower.includes('alpine') || lower.includes('centos') || lower.includes('fedora') || + lower.includes('arch') || lower.includes('nixos') || lower.includes('suse') || + lower.includes('gentoo') || lower.includes('rhel') || lower.includes('rocky') || + lower.includes('alma') || lower.includes('devuan') || lower.includes('gnu') || + lower.includes('freebsd') || lower.includes('openbsd') || lower.includes('netbsd')) { + return 'linux'; + } return 'unknown'; } const OS_COLORS: Record = { windows: 'text-blue-500', - ubuntu: 'text-orange-500', - debian: 'text-red-500', - alpine: 'text-blue-400', - centos: 'text-purple-500', - fedora: 'text-blue-600', - arch: 'text-cyan-500', - nixos: 'text-sky-400', - opensuse: 'text-green-500', - gentoo: 'text-violet-400', - linux: 'text-yellow-500', - freebsd: 'text-red-600', + linux: 'text-gray-600 dark:text-gray-400', unknown: 'text-gray-400', }; @@ -270,98 +258,16 @@ function OSInfoCell(props: { osName: string; osVersion: string; agentVersion: st setShowTooltip(false); }; - // SVG icons for different OS types - const OSIcon = () => { + // Simple text labels + const OSLabel = () => { const type = osType(); - const iconClass = `w-3.5 h-3.5 ${colorClass()}`; - switch (type) { case 'windows': - return ( - - - - ); - case 'ubuntu': - return ( - - - - - - - ); - case 'debian': - return ( - - - - ); - case 'alpine': - return ( - - - - ); - case 'centos': - case 'fedora': - return ( - - - - ); - case 'arch': - return ( - - - - ); - case 'nixos': - // Snowflake-like icon for NixOS - return ( - - - - - ); - case 'opensuse': - // Chameleon-inspired icon for openSUSE - return ( - - - - - - ); - case 'gentoo': - // G-like icon for Gentoo - return ( - - - - ); - case 'freebsd': - return ( - - - - - ); + return Windows; case 'linux': - return ( - - - - ); + return Linux; default: - // Generic server/computer icon - return ( - - - - - - ); + return -; } }; @@ -372,7 +278,7 @@ function OSInfoCell(props: { osName: string; osVersion: string; agentVersion: st onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} > - +