diff --git a/lib/towerops_web/live/site_live/form.ex b/lib/towerops_web/live/site_live/form.ex index 4792ee96..2fed42a3 100644 --- a/lib/towerops_web/live/site_live/form.ex +++ b/lib/towerops_web/live/site_live/form.ex @@ -63,11 +63,11 @@ defmodule ToweropsWeb.SiteLive.Form do site_params = Map.put(site_params, "organization_id", socket.assigns.organization.id) case Sites.create_site(site_params) do - {:ok, _site} -> + {:ok, site} -> {:noreply, socket - |> put_flash(:info, "Site created successfully") - |> push_navigate(to: ~p"/orgs/#{socket.assigns.organization.slug}/sites")} + |> put_flash(:info, "Site created successfully! Now add your first device.") + |> push_navigate(to: ~p"/orgs/#{socket.assigns.organization.slug}/sites/#{site.id}")} {:error, %Ecto.Changeset{} = changeset} -> {:noreply, assign(socket, :form, to_form(changeset))} diff --git a/lib/towerops_web/live/site_live/show.html.heex b/lib/towerops_web/live/site_live/show.html.heex index 27eff872..ebde7f07 100644 --- a/lib/towerops_web/live/site_live/show.html.heex +++ b/lib/towerops_web/live/site_live/show.html.heex @@ -80,7 +80,26 @@ <%= if @equipment == [] do %> -

No equipment at this site yet.

+
+ <.icon name="hero-server" class="mx-auto h-12 w-12 text-zinc-400 dark:text-zinc-600" /> +

+ Add your first device +

+

+ Start monitoring by adding network equipment to this site. +

+

+ You can add routers, switches, servers, or any device with an IP address. +

+
+ <.button + navigate={~p"/orgs/#{@current_organization.slug}/equipment/new?site_id=#{@site.id}"} + variant="primary" + > + <.icon name="hero-plus" class="h-5 w-5" /> Add Equipment + +
+
<% else %>