Add system fields for all collections

This commit is contained in:
rijkvanzanten
2020-10-29 15:42:26 -04:00
parent ac6d358e4f
commit d21dfa74ba
16 changed files with 427 additions and 396 deletions

View File

@@ -23,6 +23,8 @@ data:
note: Metadata for all managed file assets
- collection: directus_folders
note: Provides virtual directories for files
- collection: directus_migrations
note: What version of the database you're using
- collection: directus_permissions
icon: admin_panel_settings
note: Access permissions for each role

View File

@@ -1,8 +1,13 @@
table: directus_activity
fields:
- collection: directus_activity
field: action
- field: id
width: half
- field: item
width: half
- field: action
display: labels
display_options:
defaultForeground: '#263238'
@@ -24,41 +29,47 @@ fields:
value: authenticate
foreground: '#9b51e0'
background: '#e6d3f7'
- collection: directus_activity
field: collection
width: half
- field: collection
display: collection
display_options:
icon: true
- collection: directus_activity
field: timestamp
width: half
- field: timestamp
display: datetime
options:
relative: true
- collection: directus_activity
field: user
width: half
- field: user
display: user
- collection: directus_activity
field: comment
width: half
- field: comment
display: formatted-text
display_options:
subdued: true
- collection: directus_activity
field: user_agent
width: half
- field: user_agent
display: formatted-text
display_options:
font: monospace
- collection: directus_activity
field: ip
width: half
- field: ip
display: formatted-text
display_options:
font: monospace
- collection: directus_activity
field: revisions
width: half
- field: revisions
interface: one-to-many
locked: true
special: o2m
options:
fields:
- collection
- item
width: full
width: half

View File

@@ -1,69 +1,54 @@
table: directus_collections
fields:
- collection: directus_collections
field: collection_divider
- field: collection_divider
special: alias
interface: divider
options:
icon: box
title: Collection Setup
color: '#2F80ED'
locked: true
sort: 1
width: full
- collection: directus_collections
field: collection
- field: collection
interface: text-input
options:
font: monospace
locked: true
readonly: true
sort: 2
width: half
- collection: directus_collections
field: icon
- field: icon
interface: icon
options:
locked: true
sort: 3
width: half
- collection: directus_collections
field: note
- field: note
interface: text-input
options:
placeholder: A description of this collection...
locked: true
sort: 4
width: full
- collection: directus_collections
field: display_template
- field: display_template
interface: display-template
options:
collectionField: collection
locked: true
sort: 5
width: full
- collection: directus_collections
field: hidden
- field: hidden
special: boolean
interface: toggle
options:
label: Hide within the App
locked: true
sort: 6
width: half
- collection: directus_collections
field: singleton
- field: singleton
special: boolean
interface: toggle
options:
label: Treat as single object
locked: true
sort: 7
width: half
- collection: directus_collections
field: translations
- field: translations
special: json
interface: repeater
options:
@@ -85,72 +70,58 @@ fields:
width: half
options:
placeholder: Enter a translation...
locked: true
sort: 8
width: full
- collection: directus_collections
field: archive_divider
- field: archive_divider
special: alias
interface: divider
options:
icon: archive
title: Archive
color: '#2F80ED'
locked: true
sort: 9
width: full
- collection: directus_collections
field: archive_field
- field: archive_field
interface: field
options:
collectionField: collection
allowNone: true
placeholder: Choose a field...
locked: true
sort: 10
width: half
- collection: directus_collections
field: archive_app_filter
- field: archive_app_filter
interface: toggle
special: boolean
options:
label: Enable App Archive Filter
locked: true
sort: 11
width: half
- collection: directus_collections
field: archive_value
- field: archive_value
interface: text-input
options:
font: monospace
iconRight: archive
placeholder: Value set when archiving...
locked: true
sort: 12
width: half
- collection: directus_collections
field: unarchive_value
- field: unarchive_value
interface: text-input
options:
font: monospace
iconRight: unarchive
placeholder: Value set when unarchiving...
locked: true
sort: 13
width: half
- collection: directus_collections
field: sort_divider
- field: sort_divider
special: alias
interface: divider
options:
icon: sort
title: Sort
color: '#2F80ED'
locked: true
sort: 14
width: full
- collection: directus_collections
field: sort_field
- field: sort_field
interface: field
options:
collectionField: collection
@@ -160,6 +131,4 @@ fields:
- decimal
- integer
allowNone: true
locked: true
sort: 15
width: half

