diff --git a/lib/towerops_web/components/layouts.ex b/lib/towerops_web/components/layouts.ex index 346f25d1..21fbcb5b 100644 --- a/lib/towerops_web/components/layouts.ex +++ b/lib/towerops_web/components/layouts.ex @@ -303,6 +303,78 @@ defmodule ToweropsWeb.Layouts do """ end + @doc """ + Renders the marketing layout. + + Use this for public-facing marketing pages. + + ## Examples + + +

Marketing Content

+
+ + """ + attr :flash, :map, required: true, doc: "the map of flash messages" + + slot :inner_block, required: true + + def marketing(assigns) do + ~H""" +
+
+
+ +
+
+ +
+ {render_slot(@inner_block)} +
+ + +
+ + <.flash_group flash={@flash} /> + """ + end + @doc """ Renders the admin layout. diff --git a/lib/towerops_web/controllers/page_controller.ex b/lib/towerops_web/controllers/page_controller.ex index 6f4efe6c..1769a4cd 100644 --- a/lib/towerops_web/controllers/page_controller.ex +++ b/lib/towerops_web/controllers/page_controller.ex @@ -3,11 +3,10 @@ defmodule ToweropsWeb.PageController do def home(conn, _params) do # If user is authenticated, redirect to organization list - # Otherwise, redirect to login page if conn.assigns.current_scope && conn.assigns.current_scope.user do redirect(conn, to: ~p"/orgs") else - redirect(conn, to: ~p"/users/log-in") + render(conn, :home, layout: false) end end end diff --git a/lib/towerops_web/controllers/page_html/home.html.heex b/lib/towerops_web/controllers/page_html/home.html.heex new file mode 100644 index 00000000..f32086ea --- /dev/null +++ b/lib/towerops_web/controllers/page_html/home.html.heex @@ -0,0 +1,213 @@ + + +
+

+ Network monitoring + + + made simple + + for network operators. +

+

+ Monitor network equipment via SNMP, track performance metrics in real-time, and respond to alerts instantly. + Built specifically for telecom tower infrastructure. +

+
+ <.link + navigate={~p"/users/register"} + class="group inline-flex items-center justify-center rounded-full py-2 px-4 text-sm font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 bg-blue-600 text-white hover:text-slate-100 hover:bg-blue-500 active:bg-blue-800 active:text-blue-100 focus-visible:outline-blue-600" + > + Get 1 month free + +
+
+ +
+
+
+

+ Everything you need to monitor your network. +

+

+ Comprehensive SNMP monitoring with real-time alerts and performance tracking. +

+
+
+ +
+
+
+ <.icon name="hero-signal" class="h-6 w-6 text-white" /> +
+

SNMP Monitoring

+
+

+ Automatic device discovery via SNMP. Track interface statistics, sensor readings, + and equipment health with support for MikroTik, Cisco, and generic SNMP devices. +

+
+ +
+
+
+ <.icon name="hero-bell-alert" class="h-6 w-6 text-white" /> +
+

Real-time Alerts

+
+

+ Get instant notifications when equipment goes down or thresholds are exceeded. + Configurable alert rules with email notifications to keep you informed. +

+
+ +
+
+
+ <.icon name="hero-chart-bar" class="h-6 w-6 text-white" /> +
+

Performance Charts

+
+

+ Visualize historical data with interactive time-series charts. Track bandwidth, + temperature sensors, and custom metrics over configurable time ranges. +

+
+
+
+
+ +
+
+
+

+ Built for multi-site operations. +

+

+ Organize equipment by site, collaborate with your team, and maintain clear visibility + across your entire network infrastructure. +

+
+
+ +
+
+ +
+

Site Management

+

+ Organize equipment by physical location +

+

+ Group devices by tower site or facility. View site-wide status and health metrics + at a glance, then drill down into individual equipment details. +

+
+ +
+
+ +
+

Team Collaboration

+

Share access with your team

+

+ Create organizations and invite team members. Control access with owner, admin, and member roles. + Each team member sees only what they need. +

+
+ +
+
+ +
+

Historical Data

+

Track trends over time

+

+ All sensor readings and interface statistics are stored for historical analysis. + View data from the past hour, day, week, or month with interactive charts. +

+
+
+
+
+ +
+
+
+

+ Start monitoring today +

+

+ Get started in minutes. No credit card required for the free trial. +

+ <.link + navigate={~p"/users/register"} + class="group inline-flex items-center justify-center rounded-full py-2 px-4 text-sm font-semibold focus-visible:outline-2 focus-visible:outline-offset-2 mt-10 bg-white text-slate-900 hover:bg-blue-50 active:bg-blue-200 active:text-slate-600 focus-visible:outline-white" + > + Get 1 month free + +
+
+
+
diff --git a/priv/static/images/logo.svg b/priv/static/images/logo.svg deleted file mode 100644 index 9f26baba..00000000 --- a/priv/static/images/logo.svg +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/priv/static/images/squirrel.jpg b/priv/static/images/squirrel.jpg new file mode 100644 index 00000000..7779648f Binary files /dev/null and b/priv/static/images/squirrel.jpg differ diff --git a/priv/static/images/towerops_logo.png b/priv/static/images/towerops_logo.png new file mode 100644 index 00000000..85e810a1 Binary files /dev/null and b/priv/static/images/towerops_logo.png differ diff --git a/test/towerops/alerts/alert_notifier_test.exs b/test/towerops/alerts/alert_notifier_test.exs index b306aae3..b4ddfb16 100644 --- a/test/towerops/alerts/alert_notifier_test.exs +++ b/test/towerops/alerts/alert_notifier_test.exs @@ -112,10 +112,13 @@ defmodule Towerops.Alerts.AlertNotifierTest do message: "Equipment is down" }) - {:ok, _results} = AlertNotifier.deliver_alert_notification(alert) + {:ok, results} = AlertNotifier.deliver_alert_notification(alert) + assert length(results) == 2 + + # Verify email sent to owner contains all expected information assert_email_sent(fn email -> - email.to == [{"", owner.email}] && + email.to |> List.first() |> elem(1) == owner.email && email.subject =~ "Equipment Down" && email.text_body =~ organization.name && email.text_body =~ equipment.name && diff --git a/test/towerops_web/controllers/page_controller_test.exs b/test/towerops_web/controllers/page_controller_test.exs index 2db9e151..53d6b7db 100644 --- a/test/towerops_web/controllers/page_controller_test.exs +++ b/test/towerops_web/controllers/page_controller_test.exs @@ -3,9 +3,10 @@ defmodule ToweropsWeb.PageControllerTest do import Towerops.AccountsFixtures - test "GET / redirects to login when not authenticated", %{conn: conn} do + test "GET / renders marketing page when not authenticated", %{conn: conn} do conn = get(conn, ~p"/") - assert redirected_to(conn) == ~p"/users/log-in" + assert html_response(conn, 200) =~ "Network monitoring" + assert html_response(conn, 200) =~ "made simple" end test "GET / redirects to organizations when authenticated", %{conn: conn} do