Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Expose workload agent action readiness

rcourtman83178f6e58e6
diff --git a/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx b/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
index 4787a6dce9..02c8f5b8cd 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
@@ -447,12 +447,41 @@ describe('GuestDrawer', () => {
expect(screen.getByText('1.0.0')).toBeInTheDocument();
});
- it('hides agent section when no agentVersion', () => {
+ it('surfaces the install path when a running VM has no Pulse agent', () => {
render(() => (
<GuestDrawer guest={makeGuest({ agentVersion: undefined })} onClose={vi.fn()} />
));
+ expect(screen.getByText('Agent')).toBeInTheDocument();
+ expect(screen.getByRole('link', { name: 'Add agent for AI actions' })).toHaveAttribute(
+ 'href',
+ '/settings/infrastructure?add=agent',
+ );
+ });
+
+ it('hides agent guidance for app containers without an in-guest agent target', () => {
+ render(() => (
+ <GuestDrawer
+ guest={makeGuest({
+ agentVersion: undefined,
+ type: 'docker-container',
+ workloadType: 'app-container',
+ })}
+ onClose={vi.fn()}
+ />
+ ));
expect(screen.queryByText('Agent')).not.toBeInTheDocument();
});
+
+ it('hides agent guidance when the parent node is offline', () => {
+ render(() => (
+ <GuestDrawer
+ guest={makeGuest({ agentVersion: undefined, status: 'running' })}
+ parentNodeOnline={false}
+ onClose={vi.fn()}
+ />
+ ));
+ expect(screen.queryByRole('link', { name: 'Add agent for AI actions' })).toBeNull();
+ });
});
// ── Guest Info card (OS + IPs) ──
diff --git a/frontend-modern/src/components/Workloads/GuestDrawer.tsx b/frontend-modern/src/components/Workloads/GuestDrawer.tsx
index c8346ab62d..e03793b4b9 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawer.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawer.tsx
@@ -34,6 +34,7 @@ export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
networkInterfaces,
normalizedTags,
setHistoryRange,
+ showInGuestAgentInstallCue,
switchTab,
webInterfaceTargetLabel,
} = useGuestDrawerState(props);
@@ -94,6 +95,7 @@ export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
backupPresentation={backupPresentation()}
diskThresholds={diskThresholds()}
discoveryIdentifiedSummary={discoveryIdentifiedSummary()}
+ showInGuestAgentInstallCue={showInGuestAgentInstallCue()}
webInterfaceTargetLabel={webInterfaceTargetLabel()}
/>
</div>
diff --git a/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx b/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
index de08361cce..b10137ce98 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
@@ -1,6 +1,8 @@
import { For, Show } from 'solid-js';
+import { TerminalSquare } from 'lucide-solid';
import { formatDiscoveryAge } from '@/api/discovery';
+import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
import { DiscoveryProvenanceMarker } from '@/components/shared/DiscoveryProvenanceMarker';
import { WebInterfaceUrlField } from '@/components/shared/WebInterfaceUrlField';
import type { DiscoveryIdentifiedSummary } from '@/utils/discoveryPresentation';
@@ -9,6 +11,10 @@ import type { MetricDisplayThresholds } from '@/utils/metricThresholds';
import { DiskList } from './DiskList';
import { getGuestDrawerMemoryRows, isGuestDrawerVM } from './guestDrawerModel';
+import {
+ IN_GUEST_AGENT_INSTALL_ACTION_LABEL,
+ IN_GUEST_AGENT_INSTALL_TITLE,
+} from './workloadAgentReadiness';
import type { GuestDrawerProps } from './guestDrawerModel';
@@ -22,6 +28,7 @@ interface GuestDrawerOverviewProps {
hasFilesystemDetails: boolean;
hasNetworkInterfaces: boolean;
hasOsInfo: boolean;
+ showInGuestAgentInstallCue: boolean;
ipAddresses: string[];
networkInterfaces: NonNullable<GuestDrawerProps['guest']['networkInterfaces']>;
normalizedTags: string[];
@@ -152,6 +159,19 @@ export function GuestDrawerOverview(props: GuestDrawerOverviewProps) {
</span>
</div>
</Show>
+ <Show when={props.showInGuestAgentInstallCue}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Agent</span>
+ <a
+ href={buildInfrastructureOnboardingPath('agent')}
+ class="inline-flex items-center gap-1 text-right text-[11px] font-semibold text-amber-700 underline-offset-2 hover:underline dark:text-amber-300"
+ title={IN_GUEST_AGENT_INSTALL_TITLE}
+ >
+ <TerminalSquare class="h-3.5 w-3.5" aria-hidden="true" />
+ <span>{IN_GUEST_AGENT_INSTALL_ACTION_LABEL}</span>
+ </a>
+ </div>
+ </Show>
</div>
</div>
diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
index 837dc36c61..1c160d63f8 100644
--- a/frontend-modern/src/components/Workloads/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -7,6 +7,7 @@ import { StackedMemoryBar } from './StackedMemoryBar';
import {
BackupIndicator,
BackupStatusCell,
+ InGuestAgentInstallCue,
InfoTooltipCell,
NetworkInfoCell,
OSInfoCell,
@@ -86,6 +87,7 @@ export function GuestRow(props: GuestRowProps) {
osVersion,
alertAccentTone,
rowClass,
+ showInGuestAgentInstallCue,
supportsBackup,
typeInfo,
workloadType,
@@ -220,6 +222,9 @@ export function GuestRow(props: GuestRowProps) {
isTemplate={props.guest.template}
/>
</Show>
+ <Show when={showInGuestAgentInstallCue()}>
+ <InGuestAgentInstallCue />
+ </Show>
</div>
</div>
diff --git a/frontend-modern/src/components/Workloads/GuestRowCells.tsx b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
index ab1c3b923b..4f4930d326 100644
--- a/frontend-modern/src/components/Workloads/GuestRowCells.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
@@ -1,5 +1,7 @@
import { createMemo, For, Show } from 'solid-js';
+import { TerminalSquare } from 'lucide-solid';
+import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
import { TooltipPortal } from '@/components/shared/TooltipPortal';
import { useTooltip } from '@/hooks/useTooltip';
import { useAlertsActivation } from '@/stores/alertsActivation';
@@ -10,6 +12,26 @@ import {
getWorkloadsGuestBackupTooltip,
getWorkloadsGuestNetworkEmptyState,
} from '@/utils/workloadGuestPresentation';
+import {
+ IN_GUEST_AGENT_INSTALL_LABEL,
+ IN_GUEST_AGENT_INSTALL_TITLE,
+} from './workloadAgentReadiness';
+
+function InGuestAgentInstallCue() {
+ return (
+ <a
+ href={buildInfrastructureOnboardingPath('agent')}
+ class="inline-flex shrink-0 items-center gap-1 text-[10px] font-semibold text-amber-700 underline-offset-2 hover:underline dark:text-amber-300"
+ title={IN_GUEST_AGENT_INSTALL_TITLE}
+ aria-label="Add Pulse Agent for AI actions"
+ onClick={(event) => event.stopPropagation()}
+ onMouseDown={(event) => event.stopPropagation()}
+ >
+ <TerminalSquare class="h-3 w-3" aria-hidden="true" />
+ <span>{IN_GUEST_AGENT_INSTALL_LABEL}</span>
+ </a>
+ );
+}
function BackupIndicator(props: {
lastBackup: string | number | null | undefined;
@@ -404,4 +426,4 @@ function InfoTooltipCell(props: { value: string; tooltip: string; type: string }
);
}
-export { BackupIndicator, BackupStatusCell, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
+export { BackupIndicator, BackupStatusCell, InGuestAgentInstallCue, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
diff --git a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
index 3ea652778a..636d928a5a 100644
--- a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
@@ -576,6 +576,7 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
onClose={() => props.setSelectedGuestId(null)}
customUrl={metadata()?.customUrl}
onCustomUrlChange={props.handleCustomUrlUpdate}
+ parentNodeOnline={parentNodeOnline()}
/>
</div>
</TableCell>
diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
index 6cc1a1e1fc..6e689b9c24 100644
--- a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
@@ -201,6 +201,44 @@ describe('GuestRow', () => {
expect(screen.getByText('my-webserver')).toBeTruthy();
});
+ it('surfaces the in-guest agent install path for running VMs without an agent', () => {
+ renderGuestRow({
+ guest: makeGuest({ agentVersion: undefined, status: 'running' }),
+ visibleColumnIds: ['name'],
+ });
+
+ const link = screen.getByRole('link', { name: 'Add Pulse Agent for AI actions' });
+ expect(link).toHaveAttribute('href', '/settings/infrastructure?add=agent');
+ expect(link).toHaveTextContent('Add agent');
+ expect(link).toHaveAttribute(
+ 'title',
+ 'Install Pulse Agent inside this guest to unlock deep telemetry and AI actions.',
+ );
+ });
+
+ it('does not show the agent install cue when the VM already has an agent', () => {
+ renderGuestRow({
+ guest: makeGuest({ agentVersion: 'v6.0.0', status: 'running' }),
+ visibleColumnIds: ['name'],
+ });
+
+ expect(screen.queryByRole('link', { name: 'Add Pulse Agent for AI actions' })).toBeNull();
+ });
+
+ it('does not show the agent install cue for app containers', () => {
+ renderGuestRow({
+ guest: makeGuest({
+ agentVersion: undefined,
+ status: 'running',
+ type: 'docker-container',
+ workloadType: 'app-container',
+ }),
+ visibleColumnIds: ['name'],
+ });
+
+ expect(screen.queryByRole('link', { name: 'Add Pulse Agent for AI actions' })).toBeNull();
+ });
+
it('renders the status dot', () => {
renderGuestRow({ guest: makeGuest({ status: 'running' }) });
const dot = screen.getByTestId('status-dot');
diff --git a/frontend-modern/src/components/Workloads/guestDrawerModel.ts b/frontend-modern/src/components/Workloads/guestDrawerModel.ts
index ebb0787a2a..056ee82f91 100644
--- a/frontend-modern/src/components/Workloads/guestDrawerModel.ts
+++ b/frontend-modern/src/components/Workloads/guestDrawerModel.ts
@@ -16,6 +16,7 @@ export interface GuestDrawerProps {
onClose: () => void;
customUrl?: string;
onCustomUrlChange?: (guestId: string, url: string) => void;
+ parentNodeOnline?: boolean;
}
export type GuestDrawerTab = 'overview' | 'history' | 'discovery';
diff --git a/frontend-modern/src/components/Workloads/useGuestDrawerState.ts b/frontend-modern/src/components/Workloads/useGuestDrawerState.ts
index 6b3e40c006..fdabca1661 100644
--- a/frontend-modern/src/components/Workloads/useGuestDrawerState.ts
+++ b/frontend-modern/src/components/Workloads/useGuestDrawerState.ts
@@ -36,6 +36,7 @@ import {
type GuestDrawerProps,
type GuestDrawerTab,
} from './guestDrawerModel';
+import { shouldShowInGuestAgentInstallCue } from './workloadAgentReadiness';
interface GuestDiscoverySourceKey {
type: DiscoveryResourceType;
@@ -76,6 +77,9 @@ export function useGuestDrawerState(props: GuestDrawerProps) {
const agentLabel = createMemo(() => getGuestDrawerAgentLabel(props.guest));
const agentTitle = createMemo(() => getGuestDrawerAgentTitle(props.guest));
const hasAgentInfo = createMemo(() => agentLabel().length > 0);
+ const showInGuestAgentInstallCue = createMemo(() =>
+ shouldShowInGuestAgentInstallCue(props.guest, props.parentNodeOnline !== false),
+ );
const ipAddresses = createMemo(() => props.guest.ipAddresses || []);
const hasFilesystemDetails = createMemo(() => hasGuestDrawerFilesystemDetails(props.guest));
const networkInterfaces = createMemo(() => getGuestDrawerNetworkInterfaces(props.guest));
@@ -160,6 +164,7 @@ export function useGuestDrawerState(props: GuestDrawerProps) {
normalizedTags,
osName,
osVersion,
+ showInGuestAgentInstallCue,
switchTab,
setHistoryRange,
webInterfaceTargetLabel,
diff --git a/frontend-modern/src/components/Workloads/useGuestRowState.ts b/frontend-modern/src/components/Workloads/useGuestRowState.ts
index 5fb7c7ee99..7b745c02d6 100644
--- a/frontend-modern/src/components/Workloads/useGuestRowState.ts
+++ b/frontend-modern/src/components/Workloads/useGuestRowState.ts
@@ -22,6 +22,7 @@ import {
getWorkloadAlertThresholdScope,
getWorkloadDockerHostId,
} from './workloadTopology';
+import { shouldShowInGuestAgentInstallCue } from './workloadAgentReadiness';
import {
DEFAULT_FIRST_CELL_INDENT,
EMPTY_IO_EMPHASIS,
@@ -223,6 +224,9 @@ export function useGuestRowState(props: GuestRowProps) {
const parentOnline = createMemo(() => props.parentNodeOnline !== false);
const isRunning = createMemo(() => isGuestRunning(props.guest, parentOnline()));
+ const showInGuestAgentInstallCue = createMemo(() =>
+ shouldShowInGuestAgentInstallCue(props.guest, parentOnline()),
+ );
const guestStatus = createMemo(() => getGuestPowerIndicator(props.guest, parentOnline()));
const lockLabel = createMemo(() => (props.guest.lock || '').trim());
@@ -317,5 +321,6 @@ export function useGuestRowState(props: GuestRowProps) {
clusterName,
agentVersion,
rowClass,
+ showInGuestAgentInstallCue,
};
}
diff --git a/frontend-modern/src/components/Workloads/workloadAgentReadiness.ts b/frontend-modern/src/components/Workloads/workloadAgentReadiness.ts
new file mode 100644
index 0000000000..376339cde2
--- /dev/null
+++ b/frontend-modern/src/components/Workloads/workloadAgentReadiness.ts
@@ -0,0 +1,31 @@
+import type { WorkloadGuest } from '@/types/workloads';
+import { isGuestRunning } from '@/utils/status';
+import { resolveWorkloadType } from '@/utils/workloads';
+
+const isOciSystemContainer = (guest: WorkloadGuest): boolean =>
+ guest.type === 'oci-container' || (guest as { isOci?: boolean }).isOci === true;
+
+export const hasInGuestPulseAgent = (guest: WorkloadGuest): boolean =>
+ (guest.agentVersion || '').trim().length > 0;
+
+export const isInGuestPulseAgentEligibleWorkload = (guest: WorkloadGuest): boolean => {
+ if ((guest as { template?: boolean }).template === true) return false;
+
+ const workloadType = resolveWorkloadType(guest);
+ if (workloadType === 'vm') return true;
+ if (workloadType === 'system-container') return !isOciSystemContainer(guest);
+ return false;
+};
+
+export const shouldShowInGuestAgentInstallCue = (
+ guest: WorkloadGuest,
+ parentNodeOnline = true,
+): boolean =>
+ isInGuestPulseAgentEligibleWorkload(guest) &&
+ !hasInGuestPulseAgent(guest) &&
+ isGuestRunning(guest, parentNodeOnline);
+
+export const IN_GUEST_AGENT_INSTALL_LABEL = 'Add agent';
+export const IN_GUEST_AGENT_INSTALL_ACTION_LABEL = 'Add agent for AI actions';
+export const IN_GUEST_AGENT_INSTALL_TITLE =
+ 'Install Pulse Agent inside this guest to unlock deep telemetry and AI actions.';