View File

@@ -3,37 +3,79 @@ table: directus_fields
fields:
- collection: directus_fields
field: options
hidden: true
locked: true
special: json
field: id
width: half
- collection: directus_fields
field: display_options
hidden: true
locked: true
special: json
field: collection
width: half
- collection: directus_fields
field: locked
hidden: true
locked: true
special: boolean
- collection: directus_fields
field: readonly
hidden: true
locked: true
special: boolean
- collection: directus_fields
field: hidden
hidden: true
locked: true
special: boolean
field: field
width: half
- collection: directus_fields
field: special
hidden: true
locked: true
special: csv
width: half
- collection: directus_fields
field: interface
width: half
- collection: directus_fields
field: options
hidden: true
special: json
width: half
- collection: directus_fields
field: display
width: half
- collection: directus_fields
field: display_options
hidden: true
special: json
width: half
- collection: directus_fields
field: locked
hidden: true
special: boolean
width: half
- collection: directus_fields
field: readonly
hidden: true
special: boolean
width: half
- collection: directus_fields
field: hidden
hidden: true
special: boolean
width: half
- collection: directus_fields
field: sort
width: half
- collection: directus_fields
field: width
width: half
- collection: directus_fields
field: group
width: half
- collection: directus_fields
field: translations
hidden: true
locked: true
special: json
width: half
- collection: directus_fields
field: note
width: half

View File

@@ -1,114 +1,117 @@
table: directus_files
fields:
- collection: directus_files
field: id
- field: id
hidden: true
interface: text-input
locked: true
special: uuid
- collection: directus_files
field: title
- field: title
interface: text-input
locked: true
options:
iconRight: title
placeholder: A unique title...
sort: 1
width: full
- collection: directus_files
field: description
- field: description
interface: textarea
locked: true
sort: 2
width: full
options:
placeholder: An optional description...
- collection: directus_files
field: tags
- field: tags
interface: tags
locked: true
options:
iconRight: local_offer
special: json
sort: 3
width: full
display: tags
- collection: directus_files
field: location
- field: location
interface: text-input
locked: true
options:
iconRight: place
placeholder: An optional location...
sort: 4
width: half
- collection: directus_files
field: storage
- field: storage
interface: text-input
locked: true
options:
iconRight: storage
sort: 5
width: half
readonly: true
- collection: directus_files
field: storage_divider
- field: storage_divider
interface: divider
locked: true
options:
icon: insert_drive_file
title: File Naming
color: '#2F80ED'
special: alias
sort: 6
width: full
- collection: directus_files
field: filename_disk
- field: filename_disk
interface: text-input
locked: true
options:
iconRight: publish
placeholder: Name on disk storage...
sort: 7
width: half
- collection: directus_files
field: filename_download
- field: filename_download
interface: text-input
locked: true
options:
iconRight: get_app
placeholder: Name when downloading...
sort: 8
width: half
- collection: directus_files
field: metadata
- field: metadata
hidden: true
locked: true
special: json
- collection: directus_files
field: type
- field: type
display: mime-type
- collection: directus_files
field: filesize
- field: filesize
display: filesize
- collection: directus_files
field: modified_by
- field: modified_by
interface: user
locked: true
special: user-updated
width: half
display: user
- collection: directus_files
field: modified_on
- field: modified_on
interface: datetime
locked: true
special: date-updated
width: half
display: datetime
- collection: directus_files
field: created_on
- field: created_on
display: datetime
- collection: directus_files
field: created_by
- field: created_by
display: user
- field: embed
width: half
- field: uploaded_by
width: half
- field: folder
width: half
- field: width
width: half
- field: uploaded_on
width: half
- field: height
width: half
- field: charset
width: half
- field: duration
width: half

View File

@@ -1,8 +1,14 @@
table: directus_folders
fields:
- collection: directus_folders
field: id
- field: id
interface: text-input
locked: true
special: uuid
width: half
- field: parent
width: half
- field: name
width: full

View File

