<.link
- navigate={~p"/orgs/#{@organization.slug}"}
+ navigate={~p"/dashboard"}
class="text-sm font-semibold text-gray-900 dark:text-white"
>
Cancel
diff --git a/lib/towerops_web/live/org_live/index.ex b/lib/towerops_web/live/org_live/index.ex
index d4cb1abf..4b1f55a5 100644
--- a/lib/towerops_web/live/org_live/index.ex
+++ b/lib/towerops_web/live/org_live/index.ex
@@ -2,6 +2,7 @@ defmodule ToweropsWeb.OrgLive.Index do
@moduledoc false
use ToweropsWeb, :live_view
+ alias Towerops.Accounts
alias Towerops.Organizations
@impl true
@@ -19,4 +20,14 @@ defmodule ToweropsWeb.OrgLive.Index do
def handle_params(_params, _url, socket) do
{:noreply, socket}
end
+
+ @impl true
+ def handle_event("select_org", %{"org-id" => org_id}, socket) do
+ user = socket.assigns.current_scope.user
+
+ # Update user's default organization
+ {:ok, _user} = Accounts.update_user_profile(user, %{default_organization_id: org_id})
+
+ {:noreply, push_navigate(socket, to: ~p"/dashboard")}
+ end
end
diff --git a/lib/towerops_web/live/org_live/index.html.heex b/lib/towerops_web/live/org_live/index.html.heex
index e4060364..ddec3dca 100644
--- a/lib/towerops_web/live/org_live/index.html.heex
+++ b/lib/towerops_web/live/org_live/index.html.heex
@@ -12,10 +12,12 @@
- <.link
+
diff --git a/lib/towerops_web/live/org_live/new.ex b/lib/towerops_web/live/org_live/new.ex
index 041b11f1..de552e66 100644
--- a/lib/towerops_web/live/org_live/new.ex
+++ b/lib/towerops_web/live/org_live/new.ex
@@ -39,11 +39,11 @@ defmodule ToweropsWeb.OrgLive.New do
opts = if is_superuser, do: [bypass_limits: true], else: []
case Organizations.create_organization(org_params, user.id, opts) do
- {:ok, organization} ->
+ {:ok, _organization} ->
{:noreply,
socket
|> put_flash(:info, "Organization created successfully")
- |> push_navigate(to: ~p"/orgs/#{organization.slug}")}
+ |> push_navigate(to: ~p"/dashboard")}
{:error, %Ecto.Changeset{} = changeset} ->
{:noreply, assign(socket, :form, to_form(changeset))}
diff --git a/lib/towerops_web/router.ex b/lib/towerops_web/router.ex
index 7cc74c6c..893b6c35 100644
--- a/lib/towerops_web/router.ex
+++ b/lib/towerops_web/router.ex
@@ -293,7 +293,6 @@ defmodule ToweropsWeb.Router do
scope "/orgs/:org_slug", ToweropsWeb do
pipe_through [:browser, :require_authenticated_user, :load_current_organization]
- live "/", DashboardLive, :index
live "/settings", Org.SettingsLive, :index
end
end
@@ -309,6 +308,9 @@ defmodule ToweropsWeb.Router do
scope "/", ToweropsWeb do
pipe_through [:browser, :require_authenticated_user]
+ # Dashboard route
+ live "/dashboard", DashboardLive, :index
+
# Alert routes
live "/alerts", AlertLive.Index, :index
diff --git a/lib/towerops_web/user_auth.ex b/lib/towerops_web/user_auth.ex
index adc36ff8..3aae5368 100644
--- a/lib/towerops_web/user_auth.ex
+++ b/lib/towerops_web/user_auth.ex
@@ -323,8 +323,8 @@ defmodule ToweropsWeb.UserAuth do
# Get user's organizations (ordered by most recently joined first)
case Towerops.Organizations.list_user_organizations(user.id) do
[_first_org | _] ->
- # Devices page
- ~p"/devices"
+ # Dashboard page
+ ~p"/dashboard"
[] ->
# No organizations yet, go to org list
@@ -883,10 +883,10 @@ defmodule ToweropsWeb.UserAuth do
ip_address: ip
})
- # Devices page
+ # Dashboard page
redirect_path =
case Towerops.Organizations.list_user_organizations(superuser.id) do
- [_first_org | _] -> ~p"/devices"
+ [_first_org | _] -> ~p"/dashboard"
[] -> ~p"/orgs"
end
diff --git a/priv/static/changelog.txt b/priv/static/changelog.txt
index 0bbbf4a3..793b98c2 100644
--- a/priv/static/changelog.txt
+++ b/priv/static/changelog.txt
@@ -5,6 +5,8 @@ Devices Tested & Working
2026-02-05
* Fix SNMP v3 polling
+* UI Simplification
+* Add device status to device page
2026-02-04
* Feature: SNMP v3 support