diff --git a/lib/towerops_web/live/alert_live/index.ex b/lib/towerops_web/live/alert_live/index.ex index 1375ff68..230968fb 100644 --- a/lib/towerops_web/live/alert_live/index.ex +++ b/lib/towerops_web/live/alert_live/index.ex @@ -18,13 +18,13 @@ defmodule ToweropsWeb.AlertLive.Index do {:ok, socket |> assign(:page_title, "Alerts") - |> assign(:filter, "all") + |> assign(:filter, "active") |> load_alerts(organization.id)} end @impl true def handle_params(params, _url, socket) do - filter = Map.get(params, "filter", "all") + filter = Map.get(params, "filter", "active") {:noreply, socket diff --git a/lib/towerops_web/live/alert_live/index.html.heex b/lib/towerops_web/live/alert_live/index.html.heex index 84a27fd7..9b3cb062 100644 --- a/lib/towerops_web/live/alert_live/index.html.heex +++ b/lib/towerops_web/live/alert_live/index.html.heex @@ -15,18 +15,6 @@ patch={~p"/orgs/#{@current_organization.slug}/alerts"} class={[ "px-4 py-2 text-sm font-medium rounded-l-lg", - @filter == "all" && - "bg-blue-600 text-white dark:bg-blue-500", - @filter != "all" && - "bg-white text-zinc-700 hover:bg-zinc-50 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800" - ]} - > - All Alerts - - <.link - patch={~p"/orgs/#{@current_organization.slug}/alerts?filter=active"} - class={[ - "px-4 py-2 text-sm font-medium rounded-r-lg border-l border-zinc-200 dark:border-zinc-800", @filter == "active" && "bg-blue-600 text-white dark:bg-blue-500", @filter != "active" && @@ -35,6 +23,18 @@ > Active Alerts + <.link + patch={~p"/orgs/#{@current_organization.slug}/alerts?filter=all"} + class={[ + "px-4 py-2 text-sm font-medium rounded-r-lg border-l border-zinc-200 dark:border-zinc-800", + @filter == "all" && + "bg-blue-600 text-white dark:bg-blue-500", + @filter != "all" && + "bg-white text-zinc-700 hover:bg-zinc-50 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800" + ]} + > + All Alerts +