mirror of
https://github.com/ash-project/ash_admin.git
synced 2024-09-20 05:12:54 +12:00
3.9 KiB
3.9 KiB
DSL: AshAdmin.Resource
A resource extension to alter the behaviour of a resource in the admin UI.
admin
Configure the admin dashboard for a given resource.
Nested DSLs
- form
- field
Options
Name | Type | Default | Docs |
---|---|---|---|
name {: #admin-name } |
String.t |
The proper name to use when this resource appears in the admin interface. | |
actor? {: #admin-actor? } |
boolean |
Whether or not this resource can be used as the actor for requests. | |
show_action {: #admin-show_action } |
atom |
The action to use when linking to the resource/viewing a single record. Defaults to the primary read action. | |
read_actions {: #admin-read_actions } |
list(atom) |
A list of read actions that can be used to show resource details. By default, all actions are included. | |
create_actions {: #admin-create_actions } |
list(atom) |
A list of create actions that can create records. By default, all actions are included. | |
update_actions {: #admin-update_actions } |
list(atom) |
A list of update actions that can be used to update records. By default, all actions are included. | |
destroy_actions {: #admin-destroy_actions } |
list(atom) |
A list of destroy actions that can be used to destroy records. By default, all actions are included. | |
polymorphic_tables {: #admin-polymorphic_tables } |
list(String.t) |
For resources that use ash_postgres' polymorphism capabilities, you can provide a list of tables that should be available to select. These will be added to the list of derivable tables based on scanning all domains and resources provided to ash_admin. | |
polymorphic_actions {: #admin-polymorphic_actions } |
list(atom) |
For resources that use ash_postgres' polymorphism capabilities, you can provide a list of actions that should require a table to be set. If this is not set, then all actions will require tables. | |
table_columns {: #admin-table_columns } |
list(atom) |
The list of attributes to render on the table view. | |
format_fields {: #admin-format_fields } |
list(any) |
The list of fields and their formats. | |
relationship_display_fields {: #admin-relationship_display_fields } |
list(atom) |
The list of attributes to render when it's shown as a relationship on a datatable | |
resource_group {: #admin-resource_group } |
atom |
The group in the top resource dropdown that the resource appears in. | |
show_sensitive_fields {: #admin-show_sensitive_fields } |
list(atom) |
The list of fields that should not be redacted in the admin UI even if they are marked as sensitive. |
admin.form
Configure the appearance of fields in admin forms.
Nested DSLs
admin.form.field
field name
Declare non-default behavior for a specific attribute.
Arguments
Name | Type | Default | Docs |
---|---|---|---|
name {: #admin-form-field-name .spark-required} |
atom |
The name of the field to be modified |
Options
Name | Type | Default | Docs |
---|---|---|---|
type {: #admin-form-field-type .spark-required} |
:default | :long_text | :short_text | :markdown |
The type of the value in the form. Use default if you are just specifying field order |
Introspection
Target: AshAdmin.Resource.Field