@@ -14,7 +14,12 @@ for (const filepath of fieldData) {
const systemFields = requireYAML(path.resolve(__dirname, filepath));
for (const field of systemFields.fields) {
systemFieldRows.push(merge({ system: true }, defaults, field));
}
(systemFields.fields as FieldMeta[]).forEach((field, index) => {
systemFieldRows.push(
merge({ system: true }, defaults, field, {
collection: systemFields.table,
sort: index + 1,
})
);
});
}

View File

@@ -2,13 +2,33 @@
table: directus_permissions
fields:
- collection: directus_permissions
field: permissions
- field: permissions
hidden: true
locked: true
special: json
- collection: directus_permissions
field: presets
width: half
- field: presets
hidden: true
locked: true
special: json
width: half
- field: role
width: half
- field: limit
width: half
- field: collection
width: half
- field: id
width: half
- field: fields
width: half
- field: action
width: half
- field: validation
width: half

View File

@@ -1,19 +1,35 @@
table: directus_presets
fields:
# directus_presets isn't surfaced in the app
- collection: directus_presets
field: filters
- field: filters
hidden: true
locked: true
special: json
- collection: directus_presets
field: layout_query
- field: layout_query
hidden: true
locked: true
special: json
- collection: directus_presets
field: layout_options
- field: layout_options
hidden: true
locked: true
special: json
- field: role
width: half
- field: user
width: half
- field: id
width: half
- field: bookmark
width: half
- field: search
width: half
- field: collection
width: half
- field: layout
width: half

View File

@@ -1,7 +1,33 @@
table: directus_relations
fields:
- collection: directus_relations
field: one_allowed_collections
locked: true
- field: id
width: half
- field: many_collection
width: half
- field: many_field
width: half
- field: many_primary
width: half
- field: one_collection
width: half
- field: one_field
width: half
- field: one_primary
width: half
- field: one_collection_field
width: half
- field: one_allowed_collections
special: csv
width: half
- field: junction_field
width: half

View File

@@ -1,14 +1,25 @@
table: directus_revisions
fields:
# directus_revisions isn't surfaced in the app
- collection: directus_revisions
field: data
- field: id
width: half
- field: activity
width: half
- field: collection
width: half
- field: item
width: half
- field: data
hidden: true
locked: true
special: json
- collection: directus_revisions
field: delta
- field: delta
hidden: true
locked: true
special: json
- field: parent
width: half

View File

@@ -1,80 +1,61 @@
table: directus_roles
fields:
- collection: directus_roles
field: id
- field: id
hidden: true
interface: text-input
locked: true
special: uuid
- collection: directus_roles
field: name
- field: name
interface: text-input
options:
placeholder: The unique name for this role...
locked: true
sort: 1
width: half
- collection: directus_roles
field: icon
- field: icon
interface: icon
display: icon
locked: true
sort: 2
width: half
- collection: directus_roles
field: description
- field: description
interface: text-input
options:
placeholder: A description of this role...
locked: true
sort: 3
width: full
- collection: directus_roles
field: app_access
- field: app_access
interface: toggle
locked: true
special: boolean
sort: 4
width: half
- collection: directus_roles
field: admin_access
- field: admin_access
interface: toggle
locked: true
special: boolean
sort: 5
width: half
- collection: directus_roles
field: ip_access
- field: ip_access
interface: tags
options:
placeholder: Add allowed IP addresses, leave empty to allow all...
locked: true
special: csv
sort: 6
width: full
- collection: directus_roles
field: enforce_tfa
- field: enforce_tfa
interface: toggle
locked: true
sort: 7
special: boolean
width: half
- collection: directus_roles
field: users
- field: users
interface: one-to-many
locked: true
special: o2m
sort: 8
options:
fields:
- first_name
- last_name
width: full
- collection: directus_roles
field: module_list
- field: module_list
interface: repeater
locked: true
options:
template: '{{ name }}'
addLabel: Add New Module...
@@ -104,12 +85,10 @@ fields:
iconRight: link
placeholder: Relative or absolute URL...
special: json
sort: 9
width: full
- collection: directus_roles
field: collection_list
- field: collection_list
interface: repeater
locked: true
options:
template: '{{ group_name }}'
addLabel: Add New Group...
@@ -159,5 +138,4 @@ fields:
schema:
is_nullable: false
special: json
sort: 10
width: full

