diff --git a/frontend-modern/src/components/Settings/UnifiedAgents.tsx b/frontend-modern/src/components/Settings/UnifiedAgents.tsx index 7c71468..c127a3d 100644 --- a/frontend-modern/src/components/Settings/UnifiedAgents.tsx +++ b/frontend-modern/src/components/Settings/UnifiedAgents.tsx @@ -6,7 +6,7 @@ import { MonitoringAPI } from '@/api/monitoring'; import { SecurityAPI } from '@/api/security'; import { notificationStore } from '@/stores/notifications'; import type { SecurityStatus } from '@/types/config'; -import type { HostLookupResponse } from '@/types/api'; +import type { HostLookupResponse, RemovedDockerHost } from '@/types/api'; import type { APITokenRecord } from '@/api/security'; import { HOST_AGENT_SCOPE, DOCKER_REPORT_SCOPE } from '@/constants/apiScopes'; import { copyToClipboard } from '@/utils/clipboard'; @@ -302,6 +302,12 @@ export const UnifiedAgents: Component = () => { const legacyAgents = createMemo(() => allHosts().filter(h => h.isLegacy)); const hasLegacyAgents = createMemo(() => legacyAgents().length > 0); + const removedDockerHosts = createMemo(() => { + const removed = state.removedDockerHosts || []; + return removed.sort((a, b) => b.removedAt - a.removedAt); + }); + const hasRemovedDockerHosts = createMemo(() => removedDockerHosts().length > 0); + const getUpgradeCommand = (_hostname: string) => { const token = resolvedToken(); return `curl -fsSL ${pulseUrl()}/install.sh | sudo bash -s -- --url ${pulseUrl()} --token ${token}`; @@ -323,6 +329,16 @@ export const UnifiedAgents: Component = () => { } }; + const handleAllowReenroll = async (hostId: string, hostname?: string) => { + try { + await MonitoringAPI.allowDockerHostReenroll(hostId); + notificationStore.success(`Re-enrollment allowed for ${hostname || hostId}. Restart the agent to reconnect.`); + } catch (err) { + logger.error('Failed to allow re-enrollment', err); + notificationStore.error('Failed to allow re-enrollment'); + } + }; + return (
+ Docker hosts that were removed and are blocked from re-enrolling. Allow re-enrollment to let them report again. +
+| Hostname | +Host ID | +Removed | +Actions | +
|---|---|---|---|
| + {host.displayName || host.hostname || 'Unknown'} + | ++ {host.id.slice(0, 8)}... + | ++ {formatRelativeTime(host.removedAt)} + | ++ + | +