Current section

43 Versions

Jump to

Compare versions

8 files changed
+44 additions
-33 deletions
  @@ -1,5 +1,13 @@
1 1 # CHANGELOG
2 2
3 + ## v0.8.3 (2023-10-28)
4 +
5 + * Address deprecation warnings from Phoenix.LiveView and Phoenix.HTML
6 +
7 + ## v0.8.2 (2023-09-23)
8 +
9 + * Support Phoenix.LiveView 0.20.0
10 +
3 11 ## v0.8.1 (2023-08-12)
4 12
5 13 * Fix warnings on more recent Elixir versions
  @@ -2,7 +2,7 @@
2 2 [{<<"github">>,
3 3 <<"https://github.com/phoenixframework/phoenix_live_dashboard">>}]}.
4 4 {<<"name">>,<<"phoenix_live_dashboard">>}.
5 - {<<"version">>,<<"0.8.2">>}.
5 + {<<"version">>,<<"0.8.3">>}.
6 6 {<<"description">>,<<"Real-time performance dashboard for Phoenix">>}.
7 7 {<<"elixir">>,<<"~> 1.12">>}.
8 8 {<<"app">>,<<"phoenix_live_dashboard">>}.
  @@ -222,6 +222,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
222 222
223 223 You can see it in use the applications, processes, sockets pages and many others.
224 224 """
225 + @doc type: :component
225 226 attr :id, :any,
226 227 required: true,
227 228 doc: "Because is a stateful `Phoenix.LiveComponent` an unique id is needed."
  @@ -300,6 +301,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
300 301
301 302 You can see it in use the Metrics and Ecto info pages.
302 303 """
304 + @doc type: :component
303 305 attr :id, :any,
304 306 required: true,
305 307 doc: "Because is a stateful `Phoenix.LiveComponent` an unique id is needed."
  @@ -342,6 +344,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
342 344 @doc """
343 345 Hint pop-up text component
344 346 """
347 + @doc type: :component
345 348 attr :text, :string, required: true, doc: "Text to show in the hint"
346 349
347 350 @spec hint(assigns :: Socket.assigns()) :: Phoenix.LiveView.Rendered.t()
  @@ -362,6 +365,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
362 365 @doc """
363 366 Card title component.
364 367 """
368 + @doc type: :component
365 369 attr :title, :string, default: nil, doc: "The title above the card."
366 370 attr :hint, :string, default: nil, doc: "A textual hint to show close to the title."
367 371
  @@ -380,8 +384,8 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
380 384
381 385 You can see it in use the Home and OS Data pages.
382 386 """
383 -
384 - slot(:inner_block, required: true, doc: "The value that the card will show.")
387 + @doc type: :component
388 + slot :inner_block, required: true, doc: "The value that the card will show."
385 389 attr :title, :string, default: nil, doc: "The title above the card."
386 390 attr :hint, :string, default: nil, doc: "A textual hint to show close to the title."
387 391 attr :inner_title, :string, default: nil, doc: "The title inside the card."
  @@ -409,7 +413,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
409 413
410 414 You can see it in use the Home page in the Environment section.
411 415 """
412 -
416 + @doc type: :component
413 417 attr :fields, :list,
414 418 required: true,
415 419 doc: "A list of key-value elements that will be shown inside the card."
  @@ -448,12 +452,12 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
448 452
449 453 You can see it in use the Home page and OS Data pages.
450 454 """
451 - slot(:col,
455 + @doc type: :component
456 + slot :col,
452 457 required: true,
453 458 doc:
454 459 "A list of components. It can receive up to 3 components." <>
455 460 " Each element will be one column."
456 - )
457 461
458 462 @spec row(assigns :: Socket.assigns()) :: Phoenix.LiveView.Rendered.t()
459 463 def row(assigns) do
  @@ -485,6 +489,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
485 489
486 490 You can see it in use the Home page and OS Data pages.
487 491 """
492 + @doc type: :component
488 493 attr :title, :string, default: nil, doc: "The title above the card."
489 494 attr :hint, :string, default: nil, doc: "A textual hint to show close to the title."
490 495 attr :dom_id, :string, required: true, doc: "A unique identifier for all usages in this card."
  @@ -542,7 +547,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
