mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
17 lines
425 B
Elixir
17 lines
425 B
Elixir
defmodule TeslaMateWeb.LayoutView do
|
|
use TeslaMateWeb, :view
|
|
|
|
dashboards =
|
|
for dashboard_path <- Path.wildcard("grafana/dashboards/*.json") do
|
|
@external_resource Path.relative_to_cwd(dashboard_path)
|
|
|
|
dashboard_path
|
|
|> File.read!()
|
|
|> Jason.decode!()
|
|
|> Map.take(["title", "uid"])
|
|
end
|
|
|
|
@dashboards Enum.sort_by(dashboards, & &1["title"])
|
|
defp list_dashboards, do: @dashboards
|
|
end
|