Render debug information in side sheet with highlighting
This commit is contained in:
@@ -120,6 +120,18 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|
||||
data-slot="icon"
|
||||
/>
|
||||
</.button>
|
||||
<.button
|
||||
variant="soft"
|
||||
phx-click={Fluxon.open_dialog("debug-data")}
|
||||
>
|
||||
<span class="sr-only">{gettext("Debug data")}</span>
|
||||
<.icon
|
||||
name="hero-code-bracket"
|
||||
class="h-5 w-5"
|
||||
aria-hidden="true"
|
||||
data-slot="icon"
|
||||
/>
|
||||
</.button>
|
||||
<.dropdown id={"actions-#{@artist.musicbrainz_id}"} placement="bottom-end">
|
||||
<:toggle>
|
||||
<.button variant="soft">
|
||||
@@ -404,22 +416,39 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<.json_viewer
|
||||
:if={@artist_info.musicbrainz_data}
|
||||
title={gettext("MusicBrainz data")}
|
||||
data={@artist_info.musicbrainz_data}
|
||||
/>
|
||||
|
||||
<.json_viewer
|
||||
:if={@artist_info.discogs_data}
|
||||
title={gettext("Discogs data")}
|
||||
data={@artist_info.discogs_data}
|
||||
/>
|
||||
|
||||
<.json_viewer
|
||||
:if={@artist_info.wikipedia_data != %{}}
|
||||
title={gettext("Wikipedia data")}
|
||||
data={@artist_info.wikipedia_data}
|
||||
<.debug_data_sheet
|
||||
id="debug-data"
|
||||
items={
|
||||
Enum.filter(
|
||||
[
|
||||
if(@artist_info.musicbrainz_data,
|
||||
do: %{
|
||||
name: "musicbrainz",
|
||||
title: gettext("MusicBrainz"),
|
||||
data: @artist_info.musicbrainz_data,
|
||||
type: :json
|
||||
}
|
||||
),
|
||||
if(@artist_info.discogs_data,
|
||||
do: %{
|
||||
name: "discogs",
|
||||
title: gettext("Discogs"),
|
||||
data: @artist_info.discogs_data,
|
||||
type: :json
|
||||
}
|
||||
),
|
||||
if(@artist_info.wikipedia_data != %{},
|
||||
do: %{
|
||||
name: "wikipedia",
|
||||
title: gettext("Wikipedia"),
|
||||
data: @artist_info.wikipedia_data,
|
||||
type: :json
|
||||
}
|
||||
)
|
||||
],
|
||||
& &1
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -76,6 +76,18 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
|
||||
data-slot="icon"
|
||||
/>
|
||||
</.button>
|
||||
<.button
|
||||
variant="soft"
|
||||
phx-click={Fluxon.open_dialog("debug-data")}
|
||||
>
|
||||
<span class="sr-only">{gettext("Debug data")}</span>
|
||||
<.icon
|
||||
name="hero-code-bracket"
|
||||
class="h-5 w-5"
|
||||
aria-hidden="true"
|
||||
data-slot="icon"
|
||||
/>
|
||||
</.button>
|
||||
<.dropdown id={"actions-#{@record.id}"} placement="bottom-end">
|
||||
<:toggle>
|
||||
<.button variant="soft">
|
||||
@@ -371,8 +383,18 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
|
||||
section={:collection}
|
||||
/>
|
||||
|
||||
<.json_viewer title={gettext("MusicBrainz data")} data={@record.musicbrainz_data} />
|
||||
<.text_viewer title={gettext("Record Embedding")} data={@embedding_text} />
|
||||
<.debug_data_sheet
|
||||
id="debug-data"
|
||||
items={[
|
||||
%{
|
||||
name: "musicbrainz",
|
||||
title: gettext("MusicBrainz"),
|
||||
data: @record.musicbrainz_data,
|
||||
type: :json
|
||||
},
|
||||
%{name: "embedding", title: gettext("Embedding"), data: @embedding_text, type: :text}
|
||||
]}
|
||||
/>
|
||||
|
||||
<.live_component
|
||||
id="release-with-tracks"
|
||||
|
||||
@@ -48,6 +48,18 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
|
||||
data-slot="icon"
|
||||
/>
|
||||
</.button>
|
||||
<.button
|
||||
variant="soft"
|
||||
phx-click={Fluxon.open_dialog("debug-data")}
|
||||
>
|
||||
<span class="sr-only">{gettext("Debug data")}</span>
|
||||
<.icon
|
||||
name="hero-code-bracket"
|
||||
class="h-5 w-5"
|
||||
aria-hidden="true"
|
||||
data-slot="icon"
|
||||
/>
|
||||
</.button>
|
||||
<.dropdown id={"actions-#{@record.id}"} placement="bottom-end">
|
||||
<:toggle>
|
||||
<.button variant="soft">
|
||||
@@ -347,8 +359,18 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<.json_viewer title={gettext("MusicBrainz data")} data={@record.musicbrainz_data} />
|
||||
<.text_viewer title={gettext("Record Embedding")} data={@embedding_text} />
|
||||
<.debug_data_sheet
|
||||
id="debug-data"
|
||||
items={[
|
||||
%{
|
||||
name: "musicbrainz",
|
||||
title: gettext("MusicBrainz"),
|
||||
data: @record.musicbrainz_data,
|
||||
type: :json
|
||||
},
|
||||
%{name: "embedding", title: gettext("Embedding"), data: @embedding_text, type: :text}
|
||||
]}
|
||||
/>
|
||||
|
||||
<.live_component
|
||||
id="record-chat"
|
||||
|
||||
Reference in New Issue
Block a user