542 547 attr :dom_id, :string, required: true
543 548 attr :percent, :float, required: true
544 549 attr :csp_nonces, :any, required: true
545 - slot(:inner_block, required: true)
550 + slot :inner_block, required: true
546 551
547 552 defp title_bar_component(assigns) do
548 553 ~H"""
  @@ -575,6 +580,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
575 580
576 581 You can see it in use the Home page and OS Data pages.
577 582 """
583 + @doc type: :component
578 584 attr :usages, :list,
579 585 required: true,
580 586 doc: """
  @@ -700,6 +706,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
700 706 ...> ]
701 707 ...> ]
702 708 """
709 + @doc type: :component
703 710 attr :id, :any,
704 711 required: true,
705 712 doc: "Because is a stateful `Phoenix.LiveComponent` an unique id is needed."
  @@ -764,6 +771,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
764 771
765 772 You can see it in use in the modal in Ports or Processes page.
766 773 """
774 + @doc type: :component
767 775 slot :elem, required: true, doc: "Value for each element of the list" do
768 776 attr :label, :string, required: true, doc: "Label for the elem"
769 777 end
  @@ -792,7 +800,7 @@ defmodule Phoenix.LiveDashboard.PageBuilder do
792 800 attr :title, :string, required: true, doc: "Title of the modal"
793 801
794 802 attr :return_to, :string, required: true, doc: "Path to return when closing the modal"
795 - slot(:inner_block, required: true, doc: "Content to show in the modal")
803 + slot :inner_block, required: true, doc: "Content to show in the modal"
796 804
797 805 def live_modal(assigns) do
798 806 ~H"""
  @@ -348,7 +348,7 @@ defmodule Phoenix.LiveDashboard.PageLive do
348 348
349 349 ~H"""
350 350 <div class="menu-item menu-item-disabled">
351 - <%= @text %> <%= link("Enable", to: @more_info_url, class: "menu-item-enable-button") %>
351 + <%= @text %> <a href={@more_info_url} class="menu-item-enable-button">Enable</a>
352 352 </div>
353 353 """
354 354 end
  @@ -19,7 +19,8 @@ defmodule Phoenix.LiveDashboard.RequestLoggerPage do
19 19 end
20 20
21 21 socket =
22 - assign(socket,
22 + socket
23 + |> assign(
23 24 stream: stream,
24 25 param_key: param_key,
25 26 cookie_key: cookie_key,
  @@ -28,8 +29,10 @@ defmodule Phoenix.LiveDashboard.RequestLoggerPage do
28 29 autoscroll_enabled: true,
29 30 messages_present: false
30 31 )
32 + |> stream_configure(:messages, dom_id: fn _ -> "log-#{System.unique_integer()}" end)
33 + |> stream(:messages, [])
31 34
32 - {:ok, socket, temporary_assigns: [messages: []]}
35 + {:ok, socket}
33 36 end
34 37
35 38 def mount(_, %{request_logger: _}, socket) do
  @@ -53,7 +56,7 @@ defmodule Phoenix.LiveDashboard.RequestLoggerPage do
53 56
54 57 @impl true
55 58 def handle_info({:logger, level, message}, socket) do
56 - {:noreply, assign(socket, messages: [{message, level}], messages_present: true)}
59 + {:noreply, socket |> stream(:messages, [{message, level}]) |> assign(messages_present: true)}
57 60 end
58 61
59 62 @impl true
  @@ -78,9 +81,9 @@ defmodule Phoenix.LiveDashboard.RequestLoggerPage do
78 81
79 82 <div class="card mb-4" id="logger-messages-card" phx-hook="PhxRequestLoggerMessages">
80 83 <div class="card-body">
81 - <div id="logger-messages" phx-update="append">
82 - <%= for {message, level} <- @messages do %>
83 - <pre id={"log-#{System.unique_integer()}"} class={"log-level#{level}"}><%= message %></pre>
84 + <div id="logger-messages" phx-update="stream">
85 + <%= for {id, {message, level}} <- @streams.messages do %>
86 + <pre id={id} class={"log-level#{level}"}><%= message %></pre>
84 87 <% end %>
85 88 </div>
86 89 <!-- Autoscroll ON/OFF checkbox -->
Loading more files…