Fix icons, add Anki, exclude dashboard self-reference
- Extend Tailwind source scan to lib/homelab_dashboard/ so icon classes in services_sync.ex are included in compiled CSS - Add Anki service (hero-academic-cap) to icon and description maps - Exclude 'devbox' (the dashboard itself) from the rendered service list Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
@source "../css";
|
@source "../css";
|
||||||
@source "../js";
|
@source "../js";
|
||||||
@source "../../lib/homelab_dashboard_web";
|
@source "../../lib/homelab_dashboard_web";
|
||||||
|
@source "../../lib/homelab_dashboard";
|
||||||
|
|
||||||
/* A Tailwind plugin that makes "hero-#{ICON}" classes available.
|
/* A Tailwind plugin that makes "hero-#{ICON}" classes available.
|
||||||
The heroicons installation itself is managed by your mix.exs */
|
The heroicons installation itself is managed by your mix.exs */
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ defmodule HomelabDashboard.ServicesSync do
|
|||||||
"radarr" => "hero-film",
|
"radarr" => "hero-film",
|
||||||
"sonarr" => "hero-tv",
|
"sonarr" => "hero-tv",
|
||||||
"prowlarr" => "hero-funnel",
|
"prowlarr" => "hero-funnel",
|
||||||
"qbittorrent" => "hero-cloud-arrow-down"
|
"qbittorrent" => "hero-cloud-arrow-down",
|
||||||
|
"anki" => "hero-academic-cap"
|
||||||
}
|
}
|
||||||
|
|
||||||
@descriptions %{
|
@descriptions %{
|
||||||
@@ -30,7 +31,8 @@ defmodule HomelabDashboard.ServicesSync do
|
|||||||
"radarr" => "Movie collection manager",
|
"radarr" => "Movie collection manager",
|
||||||
"sonarr" => "TV series collection manager",
|
"sonarr" => "TV series collection manager",
|
||||||
"prowlarr" => "Indexer manager",
|
"prowlarr" => "Indexer manager",
|
||||||
"qbittorrent" => "Torrent client"
|
"qbittorrent" => "Torrent client",
|
||||||
|
"anki" => "Flashcard study tool"
|
||||||
}
|
}
|
||||||
|
|
||||||
@display_names %{
|
@display_names %{
|
||||||
@@ -43,6 +45,9 @@ defmodule HomelabDashboard.ServicesSync do
|
|||||||
"pihole" => "/admin"
|
"pihole" => "/admin"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Services to omit from the dashboard (e.g. the dashboard itself)
|
||||||
|
@excluded_services ~w(devbox)
|
||||||
|
|
||||||
def start_link(opts \\ []) do
|
def start_link(opts \\ []) do
|
||||||
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
|
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
|
||||||
end
|
end
|
||||||
@@ -113,6 +118,7 @@ defmodule HomelabDashboard.ServicesSync do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp parse_services(services) do
|
defp parse_services(services) do
|
||||||
|
services = Enum.reject(services, &(&1["name"] in @excluded_services))
|
||||||
{public_raw, internal_raw} = Enum.split_with(services, &Map.has_key?(&1, "public_host"))
|
{public_raw, internal_raw} = Enum.split_with(services, &Map.has_key?(&1, "public_host"))
|
||||||
|
|
||||||
public =
|
public =
|
||||||
|
|||||||
Reference in New Issue
Block a user