diff --git a/frontend-modern/src/components/Hosts/HostsOverview.tsx b/frontend-modern/src/components/Hosts/HostsOverview.tsx index fdfda33..501cf7d 100644 --- a/frontend-modern/src/components/Hosts/HostsOverview.tsx +++ b/frontend-modern/src/components/Hosts/HostsOverview.tsx @@ -83,9 +83,11 @@ export const HostsOverview: Component = (props) => { const connected = () => wsContext.connected(); const reconnecting = () => wsContext.reconnecting(); + const reconnect = () => wsContext.reconnect(); - const isLoading = createMemo(() => { - return !connected() && !reconnecting(); + const isInitialLoading = createMemo(() => { + // Only show loading spinner when we've never been connected and have no hosts + return !connected() && !reconnecting() && props.hosts.length === 0; }); const sortedHosts = createMemo(() => { @@ -194,7 +196,7 @@ export const HostsOverview: Component = (props) => { return (
- + = (props) => { /> } - title={reconnecting() ? 'Reconnecting to host agents...' : 'Loading host data...'} + title="Loading host data..." + description="Connecting to the monitoring service." + /> + + + + {/* Disconnected State */} + + + + + + } + title="Connection lost" description={ reconnecting() - ? 'Re-establishing metrics from the monitoring service.' - : connected() - ? 'Waiting for the first host update.' - : 'Connecting to the monitoring service.' + ? 'Attempting to reconnect…' + : 'Unable to connect to the backend server' + } + tone="danger" + actions={ + !reconnecting() ? ( + + ) : undefined } /> - +