fix: clarify one-token-per-host requirement and improve stale agent cleanup

- Setup wizard now clearly states 'Use a different token for each host'
- New Token button is always visible and more prominent (blue styling)
- WebSocket store now clears stale agents (>60s since lastSeen) immediately
  when receiving empty host arrays, instead of waiting for 3 consecutive updates
This commit is contained in:
rcourtman 2025-12-13 22:57:00 +00:00
parent 68456763f9
commit 893d3d5c79

View file

@ -334,12 +334,11 @@ Keep these credentials secure!
</svg> </svg>
Install Command Install Command
</h3> </h3>
<Show when={connectedAgents().length > 0}>
<button <button
onClick={generateNewToken} onClick={generateNewToken}
disabled={generatingToken()} disabled={generatingToken()}
class="text-xs text-white/50 hover:text-white/70 flex items-center gap-1 disabled:opacity-50" class="text-xs bg-blue-500/20 text-blue-300 hover:bg-blue-500/30 hover:text-blue-200 px-2 py-1 rounded flex items-center gap-1 disabled:opacity-50"
title="Generate a different token if needed for security isolation" title="Generate a new token for the next host"
> >
{generatingToken() ? ( {generatingToken() ? (
<svg class="w-3 h-3 animate-spin" fill="none" viewBox="0 0 24 24"> <svg class="w-3 h-3 animate-spin" fill="none" viewBox="0 0 24 24">
@ -348,15 +347,14 @@ Keep these credentials secure!
</svg> </svg>
) : ( ) : (
<svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg> </svg>
)} )}
Different Token New Token
</button> </button>
</Show>
</div> </div>
<p class="text-white/70 text-xs mb-2"> <p class="text-white/70 text-xs mb-2">
Run this command on any host you want to monitor. Use the same command on multiple servers. Run on the host you want to monitor. <span class="text-amber-300">Use a different token for each host</span> - click "New Token" after each install.
</p> </p>
<div class="bg-black/40 rounded-lg p-2.5 font-mono text-[10px] mb-2 relative group"> <div class="bg-black/40 rounded-lg p-2.5 font-mono text-[10px] mb-2 relative group">