View File

@@ -0,0 +1,17 @@
table: directus_sessions
fields:
- field: token
width: half
- field: user
width: half
- field: expires
width: half
- field: ip
width: half
- field: user_agent
width: half

View File

@@ -1,102 +1,85 @@
table: directus_settings
fields:
- collection: directus_settings
field: project_name
- field: id
hidden: true
- field: project_name
interface: text-input
locked: true
options:
iconRight: title
placeholder: My project...
sort: 1
translations:
language: en-US
translations: Name
width: half
- collection: directus_settings
field: project_url
- field: project_url
interface: text-input
locked: true
options:
iconRight: link
placeholder: https://example.com
sort: 2
translations:
language: en-US
translations: Website
width: half
- collection: directus_settings
field: project_color
- field: project_color
interface: color
locked: true
note: Login & Logo Background
sort: 3
translations:
language: en-US
translations: Brand Color
width: half
- collection: directus_settings
field: project_logo
- field: project_logo
interface: file
locked: true
note: White 40x40 SVG/PNG
sort: 4
translations:
language: en-US
translations: Brand Logo
width: half
- collection: directus_settings
field: public_divider
- field: public_divider
interface: divider
locked: true
options:
icon: public
title: Public Pages
color: '#2F80ED'
special: alias
sort: 5
width: full
- collection: directus_settings
field: public_foreground
- field: public_foreground
interface: file
locked: true
sort: 6
translations:
language: en-US
translations: Login Foreground
width: half
- collection: directus_settings
field: public_background
- field: public_background
interface: file
locked: true
sort: 7
translations:
language: en-US
translations: Login Background
width: half
- collection: directus_settings
field: public_note
- field: public_note
interface: textarea
locked: true
options:
placeholder: A short, public message that supports markdown formatting...
sort: 8
width: full
- collection: directus_settings
field: security_divider
- field: security_divider
interface: divider
locked: true
options:
icon: security
title: Security
color: '#2F80ED'
special: alias
sort: 9
width: full
- collection: directus_settings
field: auth_password_policy
- field: auth_password_policy
interface: dropdown
locked: true
options:
choices:
- value: null
@@ -105,31 +88,25 @@ fields:
text: Weak Minimum 8 Characters
- value: "/(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+}{';'?>.<,])(?!.*\\s).*$/"
text: Strong Upper / Lowercase / Numbers / Special
sort: 10
width: half
- collection: directus_settings
field: auth_login_attempts
- field: auth_login_attempts
interface: numeric
locked: true
options:
iconRight: lock
sort: 11
width: half
- collection: directus_settings
field: files_divider
- field: files_divider
interface: divider
locked: true
options:
icon: storage
title: Files & Thumbnails
color: '#2F80ED'
special: alias
sort: 12
width: full
- collection: directus_settings
field: storage_asset_presets
- field: storage_asset_presets
interface: repeater
locked: true
options:
fields:
- field: key
@@ -187,12 +164,10 @@ fields:
width: full
template: '{{key}}'
special: json
sort: 13
width: full
- collection: directus_settings
field: storage_asset_transform
- field: storage_asset_transform
interface: dropdown
locked: true
options:
choices:
- value: all
@@ -201,29 +176,20 @@ fields:
text: None
- value: presets
text: Presets Only
sort: 14
width: half
- collection: directus_settings
field: id
hidden: true
locked: true
- collection: directus_settings
field: overrides_divider
- field: overrides_divider
interface: divider
locked: true
options:
icon: brush
title: App Overrides
color: '#2F80ED'
special: alias
sort: 15
width: full
- collection: directus_settings
field: custom_css
- field: custom_css
interface: code
locked: true
options:
language: css
lineNumber: true
sort: 16
width: full

View File

