defmodule FreediveWeb.HomeLive do use FreediveWeb, :live_view def render(assigns) do ~H""" <.block class="px-2 py-4"> <.panel is-info> <.panel_heading> Home <.panel_tabs is-hidden-mobile> All Compute Storage Network System <.panel_tabs is-hidden-tablet> <.icon for="all" color="auto" /> <.icon for="compute" color="auto" /> <.icon for="storage" color="auto" /> <.icon for="network" color="auto" /> <.icon for="system" color="auto" /> <.panel_block> <.control has-icons-left> <.icon for="search" size="1.5rem" aria-hidden="true" is-left /> <.link patch={~p"/services"} class="panel-block pt-1"> <.icon for="puzzle" color="auto" aria-hidden="true" />
Services
<.link patch={~p"/packages"} class="panel-block pt-1"> <.icon for="package" color="auto" aria-hidden="true" /> Packages <.link patch={~p"/updates"} class="panel-block pt-1"> <.icon for="hard-drive-download" color="auto" aria-hidden="true" /> Software updates <.section> <.box> <.button phx-click="color" phx-value-enable="true"> Color <.button phx-click="color" phx-value-enable="false"> Grayscale """ end def mount(_params, _session, socket) do socket = assign(socket, query: "all") {:ok, socket} end def handle_event("color", %{"enable" => "true"}, socket) do Freedive.Features.enable(:colorhash) {:noreply, assign(socket, query: "color")} end def handle_event("color", %{"enable" => "false"}, socket) do Freedive.Features.disable(:colorhash) {:noreply, assign(socket, query: "grayscale")} end end