diff --git a/lib/aprs_web/controllers/page_controller.ex b/lib/aprs_web/controllers/page_controller.ex index 0879314..15c54f3 100644 --- a/lib/aprs_web/controllers/page_controller.ex +++ b/lib/aprs_web/controllers/page_controller.ex @@ -10,4 +10,8 @@ defmodule AprsWeb.PageController do def map(conn, _params) do render(conn, :map, layout: false) end + + def packets(conn, _params) do + render(conn, :packets) + end end diff --git a/lib/aprs_web/controllers/page_html/packets.html.heex b/lib/aprs_web/controllers/page_html/packets.html.heex new file mode 100644 index 0000000..70ae620 --- /dev/null +++ b/lib/aprs_web/controllers/page_html/packets.html.heex @@ -0,0 +1 @@ +

Packets

diff --git a/lib/aprs_web/live/packets_live/index.ex b/lib/aprs_web/live/packets_live/index.ex new file mode 100644 index 0000000..e4b9f09 --- /dev/null +++ b/lib/aprs_web/live/packets_live/index.ex @@ -0,0 +1,43 @@ +defmodule AprsWeb.PacketsLive.Index do + use AprsWeb, :live_view + + @impl true + def mount(_params, _session, socket) do + {:ok, assign(socket, :packets, [])} + end + + # @impl true + # def handle_params(params, _url, socket) do + # {:noreply, apply_action(socket, socket.assigns.live_action, params)} + # end + + # defp apply_action(socket, :edit, %{"id" => id}) do + # socket + # |> assign(:page_title, "Edit Book") + # |> assign(:book, Books.get_book!(id)) + # end + + # defp apply_action(socket, :new, _params) do + # socket + # |> assign(:page_title, "New Book") + # |> assign(:book, %Book{}) + # end + + # defp apply_action(socket, :index, _params) do + # socket + # |> assign(:page_title, "Listing Books") + # |> assign(:book, nil) + # end + + # @impl true + # def handle_event("delete", %{"id" => id}, socket) do + # book = Books.get_book!(id) + # {:ok, _} = Books.delete_book(book) + + # {:noreply, assign(socket, :books, list_books())} + # end + + # defp list_books do + # Books.list_books() + # end +end diff --git a/lib/aprs_web/live/packets_live/index.html.heex b/lib/aprs_web/live/packets_live/index.html.heex new file mode 100644 index 0000000..3fde9ff --- /dev/null +++ b/lib/aprs_web/live/packets_live/index.html.heex @@ -0,0 +1,7 @@ +<.header> + Packets + + +<.table id="packets" rows={@packets}> + <:col :let={packet} label="packet"><%= packet %> + diff --git a/lib/aprs_web/router.ex b/lib/aprs_web/router.ex index e769dcc..9dd82ab 100644 --- a/lib/aprs_web/router.ex +++ b/lib/aprs_web/router.ex @@ -22,6 +22,8 @@ defmodule AprsWeb.Router do get "/", PageController, :home get "/map", PageController, :map + + live "/packets", PacketsLive.Index, :index end # Other scopes may use custom stacks. diff --git a/lib/types/inspect_position.ex b/lib/types/inspect_position.ex deleted file mode 100644 index e81f4a7..0000000 --- a/lib/types/inspect_position.ex +++ /dev/null @@ -1,11 +0,0 @@ -defimpl Inspect, for: Parser.Types.Position do - alias Parser.Types.Position - - def inspect(d, %{:structs => false} = opts) do - Inspect.Algebra.to_doc(d, opts) - end - - def inspect(d, _opts) do - "#{Position.to_string(d)}" - end -end