-
-
- Email
-
- <%= @current_user.email %>
- Last signed in at
- <%= @current_user.last_signed_in_at %>
-
+<%= render FzHttpWeb.SharedView, "heading.html", page_title: @page_title %>
-
- <%= live_patch("Change email or password", to: Routes.account_show_path(@socket, :edit)) %>
+
+ <%= render FzHttpWeb.SharedView, "flash.html", assigns %>
+
+
+
+
+
+ Email
+
+ <%= @current_user.email %>
- <%# This is purposefully a synchronous form in order to easily clear the session %>
- <%= form_for @changeset, Routes.user_path(@socket, :delete), [id: "delete-account", method: :delete], fn _f -> %>
- <%= submit "Delete your account", class: "button is-danger", data: [confirm: "Are you sure?"] %>
- <% end %>
+ Last signed in at
+ <%= @current_user.last_signed_in_at %>
+
+
+
+ <%= live_patch("Change email or password", to: Routes.account_show_path(@socket, :edit)) %>
+
+ <%# This is purposefully a synchronous form in order to easily clear the session %>
+ <%= form_for @changeset, Routes.user_path(@socket, :delete), [id: "delete-account", method: :delete], fn _f -> %>
+ <%= submit "Delete your account", class: "button is-danger", data: [confirm: "Are you sure?"] %>
+ <% end %>
+
-
+
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex b/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex
index b22fa7ca0..09d73acd7 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex
@@ -1,30 +1,36 @@
-
-
+<%= render FzHttpWeb.SharedView, "heading.html", page_title: @page_title %>
-
-
-
- Name
- Public key
- Remote IP
- Last seen at
-
-
-
- <%= for device <- @devices do %>
-
-
- <%= link(device.name, to: Routes.device_show_path(@socket, :show, device)) %>
-
- <%= device.public_key %>
- <%= device.remote_ip || "Never connected" %>
- <%= device.last_seen_at %>
-
- <% end %>
-
-
-
+
+ <%= render FzHttpWeb.SharedView, "flash.html", assigns %>
-
- Add Device
-
+
+
+
+
+
+
+ Name
+ Public key
+ Remote IP
+ Last seen at
+
+
+
+ <%= for device <- @devices do %>
+
+
+ <%= live_redirect(device.name, to: Routes.device_show_path(@socket, :show, device)) %>
+
+ <%= device.public_key %>
+ <%= device.remote_ip || "Never connected" %>
+ <%= device.last_seen_at %>
+
+ <% end %>
+
+
+
+
+
+ Add Device
+
+
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex b/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex
index 912781952..c43a5683b 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/index_live.ex
@@ -15,13 +15,12 @@ defmodule FzHttpWeb.DeviceLive.Index do
def handle_event("create_device", _params, socket) do
# XXX: Remove device from WireGuard if create isn't successful
- {:ok, privkey, pubkey, server_pubkey, psk} = @events_module.create_device()
+ {:ok, privkey, pubkey, server_pubkey} = @events_module.create_device()
device_attrs = %{
private_key: privkey,
public_key: pubkey,
- server_public_key: server_pubkey,
- preshared_key: psk
+ server_public_key: server_pubkey
}
attributes =
@@ -37,7 +36,6 @@ defmodule FzHttpWeb.DeviceLive.Index do
{:ok, device} ->
@events_module.device_created(
device.public_key,
- device.preshared_key,
"10.3.2.#{device.octet_sequence}"
)
diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex b/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex
index e3c05e9d7..c65ec422a 100644
--- a/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex
@@ -8,78 +8,77 @@
action: @live_action) %>
<% end %>
-
-
-
-
-
Device Details
+<%= render FzHttpWeb.SharedView, "heading.html", page_title: @page_title %>
+
+
+ <%= render FzHttpWeb.SharedView, "flash.html", assigns %>
+
+
+
+
+
Device Details
+
+
+ <%= live_patch("Edit", to: Routes.device_show_path(@socket, :edit, @device)) %>
+
-
- <%= live_patch("Edit", to: Routes.device_show_path(@socket, :edit, @device)) %>
+
+
+
+
+ Name:
+
+ <%= @device.name %>
+
+
+ Interface IP:
+
+ 10.3.2.<%= @device.octet_sequence %>
+
+
+ Public key:
+
+ <%= @device.public_key %>
+
+
+ Private key:
+
+ <%= @device.private_key %>
+
+
+ Server Public key:
+
+ <%= @device.server_public_key %>
+
+
+ Remote IP:
+
+ <%= @device.remote_ip %>
+
+
+ Last seen at:
+
+ <%= @device.last_seen_at %>
+
+
+
+ <%= live_redirect("Back to Devices", to: Routes.device_index_path(@socket, :index), class: "button") %>
+
+ Delete device
+
-
-
-
-
- Name:
-
- <%= @device.name %>
-
-
- Interface IP:
-
- 10.3.2.<%= @device.octet_sequence %>
-
-
- Public key:
-
- <%= @device.public_key %>
-
-
- Private key:
-
- <%= @device.private_key %>
-
-
- Preshared key:
-
- <%= @device.preshared_key %>
-
-
- Server Public key:
-
- <%= @device.server_public_key %>
-
-
- Remote IP:
-
- <%= @device.remote_ip %>
-
-
- Last seen at:
-
- <%= @device.last_seen_at %>
-
-
-
- <%= link("Back to Devices", to: Routes.device_index_path(@socket, :index), class: "button") %>
-
- Delete device
-
-
-
-
-
Config
-
-
-
- Add the following to your WireGuard™ configuration file:
-
-
+
+
Config
+
+
+
+ Add the following to your WireGuard™ configuration file:
+
+
[Interface]
PrivateKey = <%= @device.private_key %>
Address = 10.3.2.<%= @device.octet_sequence %>
@@ -89,12 +88,13 @@ DNS = 1.1.1.1, 1.0.0.1
PublicKey = <%= @device.server_public_key %>
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = <%= @wireguard_endpoint_ip %>:<%= @wireguard_port %>
-
- Or scan the QR code with your mobile phone:
-
-
-
+
+ Or scan the QR code with your mobile phone:
+
+
+
+
-
+
diff --git a/apps/fz_http/lib/fz_http_web/live/rule_live/index.html.heex b/apps/fz_http/lib/fz_http_web/live/rule_live/index.html.heex
index b258a211e..86fd314da 100644
--- a/apps/fz_http/lib/fz_http_web/live/rule_live/index.html.heex
+++ b/apps/fz_http/lib/fz_http_web/live/rule_live/index.html.heex
@@ -1,18 +1,23 @@
-
-
- <%= live_component(
- @socket,
- FzHttpWeb.RuleLive.RuleListComponent,
- title: "Allowlist",
- id: :allowlist,
- current_user: @current_user) %>
+<%= render FzHttpWeb.SharedView, "heading.html", page_title: @page_title %>
+
+
+ <%= render FzHttpWeb.SharedView, "flash.html", assigns %>
+
+
+ <%= live_component(
+ @socket,
+ FzHttpWeb.RuleLive.RuleListComponent,
+ title: "Allowlist",
+ id: :allowlist,
+ current_user: @current_user) %>
+
+
+ <%= live_component(
+ @socket,
+ FzHttpWeb.RuleLive.RuleListComponent,
+ title: "Denylist",
+ id: :denylist,
+ current_user: @current_user) %>
+
-
- <%= live_component(
- @socket,
- FzHttpWeb.RuleLive.RuleListComponent,
- title: "Denylist",
- id: :denylist,
- current_user: @current_user) %>
-
-
+
diff --git a/apps/fz_http/lib/fz_http_web/mock_events.ex b/apps/fz_http/lib/fz_http_web/mock_events.ex
index 550b54848..17d35b04e 100644
--- a/apps/fz_http/lib/fz_http_web/mock_events.ex
+++ b/apps/fz_http/lib/fz_http_web/mock_events.ex
@@ -8,14 +8,14 @@ defmodule FzHttpWeb.MockEvents do
"""
def create_device do
- {:ok, "privkey", "pubkey", "server_pubkey", "preshared_key"}
+ {:ok, "privkey", "pubkey", "server_pubkey"}
end
def delete_device(pubkey) do
{:ok, pubkey}
end
- def device_created(_pubkey, _psk, _ip) do
+ def device_created(_pubkey, _ip) do
:ok
end
diff --git a/apps/fz_http/lib/fz_http_web/templates/layout/live.html.heex b/apps/fz_http/lib/fz_http_web/templates/layout/live.html.heex
index dcc9b71be..c25717ed4 100644
--- a/apps/fz_http/lib/fz_http_web/templates/layout/live.html.heex
+++ b/apps/fz_http/lib/fz_http_web/templates/layout/live.html.heex
@@ -1,27 +1,3 @@
-<%= if !is_nil(live_flash(@flash, :info)) or !is_nil(live_flash(@flash, :error)) do %>
-
- <%= if live_flash(@flash, :info) do %>
-
-
-
<%= live_flash(@flash, :info) %>
-
- <% end %>
- <%= if live_flash(@flash, :error) do %>
-
-
-
<%= live_flash(@flash, :error) %>
-
- <% end %>
-
-<% end %>
<%= @inner_content %>
diff --git a/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex b/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex
index b07bec4bb..a503fb162 100644
--- a/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex
+++ b/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex
@@ -94,26 +94,8 @@
-
-
-
-
-
-
- <%= @page_title %>
-
-
-
-
-
-
-
-
- <%= @inner_content %>
-
+ <%= @inner_content %>