+
Reset Password
+
-<%= form_for @changeset, Routes.password_reset_path(@conn, :update, @password_reset.id), fn f -> %>
- <%= hidden_input f, :reset_token %>
+ <%= form_for @changeset, Routes.password_reset_path(@conn, :update, @password_reset.id), fn f -> %>
+ <%= hidden_input f, :reset_token %>
- <%= if @changeset.action do %>
-
-
Oops, something went wrong! Please check the errors below.
-
- <% end %>
+ <%= if @changeset.action do %>
+
+
Oops, something went wrong! Please check the errors below.
+
+ <% end %>
-
-
- <%= label f, :password %>
-
-
-
- <%= text_input f, :password, placeholder: "Password" %>
-
-
-
-
+ <%= label(f, :password, class: "label") %>
+
+ <%= password_input(f, :password, class: "input",placeholder: "New Password")%>
+
+
<%= error_tag f, :password %>
-
-
-
-
- <%= label f, :password_confirmation %>
-
-
-
- <%= text_input f, :password_confirmation, placeholder: "Password Confirmation" %>
-
-
-
-
+ <%= label(f, :password_confirmation, class: "label") %>
+
+ <%= password_input(f, :password_confirmation, class: "input",placeholder: "New Password")%>
+
+
<%= error_tag f, :password_confirmation %>
-
-
-
- <%= submit "Submit" %>
+
+
+ <%= submit "Submit", class: "button is-primary" %>
+
+
+ <% end %>
-<% end %>
-
-
- <%= link "Back", to: Routes.session_path(@conn, :new) %>
-
+
diff --git a/apps/fg_http/lib/fg_http_web/templates/password_reset/new.html.eex b/apps/fg_http/lib/fg_http_web/templates/password_reset/new.html.eex
index 220f12cd1..2ab1c01e6 100644
--- a/apps/fg_http/lib/fg_http_web/templates/password_reset/new.html.eex
+++ b/apps/fg_http/lib/fg_http_web/templates/password_reset/new.html.eex
@@ -1,19 +1,29 @@
-
+
+
Request Password Reset Link
+
-<%= form_for @changeset, Routes.password_reset_path(@conn, :create), fn f -> %>
- <%= if @changeset.action do %>
-
-
Oops, something went wrong! Please check the errors below.
-
- <% end %>
+ <%= form_for @changeset, Routes.password_reset_path(@conn, :create), fn f -> %>
+ <%= if @changeset.action do %>
+
+
Oops, something went wrong! Please check the errors below.
+
+ <% end %>
- <%= label f, :email %>
- <%= text_input f, :email %>
- <%= error_tag f, :email %>
+
+ <%= label(f, :email, class: "label") %>
+
+ <%= text_input(f, :email, class: "input") %>
+
+
+ <%= error_tag f, :email %>
+
+
-
- <%= submit "Submit" %>
+
+ <%= link "Back", to: Routes.session_path(@conn, :new) %>
+ <%= submit "Submit", class: "button is-primary" %>
+
+ <% end %>
-<% end %>
-
-
<%= link "Back", to: Routes.session_path(@conn, :new) %>
+
diff --git a/apps/fg_http/lib/fg_http_web/templates/rule/form.html.eex b/apps/fg_http/lib/fg_http_web/templates/rule/form.html.eex
index b225c00bb..f4bb5cab9 100644
--- a/apps/fg_http/lib/fg_http_web/templates/rule/form.html.eex
+++ b/apps/fg_http/lib/fg_http_web/templates/rule/form.html.eex
@@ -60,6 +60,11 @@
<%= error_tag f, :priority %>
+
+
+ Higher numbers indicate higher priority.
+
+
diff --git a/apps/fg_http/lib/fg_http_web/templates/rule/index.html.eex b/apps/fg_http/lib/fg_http_web/templates/rule/index.html.eex
index 8caaeb0e6..36dab0e16 100644
--- a/apps/fg_http/lib/fg_http_web/templates/rule/index.html.eex
+++ b/apps/fg_http/lib/fg_http_web/templates/rule/index.html.eex
@@ -9,7 +9,7 @@
| <%= rule.action %> |
<%= rule.destination %> |
- <%= rule.port_number %> |
+ <%= port_number_helper(rule) %> |
<%= rule.protocol %> |
<%= rule.priority %> |
- <%= rule.enabled %> |
+ <%= status_helper(rule) %> |
<%= link "Show", to: Routes.rule_path(@conn, :show, rule) %>
|
@@ -36,8 +36,13 @@
-<%=
- link "New Rule",
- to: Routes.device_rule_path(@conn, :new, @device),
- class: "button is-primary"
-%>
+
+ <%=
+ link "Back to Devices",
+ to: Routes.device_path(@conn, :index)
+ %>
+ <%=
+ link "New Rule",
+ to: Routes.device_rule_path(@conn, :new, @device)
+ %>
+
diff --git a/apps/fg_http/lib/fg_http_web/templates/rule/show.html.eex b/apps/fg_http/lib/fg_http_web/templates/rule/show.html.eex
index a27759284..cc7096337 100644
--- a/apps/fg_http/lib/fg_http_web/templates/rule/show.html.eex
+++ b/apps/fg_http/lib/fg_http_web/templates/rule/show.html.eex
@@ -1,28 +1,32 @@
-
- Show Rule
+
+
+
+ Show Rule
-
- - Action:
- - <%= @rule.action %>
+
+ - Action:
+ - <%= @rule.action %>
- - Destination:
- - <%= @rule.destination %>
+ - Destination:
+ - <%= @rule.destination %>
- - Port Number:
- - <%= @rule.port_number %>
+ - Port Number:
+ - <%= port_number_helper(@rule) %>
- - Protocol:
- - <%= @rule.protocol %>
+ - Protocol:
+ - <%= @rule.protocol %>
- - Priority:
- - <%= @rule.priority %>
+ - Priority:
+ - <%= @rule.priority %>
- - Enabled:
- - <%= @rule.enabled %>
-
+ - Enabled:
+ - <%= @rule.enabled %>
+
-
- <%= link "Edit", to: Routes.rule_path(@conn, :edit, @rule), class: "button is-primary" %>
- <%= link "Back", to: Routes.device_rule_path(@conn, :index, @rule.device_id), class: "button is-danger" %>
+
+ <%= link "Back", to: Routes.device_rule_path(@conn, :index, @rule.device_id) %>
+ <%= link "Edit", to: Routes.rule_path(@conn, :edit, @rule) %>
+
+
diff --git a/apps/fg_http/lib/fg_http_web/templates/user/edit.html.eex b/apps/fg_http/lib/fg_http_web/templates/user/edit.html.eex
index f9c17e5dd..344f556c8 100644
--- a/apps/fg_http/lib/fg_http_web/templates/user/edit.html.eex
+++ b/apps/fg_http/lib/fg_http_web/templates/user/edit.html.eex
@@ -55,7 +55,7 @@
- <%= link "Back", to: Routes.user_path(@conn, :show), class: "button" %>
+ <%= link "Back", to: Routes.user_path(@conn, :show) %>
<%= submit "Save", class: "button is-primary" %>
diff --git a/apps/fg_http/lib/fg_http_web/templates/user/show.html.eex b/apps/fg_http/lib/fg_http_web/templates/user/show.html.eex
index aad645841..96a706ef3 100644
--- a/apps/fg_http/lib/fg_http_web/templates/user/show.html.eex
+++ b/apps/fg_http/lib/fg_http_web/templates/user/show.html.eex
@@ -14,7 +14,7 @@
- <%= link("Change Password", to: Routes.user_path(@conn, :edit), class: "button is-primary") %>
+ <%= link("Change Email or Password", to: Routes.user_path(@conn, :edit)) %>
<%= link "Delete your account",
to: Routes.user_path(@conn, :delete),
method: :delete,
diff --git a/apps/fg_http/lib/fg_http_web/views/rule_view.ex b/apps/fg_http/lib/fg_http_web/views/rule_view.ex
index 381515560..7891808e3 100644
--- a/apps/fg_http/lib/fg_http_web/views/rule_view.ex
+++ b/apps/fg_http/lib/fg_http_web/views/rule_view.ex
@@ -8,4 +8,18 @@ defmodule FgHttpWeb.RuleView do
def action_options_for_select do
RuleActionEnum.__enum_map__()
end
+
+ def port_number_helper(rule) when is_nil(rule.port_number) do
+ "-"
+ end
+
+ def port_number_helper(rule), do: rule.port_number
+
+ def status_helper(rule) do
+ if rule.enabled do
+ "Enabled"
+ else
+ "Disabled"
+ end
+ end
end
diff --git a/apps/fg_http/priv/repo/migrations/20200228145810_create_devices.exs b/apps/fg_http/priv/repo/migrations/20200228145810_create_devices.exs
index d1c8d6b8e..6fcb7b592 100644
--- a/apps/fg_http/priv/repo/migrations/20200228145810_create_devices.exs
+++ b/apps/fg_http/priv/repo/migrations/20200228145810_create_devices.exs
@@ -14,5 +14,6 @@ defmodule FgHttp.Repo.Migrations.CreateDevices do
create index(:devices, [:user_id])
create unique_index(:devices, [:public_key])
+ create unique_index(:devices, [:name])
end
end
diff --git a/apps/fg_http/test/fg_http_web/controllers/password_reset_controller_test.exs b/apps/fg_http/test/fg_http_web/controllers/password_reset_controller_test.exs
index 8e2eef9be..f7fc11072 100644
--- a/apps/fg_http/test/fg_http_web/controllers/password_reset_controller_test.exs
+++ b/apps/fg_http/test/fg_http_web/controllers/password_reset_controller_test.exs
@@ -9,7 +9,7 @@ defmodule FgHttpWeb.PasswordResetControllerTest do
describe "new password_reset" do
test "renders form", %{unauthed_conn: conn} do
conn = get(conn, Routes.password_reset_path(conn, :new))
- assert html_response(conn, 200) =~ "Reset Password"
+ assert html_response(conn, 200) =~ "Request Password Reset Link"
end
end
@@ -28,7 +28,7 @@ defmodule FgHttpWeb.PasswordResetControllerTest do
password_reset: @invalid_create_attrs
)
- assert html_response(conn, 200) =~ "Reset Password"
+ assert html_response(conn, 200) =~ "Request Password Reset Link"
assert get_flash(conn, :error) == "Email not found."
end
end
@@ -43,7 +43,7 @@ defmodule FgHttpWeb.PasswordResetControllerTest do
Routes.password_reset_path(conn, :edit, password_reset.reset_token)
)
- assert html_response(conn, 200) =~ "Edit Password"
+ assert html_response(conn, 200) =~ "Reset Password"
end
end
@@ -107,7 +107,7 @@ defmodule FgHttpWeb.PasswordResetControllerTest do
)
assert get_flash(conn, :error) == "Error updating password."
- assert html_response(conn, 200) =~ "Edit Password"
+ assert html_response(conn, 200) =~ "Reset Password"
end
end
diff --git a/apps/fg_http/test/fg_http_web/controllers/rule_controller_test.exs b/apps/fg_http/test/fg_http_web/controllers/rule_controller_test.exs
index 4deb258a4..d03de7def 100644
--- a/apps/fg_http/test/fg_http_web/controllers/rule_controller_test.exs
+++ b/apps/fg_http/test/fg_http_web/controllers/rule_controller_test.exs
@@ -7,7 +7,7 @@ defmodule FgHttpWeb.RuleControllerTest do
destination: "1.1.1.1",
port_number: 53,
protocol: "udp",
- action: "accept"
+ action: "allow"
}
@invalid_create_attrs %{
destination: "problem"
|