diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 1b56823..81de8b4 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -651,17 +651,7 @@ const Dashboard = () => { case "osDistribution": return ( - + ); case "osDistributionDoughnut": return ( - + ); case "osDistributionBar": return ( - + ); case "updateStatus": @@ -1100,6 +1070,7 @@ const Dashboard = () => { }, }, }, + onClick: handleOSChartClick, }; const osChartData = { diff --git a/frontend/src/pages/Hosts.jsx b/frontend/src/pages/Hosts.jsx index d24cf71..462c543 100644 --- a/frontend/src/pages/Hosts.jsx +++ b/frontend/src/pages/Hosts.jsx @@ -657,6 +657,18 @@ const Hosts = () => { hideStale, ]); + // Get unique OS types from hosts for dynamic dropdown + const uniqueOsTypes = useMemo(() => { + if (!hosts) return []; + const osTypes = new Set(); + hosts.forEach((host) => { + if (host.os_type) { + osTypes.add(host.os_type); + } + }); + return Array.from(osTypes).sort(); + }, [hosts]); + // Group hosts by selected field const groupedHosts = useMemo(() => { if (groupBy === "none") { @@ -1268,9 +1280,11 @@ const Hosts = () => { className="w-full border border-secondary-300 dark:border-secondary-600 rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-secondary-800 text-secondary-900 dark:text-white" > - - - + {uniqueOsTypes.map((osType) => ( + + ))}