analytics/lib/plausible_web/templates/site/settings_shields.html.heex
hq1 f635f0a6d3
Hostnames shield (#3990)
* Add shield hostname rules migration

* Add hostname rule schema

* Initialize hostname rules cache

* Extend Shields context with hostname related functions

* Instrument ingestion pipeline with hostname rule lookups

* Limit hostname suggestions by shield patterns

* Add LiveView for hostname rules management

* Test hostname cache

* Rename feature flag - should be separate from hostname filter

* Remove :shield_pages feature flag

* Update CHANGELOG

* Format

* Update lib/plausible/shield/hostname_rule.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Move tests from `lib/` 🤦

* Use plain `assign` where no short-circuit is necessary

* Fine tune the copy a little bit

* Prevent misplaced tests

* Treat a test with common sense

* Fixup another test that hasn't been really run before

* Make the form hint dynamic depending on rules count

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2024-04-16 20:30:20 +02:00

32 lines
831 B
Plaintext

<%= case @shield do %>
<% "ip_addresses" -> %>
<%= live_render(@conn, PlausibleWeb.Live.Shields.IPAddresses,
session: %{
"site_id" => @site.id,
"domain" => @site.domain,
"remote_ip" => PlausibleWeb.RemoteIP.get(@conn)
}
) %>
<% "countries" -> %>
<%= live_render(@conn, PlausibleWeb.Live.Shields.Countries,
session: %{
"site_id" => @site.id,
"domain" => @site.domain
}
) %>
<% "pages" -> %>
<%= live_render(@conn, PlausibleWeb.Live.Shields.Pages,
session: %{
"site_id" => @site.id,
"domain" => @site.domain
}
) %>
<% "hostnames" -> %>
<%= live_render(@conn, PlausibleWeb.Live.Shields.Hostnames,
session: %{
"site_id" => @site.id,
"domain" => @site.domain
}
) %>
<% end %>