Packages

ReflectOS Console is a web app that allows users to arrange their ReflectOS dashboard, configure section, switch layouts and much more. It ships with the pre-built ReflectOS firmware.

Current section

Files

Jump to
reflect_os_console lib console_web controllers page_controller.ex
Raw

lib/console_web/controllers/page_controller.ex

defmodule ReflectOS.ConsoleWeb.PageController do
use ReflectOS.ConsoleWeb, :controller
alias ReflectOS.Kernel.Section.Registry, as: SectionRegistry
alias ReflectOS.Kernel.Layout.Registry, as: LayoutRegistry
alias ReflectOS.Kernel.LayoutManager.Registry, as: LayoutManagerRegistry
def about(conn, _params) do
# The home page is often custom made,
# so skip the default app layout.
section_types =
SectionRegistry.list()
|> Enum.map(fn module ->
module.section_definition()
end)
layout_types =
LayoutRegistry.list()
|> Enum.map(fn module ->
module.layout_definition()
end)
layout_manager_types =
LayoutManagerRegistry.list()
|> Enum.map(fn module ->
module.layout_manager_definition()
end)
render(conn, :about,
active_tab: :about,
section_types: section_types,
layout_types: layout_types,
layout_manager_types: layout_manager_types
)
end
end