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.
This commit is contained in:
parent
38bd9828f7
commit
3fe3a01726
2 changed files with 2 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -9,24 +9,12 @@
|
|||
<p class="text-sm text-zinc-600 dark:text-zinc-400 font-mono">{@equipment.ip_address}</p>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<.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
|
||||
</.button>
|
||||
<%= 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
|
||||
</.button>
|
||||
<% 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
|
||||
</.button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue