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.

Add pingable machine availability preset

rcourtman3561803d769e
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 5201d91159..e2545b7625 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -3576,12 +3576,12 @@ and availability management copy must use shared presentation helpers instead
of feature-local wording, so availability probes stay visually aligned with
the Monitoring availability settings surface without pretending to be a host
agent install or a platform API connection.
-Availability setup presets for pingable devices, MQTT, ESPHome, or similar
-agentless endpoints must also stay on the shared settings form vocabulary:
-presets may fill target kind, protocol, port, and path defaults, but display
-badges and drawers still derive `Availability` and `Network Endpoint` labels
-from the shared resource presentation helpers rather than from preset-local
-copy.
+Availability setup presets for pingable machines/devices, MQTT, ESPHome, or
+similar agentless endpoints must also stay on the shared settings form
+vocabulary: presets may fill target kind, protocol, port, and path defaults,
+but display badges and drawers still derive `Availability` and
+`Network Endpoint` labels from the shared resource presentation helpers rather
+than from preset-local copy.
Infrastructure rows for those same agentless endpoints must surface probe
evidence directly in the row, not just as a green status dot or an
`Availability` badge. The shared row presentation must expose the probe method
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx
index fd8b967a70..7325f0e0c4 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/AvailabilityTargetSlot.tsx
@@ -119,12 +119,17 @@ const presetSensitiveFormKeys: ReadonlySet<keyof AvailabilityForm> = new Set([
'targetKind',
]);
+const initialPresetForTargetKind = (
+ targetKind: AvailabilityTargetKind | undefined,
+): AvailabilityTargetPresetID =>
+ targetKind === 'machine' ? 'ping-machine' : CUSTOM_AVAILABILITY_PRESET_ID;
+
export const AvailabilityTargetSlot: Component<AvailabilityTargetSlotProps> = (props) => {
const [form, setForm] = createSignal<AvailabilityForm>(
newAvailabilityForm(props.initialTargetKind),
);
const [selectedPreset, setSelectedPreset] = createSignal<AvailabilityTargetPresetID>(
- CUSTOM_AVAILABILITY_PRESET_ID,
+ initialPresetForTargetKind(props.initialTargetKind),
);
const [loading, setLoading] = createSignal(false);
const [saving, setSaving] = createSignal(false);
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/AvailabilityTargetSlot.test.tsx b/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/AvailabilityTargetSlot.test.tsx
index 9dd3f8bc03..e44899ca4e 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/AvailabilityTargetSlot.test.tsx
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/AvailabilityTargetSlot.test.tsx
@@ -73,6 +73,7 @@ describe('AvailabilityTargetSlot', () => {
<AvailabilityTargetSlot initialTargetKind="machine" onCancel={vi.fn()} onSaved={onSaved} />
));
+ expect(screen.getByLabelText('Preset')).toHaveValue('ping-machine');
expect(screen.getByLabelText('Target type')).toHaveValue('machine');
expect(screen.getByPlaceholderText('mac-mini')).toBeInTheDocument();
expect(screen.getByPlaceholderText('server.local')).toBeInTheDocument();
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/availabilityTargetPresets.test.ts b/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/availabilityTargetPresets.test.ts
index d4aa17cbc3..2d63d8604a 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/availabilityTargetPresets.test.ts
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/__tests__/availabilityTargetPresets.test.ts
@@ -6,6 +6,16 @@ import {
} from '../availabilityTargetPresets';
describe('availabilityTargetPresets', () => {
+ it('includes pingable machines as ICMP availability presets', () => {
+ expect(availabilityPresetById('ping-machine')).toEqual(
+ expect.objectContaining({
+ label: 'Pingable machine',
+ targetKind: 'machine',
+ protocol: 'icmp',
+ }),
+ );
+ });
+
it('includes ESPHome as a TCP availability preset', () => {
expect(availabilityPresetById('esphome-device')).toEqual(
expect.objectContaining({
diff --git a/frontend-modern/src/components/Settings/ConnectionEditor/availabilityTargetPresets.ts b/frontend-modern/src/components/Settings/ConnectionEditor/availabilityTargetPresets.ts
index 452a26fee1..3e0c814dce 100644
--- a/frontend-modern/src/components/Settings/ConnectionEditor/availabilityTargetPresets.ts
+++ b/frontend-modern/src/components/Settings/ConnectionEditor/availabilityTargetPresets.ts
@@ -4,6 +4,7 @@ export const CUSTOM_AVAILABILITY_PRESET_ID = 'custom';
export type AvailabilityTargetPresetID =
| typeof CUSTOM_AVAILABILITY_PRESET_ID
+ | 'ping-machine'
| 'ping-device'
| 'mqtt-broker'
| 'esphome-device'
@@ -28,6 +29,13 @@ export interface AvailabilityPresetFields {
}
export const AVAILABILITY_TARGET_PRESETS: readonly AvailabilityTargetPreset[] = [
+ {
+ id: 'ping-machine',
+ label: 'Pingable machine',
+ targetKind: 'machine',
+ protocol: 'icmp',
+ addressPlaceholder: 'server.local',
+ },
{
id: 'ping-device',
label: 'Pingable device',