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.

Reduce workload agent cue density

rcourtmanc179afa89dfb
diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
index 1c160d63f8..837dc36c61 100644
--- a/frontend-modern/src/components/Workloads/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -7,7 +7,6 @@ import { StackedMemoryBar } from './StackedMemoryBar';
import {
BackupIndicator,
BackupStatusCell,
- InGuestAgentInstallCue,
InfoTooltipCell,
NetworkInfoCell,
OSInfoCell,
@@ -87,7 +86,6 @@ export function GuestRow(props: GuestRowProps) {
osVersion,
alertAccentTone,
rowClass,
- showInGuestAgentInstallCue,
supportsBackup,
typeInfo,
workloadType,
@@ -222,9 +220,6 @@ 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 4f4930d326..ab1c3b923b 100644
--- a/frontend-modern/src/components/Workloads/GuestRowCells.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
@@ -1,7 +1,5 @@
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';
@@ -12,26 +10,6 @@ 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;
@@ -426,4 +404,4 @@ function InfoTooltipCell(props: { value: string; tooltip: string; type: string }
);
}
-export { BackupIndicator, BackupStatusCell, InGuestAgentInstallCue, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
+export { BackupIndicator, BackupStatusCell, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
diff --git a/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx b/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
index 03fac76537..6148bee20e 100644
--- a/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadsSurface.tsx
@@ -1,6 +1,11 @@
-import { Show } from 'solid-js';
+import { createMemo, Show } from 'solid-js';
+import { TerminalSquare } from 'lucide-solid';
+
+import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
import { EmptyState } from '@/components/shared/EmptyState';
import { TableCard } from '@/components/shared/TableCard';
+import { isNodeOnline } from '@/utils/status';
+import { getCanonicalWorkloadId } from '@/utils/workloads';
import { WorkloadsFilter } from './WorkloadsFilter';
import {
DEFAULT_WORKLOADS_VIEW_MODE,
@@ -12,6 +17,11 @@ import {
type WorkloadsState,
type WorkloadsSurfaceProps,
} from './useWorkloadsState';
+import {
+ IN_GUEST_AGENT_INSTALL_SUMMARY_LABEL,
+ IN_GUEST_AGENT_INSTALL_TITLE,
+ shouldShowInGuestAgentInstallCue,
+} from './workloadAgentReadiness';
export type { WorkloadsSurfaceProps } from './useWorkloadsState';
interface WorkloadsSurfaceComponentProps extends WorkloadsSurfaceProps {
@@ -22,6 +32,18 @@ interface WorkloadsSurfaceComponentProps extends WorkloadsSurfaceProps {
export function WorkloadsSurface(props: WorkloadsSurfaceComponentProps) {
const state = props.state ?? useWorkloadsState(props);
+ const missingAgentWorkloadCount = createMemo(() => {
+ const parentNodeByGuestId = state.guestParentNodeMap();
+ return state.filteredGuests().reduce((count, guest) => {
+ const parentNode = parentNodeByGuestId[getCanonicalWorkloadId(guest)];
+ const parentNodeOnline = parentNode ? isNodeOnline(parentNode) : true;
+ return shouldShowInGuestAgentInstallCue(guest, parentNodeOnline) ? count + 1 : count;
+ }, 0);
+ });
+ const missingAgentWorkloadLabel = createMemo(() => {
+ const count = missingAgentWorkloadCount();
+ return `${count} running ${count === 1 ? 'workload has' : 'workloads have'} no Pulse Agent`;
+ });
const tableOnlyFiltersActive = () =>
hasActiveWorkloadsFilters({
search: state.search(),
@@ -94,6 +116,33 @@ export function WorkloadsSurface(props: WorkloadsSurfaceComponentProps) {
</div>
</Show>
+ <Show
+ when={
+ !state.kioskMode() &&
+ state.surfaceConnected() &&
+ state.surfaceInitialDataReceived() &&
+ missingAgentWorkloadCount() > 0
+ }
+ >
+ <div class="flex flex-col gap-2 rounded-md border border-amber-200 bg-amber-50/80 px-3 py-2 text-xs text-amber-900 shadow-sm dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100 sm:flex-row sm:items-center sm:justify-between">
+ <div class="min-w-0">
+ <div class="font-semibold">{missingAgentWorkloadLabel()}</div>
+ <div class="mt-0.5 text-amber-800/80 dark:text-amber-200/80">
+ Platform monitoring stays available. Install inside guests where Pulse should run
+ AI actions.
+ </div>
+ </div>
+ <a
+ href={buildInfrastructureOnboardingPath('agent')}
+ class="inline-flex shrink-0 items-center gap-1 self-start rounded border border-amber-300 bg-white px-2 py-1 font-semibold text-amber-800 shadow-sm hover:bg-amber-100 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-100 dark:hover:bg-amber-900 sm:self-center"
+ title={IN_GUEST_AGENT_INSTALL_TITLE}
+ >
+ <TerminalSquare class="h-3.5 w-3.5" aria-hidden="true" />
+ <span>{IN_GUEST_AGENT_INSTALL_SUMMARY_LABEL}</span>
+ </a>
+ </div>
+ </Show>
+
<Show
when={
state.surfaceConnected() &&
diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
index 6e689b9c24..9f68609f09 100644
--- a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
@@ -201,41 +201,12 @@ describe('GuestRow', () => {
expect(screen.getByText('my-webserver')).toBeTruthy();
});
- it('surfaces the in-guest agent install path for running VMs without an agent', () => {
+ it('does not repeat the in-guest agent install action in every row', () => {
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();
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index cf23c1b9dd..8004a7ba1d 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
-import { fireEvent, render, waitFor } from '@solidjs/testing-library';
+import { fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
import { createSignal, onCleanup, onMount } from 'solid-js';
import type { Resource } from '@/types/resource';
import { WorkloadsSurface } from '../WorkloadsSurface';
@@ -572,6 +572,57 @@ describe('Workloads performance contract', () => {
expect(mockLocationSearch).toBe(routeSearchBeforeOpen);
});
+ it('summarizes missing in-guest agents once instead of repeating row actions', async () => {
+ mockLocationSearch = '?type=all';
+ mockWorkloads = [
+ makeGuest(1, {
+ name: 'vm-missing-agent',
+ type: 'qemu',
+ workloadType: 'vm',
+ status: 'running',
+ agentVersion: undefined,
+ }),
+ makeGuest(2, {
+ name: 'lxc-missing-agent',
+ type: 'lxc',
+ workloadType: 'system-container',
+ status: 'running',
+ agentVersion: '',
+ }),
+ makeGuest(3, {
+ name: 'app-container',
+ type: 'docker-container',
+ workloadType: 'app-container',
+ status: 'running',
+ agentVersion: undefined,
+ }),
+ makeGuest(4, {
+ name: 'stopped-vm',
+ type: 'qemu',
+ workloadType: 'vm',
+ status: 'stopped',
+ agentVersion: undefined,
+ }),
+ makeGuest(5, {
+ name: 'agented-vm',
+ type: 'qemu',
+ workloadType: 'vm',
+ status: 'running',
+ agentVersion: 'v6.0.0',
+ }),
+ ];
+
+ render(() => <WorkloadsSurface vms={[]} containers={[]} nodes={[]} useWorkloads />);
+
+ await waitFor(() => {
+ expect(screen.getByText('2 running workloads have no Pulse Agent')).toBeInTheDocument();
+ });
+
+ const link = screen.getByRole('link', { name: 'Install agent' });
+ expect(link).toHaveAttribute('href', '/settings/infrastructure?add=agent');
+ expect(document.body).not.toHaveTextContent('Add Pulse Agent for AI actions');
+ });
+
it('searches policy-redacted resources by their raw display name in operator-local UI', () => {
// owning route search; redaction is a transmission-boundary policy
// (docs/PRIVACY.md), so the haystack must use the raw infra name.
diff --git a/frontend-modern/src/components/Workloads/useGuestRowState.ts b/frontend-modern/src/components/Workloads/useGuestRowState.ts
index 7b745c02d6..5fb7c7ee99 100644
--- a/frontend-modern/src/components/Workloads/useGuestRowState.ts
+++ b/frontend-modern/src/components/Workloads/useGuestRowState.ts
@@ -22,7 +22,6 @@ import {
getWorkloadAlertThresholdScope,
getWorkloadDockerHostId,
} from './workloadTopology';
-import { shouldShowInGuestAgentInstallCue } from './workloadAgentReadiness';
import {
DEFAULT_FIRST_CELL_INDENT,
EMPTY_IO_EMPHASIS,
@@ -224,9 +223,6 @@ 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());
@@ -321,6 +317,5 @@ 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
index 376339cde2..7d27726447 100644
--- a/frontend-modern/src/components/Workloads/workloadAgentReadiness.ts
+++ b/frontend-modern/src/components/Workloads/workloadAgentReadiness.ts
@@ -25,7 +25,7 @@ export const shouldShowInGuestAgentInstallCue = (
!hasInGuestPulseAgent(guest) &&
isGuestRunning(guest, parentNodeOnline);
-export const IN_GUEST_AGENT_INSTALL_LABEL = 'Add agent';
+export const IN_GUEST_AGENT_INSTALL_SUMMARY_LABEL = 'Install 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.';