Modules
GreenAsh — a "green screen" test console (LiveView, 100% keyboard-driven, AS400 style) generated by introspection from your Ash resources, with no UI code.
Management of the console's "actor": the Ash record on whose behalf actions
are executed (to exercise the policies). Stored in the HTTP session (a
LiveView cannot write the session via the socket: see
GreenAsh.ActorController) and re-threaded through all Ash calls.
Parser + application of the : command line (Vim-style), shared by all
screens. Paths are built from the mount base (base) provided by the host,
and resources are resolved among domains.
Self-contained UI components for the console: the full-screen "green
terminal" stylesheet, a generic <.input> (driven by an AshPhoenix form
field), and a <.button>. No dependency on the host's components.
Introspection of an Ash action -> field specs -> HTML widget type.
Main menu, AS400-style: full screen, numbered options, Option ===>
command line, and keyboard navigation. Two levels discovered automatically
(resources -> actions). A :create action opens the entry screen, :read
opens a list; :update/:destroy redirect to a list.
Generic engine: renders an executable entry screen for ONE Ash action,
entirely through introspection. The resource/action come from the route;
the fields are inferred by GreenAsh.Field and the form by
AshPhoenix.Form. An :id (PK token) loads a record for an update action.
AS400 subfile: lists the records of a :read action, with an "Opt" column
per row (codes derived from the actions: update/destroy/display), a filter
(arguments of the read action, on the query side), column sorting, and
pagination. All reads/deletes pass through the current actor.
on_mount set by the router macro: injects into each LiveView the list of
domains, the mount base, the current tenant, and the current actor
(resolved from the session, within that tenant).
Runtime discovery of Ash resources / actions from the list of domains provided by the host (via the router macro), and module <-> slug / primary key resolution for the console's routes.
Integration into the host's router.
Writes/clears the console's actor and tenant in the session, then redirects.
The console's current tenant: the value threaded through every Ash call so that multitenant resources can be browsed.
Entry point use GreenAsh.Web, :live_view for the console's LiveViews.
Imports nothing from the host application: only Phoenix.LiveView, the
lib's components, and a path helper relative to the mount base.
Mix Tasks
Installs GreenAsh: mounts the console in your router