Repository navigation
fix(hosts): keep the host OS icon in step with the detected distro - #659
Merged
Merged
Conversation
The host card prefers the stored icon over the distro, and older builds copied the distro into the icon, so a host whose OS changed kept the old logo. An icon equal to the distro is now treated as derived: changing the distro (Auto-detect, sync, undo) clears it, while an icon the user picked stays. An empty icon from the edit form now clears the saved one instead of being ignored. The OS is re-detected on every SSH connect, not only when no distro is saved, so a reinstalled host picks up its new OS. Nothing is written when the result is unchanged, and the generic "linux" fallback never replaces a saved distro. Windows and MikroTik RouterOS are recognised from the SSH banner (OpenSSH_for_Windows, ROSSSH) and get their own entries in the distro list and icon picker. Form auto-detect now goes through a backend one-shot command that shares the same detection as connected sessions, and the one-shot exec/kill commands take a single target struct. Fixes #655
Shell integration, persistence and the export/cd startup lines all assume a POSIX shell. They were skipped only for Windows, so a MikroTik RouterOS host would get the wrapper exec'd into its CLI. Skip them for any platform the banner names, since that list is exactly the hosts without a POSIX shell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #655
What changes
linuxfallback (unrecognised OS) never replaces a saved distro, so a hand-set FreeBSD or OpenWrt host stays as set.OpenSSH_for_Windows,ROSSSH) with no command run, and get entries in the distro list and icon picker.export/cdstartup lines were skipped only for Windows. They are now skipped for any platform the banner names, so RouterOS gets a plain shell instead of a POSIX wrapper exec'd into its CLI. Not tested against a real RouterOS (no KVM on the dev box).ssh_detect_distro_direct) that shares detection with connected sessions, replacing the TypeScript os-release parsing.ssh_exec_command/ssh_kill_persistenttake a singletargetstruct instead of nine arguments each.Testing
connectionStore.distroIcon.test.ts: a legacy icon is dropped, a custom icon is kept, team vault hosts follow the same rule, an unchanged detection writes nothing, and thelinuxfallback rule.VersionAddendum ROSSSHboth the form and connect-time paths returnedrouteros. Exec and kill still work with the new payload.