defmodule GustWeb.DagSummaryComponent do use GustWeb, :live_component alias Gust.Flows @impl true def handle_event("toggle_enabled", %{"id" => dag_id}, socket) do {:ok, dag} = Flows.get_dag!(dag_id) |> Flows.toggle_enabled() if dag.enabled do Gust.DAG.RunRestarter.restart_enqueued(dag.id) end {:noreply, socket |> assign(:dag, dag)} end defp format_error(%CompileError{file: _file, description: description, line: _line}), do: description @impl true def render(assigns) do ~H"""
0} class="alert alert-error shadow-lg mb-4" role="alert"> {format_error(@dag_def.error)}
0} class="bg-warning text-warning-content rounded-xl p-4 shadow-md space-y-2" >

Warnings

<.link navigate={~p"/dags/#{@dag.name}/runs"}>{@dag.name}

Schedule
{@dag_def.options[:schedule]}
""" end end