@@ -1,87 +1,70 @@
table: directus_users
fields:
- collection: directus_users
field: first_name
- field: first_name
interface: text-input
locked: true
options:
iconRight: account_circle
sort: 1
width: half
- collection: directus_users
field: last_name
- field: last_name
interface: text-input
locked: true
options:
iconRight: account_circle
sort: 2
width: half
- collection: directus_users
field: email
- field: email
interface: text-input
locked: true
options:
iconRight: email
sort: 3
width: half
- collection: directus_users
field: password
- field: password
special: hash, conceal
interface: hash
locked: true
options:
iconRight: lock
masked: true
sort: 4
width: half
- collection: directus_users
field: avatar
- field: avatar
interface: file
locked: true
sort: 5
width: full
- collection: directus_users
field: location
- field: location
interface: text-input
options:
iconRight: place
sort: 6
width: half
- collection: directus_users
field: title
- field: title
interface: text-input
options:
iconRight: work
sort: 7
width: half
- collection: directus_users
field: description
- field: description
interface: textarea
sort: 8
width: full
- collection: directus_users
field: tags
- field: tags
interface: tags
special: json
sort: 9
width: full
options:
iconRight: local_offer
- collection: directus_users
field: preferences_divider
- field: preferences_divider
interface: divider
options:
icon: face
title: User Preferences
color: '#2F80ED'
special: alias
sort: 10
width: full
- collection: directus_users
field: language
- field: language
interface: dropdown
locked: true
options:
choices:
- text: Afrikaans (South Africa)
@@ -146,12 +129,10 @@ fields:
value: uk-UA
- text: Vietnamese (Vietnam)
value: vi-VN
sort: 11
width: half
- collection: directus_users
field: theme
- field: theme
interface: dropdown
locked: true
options:
choices:
- value: auto
@@ -160,30 +141,24 @@ fields:
text: Light Mode
- value: dark
text: Dark Mode
sort: 12
width: half
- collection: directus_users
field: tfa_secret
- field: tfa_secret
interface: tfa-setup
locked: true
special: conceal
sort: 13
width: half
- collection: directus_users
field: admin_divider
- field: admin_divider
interface: divider
locked: true
options:
icon: verified_user
title: Admin Options
color: '#F2994A'
special: alias
sort: 14
width: full
- collection: directus_users
field: status
- field: status
interface: dropdown
locked: true
options:
choices:
- text: Draft
@@ -196,32 +171,31 @@ fields:
value: suspended
- text: Archived
value: archived
sort: 15
width: half
- collection: directus_users
field: role
- field: role
interface: many-to-one
locked: true
options:
template: '{{ name }}'
special: m2o
sort: 16
width: half
- collection: directus_users
field: token
- field: token
interface: token
locked: true
options:
iconRight: vpn_key
placeholder: Enter a secure access token...
sort: 17
width: full
- collection: directus_users
field: id
- field: id
special: uuid
interface: text-input
locked: true
options:
iconRight: vpn_key
sort: 18
width: full
- field: last_page
width: half
- field: last_access
width: half

View File

@@ -1,43 +1,35 @@
table: directus_webhooks
fields:
- collection: directus_webhooks
field: id
- field: id
hidden: true
locked: true
- collection: directus_webhooks
field: name
- field: name
interface: text-input
locked: true
options:
iconRight: title
sort: 1
width: full
- collection: directus_webhooks
field: method
- field: method
interface: dropdown
display: labels
display_options:
defaultBackground: "#ECEFF1"
choices: null
format: false
locked: true
options:
choices:
- GET
- POST
sort: 2
width: half
- collection: directus_webhooks
field: url
- field: url
interface: text-input
locked: true
options:
iconRight: link
sort: 3
width: half
- collection: directus_webhooks
field: status
- field: status
interface: dropdown
display: labels
display_options:
@@ -53,36 +45,31 @@ fields:
value: inactive
foreground: "#607D8B"
background: "#ECEFF1"
locked: true
options:
choices:
- text: Active
value: active
- text: Inactive
value: inactive
sort: 4
width: half
- collection: directus_webhooks
field: data
- field: data
interface: toggle
locked: true
options:
label: Send Event Data
special: boolean
sort: 5
width: half
- collection: directus_webhooks
field: triggers_divider
- field: triggers_divider
interface: divider
options:
icon: api
title: Triggers
color: '#2F80ED'
special: alias
sort: 6
width: full
- collection: directus_webhooks
field: actions
- field: actions
interface: checkboxes
options:
choices:
@@ -93,11 +80,9 @@ fields:
- text: Delete
value: delete
special: csv
sort: 7
width: full
- collection: directus_webhooks
field: collections
- field: collections
interface: collections
special: csv
sort: 8
width: full