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.
This commit is contained in:
parent
6c6b68f8fb
commit
b6ef989809
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue