Add hosts from the tailnet, and switch between them

The server chip's card now lists the hosts to switch to: this machine, then the hosts the local server keeps, the one shown marked, and an Add host… button. The palette does the same, under Rex.app's action names: client.host.switch lists the hosts, and client.host.add the tailnet's machines, this one first, then those online, each with its OS. Choosing a machine looks for Rex on it, as rex-rune's picker does, and says so in the palette. If a server answers, the machine is saved as a host, named as the tailnet names it, so rex -S and other clients know it too, and the window switches to it. If not, the palette says why: no Rex server, with the command that turns on built-in Tailscale; the machine being offline; or a Rex server that didn't let this device in, with its reason. A 403 counts as a Rex server refusing only when it carries Rex's {"error": ...} reason: on this tailnet, another program on a machine's port 443 answers 403 too, and isn't Rex. The chip's tag shows CONNECTING or RECONNECTING while that is under way, and FAILED, with the reason in the card, when a switch doesn't work. Tests add a machine with no Rex and one with Rex, standing in for tailnet addresses, check the host is saved and the window switches, and switch back from the hosts list; and tell a Rex 403 from another.


Author Daniel Patterson Date Commit Parent 6b652e4e Change ID