refactor: use lucide-solid icons for OS platform selection

Replace custom SVG icons with proper icons from lucide-solid library:
- Linux: Monitor icon
- macOS: Laptop icon
- Windows: Computer icon

These are FOSS icons from the lucide project, properly imported from the existing icon library rather than hand-coded SVG paths.
This commit is contained in:
rcourtman 2025-10-24 11:19:38 +00:00
parent 9dc2b78da9
commit aaa3a578af

View file

@ -1,4 +1,4 @@
import { Component, For, Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import { type Component, For, Show, createEffect, createMemo, createSignal, onMount } from 'solid-js';
import type { JSX } from 'solid-js';
import { useWebSocket } from '@/App';
import type { Host } from '@/types/api';
@ -11,6 +11,9 @@ import { HOST_AGENT_SCOPE } from '@/constants/apiScopes';
import type { SecurityStatus } from '@/types/config';
import type { APITokenRecord } from '@/api/security';
import { useScopedTokenManager } from '@/hooks/useScopedTokenManager';
import Monitor from 'lucide-solid/icons/monitor';
import Laptop from 'lucide-solid/icons/laptop';
import Computer from 'lucide-solid/icons/computer';
type HostAgentVariant = 'all' | 'linux' | 'macos' | 'windows';
@ -20,36 +23,24 @@ interface HostAgentsProps {
type HostPlatform = 'linux' | 'macos' | 'windows';
const hostPlatformOptions: { id: HostPlatform; label: string; description: string; icon: JSX.Element }[] = [
const hostPlatformOptions: { id: HostPlatform; label: string; description: string; icon: typeof Monitor }[] = [
{
id: 'linux',
label: 'Linux',
description: 'Download the static binary and enable the systemd service on Debian, Ubuntu, RHEL, Arch, and more.',
icon: (
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path d="M12.504 0c-.155 0-.315.008-.48.021-4.226.333-3.105 4.807-3.17 6.298-.076 1.092-.3 1.953-1.05 3.02-.885 1.051-2.127 2.75-2.716 4.521-.278.832-.41 1.684-.287 2.489.035.23.05.448.078.671.145 1.16.692 1.83 1.529 2.472.836.642 1.943 1.17 3.074 1.17.074 0 .148-.002.221-.007.86-.064 1.49-.433 1.944-1.078.45-.641.726-1.475.904-2.364.179-.891.241-1.846.241-2.65 0-.804.062-1.759.241-2.65.178-.889.454-1.723.904-2.364.454-.645 1.084-1.014 1.944-1.078.073-.005.147-.007.221-.007 1.131 0 2.238.528 3.074 1.17.837.642 1.384 1.312 1.529 2.472.028.223.043.441.078.671.123.805-.009 1.657-.287 2.489-.589 1.771-1.831 3.47-2.716 4.521-.75 1.067-.974 1.928-1.05 3.02-.065 1.491 1.056 5.965-3.17 6.298-.165.013-.325.021-.48.021z" />
</svg>
),
icon: Monitor,
},
{
id: 'macos',
label: 'macOS',
description: 'Use the universal binary with launchd to keep desktops and hosts reporting in the background.',
icon: (
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path d="M14.94 5.19A4.38 4.38 0 0 0 16 2a4.44 4.44 0 0 0-3 1.52 4.17 4.17 0 0 0-1 3.09 3.69 3.69 0 0 0 2.94-1.42zm2.52 7.44a4.51 4.51 0 0 1 2.16-3.81 4.66 4.66 0 0 0-3.66-2c-1.56-.16-3 .91-3.83.91s-2-.89-3.3-.87A4.92 4.92 0 0 0 4.69 9.39C2.93 12.45 4.24 17 6 19.47c.8 1.21 1.8 2.58 3.12 2.53s1.75-.82 3.28-.82 2 .82 3.3.79 2.22-1.24 3.06-2.45a11 11 0 0 0 1.38-2.85 4.41 4.41 0 0 1-2.68-4.08z" />
</svg>
),
icon: Laptop,
},
{
id: 'windows',
label: 'Windows',
description: 'Native Windows service with automatic startup. PowerShell script handles binary download and service installation.',
icon: (
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801" />
</svg>
),
icon: Computer,
},
];
@ -343,6 +334,7 @@ export const HostAgents: Component<HostAgentsProps> = (props) => {
<For each={hostPlatformOptions}>
{(option) => {
const isActive = () => selectedPlatform() === option.id;
const Icon = option.icon;
return (
<button
type="button"
@ -367,7 +359,7 @@ export const HostAgents: Component<HostAgentsProps> = (props) => {
: 'bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-200'
}`}
>
{option.icon}
<Icon size={20} stroke-width={2} />
</div>
<div class="flex-1">
<p class="font-semibold text-gray-900 dark:text-gray-100">{option.label}</p>