mirror of
https://github.com/netfun2000/hipudding-teslamate.git
synced 2026-02-27 09:44:28 +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
|