diff --git a/src/pages/Infrastructure.tsx b/src/pages/Infrastructure.tsx index 5d6f41e..5d06099 100644 --- a/src/pages/Infrastructure.tsx +++ b/src/pages/Infrastructure.tsx @@ -92,6 +92,42 @@ const cdnIconCandidatesByIntegrationType: Record = { netbird: ['https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/netbird.png'], cloudflare: ['https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/cloudflare.png'], ssh: ['https://samuelsjames.github.io/assets-public/logos/linux-logo.svg'], + proxmox: [ + 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/proxmox.png', + 'https://api.iconify.design/simple-icons/proxmox.svg', + ], + weather: [ + 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/openweathermap.png', + 'https://api.iconify.design/mdi/weather-partly-cloudy.svg', + ], + remote_desktop: [ + 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/guacamole.png', + 'https://api.iconify.design/simple-icons/apacheguacamole.svg', + 'https://api.iconify.design/mdi/remote-desktop.svg', + ], +} + +// SSH connections are named by the user after whatever host/service they point at +// (e.g. "Linode", "Portainer") — match known keywords in the connection name to a +// more specific icon before falling back to the generic Linux icon above. +const sshNameIconCandidates: { keyword: string; candidates: string[] }[] = [ + { keyword: 'linode', candidates: [ + 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/linode.png', + 'https://api.iconify.design/simple-icons/linode.svg', + ] }, + { keyword: 'portainer', candidates: [ + 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/portainer.png', + 'https://api.iconify.design/simple-icons/portainer.svg', + ] }, +] + +function iconCandidatesForNode(node: NodeTile): string[] { + if (node.integrationType === 'ssh') { + const name = ('isGroup' in node ? node.integration : node.name).toLowerCase() + const match = sshNameIconCandidates.find((m) => name.includes(m.keyword)) + if (match) return [...match.candidates, ...cdnIconCandidatesByIntegrationType.ssh] + } + return cdnIconCandidatesByIntegrationType[node.integrationType] ?? [] } interface NodeGroup { @@ -372,7 +408,7 @@ export default function Infrastructure() {