Skip to content

Commit 184c189

Browse files
committed
Merge branch 'main' of github.com:algora-io/console into feat/oban_web
2 parents 65fc46c + 6de7b66 commit 184c189

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ APPSIGNAL_APP_ENV="dev"
3939

4040
SENDGRID_API_KEY="SG.x.x"
4141

42-
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1234567890/x"
42+
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1234567890/x"
43+
44+
PLAUSIBLE_URL=""

config/dev.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,5 @@ config :algora, :discord, webhook_url: System.get_env("DISCORD_WEBHOOK_URL")
130130
config :algora, :login_code,
131131
ttl: String.to_integer(System.get_env("LOGIN_CODE_TTL", "3600")),
132132
salt: System.get_env("LOGIN_CODE_SALT", "algora-login-code")
133+
134+
config :algora, :plausible_url, System.get_env("PLAUSIBLE_URL")

config/runtime.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,6 @@ if config_env() == :prod do
147147
config :algora, :login_code,
148148
ttl: String.to_integer(System.get_env("LOGIN_CODE_TTL", "3600")),
149149
salt: System.fetch_env!("LOGIN_CODE_SALT")
150+
151+
config :algora, :plausible_url, System.get_env("PLAUSIBLE_URL")
150152
end

config/test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ config :algora, :stripe,
6060
config :algora, :login_code,
6161
ttl: String.to_integer(System.get_env("LOGIN_CODE_TTL", "3600")),
6262
salt: System.get_env("LOGIN_CODE_SALT", "algora-login-code")
63+
64+
config :algora, :plausible_url, System.get_env("PLAUSIBLE_URL")

lib/algora_web/live/admin/admin_live.ex

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ defmodule AlgoraWeb.Admin.AdminLive do
2828
|> assign(:mainthing, mainthing)
2929
|> assign(:notes_edit_mode, false)
3030
|> assign(:notes_full_screen, false)
31+
|> assign(:plausible_url, Application.get_env(:algora, :plausible_url))
3132
|> stream(:activities, [])
3233
|> start_async(:get_activities, fn -> Activities.all() end)}
3334
end
@@ -202,6 +203,19 @@ defmodule AlgoraWeb.Admin.AdminLive do
202203
</.scroll_area>
203204
</div>
204205
</section>
206+
207+
<section id="traffic" class="scroll-mt-16">
208+
<div class="mb-4">
209+
<h1 class="text-2xl font-bold">Traffic</h1>
210+
</div>
211+
<iframe
212+
:if={@plausible_url}
213+
src={@plausible_url}
214+
plausible-embed=""
215+
loading="lazy"
216+
style="width: 1; min-width: 100%; height: 609px;"
217+
/>
218+
</section>
205219
</div>
206220
"""
207221
end

lib/algora_web/live/admin/nav.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ defmodule AlgoraWeb.Admin.Nav do
4040
label: "Customers"
4141
},
4242
%{href: "/admin#funnel", tab: :funnel, icon: "tabler-filter", label: "Funnel"},
43+
%{href: "/admin#traffic", tab: :traffic, icon: "tabler-traffic-lights", label: "Traffic"},
4344
%{href: "/admin/leaderboard", tab: :developers, icon: "tabler-user-code", label: "Developers"}
4445
]
4546
},

0 commit comments

Comments
 (0)