From b6ef989809d40ff83c613a01b1095b49578d5ce3 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 17 Jan 2026 18:20:24 -0600 Subject: [PATCH] feat: redirect to device page after triggering rediscovery When clicking 'Rediscover Device', navigate to the device details page where the user can see live updates as discovery progresses. The device show page already subscribes to PubSub discovery events and will automatically refresh when discovery completes, showing updated manufacturer, model, sensors, and interfaces. --- lib/towerops_web/live/device_live/form.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/towerops_web/live/device_live/form.ex b/lib/towerops_web/live/device_live/form.ex index c902ff7c..93a342ec 100644 --- a/lib/towerops_web/live/device_live/form.ex +++ b/lib/towerops_web/live/device_live/form.ex @@ -199,7 +199,11 @@ defmodule ToweropsWeb.DeviceLive.Form do # Enqueue discovery job enqueue_discovery(device.id) - {:noreply, put_flash(socket, :info, "Discovery started...")} + # Navigate to device show page where live updates will appear + {:noreply, + socket + |> put_flash(:info, "Discovery started...") + |> push_navigate(to: ~p"/orgs/#{socket.assigns.organization.slug}/devices/#{device.id}")} else {:noreply, put_flash(socket, :error, "SNMP is not enabled for this device")} end