Remove custom domains support + update build options (#3559)
* Disable super-admin checks on small build * Mute a test writing to stdout * Move sampling outside of small build * Convert waiting_first_pageview to heex and stop relying on env vars * Set site limit unlimited on small build * Stop relying on app env to get trial expiry * Remove custom domains - including migration * Remove is_selfhosted from layout view * Quota fixup * Stop relying on app env for self hosted registration * Stop relying on app env for pass reset success * Apply on_trial? check only on full build * Update templates relying on app env * Adjusts auth controller tests for small build * Trial fixup * Fixup * Stop relying on app env * Rest of the fsckn owl * Update typespecs * Fix dialyzer warning * Remove unused module * Credo + format * GeoIP is not, for full build * Use `small_build?()` where applicable * Implement bypassing FirstLaunchPlug without insertions * Get Marko's patchpull/3560/head^2 r2023.11.29-261de58a18a85* Test is-dbip=false presence * Fix typespec * Remove future hardcodes * Handle `nil` from `Plausible.Geo.database_type()` * Remove XXX marker * Use one typespec for two clauses * Introduce `MIX_ENV=small_dev` * Revert "Use one typespec for two clauses" This reverts commit8d8cd21764.
parent
86b9d1680d
commit
a4b9c3b8ba
@ -0,0 +1,11 @@
|
||||
import Config
|
||||
|
||||
import_config "dev.exs"
|
||||
|
||||
config :esbuild,
|
||||
default: [
|
||||
args:
|
||||
~w(js/app.js js/dashboard.js js/embed.host.js js/embed.content.js --bundle --target=es2017 --loader:.js=jsx --outdir=../priv/static/js --define:BUILD_EXTRA=false),
|
||||
cd: Path.expand("../assets", __DIR__),
|
||||
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
|
||||
]
|
||||
@ -0,0 +1,41 @@
|
||||
defmodule Plausible.Stats.Sampling do
|
||||
@moduledoc """
|
||||
Sampling related functions
|
||||
"""
|
||||
@default_sample_threshold 20_000_000
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
@spec add_query_hint(Ecto.Query.t(), Plausible.Stats.Query.t()) :: Ecto.Query.t()
|
||||
def add_query_hint(%Ecto.Query{} = db_query, %Plausible.Stats.Query{} = query) do
|
||||
case query.sample_threshold do
|
||||
:infinite ->
|
||||
db_query
|
||||
|
||||
threshold ->
|
||||
add_query_hint(db_query, threshold)
|
||||
end
|
||||
end
|
||||
|
||||
@spec add_query_hint(Ecto.Query.t(), pos_integer()) :: Ecto.Query.t()
|
||||
def add_query_hint(%Ecto.Query{} = query, threshold) when is_integer(threshold) do
|
||||
from(x in query, hints: [sample: threshold])
|
||||
end
|
||||
|
||||
@spec add_query_hint(Ecto.Query.t()) :: Ecto.Query.t()
|
||||
def add_query_hint(%Ecto.Query{} = query) do
|
||||
add_query_hint(query, @default_sample_threshold)
|
||||
end
|
||||
|
||||
@spec put_threshold(Plausible.Stats.Query.t(), map()) :: Plausible.Stats.Query.t()
|
||||
def put_threshold(query, params) do
|
||||
sample_threshold =
|
||||
case params["sample_threshold"] do
|
||||
nil -> @default_sample_threshold
|
||||
"infinite" -> :infinite
|
||||
value -> String.to_integer(value)
|
||||
end
|
||||
|
||||
Map.put(query, :sample_threshold, sample_threshold)
|
||||
end
|
||||
end
|
||||
@ -1,11 +0,0 @@
|
||||
defmodule Plausible.Site.CustomDomain do
|
||||
use Ecto.Schema
|
||||
|
||||
schema "custom_domains" do
|
||||
field :domain, :string
|
||||
field :has_ssl_certificate, :boolean
|
||||
belongs_to :site, Plausible.Site
|
||||
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
@ -1,71 +0,0 @@
|
||||
<div class="w-full max-w-3xl mt-4 mx-auto flex">
|
||||
<%= if @has_email_code? do %>
|
||||
<%= form_for @conn, "/activate", [class: "w-full max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">
|
||||
<%= if @has_any_memberships? do %>
|
||||
Verify your email address
|
||||
<% else %>
|
||||
Activate your account
|
||||
<% end %>
|
||||
</h2>
|
||||
|
||||
<div class="mt-2 text-sm text-gray-500 dark:text-gray-200 leading-tight">
|
||||
Please enter the 4-digit code we sent to <b><%= @conn.assigns[:current_user].email %></b>
|
||||
</div>
|
||||
|
||||
<div class="mt-12 flex items-stretch flex-grow">
|
||||
<div>
|
||||
<%= text_input f, :code, class: "tracking-widest font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-36 px-8 border-gray-300 dark:border-gray-500 rounded-l-md dark:text-gray-200 dark:bg-gray-900", oninput: "this.value=this.value.replace(/[^0-9]/g, ''); if (this.value.length >= 4) document.getElementById('submit').focus()", onclick: "this.select();", maxlength: "4", placeholder: "••••", style: "letter-spacing: 10px;", required: "required" %>
|
||||
</div>
|
||||
<button id="submit" class="button rounded-l-none">Activate →</button>
|
||||
</div>
|
||||
<%= error_tag(assigns, :error) %>
|
||||
|
||||
<div class="mt-16 text-sm dark:text-gray-100">
|
||||
Didn't receive an email?
|
||||
</div>
|
||||
<ol class="list-disc text-xs text-gray-500 leading-tight space-y-1 mt-1">
|
||||
<li>Check your spam folder</li>
|
||||
<li><%= link("Send a new code", class: "underline text-indigo-600", to: "/activate/request-code", method: :post) %> to <%= @conn.assigns[:current_user].email %></li>
|
||||
<%= if Application.get_env(:plausible, :is_selfhost) do %>
|
||||
<li>Ask on our <%= link("community-supported forum", to: "https://github.com/plausible/analytics/discussions", class: "text-indigo-600 underline" ) %></li>
|
||||
<% else %>
|
||||
<li><a class="underline text-indigo-600" href="https://plausible.io/contact">Contact us</a> if the problem persists</li>
|
||||
<% end %>
|
||||
</ol>
|
||||
<div class="mt-4 text-sm dark:text-gray-100">
|
||||
Entered the wrong email address?
|
||||
</div>
|
||||
<ul class="list-disc text-xs text-gray-500 leading-tight mt-1">
|
||||
<%= if @has_any_memberships? do %>
|
||||
<li>
|
||||
<%= link("Change email back to", class: "underline text-indigo-600", to: "/settings/email/cancel", method: "post") %> to <%= @conn.assigns[:current_user].previous_email %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link("Delete this account", class: "underline text-indigo-600", to: "/me?redirect=/register", method: "delete", data: [confirm: "Deleting your account cannot be reversed. Are you sure?"]) %> and start over
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="w-full max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mb-4 mt-8">
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Activate your account</h2>
|
||||
|
||||
<div class="mt-2 text-sm text-gray-500 dark:text-gray-200 leading-tight">
|
||||
A 4-digit activation code will be sent to <b><%= @conn.assigns[:current_user].email %></b>
|
||||
</div>
|
||||
|
||||
<%= error_tag(assigns, :error) %>
|
||||
|
||||
<%= button("Request activation code", to: "/activate/request-code", method: :post, class: "button mt-12") %>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= if !@has_any_invitations? and !@has_any_memberships? do %>
|
||||
<div class="pt-12 pl-8 hidden md:block">
|
||||
<%= render(PlausibleWeb.AuthView, "_onboarding_steps.html", current_step: 1) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@ -0,0 +1,109 @@
|
||||
<div class="w-full max-w-3xl mt-4 mx-auto flex">
|
||||
<%= if @has_email_code? do %>
|
||||
<%= form_for @conn, "/activate", [class: "w-full max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">
|
||||
<%= if @has_any_memberships? do %>
|
||||
Verify your email address
|
||||
<% else %>
|
||||
Activate your account
|
||||
<% end %>
|
||||
</h2>
|
||||
|
||||
<div class="mt-2 text-sm text-gray-500 dark:text-gray-200 leading-tight">
|
||||
Please enter the 4-digit code we sent to <b><%= @conn.assigns[:current_user].email %></b>
|
||||
</div>
|
||||
|
||||
<div class="mt-12 flex items-stretch flex-grow">
|
||||
<div>
|
||||
<%= text_input(f, :code,
|
||||
class:
|
||||
"tracking-widest font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-36 px-8 border-gray-300 dark:border-gray-500 rounded-l-md dark:text-gray-200 dark:bg-gray-900",
|
||||
oninput:
|
||||
"this.value=this.value.replace(/[^0-9]/g, ''); if (this.value.length >= 4) document.getElementById('submit').focus()",
|
||||
onclick: "this.select();",
|
||||
maxlength: "4",
|
||||
placeholder: "••••",
|
||||
style: "letter-spacing: 10px;",
|
||||
required: "required"
|
||||
) %>
|
||||
</div>
|
||||
<button id="submit" class="button rounded-l-none">Activate →</button>
|
||||
</div>
|
||||
<%= error_tag(assigns, :error) %>
|
||||
|
||||
<div class="mt-16 text-sm dark:text-gray-100">
|
||||
Didn't receive an email?
|
||||
</div>
|
||||
<ol class="list-disc text-xs text-gray-500 leading-tight space-y-1 mt-1">
|
||||
<li>Check your spam folder</li>
|
||||
<li>
|
||||
<%= link("Send a new code",
|
||||
class: "underline text-indigo-600",
|
||||
to: "/activate/request-code",
|
||||
method: :post
|
||||
) %> to <%= @conn.assigns[:current_user].email %>
|
||||
</li>
|
||||
<%= if full_build?() do %>
|
||||
<li>
|
||||
<a class="underline text-indigo-600" href="https://plausible.io/contact">
|
||||
Contact us
|
||||
</a>
|
||||
if the problem persists
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
Ask on our <%= link("community-supported forum",
|
||||
to: "https://github.com/plausible/analytics/discussions",
|
||||
class: "text-indigo-600 underline"
|
||||
) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ol>
|
||||
<div class="mt-4 text-sm dark:text-gray-100">
|
||||
Entered the wrong email address?
|
||||
</div>
|
||||
<ul class="list-disc text-xs text-gray-500 leading-tight mt-1">
|
||||
<%= if @has_any_memberships? do %>
|
||||
<li>
|
||||
<%= link("Change email back to",
|
||||
class: "underline text-indigo-600",
|
||||
to: "/settings/email/cancel",
|
||||
method: "post"
|
||||
) %> to <%= @conn.assigns[:current_user].previous_email %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link("Delete this account",
|
||||
class: "underline text-indigo-600",
|
||||
to: "/me?redirect=/register",
|
||||
method: "delete",
|
||||
data: [confirm: "Deleting your account cannot be reversed. Are you sure?"]
|
||||
) %> and start over
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="w-full max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mb-4 mt-8">
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Activate your account</h2>
|
||||
|
||||
<div class="mt-2 text-sm text-gray-500 dark:text-gray-200 leading-tight">
|
||||
A 4-digit activation code will be sent to <b><%= @conn.assigns[:current_user].email %></b>
|
||||
</div>
|
||||
|
||||
<%= error_tag(assigns, :error) %>
|
||||
|
||||
<%= button("Request activation code",
|
||||
to: "/activate/request-code",
|
||||
method: :post,
|
||||
class: "button mt-12"
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= if !@has_any_invitations? and !@has_any_memberships? do %>
|
||||
<div class="pt-12 pl-8 hidden md:block">
|
||||
<%= render(PlausibleWeb.AuthView, "_onboarding_steps.html", current_step: 1) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@ -1,20 +1,27 @@
|
||||
<div class="bg-white dark:bg-gray-800 max-w-md w-full mx-auto shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8">
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Success!</h2>
|
||||
<div class="my-4 leading-tight dark:text-gray-100">
|
||||
We've sent an email containing password reset instructions to <b><%= @email %></b> if it's registered in our system.
|
||||
We've sent an email containing password reset instructions to <b><%= @email %></b>
|
||||
if it's registered in our system.
|
||||
</div>
|
||||
<div class="mt-8 text-sm dark:text-gray-100">
|
||||
Didn't receive the email within a few minutes?
|
||||
</div>
|
||||
<div class="mt-2 text-sm text-gray-600 dark:text-gray-400 leading-tight">
|
||||
You might have used an email address that's not registered in our database. Please verify the email address associated with your Plausible account and attempt the password reset once more.
|
||||
</div>
|
||||
<div class="mt-2 text-sm text-gray-600 dark:text-gray-400 leading-tight">
|
||||
<%= if Application.get_env(:plausible, :is_selfhost) do %>
|
||||
Certain that you're using the correct email address but still aren't receiving the password reset email? Please check your spam folder or ask on our <a href="https://github.com/plausible/analytics/discussions" class="text-indigo-500">community-supported forum</a>.
|
||||
<% else %>
|
||||
Certain that you're using the correct email address but still aren't receiving the password reset email? Please check your spam folder or <a href="https://plausible.io/contact" class="text-indigo-500">contact us</a>.
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 text-sm text-gray-600 dark:text-gray-400 leading-tight">
|
||||
<span :if={small_build?()}>
|
||||
Certain that you're using the correct email address but still aren't receiving the password reset email? Please check your spam folder or ask on our <a
|
||||
href="https://github.com/plausible/analytics/discussions"
|
||||
class="text-indigo-500"
|
||||
>community-supported forum</a>.
|
||||
</span>
|
||||
<span :if={full_build?()}>
|
||||
Certain that you're using the correct email address but still aren't receiving the password reset email? Please check your spam folder or <a
|
||||
href="https://plausible.io/contact"
|
||||
class="text-indigo-500"
|
||||
>contact us</a>.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,54 +0,0 @@
|
||||
<div class="w-full max-w-3xl mt-4 mx-auto flex">
|
||||
<div class="max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-lg rounded px-8 pt-6 pb-8 mb-4 mt-8" >
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Oops, sorry about that...</h2>
|
||||
|
||||
<div class="rounded-md bg-yellow-50 dark:bg-transparent dark:border border-yellow-200 p-4 mt-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-yellow-400 dark:text-yellow-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-400">
|
||||
There has been a server error.
|
||||
<%= if !assigns[:selfhosted?] do %>
|
||||
But don't worry, we're on it!
|
||||
<% end %>
|
||||
</h3>
|
||||
|
||||
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
|
||||
<p>
|
||||
<%= if assigns[:trace_id] && !assigns[:selfhosted?] do %>
|
||||
If you would like to help, tell us what you were trying to do. Our development team will receive your report.
|
||||
<% else %>
|
||||
We have been notified.
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= if !assigns[:selfhosted?] do %>
|
||||
<%= if assigns[:trace_id] do %>
|
||||
<div class="my-6">
|
||||
<%= form_for :error, Routes.error_report_path(PlausibleWeb.Endpoint, :submit_error_report), fn f -> %>
|
||||
<%= hidden_input f, :trace_id, value: @trace_id %>
|
||||
<%= label f, "What happened?", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
|
||||
<%= textarea f, :user_feedback, rows: 5, class: "block w-full max-w-xl border-gray-300 dark:border-gray-700 resize-none shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md dark:bg-gray-900 dark:text-gray-300", placeholder: "I clicked on 'X' and then hit 'Confirm'..." %>
|
||||
<%= submit "Send feedback →", class: "button mt-4 w-full" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mb-6 mt-12">
|
||||
<p class="text-sm text-center">
|
||||
<%= link("Home page", to: "/", class: "text-indigo-500 mr-8") %>
|
||||
<%= link("Status page", to: "https://status.plausible.io", class: "mr-8 text-indigo-500") %>
|
||||
<%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-500") %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,74 @@
|
||||
<div class="w-full max-w-3xl mt-4 mx-auto flex">
|
||||
<div class="max-w-lg w-full mx-auto bg-white dark:bg-gray-800 shadow-lg rounded px-8 pt-6 pb-8 mb-4 mt-8">
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Oops, sorry about that...</h2>
|
||||
|
||||
<div class="rounded-md bg-yellow-50 dark:bg-transparent dark:border border-yellow-200 p-4 mt-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg
|
||||
class="h-5 w-5 text-yellow-400 dark:text-yellow-300"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
|
||||
clip-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-400">
|
||||
There has been a server error.
|
||||
<%= if full_build?() do %>
|
||||
But don't worry, we're on it!
|
||||
<% end %>
|
||||
</h3>
|
||||
|
||||
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
|
||||
<p>
|
||||
<%= if assigns[:trace_id] && full_build?() do %>
|
||||
If you would like to help, tell us what you were trying to do. Our development team will receive your report.
|
||||
<% else %>
|
||||
We have been notified.
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= if full_build?() do %>
|
||||
<%= if assigns[:trace_id] do %>
|
||||
<div class="my-6">
|
||||
<%= form_for :error, Routes.error_report_path(PlausibleWeb.Endpoint, :submit_error_report), fn f -> %>
|
||||
<%= hidden_input(f, :trace_id, value: @trace_id) %>
|
||||
<%= label(f, "What happened?",
|
||||
class: "block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
) %>
|
||||
<%= textarea(f, :user_feedback,
|
||||
rows: 5,
|
||||
class:
|
||||
"block w-full max-w-xl border-gray-300 dark:border-gray-700 resize-none shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md dark:bg-gray-900 dark:text-gray-300",
|
||||
placeholder: "I clicked on 'X' and then hit 'Confirm'..."
|
||||
) %>
|
||||
<%= submit("Send feedback →", class: "button mt-4 w-full") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mb-6 mt-12">
|
||||
<p class="text-sm text-center">
|
||||
<%= link("Home page", to: "/", class: "text-indigo-500 mr-8") %>
|
||||
<%= link("Status page",
|
||||
to: "https://status.plausible.io",
|
||||
class: "mr-8 text-indigo-500"
|
||||
) %>
|
||||
<%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-500") %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,190 +0,0 @@
|
||||
<div class="mt-24 bg-gray-800 dark:bg-gray-800">
|
||||
<div class="container px-4 py-12 sm:px-6 lg:py-16 lg:px-8">
|
||||
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
|
||||
<div class="my-8 xl:my-0">
|
||||
<h4 class="font-semibold tracking-wider text-gray-300 leading-5">
|
||||
<img src="/images/icon/plausible_logo_sm.png" class="inline-block w-6 mr-1" />
|
||||
Plausible Analytics
|
||||
</h4>
|
||||
<p class="mt-4 text-base text-gray-400 leading-6">
|
||||
<%= if !Application.get_env(:plausible, :is_selfhost) do %>
|
||||
Made and hosted in the EU <span class="text-lg">🇪🇺</span><br />
|
||||
<% end %>
|
||||
Solely funded by our subscribers.<br />
|
||||
</p>
|
||||
<%= if Application.get_env(:plausible, :is_selfhost) do %>
|
||||
<div class="mt-4">
|
||||
<a href="https://github.com/sponsors/plausible" class="inline-flex items-center px-4 py-2 text-sm font-medium bg-gray-700 border border-transparent shadow-sm rounded-md text-gray-50 hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500">
|
||||
<svg class="w-5 h-5 mr-2 -ml-1 text-pink-600" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"></path></svg>
|
||||
Sponsor @plausible
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-8 xl:col-span-2">
|
||||
<div class="md:grid md:grid-cols-2 md:gap-8">
|
||||
<div>
|
||||
<h4 class="text-sm font-semibold tracking-wider text-gray-400 uppercase leading-5">
|
||||
Why Plausible?
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li>
|
||||
<a rel="noreferrer" href="https://plausible.io/simple-web-analytics" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
Simple metrics
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noferrer" href="https://plausible.io/lightweight-web-analytics" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
Lightweight script
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/privacy-focused-web-analytics" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
Privacy focused
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/open-source-website-analytics" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
Open source
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/for-bloggers-creators" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
For creators
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/for-freelancers-agencies" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
For agencies
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/for-ecommerce-saas" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
For ecommerce
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/white-label-web-analytics" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
White label
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-32 md:mt-0">
|
||||
<h4 class="text-sm font-semibold tracking-wider text-gray-400 uppercase leading-5">
|
||||
Comparisons
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li>
|
||||
<a rel="noferrer" href="https://plausible.io/vs-google-analytics" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
vs Google Analytics
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noferrer" href="https://plausible.io/vs-matomo" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
vs Matomo
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noferrer" href="https://plausible.io/vs-cloudflare-web-analytics" class="text-base text-gray-300 leading-6 hover:text-white">
|
||||
vs Cloudflare
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md:grid md:grid-cols-2 md:gap-8">
|
||||
<div>
|
||||
<h4 class="text-sm leading-5 font-semibold tracking-wider text-gray-400 uppercase">
|
||||
Community
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li>
|
||||
<a rel="noreferrer" href="https://plausible.io/blog" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Blog
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a ref="noreferrer" target="_blank" href="https://plausible.io/status" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Status
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/docs" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Documentation
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" target="_blank" href="https://github.com/plausible/analytics" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
GitHub
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" target="_blank" href="https://twitter.com/plausiblehq" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Twitter
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" target="_blank" rel="me" href="https://fosstodon.org/@plausible" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Mastodon
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" target="_blank" href="https://www.linkedin.com/company/plausible-analytics/" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
LinkedIn
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-12 md:mt-0">
|
||||
<h4 class="text-sm leading-5 font-semibold tracking-wider text-gray-400 uppercase">
|
||||
Company
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/about" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/contact" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Contact
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/privacy" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Privacy
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/data-policy" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Data policy
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/terms" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Terms
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/dpa" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
DPA
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/security" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a rel="noreferrer" href="https://plausible.io/imprint" class="text-base leading-6 text-gray-300 hover:text-white">
|
||||
Imprint
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,317 @@
|
||||
<div class="mt-24 bg-gray-800 dark:bg-gray-800">
|
||||
<div class="container px-4 py-12 sm:px-6 lg:py-16 lg:px-8">
|
||||
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
|
||||
<div class="my-8 xl:my-0">
|
||||
<h4 class="font-semibold tracking-wider text-gray-300 leading-5">
|
||||
<img src="/images/icon/plausible_logo_sm.png" class="inline-block w-6 mr-1" />
|
||||
Plausible Analytics
|
||||
</h4>
|
||||
<p class="mt-4 text-base text-gray-400 leading-6">
|
||||
<%= if full_build?() do %>
|
||||
Made and hosted in the EU <span class="text-lg">🇪🇺</span> <br />
|
||||
<% end %>
|
||||
Solely funded by our subscribers.<br />
|
||||
</p>
|
||||
<%= if small_build?() do %>
|
||||
<div class="mt-4">
|
||||
<a
|
||||
href="https://github.com/sponsors/plausible"
|
||||
class="inline-flex items-center px-4 py-2 text-sm font-medium bg-gray-700 border border-transparent shadow-sm rounded-md text-gray-50 hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 mr-2 -ml-1 text-pink-600"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
Sponsor @plausible
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-8 xl:col-span-2">
|
||||
<div class="md:grid md:grid-cols-2 md:gap-8">
|
||||
<div>
|
||||
<h4 class="text-sm font-semibold tracking-wider text-gray-400 uppercase leading-5">
|
||||
Why Plausible?
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li>
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/simple-web-analytics"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
Simple metrics
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noferrer"
|
||||
href="https://plausible.io/lightweight-web-analytics"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
Lightweight script
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/privacy-focused-web-analytics"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
Privacy focused
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/open-source-website-analytics"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
Open source
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/for-bloggers-creators"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
For creators
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/for-freelancers-agencies"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
For agencies
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/for-ecommerce-saas"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
For ecommerce
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/white-label-web-analytics"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
White label
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-32 md:mt-0">
|
||||
<h4 class="text-sm font-semibold tracking-wider text-gray-400 uppercase leading-5">
|
||||
Comparisons
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li>
|
||||
<a
|
||||
rel="noferrer"
|
||||
href="https://plausible.io/vs-google-analytics"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
vs Google Analytics
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noferrer"
|
||||
href="https://plausible.io/vs-matomo"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
vs Matomo
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noferrer"
|
||||
href="https://plausible.io/vs-cloudflare-web-analytics"
|
||||
class="text-base text-gray-300 leading-6 hover:text-white"
|
||||
>
|
||||
vs Cloudflare
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md:grid md:grid-cols-2 md:gap-8">
|
||||
<div>
|
||||
<h4 class="text-sm leading-5 font-semibold tracking-wider text-gray-400 uppercase">
|
||||
Community
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li>
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/blog"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Blog
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
ref="noreferrer"
|
||||
target="_blank"
|
||||
href="https://plausible.io/status"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Status
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/docs"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Documentation
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
target="_blank"
|
||||
href="https://github.com/plausible/analytics"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
target="_blank"
|
||||
href="https://twitter.com/plausiblehq"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Twitter
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
target="_blank"
|
||||
rel="me"
|
||||
href="https://fosstodon.org/@plausible"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Mastodon
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
target="_blank"
|
||||
href="https://www.linkedin.com/company/plausible-analytics/"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
LinkedIn
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-12 md:mt-0">
|
||||
<h4 class="text-sm leading-5 font-semibold tracking-wider text-gray-400 uppercase">
|
||||
Company
|
||||
</h4>
|
||||
<ul class="mt-4">
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/about"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/contact"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Contact
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/privacy"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Privacy
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/data-policy"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Data policy
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/terms"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Terms
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/dpa"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
DPA
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/security"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Security
|
||||
</a>
|
||||
</li>
|
||||
<li class="mt-4">
|
||||
<a
|
||||
rel="noreferrer"
|
||||
href="https://plausible.io/imprint"
|
||||
class="text-base leading-6 text-gray-300 hover:text-white"
|
||||
>
|
||||
Imprint
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,39 +0,0 @@
|
||||
<div class="rounded-md bg-yellow-50 dark:bg-transparent dark:border border-yellow-200 p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-yellow-400 dark:text-yellow-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-400">
|
||||
Deprecated feature
|
||||
</h3>
|
||||
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
|
||||
<p>
|
||||
We are moving away from CNAME-based custom domains. If you're concerned about adblockers, we recommend
|
||||
<%= link("setting up a proxy", class: "underline text-yellow-800 dark:text-yellow-400", to: "https://plausible.io/docs/proxy/introduction", target: "_blank", rel: "noferrer") %> for your analytics script instead.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="shadow bg-white dark:bg-gray-800 sm:rounded-md sm:overflow-hidden py-6 px-4 sm:p-6">
|
||||
<header class="relative">
|
||||
<h2 class="text-lg leading-6 font-medium text-gray-900 dark:text-gray-100">Custom domain</h2>
|
||||
<p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">Serve the tracking script from your domain name as a first-party resource instead of loading the script from our domain.</p>
|
||||
|
||||
<%= link(to: "https://plausible.io/docs/proxy/introduction", target: "_blank") do %>
|
||||
<svg class="w-6 h-6 absolute top-0 right-0 text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path></svg>
|
||||
<% end %>
|
||||
</header>
|
||||
<div class="mt-6 dark:text-gray-100 flex justify-between items-center">
|
||||
<%= if @site.custom_domain do %>
|
||||
<span>
|
||||
Configured domain: <b><%= @site.custom_domain.domain %></b>
|
||||
</span>
|
||||
<%= link("Remove custom domain", to: "/sites/#{URI.encode_www_form(@site.domain)}/custom-domains/#{@site.custom_domain.id}", class: "inline-block mt-4 px-4 py-2 border border-gray-300 dark:border-gray-500 text-sm leading-5 font-medium rounded-md text-red-700 bg-white dark:bg-gray-800 hover:text-red-500 dark:hover:text-red-400 focus:outline-none focus:border-blue-300 focus:ring active:text-red-800 active:bg-gray-50 transition ease-in-out duration-150", method: "delete") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,37 +0,0 @@
|
||||
<script>
|
||||
function updateStatus() {
|
||||
fetch("/api/<%= URI.encode_www_form(@site.domain) %>/status")
|
||||
.then(function(res) { return res.json() })
|
||||
.then(function(status) {
|
||||
if (status === "READY") {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
setInterval(updateStatus, 5000)
|
||||
</script>
|
||||
|
||||
<div class="w-full max-w-md mx-auto mt-8">
|
||||
<%= if @site.locked do %>
|
||||
<div class="w-full px-4 py-4 text-sm font-bold text-center text-yellow-800 bg-yellow-100 rounded transition" style="top: 91px" role="alert">
|
||||
<p>This dashboard is actually locked. You are viewing it with super-admin access</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-16 relative text-center">
|
||||
<h2 class="text-xl font-bold dark:text-gray-100">Waiting for first pageview</h2>
|
||||
<h2 class="text-xl font-bold dark:text-gray-100">on <%= @site.domain %></h2>
|
||||
<div class="my-44">
|
||||
<div class="block pulsating-circle top-1/2 left-1/2"></div>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-xs absolute left-0 bottom-0 mb-6 w-full text-center leading-normal">
|
||||
Need to see the snippet again? <%= link("Click here", to: "/#{URI.encode_www_form(@site.domain)}/snippet", class: "text-indigo-600 dark:text-indigo-500 text-underline")%><br />
|
||||
Not working? <%= link("Troubleshoot the integration", to: "https://plausible.io/docs/troubleshoot-integration#check-for-the-plausible-snippet-in-your-source-code", class: "text-indigo-600 dark:text-indigo-500 text-underline", rel: "noreferrer") %> with our guide
|
||||
<%= if Application.get_env(:plausible, :is_selfhost) do %>
|
||||
first<br /> Still not working? Ask on our <%= link("community-supported forum", to: "https://github.com/plausible/analytics/discussions", class: "text-indigo-600 dark:text-indigo-500 text-underline" ) %>
|
||||
<% else %>
|
||||
first<br /> Still not working? <%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-600 dark:text-indigo-500 text-underline" ) %> and we will help you with your setup
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,59 @@
|
||||
<script>
|
||||
function updateStatus() {
|
||||
fetch("/api/<%= URI.encode_www_form(@site.domain) %>/status")
|
||||
.then(function(res) { return res.json() })
|
||||
.then(function(status) {
|
||||
if (status === "READY") {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
setInterval(updateStatus, 5000)
|
||||
</script>
|
||||
|
||||
<div class="w-full max-w-md mx-auto mt-8">
|
||||
<%= if @site.locked do %>
|
||||
<div
|
||||
class="w-full px-4 py-4 text-sm font-bold text-center text-yellow-800 bg-yellow-100 rounded transition"
|
||||
style="top: 91px"
|
||||
role="alert"
|
||||
>
|
||||
<p>This dashboard is actually locked. You are viewing it with super-admin access</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-16 relative text-center">
|
||||
<h2 class="text-xl font-bold dark:text-gray-100">Waiting for first pageview</h2>
|
||||
<h2 class="text-xl font-bold dark:text-gray-100">on <%= @site.domain %></h2>
|
||||
<div class="my-44">
|
||||
<div class="block pulsating-circle top-1/2 left-1/2"></div>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-xs absolute left-0 bottom-0 mb-6 w-full text-center leading-normal">
|
||||
Need to see the snippet again?
|
||||
<.styled_link href={"/#{URI.encode_www_form(@site.domain)}/snippet"}>
|
||||
Click here
|
||||
</.styled_link>
|
||||
|
||||
<br /> Not working?
|
||||
<.styled_link
|
||||
new_tab
|
||||
href="https://plausible.io/docs/troubleshoot-integration#check-for-the-plausible-snippet-in-your-source-code"
|
||||
>
|
||||
Troubleshoot the integration
|
||||
</.styled_link>
|
||||
|
||||
<br />
|
||||
<span :if={full_build?()}>
|
||||
Still not working?
|
||||
<.styled_link new_tab href="https://plausible.io/contact">Contact us</.styled_link>
|
||||
and we will help you with your setup
|
||||
</span>
|
||||
<span :if={small_build?()}>
|
||||
Still not working? Ask on our
|
||||
<.styled_link new_tab href="https://github.com/plausible/analytics/discussions">
|
||||
community-supported forum
|
||||
</.styled_link>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,7 @@
|
||||
defmodule Plausible.Repo.Migrations.RemoveCustomDomains do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
drop table(:custom_domains)
|
||||
end
|
||||
end
|
||||
@ -1,35 +1,43 @@
|
||||
defmodule Plausible.ReleaseTest do
|
||||
use Plausible.DataCase
|
||||
use Plausible.DataCase, async: true
|
||||
alias Plausible.{Release, Auth}
|
||||
import ExUnit.CaptureIO
|
||||
|
||||
describe "should_be_first_launch?/0" do
|
||||
@tag :small_build_only
|
||||
test "returns true when self-hosted and no users" do
|
||||
patch_env(:is_selfhost, true)
|
||||
refute Repo.exists?(Auth.User)
|
||||
assert Release.should_be_first_launch?()
|
||||
end
|
||||
|
||||
@tag :full_build_only
|
||||
test "returns false when not self-hosted and has no users" do
|
||||
patch_env(:is_selfhost, false)
|
||||
refute Repo.exists?(Auth.User)
|
||||
refute Release.should_be_first_launch?()
|
||||
end
|
||||
|
||||
@tag :full_build_only
|
||||
test "returns false when not self-hosted and has users" do
|
||||
insert(:user)
|
||||
patch_env(:is_selfhost, false)
|
||||
refute Release.should_be_first_launch?()
|
||||
end
|
||||
|
||||
@tag :small_build_only
|
||||
test "returns false when self-hosted and has users" do
|
||||
insert(:user)
|
||||
patch_env(:is_selfhost, true)
|
||||
refute Release.should_be_first_launch?()
|
||||
end
|
||||
end
|
||||
|
||||
test "dump_plans/0 inserts plans" do
|
||||
Release.dump_plans()
|
||||
assert Plausible.Repo.aggregate("plans", :count) == 54
|
||||
stdout =
|
||||
capture_io(fn ->
|
||||
Release.dump_plans()
|
||||
end)
|
||||
|
||||
assert stdout =~ "Loading plausible.."
|
||||
assert stdout =~ "Starting dependencies.."
|
||||
assert stdout =~ "Starting repos.."
|
||||
assert stdout =~ "Inserted 54 plans"
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue