Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

CRM: Add quick links section to site view (#5466)

hq1d5fe22e97f8a
diff --git a/extra/lib/plausible_web/live/customer_support/live/site.ex b/extra/lib/plausible_web/live/customer_support/live/site.ex
index bf716f9d8e..9981045775 100644
--- a/extra/lib/plausible_web/live/customer_support/live/site.ex
+++ b/extra/lib/plausible_web/live/customer_support/live/site.ex
@@ -118,6 +118,31 @@ defmodule PlausibleWeb.CustomerSupport.Live.Site do
phx-submit="save-site"
class="mt-8"
>
+ <div class="flex justify-center items-center gap-x-8 pb-8 mb-8 border-b border-gray-200 dark:border-gray-700 w-full text-sm text-center">
+ <span>Quick links:</span>
+
+ <.styled_link
+ new_tab={true}
+ href={Routes.stats_path(PlausibleWeb.Endpoint, :stats, @site.domain, [])}
+ >
+ Dashboard
+ </.styled_link>
+
+ <.styled_link
+ new_tab={true}
+ href={Routes.site_path(PlausibleWeb.Endpoint, :settings_general, @site.domain, [])}
+ >
+ Settings
+ </.styled_link>
+
+ <.styled_link
+ new_tab={true}
+ href={"https://plausible.grafana.net/d/BClBG5b4k/ingest-counters-per-domain?orgId=1&from=now-24h&to=now&timezone=browser&var-domain=#{@site.domain}&refresh=10s"}
+ >
+ Ingest Overview
+ </.styled_link>
+ </div>
+
<.input
type="select"
field={f[:timezone]}
diff --git a/extra/lib/plausible_web/live/customer_support/live/team.ex b/extra/lib/plausible_web/live/customer_support/live/team.ex
index a9a0b35344..e59f8d14ca 100644
--- a/extra/lib/plausible_web/live/customer_support/live/team.ex
+++ b/extra/lib/plausible_web/live/customer_support/live/team.ex
@@ -147,7 +147,7 @@ defmodule PlausibleWeb.CustomerSupport.Live.Team do
</.styled_link>
</span>
- <span :if={not Teams.locked?(@team)} class="flex items-center">
+ <span :if={not Teams.locked?(@team)} class="flex items-center font-xs">
<Heroicons.lock_open class="inline stroke-2 w-4 h-4 text-gray-800 mr-2" />
<.styled_link id="lock-dashboards" phx-click="lock" phx-target={@myself}>
Lock Dashboards
diff --git a/test/plausible_web/live/customer_support/sites_test.exs b/test/plausible_web/live/customer_support/sites_test.exs
index e74518de57..ca87dd6f4a 100644
--- a/test/plausible_web/live/customer_support/sites_test.exs
+++ b/test/plausible_web/live/customer_support/sites_test.exs
@@ -31,6 +31,14 @@ defmodule PlausibleWeb.Live.CustomerSupport.SitesTest do
test "renders", %{conn: conn, site: site} do
{:ok, _lv, html} = live(conn, open_site(site.id))
assert text(html) =~ site.domain
+ assert element_exists?(html, ~s|a[href^="https://plausible.grafana.net"]|)
+
+ assert element_exists?(
+ html,
+ ~s|a[href$="#{URI.encode_www_form(site.domain)}/settings/general"]|
+ )
+
+ assert element_exists?(html, ~s|a[href$="#{URI.encode_www_form(site.domain)}/"]|)
end
test "404", %{conn: conn} do