From 3fe3a0172647131bbdda73ad37de3716f774ea3e Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 4 Jan 2026 13:31:14 -0600 Subject: [PATCH] Remove 'Check Now' button and clean up equipment detail page Removed the manual 'Check Now' functionality since polling happens automatically on a schedule with distributed coordination. Manual triggers would interfere with the coordinated polling system. Changes: - Removed 'Check Now' button from equipment detail page - Removed trigger_check event handler - Simplified Discover and Edit buttons to use standard button styling - Removed custom classes in favor of default button component styling The equipment is now polled automatically based on its configured check_interval_seconds, coordinated across all pods. --- lib/towerops_web/live/equipment_live/show.ex | 6 ------ .../live/equipment_live/show.html.heex | 16 ++-------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/towerops_web/live/equipment_live/show.ex b/lib/towerops_web/live/equipment_live/show.ex index 48cbffb7..525f023d 100644 --- a/lib/towerops_web/live/equipment_live/show.ex +++ b/lib/towerops_web/live/equipment_live/show.ex @@ -40,12 +40,6 @@ defmodule ToweropsWeb.EquipmentLive.Show do |> put_flash(:info, "Discovery completed")} end - @impl true - def handle_event("trigger_check", _params, socket) do - _ = Towerops.Monitoring.EquipmentMonitor.trigger_check(socket.assigns.equipment.id) - {:noreply, put_flash(socket, :info, "Check triggered")} - end - @impl true def handle_event("trigger_discovery", _params, socket) do equipment = socket.assigns.equipment diff --git a/lib/towerops_web/live/equipment_live/show.html.heex b/lib/towerops_web/live/equipment_live/show.html.heex index 52a76f4e..a0018a26 100644 --- a/lib/towerops_web/live/equipment_live/show.html.heex +++ b/lib/towerops_web/live/equipment_live/show.html.heex @@ -9,24 +9,12 @@

{@equipment.ip_address}

- <.button - phx-click="trigger_check" - class="text-sm bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100" - > - <.icon name="hero-arrow-path" class="h-4 w-4" /> Check Now - <%= if @equipment.snmp_enabled do %> - <.button - phx-click="trigger_discovery" - class="text-sm bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100" - > + <.button phx-click="trigger_discovery"> <.icon name="hero-magnifying-glass" class="h-4 w-4" /> Discover <% end %> - <.button - navigate={~p"/orgs/#{@current_organization.slug}/equipment/#{@equipment.id}/edit"} - class="text-sm bg-white dark:bg-zinc-800 border border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-zinc-100" - > + <.button navigate={~p"/orgs/#{@current_organization.slug}/equipment/#{@equipment.id}/edit"}> <.icon name="hero-pencil" class="h-4 w-4" /> Edit